14
Sampling of Continuous-Time Signals Jordi Bonet-Dalmau December 12, 2019 1

Sampling of Continuous-Time Signals - UPC

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sampling of Continuous-Time Signals - UPC

Sampling of Continuous-Time Signals

Jordi Bonet-Dalmau

December 12, 2019

1

Page 2: Sampling of Continuous-Time Signals - UPC

1 Subsampling a sinusoidal signal

Problem 1.1 Consider sampling the sinusoidal signal of the figure with an ideal (i.e no quan-tization error) ADC. The samples are send to an ideal (i.e. ideal interpolator) DAC. How theobtained signal at the output of the DAC will be seen in an oscilloscope? Let the samplingrate be Fs = 10 kHz. Repeat for Fs = 20 kHz.

0 50 100 150 200 250 300 350 400 450 500−1.5

−1

−0.5

0

0.5

1

1.5

time (us)

volta

ge (

V)

input

Problem 1.2 Consider sampling a sinusoidal signal with an ideal ADC followed by an idealDAC. Let the sampling rate be Fs = 7 kHz. The figure shows the obtained signal at the outputof the DAC. How the signal at the input of the ADC will be seen in an oscilloscope? Are yousure that this is the only possible signal?

0 100 200 300 400 500 600

−1

−0.5

0

0.5

1

time (us)

volta

ge (

V)

output

Problem 1.3 Consider the two signals in the figure. The output signal is the result of samplingthe input signal with an ideal ADC followed by an ideal DAC. Determine the sampling rateFs that has been used. Sure?

0 100 200 300 400 500 600

−1

−0.5

0

0.5

1

time (us)

volta

ge (

V)

inputoutput

2

Page 3: Sampling of Continuous-Time Signals - UPC

Problem 1.4 Consider the square signal of the figure. This signal is low-pass filtered by anideal filter in order to remove all the harmonics higher than the fundamental frequency. Thelow-pass filtered signal is sampled using an ideal ADC followed by an ideal DAC. How theobtained signal at the output of the DAC will be seen in an oscilloscope? Let the samplingrate be Fs = 10 kHz.

Hint: A square wave with a peak-to-peak amplitude of value App has a first harmonic witha peak-to-peak amplitude App

4π .

0 50 100 150 200 250 300 350 400 450 500

−1

−0.5

0

0.5

1

time (us)

volta

ge (

V)

input

Problem 1.5 Consider a square signal low-pass filtered as before. The low-pass filtered signalis sampled using an ideal ADC followed by an ideal DAC. Let the sampling rate be Fs = 10 kHz.The figure shows the obtained signal at the output of the DAC. How the square signal will beseen in an oscilloscope? Are you sure that this is the only possible signal?

0 100 200 300 400 500 600−2

−1.5

−1

−0.5

0

0.5

1

1.5

2

time (us)

volta

ge (

V)

output

Problem 1.6 Consider the two signals in the figure. The output signal is the result of samplingthe, previously low-pass filtered as before, input signal with an ideal ADC followed by an idealDAC. Determine the sampling rate Fs that has been used. Sure?

Hint: cos(2πFat) = cos(2π(−Fa)t).

0 100 200 300 400 500 600−0.5

0

0.5

1

1.5

2

2.5

3

3.5

time (us)

volta

ge (

V)

inputoutput

3

Page 4: Sampling of Continuous-Time Signals - UPC

2 Subsampling a periodic signal

Non-sinusoidal periodic waveforms are an important class of signals with some prominentexamples as the square and sawtooth waveform. The Fourier series method of analysis firstresolves a periodic input into the sum of a dc component and infinitely ac components atharmonically related frequencies.

For instance, a rectangular signal like the one in the figure

can be resolved into the following sum: xsq(t) = αA+ 2Aπ

∞∑n=1

sin(nαπ)n cos(nω0t).

The square signal is a particular case of the rectangular signal when α = 0.5 (i.e a duty cycleof 50%) and the previous equation may be written as:

xsq(t) = A2 +2A

π

∞∑n=0

(−1)n2n+1 cos((2n+1)ω0t) = A

2 +2Aπ

(cos(ω0t)− 1

3 cos(3ωot) + 15 cos(5ωot)− . . .

).

Another example is the sawtooth signal of the figure

that can be resolved into the following sum: xsaw(t) = A2 −

∞∑n=1

1n sin(nωot).

A final example is the triangular of the figure

that can be resolved into the following sum:

xtri(t) = A2 +4A

π2

∞∑n=0

1(2n+1)2

cos((2n+1)ωot) = A2 +4A

π2

(cos(ω0t) + 1

9 cos(3ωot) + 125 cos(5ωot) + . . .

).

An important difference between the last and the previous waveforms is the way harmonicsdecrease with frequency. While square and sawtooth components have an amplitude inverselyproportional to the frequency (i.e. amplitude at frequency nω0 ∝ 1

n), triangular componentshave an amplitude inversely proportional to the square of the frequency (i.e. amplitude atfrequency nω0 ∝ 1

n2 ). This means that a triangular waveform has the spectrum more con-centrated at low frequencies. Consequently, a low-pass filter will have much more effect on asquare than on a triangular waveform.

