17
1 Lab. 4 Sampling and Rate Conversion Sampling: The Fourier transform of an impulse train is still an impulse train. Then, x x(t) () ( ) n st t nT x s (t) () dt x(nT) () () ( ) ( )( ) s n n x t xt t nT x nT t nT 2 ( ) ( ) s k Sj k T 1 1 ( ) ( ) ( ) ( ) ( ) 2 s s s k X j X j Sj X j X j kj T * An impulse is an analog signal.

1 Lab. 4 Sampling and Rate Conversion Sampling: The Fourier transform of an impulse train is still an impulse train. Then, x x(t) x s (t)x(nT) *

Embed Size (px)

Citation preview

Page 1: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

1

Lab. 4 Sampling and Rate Conversion

Sampling:

The Fourier transform of an impulse train is still an impulse train.

Then,

xx(t)

( ) ( )n

s t t nT

xs (t)( )dt

x(nT)

( ) ( ) ( ) ( ) ( )sn n

x t x t t nT x nT t nT

2( ) ( )s

k

S j kT

1 1( ) ( ) ( ) ( ) ( )

2s s sk

X j X j S j X j X j kjT

* An impulse is an analog signal.

Page 2: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

2

Spectrum:

Reconstruction:

Sampling

s

x IdealLPF

x(nT) xs (t) x(nT)

( ) ( )n

s t t nT s

T

sin /( )

/r

t Th t

t T

Page 3: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

3

Practical reconstruction device (DAC):

Page 4: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

4

Practical sampling device (ADC):

* FLASH ADC

Page 5: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

5

Ramp counter ADC:

Page 6: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

6

Successive approximation ADC:

* Tree search

Page 7: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

7

Downsampling:

Let m=i+kM and we have

x(n) Xd(n)= x(Mn)

1 2( )

1 2( )

j

k

jd

m

kX e X j j

T T T

mX e X j j

MT MT MT

*

s

Tf

( 2 ) /

1

0

( )

1( / 2 / )

0

1 1 2 2( )

1( )

j i M

Mj

di k

X e

Mj j M i M

di

k iX e X j j j

M T MT T MT

X e X eM

1* ( ) ( )s s

k

X j X j kjT

Page 8: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

8

Spectrum:

To avoid aliasing, a filter is generally applied before the downsampling operation.

Upsampling:

x(n) Xd(n)= x(Mn)

LPFCutoff=/M

x(n) Xu(n)= x(n/L)( / ), 0, , 2 ,

( )0, otherwiseu

x n L n L Lx n

Gain=1

i=0 i=0i=0 i=1i=1

Page 9: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

9

The spectrum:

( ) ( ) ( ) ( ) ( )j j n j kL j Lu

n k k

X e x k n kL e x k e X e

( ) ( ) ( )uk

x n x k n kL

IdealLPF

2

Page 10: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

10

The upsampling process is then equivalent to increase the sampling rate by a factor of L.

The filtering operation is also known as interpolation.

x(n) Xu(n)

LPFCutoff=/L

Gain=L

Page 11: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

11

Practice 1:– Generate a sinusoidal signal, downsample the signal, and

observe the its spectrum.

– Determine the maximum downsampling rate such that the aliasing will not occur.

– Then upsample the downsampled signal, and observe its spectrum.

Page 12: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

12

General filter design:– Pass band

– Stop band

– Transition band

– Passband ripple/stopband ripple

A lowpass filter

Page 13: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

13

The analog filter design (IIR):– 1. Butterworth, 2. Chebychev I, 3. Chebychev II, 4. Ellipic

Page 14: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

14

Fdatool in Matlab:

Page 15: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

15

Practice 2:– Generate a sinusoidal signal, downsample the signal (no

aliasing), and then upsample the downsampled signal.

– Design an FIR LPF and let the upsampled signal pass the filter such that the upsampled signal is similar to the original signal.

– Calculate the MSE of these two interpolation schemes.

Page 16: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

16

Practice 3:– Create an random digital signal and upsampled it with a

selected factor.

– Observe the spectrum of the upsampled signal.

Reading assigment:– Pulse shaping (CS: 4.5)

– RC, SRRC

Page 17: 1 Lab. 4 Sampling and Rate Conversion  Sampling:  The Fourier transform of an impulse train is still an impulse train.  Then, x x(t) x s (t)x(nT) *

Filter design(FDA tool)– Key “fdatool” in the console of MATLAB

– Adjust parameters for your requirement

– Press “Filter coefficients” to get filter time-domain response h[n]

– Convolve h[n] in your C program to implement lowpass filtering

Plot spectrum in MATLAB– Plot( abs( fft( x ) ) )

• fft(): Fast Fourier Transform, frequency interval is [0 fs]

• abs(): get magnitude

17