1.16  Exercises

Unless specified otherwise, assume that the signals are in volts and were obtained over a resistor of 1 ohm. Always indicate the units in your answers and graphs.


1.1. Both continuous-time x(t) and the discrete-time x[n] signals consist of pulses with a limited duration (finite support). Their amplitudes are equal to three for 0 t 4 and 0 n 4, respectively, and zero otherwise. a) What are the values of x(t) when t = 1.5, 3 and 6? b) What are the values of x[n] when n = 1.5, 3 and 6?
1.2. An ADC uses b = 8 bits per sample and sampling frequency Fs = 100 Msps. a) What is the respective bit rate in bits per second? b) How many megabytes are needed to store 1 hour of a signal digitized with this ADC and stored in a binary “raw” format (without compression or a file header)?
1.3. Using an Internet browser, practice choosing commercial ADCs and DACs. Some companies of interest are Analog Devices, Maxim and Texas Instruments. Use their “parametric search” tools. Assume you have to choose chips for three projects with distinct requirements: 1) the fastest ADC and DAC with at least 16 bits per sample, 2) Low cost chips with 8 bits per sample to work with Fs up to 10 kHz and 3) high precision chips to work with Fs around 100 Hz in medical applications. In your comparison, indicate at least resolution, speed, price, power consumption, supply current and if the data bus is serial or parallel and inform the interface (e. g., SPI). Extra parameters you may include are full scale range (FSR), total harmonic distortion (THD), effective number of bits (ENOB) and offset error.
1.4. Get familiar with digitizing systems and boards, which are sometimes called DAQ (data acquisition) boards. Calculate the storage space and transfer rate for digitized signals (visit [ url1bww] for extra information). a) Calculate the total space in megabytes (MB) for storing 30 minutes of a signal sampled at the maximum rate of the following data transfer technologies:

b) Assume you need to use a 16-bits A/D process to achieve the desired SNR, what is the maximum sampling rate that needs to be supported for each interface above? c) Describe in high-level a digitizer system to sustain a sampling rate of 40 MHz and store 3 hours of a signal. Choose the data transfer technology, total hard disk space, etc.). d) Considering you must use USB 2.0: what is the maximum sampling rate the system could achieve in this case? e) Evaluate a Signatec [ url1sig] waveform recording product and indicate what is the maximum throughput that Signatec offers (indicate sampling rate and number of bits per sample) for recording some hours of signal into a hard disk. Note that when operating at maximum sampling rate, most acquisition boards and digital oscilloscopes store the ADC samples in a limited amount of onboard RAM, which is typically capable of storing only few seconds of signal. The discussed recording system must take into account the data transfer from onboard RAM to hard disk.
1.5. The analog signal x(t) = 2t V is digitized using a 2-bits ADC with sampling frequency Fs = 100 Hz to create a digital signal xq[n]. Assuming the first sample is obtained at t = 0 s, inform: a) the values of the first four samples (just use here sampling, without quantization) and b) the values of xq[n] for n = 0,,3 given that the ADC uses rounding and its output levels are {2Δ,Δ,0,Δ}, with Δ = 0.025 V.
1.6. Note the several distinct meanings of the word digital depending on the context: an FPGA chip implements digital logic, the signal analyzer has both analog and digital inputs, etc. We want to discuss whether the waveform at a microprocessor data bus pin is a digital signal or not. But according to the definitions adopted in this text, not the nomenclature used in a text dealing with digital electronics. For that, we will assume two cases of a waveform observed with an analog oscilloscope: a) the amplitudes assume only two values: 0 and 5 V, and b) the waveform corresponds to non-ideal pulses, with e. g. non-zero rise and fall times. In these two cases, what are the signal categories according to Table 1.1)?
1.7. Draw the graph of x[n] = n2(u[n 3] u[n 7]).
1.8. Let [3,4,5] be the amplitudes of the three samples (n = 0, 1 and 2, respectively) of a discrete-time x[n] obtained by sampling a speech signal. a) Describe the result of a D/C conversion of x[n] to a sampled signal xs(t) with sampling period Ts = 4 s and draw the graph of xs(t) specifying the abscissa in seconds. b) What are the amplitude values of xs(t) at t = 1.5 and 8 s?
1.9. a) Manually (do not use a computer) draw the graph of the sampled signal xs(t) = k=0(1)kδ(t k) indicating values at both abscissa and ordinate.
1.10. Given x(t) as depicted in Figure 1.71, clearly draw the graphs of a) x(t 3), b) x(4t) and c) x(t2).