4

Page 5: Sampling of Continuous-Time Signals - UPC

Problem 2.1 Consider the square signal of the figure with a 50% duty cycle, i.e. α = 0.5. Thissignal is sampled at Fs = 20 MHz using an ideal ADC followed by an ideal DAC. Determinethe obtained signal at the output of the DAC as a sum of sinusoidal signals. Draw its positivespectrum made of Dirac deltas at the right frequency and with the right amplitude. Numbereach delta with a number n corresponding to the nth-harmonic of the square signal at frequencyn times the fundamental. Limit your results up to the 9th-harmonic.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1

−0.5

0

0.5

1

1.5

2

2.5

3

time (us)

volta

ge (

V)

input

Problem 2.2 Repeat the previous problem considering now a rectangular signal with a 25%duty cycle, i.e. α = 0.25.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1

−0.5

0

0.5

1

1.5

2

2.5

3

time (us)

volta

ge (

V)

input

Problem 2.3 Repeat the previous problem (a rectangular signal with a 25% duty cycle, i.e.α = 0.25) now with a frequency F0 = 95.111 MHz. Let the sampling rate be Fs = 80 MHz.Limit your results up to the 6th-harmonic.

5

Page 6: Sampling of Continuous-Time Signals - UPC

3 Signal to noise ratio (SNR)

As you know a real ADC quantizes the samples of a signal with a finite number of bits b. As aconsequence it introduces an error with such properties that it can be viewed as a certain typeof noise. The quantization noise of a signal sampled by an ADC with b bits and a dynamicrange Dr can be approximated by Nq = D2

r/(12 · 22b). The approximation assumes that thesampled signal is a line between two quantized values (which is a reasonable assumption, forany signal, if b is high enough). For a sinusoidal signal of peak amplitude A, the power is

S = A2/2. So, the SNR= S/Nq = 6A2

D2r

22b. When the signal uses all the dynamic range, i.e.

the peak to peak amplitude equals the dynamic range 2A = Dr, the SNR has its maximumvalue: SNR= S/Nq = 1.5 · 22b or SNR|dB= 10 log10(S/Nq) = 10 log10(1.5) + 10 log10(2

2b) =10 log10(1.5) + 20 log10(2)b that can be approximately written as SNR|dB' 1.76 + 6.02b.

Problem 3.1 Consider an ADC of b = 8 bits an dynamic range of Dr = 5 V. Compute theSNR after the discretization and quantification of a sinusoidal signal. Let the peak amplitudebe A = 1.25 V. Compare this result with the one obtained when the input signal uses all thedynamic range of the converter, i.e. A = 2.5 V.

Problem 3.2 Consider an ADC with a dynamic range of Dr = 5 V that discretizes andquantifies a sinusoidal signal with peak amplitude A. Let the peak amplitude be A0 = 2.5 V,A1 = 1.25 V and A2 = 0.625 V. For each amplitude, how should b be chosen so that theSNR> 49 dB.

6

Page 7: Sampling of Continuous-Time Signals - UPC

4 Total harmonic distortion (THD)

In the real world there are no ideal devices. In particular there are no linear devices. Thenonlinearity of same devices is characterized putting a pure sinusoidal signal at the input. Alinear device will have a pure sinusoidal signal at the fundamental frequency at the output. Anonlinear device will have harmonics (if you are interested ask for an explanation) at multiplesof the fundamental frequency at the output. The nonlinearity is evaluated as the ratio of thepower of the signal at the fundamental frequency to the power of all other harmonics (excludingthe dc component). This relation is called Total Harmonic Distortion (THD). We can expressthis relation as THD= S/D, being S the power of the signal at the fundamental frequencyand D the power of all other harmonics. Alternatively we can express this ration in dB asTHDdB = 10 log10(S/D).

Harmonic distortion is also observed in ADC, with the particularity that once the sinusoidalsignal is sampled the relations between the harmonics could not be the expected because ofthe subsampling phenomenon previously worked, e.g. in Problem 2.2 or Problem 2.3.

Problem 4.1 Consider a sinusoidal signal of frequency F0 = 1 kHz at the input of a nonlinearADC. The obtained spectrum frequency (via Fourier Transform) at the output of the ADC isthe one showed below. Compute the THD in dB.

Hint: don’t forget the part of the spectrum with negative frequencies, i.e the sinusoidalsignal at frequency 1 kHz has two deltas and its power is computed from both.

0 1 2 3 4 5 6 7 8 9 100

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

X= 9Y= 0.0062013

X= 8Y= 0.0125

X= 7Y= 0.016037

X= 6Y= 0.013215

X= 4Y= 0.028161

X= 3Y= 0.077943

X= 2Y= 0.1661

X= 1Y= 0.3742

frequency (kHz)

peak

am

plitu

de /

2 (V

)

Deltas

