1 lab. 4 sampling and rate conversion sampling: the fourier transform of an impulse train is still...
TRANSCRIPT
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.
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
4
Practical sampling device (ADC):
* FLASH ADC
5
Ramp counter ADC:
6
Successive approximation ADC:
* Tree search
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
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
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
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
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.
12
General filter design:– Pass band
– Stop band
– Transition band
– Passband ripple/stopband ripple
A lowpass filter
13
The analog filter design (IIR):– 1. Butterworth, 2. Chebychev I, 3. Chebychev II, 4. Ellipic
14
Fdatool in Matlab:
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.
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
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