PIC
Figure 1.71: Example of continuous-time signal.

1.11. a) Manually draw the graph of x[n] = δ[n + 2] + δ[n + 1] + δ[n] + δ[n 1] + δ[n 2] + 0.4δ[n 3]. b) Do the same for the signals: y[n] = x[n + 1], z[n] = x[n + 1]δ[n 1] and w[n] = 3x[n2]. c) Convert x[n] to a sampled signal xs(t) adopting Fs = 2 kHz and draw the graph of xs(t).
1.12. Carefully draw the signals: a) z(t) = rect (t3Ts Ts ), b) x(t) = sinc ( t Ts ) and c) y(t) = 2x(t + Ts) x(t) + 2x(t Ts), d) v(t) = 2sinc (t+Ts Ts ) sinc ( t Ts ) + 2sinc (tTs Ts ), with Ts = 2 s. You may use a computer to help with c) and d).
1.13. An analog signal x(t) was periodically sampled with sampling period Ts = 2 s to obtain the sampled signal xs(t) = 2δ(t + 4) 5δ(t 2) + 7δ(t 6). The sampling theorem was obeyed. a) What is the analytic expression of x(t)? b) Is this the only possible answer? For example, is 2rect(t + 4) 5rect(t 2) + 7rect(t 6) a possible expression for x(t) given that Ts = 2 s and the sampling theorem was obeyed? Why?
1.14. Four frequencies generated by an ideal piano (in Hz) are: A7 = 3520, A6 = 1760, A5 = 880 and A4 = 440. a) When a piano song is digitized with sampling frequency Fs = 44100 Hz, what are the digital angular frequencies in radians corresponding to A7 and A4? b) what should be the values of W1 and W2 such that the Matlab/Octave commands below
1Fs=44100;Ts=1/Fs;N=3/Ts;n=0:N-1;x=cos(W1*n)+cos(W2*n);soundsc(x)