Problem 4.2 Consider a sinusoidal signal of frequency F0 = 5 kHz at the input of a nonlinearADC. The obtained spectrum at the output of the ADC is the one showed below. Note that,as the sampling frequency is Fs = 18 kHz, subsampling phenomenon is observed. Compute theTHD in dB.

0 1 2 3 4 5 6 7 8 9 100

0.1

0.2

0.3

0.4

0.5

0.6

0.7

X= 5Y= 0.51504

X= 4Y= 0.034199

X= 3Y= 0.0431

X= 2Y= 0.055087

frequency (kHz)

peak

am

plitu

de /

2 (V

)

X= 1Y= 0.013364

X= 6Y= 0.031455

X= 7Y= 0.06885

X= 8Y= 0.23231

X= 9Y= 0.024721

Deltas

7

Page 8: Sampling of Continuous-Time Signals - UPC

Problem 4.3 Consider a sinusoidal signal of frequency F0 = 5 kHz at the input of a nonlinearADC. The obtained spectrum in dB with respect to the fundamental at the output of the ADCis the one showed below. Note that, as the sampling frequency is Fs = 18 kHz, subsamplingphenomenon is observed. Compute the THD in dB.

0 1 2 3 4 5 6 7 8 9 10−90

−80

−70

−60

−50

−40

−30

−20

−10

0

frequency (kHz)

pow

er (

dBc)

Deltas

Problem 4.4 Consider that the spectrum computed in Problem 2.2 is the result of samplinga pure sinusoidal signal and not a rectangular signal. This way, you should consider that theharmonics comes from distortion of the ADC. Compute the THD in dB.

Problem 4.5 Consider that the spectrum computed in Problem 2.3 is the result of samplinga pure sinusoidal signal and not a rectangular signal. This way, you should consider that theharmonics comes from distortion of the ADC. Compute the THD in dB.

8

Page 9: Sampling of Continuous-Time Signals - UPC

5 Signal to noise and distortion ratio (SINAD)

In previous sections we have seen that an ADC adds noise and distortion to the sampled signal.The first is because of the quantization process and the second because of the nonlinearitiesof the ADC. We have characterized the effect of noise as the ratio of the signal power to thenoise power (SNR) and the effect of distortion the ratio of the signal power to the distortionpower (THD).

Now we will consider the effect of noise and distortion simultaneously as the ratio of the signalpower to the noise plus distortion power, called signal to noise and distortion ratio (SINAD).We can express this relation as SINAD= S/(N + D), being S the power of the signal at thefundamental frequency, N the power of the quantization noise and D the power of all otherharmonics. Alternatively we can express this ration in dB as SINADdB = 10 log10(S/(N+D)).

Problem 5.1 Compute the SINAD in dB of the Problem 4.2 considering that the numberof bits used to code the samples is b = 4 and the Dr the necessary to fit the input signal.How is the noise compared to the distortion? Do we have any improvement when increasingthe number of bits to b = 5? Compare the values of SNR, THD and SINAD and give someconclusions.

Problem 5.2 Compute the SINAD in dB of the Problem 4.3 considering that the numberof bits used to code the samples is b = 4 and the Dr the necessary to fit the input signal.How is the noise compared to the distortion? Do we have any improvement when increasingthe number of bits to b = 5? Compare the values of SNR, THD and SINAD and give someconclusions.

9

Page 10: Sampling of Continuous-Time Signals - UPC

6 Effective Number of Bits (ENOB)

On Section 3 we have obtained the following relation: SNR|dB' 1.76 + 6.02b. If in additionto noise we want to take into account the distortion, and see it as another source of noise, wedefine and effective number of bits (ENOB) as the number of bits that will give and SNR equalto the SINAD: SINAD|dB' 1.76 + 6.02ENOB. Once the value of SINAD is known the ENOBcan be computed from the previous equation. Note that ENOB will always be lower that thenumber of bits b. ENOB is a simple way to summarize the overall performance of an ADC.

Problem 6.1 Compute the ENOB of Problem 5.2.

10

Page 11: Sampling of Continuous-Time Signals - UPC

7 The ideal interpolator

If you are interested in knowing more about the ideal band-limited interpolator ask yourteacher.

−20 −10 0 10 20 30 40−4

−3

−2

−1

0

1

2

3

time (s)

Fm=0.7; rmse1=0.13572; rmse2=0.33675

analogideal interpolationsamples

−20 −10 0 10 20 30 40−4

−3

−2

−1

0

1

2

3

time (s)

Fm=2; rmse1=0.02433; rmse2=0.043511

analogideal interpolationsamples

−1 −0.5 0 0.5 1 1.5 2 2.5 3 3.5 4−1

−0.5

0

0.5

1

1.5

2

2.5

time (s)

The first 5 sincs

12345

11

Page 12: Sampling of Continuous-Time Signals - UPC

8 ADC vs Downconverters

Read pages 10 and 11 of the following article October 2014 Edition of EE Times Europe. Belowyou will find these two pages.

Problem 8.1 Summarize the article and relate it to the Digital Signal Processing course youare following.

12

Page 13: Sampling of Continuous-Time Signals - UPC

13

Page 14: Sampling of Continuous-Time Signals - UPC

14