generate 3 seconds of a sum of two cosines, corresponding to the frequencies A6 and A5, respectively, still assuming the given Fs? c) Repeat a) and b) for Fs = 2 kHz. d) Adopting Fs = 2 kHz brings any trouble? Explain you answer.
1.15. An b = 8-bits ADC uses two’s complement to output binary numbers that correspond to integers in the range [128,127]. The ADC’s quantizer is uniform with a step size Δ = 10 mV. a) For the following input values x[n] = [0,1,1.28,1.28,2], indicate the output xb[n] = Q~c{x[n]} in binary, its corresponding value as an integer xd[n], the decoded output xq[n] and the quantization error. b) Repeat the procedure assuming the ADC uses a numbering scheme based on an offset 2b1 = 128.
1.16. A sinusoid x[n] = sin ((π3)n) was quantized with b = 3 bits per sample using a step size Δ = 0.25 and X^min = 1. This quantization generated the digital signal xq[n]. The corresponding binary values xb[n] = Q~c{x[n]} were stored in a file using a numbering scheme with offset 2b1 = 4, but this file was wrongly interpreted with a routine that generated yq[n] assuming a two’s complement scheme. Inform the 6 values of a period of the original x[n], the properly quantized xq[n] and the erroneously interpreted yq[n].
1.17. The goal is to design a uniform scalar quantizer for a discrete-time signal x[n]. It is given that x[n] is approximately uniformly distributed with mean equal to 2 and standard deviation equal to 3. a) Describe a 3-bits quantizer that minimizes the quantization error, explaining your design decisions. b) Calculate the signal to noise ratio (in dB) for the case of a 8 bits quantizer operating with the same input signal.
1.18. A 3-bits uniform quantizer has a step size Δ = 2 V. The input is x and the output xq. Its minimum output value is xq = 8. Assume four input values [20,0.7,5.4,6.1] V and inform: a) the graph (“stairs”) showing xq × x for this quantizer, b) the quantization error eq for each of these input values and c) the power in watts of eq considering only the four corresponding samples.
1.19. Assuming the input signal of a quantizer can be modeled by a Gaussian FDP with variance 4 W and mean 2 V. Design a 2-bits uniform quantizer that tries to minimize the quantization error. a) Draw the output versus input for this quantizer and b) calculate the quantization SNR dB assuming only errors in the granular region and that the linear model for quantization is valid.
1.20. Consider you want to quantize a sinusoid with peak amplitude that is equal to 10 volts using b = 10 bits. Find general expressions for the quantization SNR in terms of b, using both linear and dB scales. If instead of a sinusoid your signal (to be quantized) had a Gaussian PDF with mean μ = 3 and standard deviation σ = 2, find similar expressions for the SNR assuming the signal dynamic range is 6σ around the mean.
1.21. Use an approach similar to Example 1.54, but assume the input signal is uniformly distributed, to prove the rule of thumb that says each extra bit of an ADC increases in 6 dB the quantization SNR.
1.22. A data acquisition system uses an ADC of 12 bits. To improve its resolution, a signal conditioning board is developed, based on an automatic gain control (AGC) circuit with programmable gain. This gain can assume 16 distinct values and is represented by 4 bits. Assuming the overall system now represents a sample with 12 + 4 = 16 bits, what is the expected improvement in the quantization SNR in dB due to the adoption of the AGC?
1.23. An eight-bits ADC uses two’s complement and the Q2.5 format. The input signal is always within the quantizer’s granular region (no saturation). The quantizer is uniform, uses rounding and its output levels match the signal dynamic range given by [3,3] V. a) What is the expected mean and variance of the quantization error assuming the linear model for quantization is valid? b) What is the estimated SQNR? c) What is the new SNR if Q3.4 is adopted and what could be an advantage of Q3.4 over Q2.5?
1.24. Represent the four numbers x[n] = [0.02,0,8.7,2.5] using b = 8 bits and two’s complement. a) Compare the quantized values xq[n] when the following formats are adopted: Q4.3, Q3.4 and Q0.7. b) What are the corresponding dynamic ranges and step sizes for each of the three formats?
1.25. An embedded system generates the following thousand numbers xd=linspace(-1e30,1e30,1000) with Matlab/Octave (or import numpy; xd=numpy.linspace(-1e30,1e30,1000) with Python) and stores them in ROM using IEEE 754 in double precision. To reduce this amount of memory, an engineer considered the adoption of single precision, obtained with xf=single(xd) in Matlab/Octave (or xf=numpy.float32(xd) in Python). a) Calculate the required ROM size in bytes in both cases. b) The maximum absolute value of the error xd-xf. c) Is this error acceptable in your opinion?
1.26. a) Assuming xd=1e200 is a double (IEEE 754 in double precision), explain the result of converting it to 32 bits using xf=single(xd) in Matlab/Octave (you can do the same analysis in Python, if you prefer). b) Explain the discrepancy between the results of single(0.3)-0.2-0.1 and double(0.3)-0.2-0.1 in Matlab/Octave or between import numpy; print(numpy.float32(0.3)-0.2-0.1) and print(numpy.float64(0.3)-0.2-0.1) in Python.
1.27. Depict in plots the even and odd parts of x[n] = δ[n + 1] + 2δ[n] + 4δ[n 1].
1.28. You do not know much about a signal x[n], but it is given that x[0] = 3. Can x[n] be an odd signal? Why?
1.29. For the following signals, calculate the energy E and power P. Do they have a finite total energy or a finite average power? a) x(t) = 5cos (2π300t + π4), b) x(t) = 3e2tu(t) and c) x(t) = t.
1.30. What can be said about the total energy and average power of any periodic signal?
1.31. a) The set M = {7,5,3,1,1,3,5,7} describes the output values of a given quantizer, in volts. Assuming all elements have the same probability, what is the average energy in joules of these values? b) Consider the same values compose a discrete-time sequence x[n] = [7,5,3,1,1,3,5,7]. What is the average power in watts of x[n] over its support of eight non-zero samples? c) Given that the equation for both cases a) and b) is the same, discuss why the results are expressed in distinct units (joules and watts).
1.32. For each of the following signals, determine whether or not it is periodic and in positive case, its fundamental period N0: a) x[n] = u[n] + u[n 1], b) x[n] = cos (π 8 n), c) x[n] = cos ( 11 128n + π3) and d) x[n] = cos ((π4)n2)?
1.33. a) Classify as energy or power signals: x(t) = cos (2π100t), y(t) = 4cos (2π100t + 0.2π) and z(t) = exp (t)u(t), where t is given in seconds. b) Calculate their autocorrelation R(τ), using the proper definition for power and energy signals, and indicate the unit of τ.
1.34. A signal x(t) = 10cos (6πt) V is sampled to obtain N = 100 samples at t = 0,Ts,2Ts,,99Ts s, where Ts = 18 s. After C/D conversion, these samples compose the finite-duration sequence x[n]. What are the power values (in watts) Pc of x(t) and Pd of x[n], assuming for x[n] only the interval n = 0 to 99?
1.35. The following commands were used to estimate the autocorrelation of a cosine: N=16; n=0:5*N-1; x=cos(2*pi/N*n); R=xcorr(x,’biased’); However, the result did not match the theoretical expression. Can you explain the reason? How could you obtain the proper result? Compare this result with Application 1.12. Why in this case autocorrelation seems to be periodic and match the theoretical result?
1.36. A sinc function sinc(τ) (see Section A.12) centered in τ = 0 can be an autocorrelation? What if it was centered in τ = 3 seconds? What is the interpretation to the fact that the autocorrelation achieves its maximum at τ = 0? What is the interpretation for sinc(0) (the autocorrelation at origin) if the adopted definition were: a) for energy signals and b) for random or power signals?
1.37. A signal x[n] was obtained using the randn function in Matlab/Octave, such that it has zero mean and unity variance. What is the power of this signal? How x[n] can be transformed in a signal y[n] with mean equal to four and variance equal to nine? What is the Matlab/Octave command to generate 100 samples of y[n] using randn? What is the average power of y[n]? Plot the following graphs: autocorrelation and probability density function of both x[n] and y[n].
1.38. Prove that for the AWGN channel with noise ν(t) uncorrelated with the input signal s(t), the output of the received signal r(t) = s(t) + ν(t) is simply the sum of the power of s(t) and the power of ν(t).
1.39. Assuming x[n] = 3δ[n] 2δ[n 1] + δ[n 2] and y[n] = (1 + j)δ[n] + (3 j4)δ[n 1], calculate the unbiased autocorrelations of x[n] and y[n], and their crosscorrelation.
1.40. The autocorrelation of a sinusoid x(t) = Asin (ωt + ϕ) is R(τ) = 50cos (30τ). What can be said about its amplitude A, angular frequency ω and phase ϕ?
1.41. In case you have access to the required equipment, estimate and describe in details the quantizer used by the sound system of some personal computer (describe the “stairs”: dynamic range and step size). Try to model the DC offset.
1.42. Learn how to manipulate wav files obtained from an audio CD and evaluate their histograms. Were the signals properly digitized? All (or most) quantizer levels were used? In case you find a CDA file, note that these files (of just 44 bytes) are not the actual audio files. They are just pointers to the audio data (similar to shortcut files). In order to copy the files, you need to use a rip software such as, e. g. [ url1rip].