Escolar Documentos
Profissional Documentos
Cultura Documentos
Computer
Digital-toAnalog Conversion
Output Signal
Digital
Method to represent a quantity, a phenomenon or an event Why digital?
Signal
What is a signal?
something (e.g., a sound, gesture, or object) that carries information a detectable physical quantity (e.g., a voltage, current, or magnetic field strength) by which messages or information can be transmitted
Processing
What kind of processing do we need and encounter almost everyday? Special effects?
2
A-to-D Converter
Signal Processor
D-to-A Converter
Output Signal
Permanence and robustness of signal representations; zerodistortion reproduction may be achievable Advanced IC technology works well for digital systems Virtually infinite flexibility with digital systems Multi-functionality Multi-input/multi-output Indispensable in telecommunications which is virtually all digital at the present time
4
Discrete-Time Signals
A sequence of numbers Mathematical representation: x = {x[n ]}, < n < Sampled from an analog signal, xa (t ), at time t = nT , x[n ] = xa (nT ), < n < T is called the sampling period, and its reciprocal, FS = 1/ T , is called the sampling frequency FS = 8000 Hz T = 1/ 8000 = 125 sec FS = 10000 Hz T = 1/10000 = 100 sec FS = 16000 Hz T = 1/16000 = 62.5 sec FS = 20000 Hz T = 1/ 20000 = 50 sec
A-to-D conversion: bandwidth control, sampling and quantization Computational processing: implemented on computers or ASICs with finite-precision arithmetic basic numerical processing: add, subtract, multiply (scaling, amplification, attenuation), mute, algorithmic numerical processing: convolution or linear filtering, non-linear filtering (e.g., median filtering), difference equations, DFT, inverse filtering, MAX/MIN, D-to-A conversion: re-quantification* and filtering (or interpolation) for reconstruction
5
Fs=8000 Hz
Fs=6000 Hz
stem( ); Fs=10000 Hz
Quantization
x[ n] can be quantized to one of a finite set of values which is then represented digitally in bits, hence a truly digital signal; the course material mostly deals with discrete-time signals (discrete-value only when noted).
out
7 6 2.4 1.8 1.2 0.6 0.3 0.9 1.5 2.1
Fs=8000 Hz
Quantization: Transforming a continuouslyvalued input into a representation that assumes one out of a finite set of values in The finite set of output values is indexed; e.g., the value 1.8 has an index of 6, or (110)2 in binary representation Storage or transmission uses binary representation; a quantization table is needed
Fs=6000 Hz
5 4 3
Fs=10000 Hz
2 1 0
Discrete Signals
6
Sinewave Spectrum
quantize
sample
y
-2
-4
-6
2 0 5 10 15 20 25 30 35 40 0
n
6
-2
y
-4 4 -6 2 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0
-2
-4
-6
x
y
10
15
20
25
30
35
40
-2
quantize
-4
sample
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-6
6.4 kHz (telephone bandwidth), 8 kHz (extended telephone BW), 10 kHz (extended bandwidth), 16 kHz (hi-fi speech)
how many quantization levels are necessary at each bit rate (bits/sample)
16, 12, 8, => ultimately determines the S/N ratio of the speech speech coding is concerned with answering this question in an optimal manner
13
A bandlimited signal can be reconstructed exactly from samples taken with sampling frequency
1 = Fs 2fmax T or 2 = s 2max T
14
Demo Examples
1. 2. 3. 5 kHz analog bandwidth sampled at 10, 5, 2.5, 1.25 kHz (notice the aliasing that arises when the sampling rate is below 10 kHz) quantization to various levels 12,9,4,2, and 1 bit quantization (notice the distortion introduced when the number of bits is too low) music quantization 16 bit audio quantized to various levels:
10 bits, 8 bits,
6 bits, 4 bits;
15
x[n] denotes the sequence value at time n Sources of sequences: Sampling a continuous-time signal x[n] = xc(nT) = xc(t)|t=nT Mathematical formulas generative system e.g., x[n] = 0.3 x[n-1] -1; x[0] = 40
16
Noise: 10 12 bits
x[ n ] =
k =
x[k ] [n k ]
a1 [ n 1]
real exponential
x[n] = n
a3 [ n + 3]
a2 [ n 2]
a7 [ n 7]
x[n ] = a3 [n + 3] + a1 [n 1] + a2 [n 2] + a7 [n 7]
17
Complex Signal
x[n ] = (0.65 + 0.5 j )n u[n ]
u[n0-n]
19
20
Complex Signal
x [n ] = ( + j )n u[n ] = (re j )n u[n ] r = 2 + 2
Complex DT Sinusoid x [n ] = A e j n
Frequency is in radians (per sample), or just radians
r
= tan1( / )
x [n ] = r e
n n j n
once sampled, x[n] is a sequence that relates to time only through the sampling period T
u [n ]
Ae
= Ae
Signal Processing
Transform digital signal into more desirable form
x[n] y[n]=T[x[n]] x[n] y[n]
MATLAB: stem
x[n] xa(nT),x(n)
single inputmultiple output, e.g., filter bank analysis, sinusoidal sum analysis, etc.
[n]
LTI System
y[n] h[n]
Linearity (superposition):
{ax1[n] + bx2 [n]} = a{x1[n]} + b {x2 [n ]}
Time-Invariance (shift-invariance): x1[n] = x[n nd ] y1[n] = y[n nd ] LTI implies discrete convolution:
y[n] = x[k ]h[n k ] = x[n] h[n] = h[n] x[n ]
k =
25
Convolution Example
1 x[n] = 0 0n3 otherwise 1 h[n ] = 0 0n3 otherwise
x[n],h[n]
h[n]
x[n]
01234 5 n=0
01234 5 n=1
n=2
Solution : y [n ] = x [n ] * h[n ] =
m =
01234 5
h[m] x[n m]
0n3 4n6 n 0, n 7
01234 567
n y[n]
01234 5 n=3
01234 5 n=4
01234 5 n=5
n 1 1 = (n + 1) m =0 3 = 1 1 = (7 n ) m = n 3 0
01234 5 n=6
01234 5 n=7
01234 5 n=8
27
01234 56
01234 567
01234 5678
28
Convolution Example
The impulse response of an LTI system is of the form: h[n ] = a n u[n ] x [ n ] = b n u [n ] | a |< 1 | b |< 1, b a and the input to the system is of the form: Determine the output of the system using the formula for discrete convolution.
SOLUTION: y [n ] =
m =
Convolution Example
a
n m =0
u[ m ] b n m u[ n m ]
m
= bn
b m u [n ] = b n
m =0
(a / b )
u [n ]
1 (a / b )n +1 b n +1 a n +1 = bn = u [n ] 1 (a / b ) b a
29
30
Convolution Example
Consider a digital system with input x [n ] = 1 for n = 0,1,2,3 and 0 everywhere else, and with impulse response h[n ] = a u[n ], | a |< 1. Determine the
n
y [n ] = x[n ] h[n ] =
k =
h[n]
y[n]=x[n]
* h[n]
u[m] a
n m
32
x[n]
h1[n]+h2[n]
y[n]
x[n]
x[n-1]
x[n]
h1[n]*h2[n]
y[n]
h1[n]*h2[n]= h2[n]*h1[n]
D is a delay of 1-sample Can replace D with delay element z 1
33
h1[n]+h2[n]= h2[n]+h1[n]
34
x[n]
y[n]
y [n ] = x [n ] * hc [n ] hc [n ] = h1[n ] * (h2 [n ] + h3 [n ]) + h4 [n ]
35
x[n]
y[n]
z-Transform Representations
Transform Representations
z-transform:
x[n ] X (z) X (z) = x[ n ] =
n =
x[n]z
1
C
1. x[n ] = [n n0 ] -- delayed impulse X (z ) = z n0 converges for | z |> 0, n0 > 0; | z |< , n0 < 0; z, n0 = 0 2. x[n ] = u[n ] u[n N ] -- box pulse
4 5 sample number
direct evaluation using residue theorem partial fraction expansion of X(z) long division power series expansion
1 0.9
0.8 0.7
2 j
X (z)z n 1dz
1 z N -- converges for 0 <| z |< 1 z 1 n =0 all finite length sequences converge in the region 0 <| z |< X(z) = (1)z n =
N-1
0.6 amplitude
0.5
0.4
0.3
0.2 0.1
4 5 sample number
n =
| x[n] | | z
|<
1 --converges for | a |<| z | 1 az 1 n =0 all infinite duration sequences which are non-zero for n 0 X (z ) = a n z n = converge in a region | z |> R1
0.6 amplitude
0.5 0.4
0.3
0.2 0.1
10
15
20
25 30 sample number
35
40
45
50
39 40
Example
If x [n ] has z-transform X ( z ) with ROC of ri <| z |< ro , find the z -transform, Y ( z ), and the region of convergence for the sequence y [n ] = a n x [n ] in terms of X ( z )
Solution: X (z) = Y (z) =
n =
4. x[n ] = b nu[ n 1]
1 n n
-0.8
-0.9 -1 -50
-45
-40
-35
-30
-15
-10
-5
1 X ( z ) = b z = --converges for | z |<| b | 1 bz 1 n = all infinite duration sequences which are non-zero for n < 0 converge in a region | z |< R2 5. x[n ] non-zero for < n < can be viewed as a combination of 3 and 4,giving a convergence region of the form R1 <| z |< R2 sub-sequence for n 0 => | z |> R1 sub-sequence for n < 0 => | z |< R2 total sequence => R1 <| z |< R2
41
x [ n ]z
R2 R1
n =
y [ n ]z
n = n
x [ n ]z n
n =
x[n](z / a)
= X (z / a)
42
z-Transform Property
The sequence x [n ] has z-transform X ( z ). Show that the sequence nx[n ] has z-transform z dX ( z ) . dz
Inverse z-Transform
x[ n ] = 1 2 j
C
X ( z )z
n 1
dz
Solution: X (z) =
n =
x [ n ]z
dX ( z ) = nx[n ]z n 1 dz n =
C R1 R2
1 = nx[n ]z n z n = 1 = Z (nx[n ]) z
43
for X(z) rational, can use a partial fraction expansion for finding inverse transforms
44
H (z ) =
46
Transform Properties
Linearity Shift
Exponential Weighting
Linear Weighting
aX1(z)+bX2(z)
z n0 X ( z)
X (v )W (z / v )v
dv
47
n =
Simple DTFTs
Impulse Delayed impulse Step function
x[n]e
jn
x[n ] = [n ],
X (e j ) = 1
x[n ] = [n n0 ], X (e j ) = e jn0 1 1 e j 1 e jN x[n ] = u[n ] u[n N ], X (e j ) = 1 e j 1 x[n ] = a n u[n ], X (e j ) = , a <1 1 ae j 1 , b >1 x[n ] = b n u[ n 1], X (e j ) = 1 be j x[n ] = u[n ], X (e j ) =
z = e j ; | z |= 1, arg(z ) = j x[ n ] = 1 2
X (e
n
)e jn d
Rectangular window
evaluation of X(z) on the unit circle in the z-plane sufficient condition for existence of Fourier transform is:
Exponential
n =
| x[n] | | z
|=
n =
| z |= 1
49
Backward exponential
50
DTFT Examples
x[n ] = nu[n ] = 0.9 1 X (e j ) = | |< 1 1 e j
DTFT Examples
x [n ] = cos(0 n ), X (e ) =
j k =
< n <
0
[ (
+ 2 k ) + ( + 0 + 2 k )]
51
52
DTFT Examples
x[n ] = rect M [n ]
DTFT Examples
h[n ]
53
54
Periodic DT Signals
A signal is periodic with period N if x[n] = x[n+N] for all n For the complex exponential this condition becomes j (0 n +0 N ) j0 n j0 ( n + N )
periodicity in
D,
Ae
= Ae
= Ae
which requires 0N = 2 k for some integer k Thus, not all DT sinusoids are periodic! Consequence: there are N distinguishable frequencies with period N
e.g., k = 2 k/N, k=0,1,,N-1
56
Periodic DT Signals
Example 1: Fs = 10, 000 Hz Is the signal x[n] = cos(2 100n / Fs ) a periodic signal? If so, what is the period.
Solution: If the signal is periodic with period N , then we have: x[ n] = x[ n + N ] cos(2 100n / Fs ) = cos(2 100( n + N ) / Fs ) 2 100 N = 2 k (k an integer ) Fs k= 100 N 100 N N = = 10, 000 100 Fs
Periodic DT Signals
Example 2: Fs = 11059 Hz; Is the signal x[n] = cos(2 100n / Fs ) periodic? If so, what is the period.
Solution: If the signal is periodic with period N , then we have: x [ n ] = x[ n + N ] cos(2 100n / Fs ) = cos(2 100( n + N ) / Fs ) 2 100 N = 2 k ( k an integer ) Fs k= 100 N 100 N = 11, 059 Fs
For k an integer we get N = 100k = 100 (for k = 1) Thus x[ n] is periodic of period 100 samples.
11059 k which is not an integer 100 Thus x[n ] is not periodic at this sampling rate.
58
Periodic DT Signals
Example 3: Fs = 10, 000 Hz Is the signal x[n] = cos(2 101n / Fs ) a periodic signal? If so, what is the period.
Solution: If the signal is periodic with period N , then we have: x[ n] = x[ n + N ] cos(2 101n / Fs ) = cos(2 101(n + N ) / Fs ) 2 101N = 2 k ( k an integer ) Fs k= 101N 101N = which is not an integer 10, 000 Fs
59
Periodic Sequences??
60
10
% [k ] = x X %[n]e j 2 kn / N % [n ] = x 1 % [k ]e j 2 kn / N X N k =0
N 1
N sequence values
N DFT coefficients
62
DFT Examples
2 (1 j ) 2 =j
[ n]
1
DFT{ [n]}
1
2 k = 3; e = (1 j ) 2 j 2 k /8 k = 4; e = 1
j 2 k /8
k = 5; e j 2 k /8 = k = 6; e j 2 k /8 = j k = 7; e j 2 k /8 =
2 ( 1 + j ) 2 2 (1 + j ) 2
63
64
DFT Examples
x[n] X [k]
DFT Examples
%[n ] = (0.9)n 0 n 31 (N = 32) x
65
66
11
Review
DTFT of sequence { x[n ], < n < } X (e j ) = x[n ] =
n =
x [n ] e
j n
x[n-1]
x((n-1))
x[-n]
x((-n))
1 N 1 % % [n ] = X x [k ] e j 2 nk / N , 0 n N 1 N k =0
67 68
X (z ) = x[n ]z n
n =0
N 1
69
j 2 k / N
% (n ) = x
r =
x [n + r N ]
X[k]
0.1 0
8 10 s ample number
12
14
16
18
% [k ], are then identical to the values - the Fourier coefficients, X of X (e j 2 k /N ) for the finite duration sequence => a sequence
x[n]
of the form:
71
72
12
S(e )
. . .
0 1 2 3 4 N-1 k =2k/N
If the duration of the finite duration signal satisfies the relation N L, then only the first term in the infinite summation affects the interval 0 n L 1 and there is no time domain aliasing, i.e., %[n ] = x[n ] 0 n L 1 x If N < L, i.e., the number of frequency samples is smaller than the duration of the finite duration signal, then there is time domain aliasing and the resulting aliased signal (over the interval 0 n L 1) satisfies the aliasing relation: %[n ] = x[n ] + x[n + N ] + x[n N ] 0 n N 1 x
Consider sampling the discrete time Fourier transform by multiplying it by a signal that is defined as: S (e ) = [ 2 k / N ]
j k =0 N 1
s[n]
. . .
-N 0 N 2N
. . .
n
[n rN ]
Thus we form the spectral sequence % (e j ) = X ( e j ) S (e j ) X which transforms in the time domain to the convolution % [n ] = x[n ] s[n ] = x[n ] [n rN ] = x
r = r =
x[n rN ]
73 74
DFT Properties
Periodic Sequence Finite Sequence
Period=N Length=N Sequence defined for all n Sequence defined for n=0,1,,N-1 DFT defined for all k DTFT defined for all
-2 -1
The discrete time Fourier transform of x[n] is computed and sampled at N frequencies around the unit circle. The resulting sampled Fourier transform is inverse %[n], transformed back to the time domain. What is the resulting time domain signal, x (over the interval 0 n L 1) for the cases N = 11, N = 5 and N = 4.
SOLUTION: % [ n ] = x[ n ] For the cases N = 11 and N = 5, we have no aliasing (since N L) and we get x over the interval 0 n L 1. For the case N = 4, the n = 0 value is aliased, giving %[0] = 6 (as opposed to 1 for x[0]) with the remaining values unchanged. x
75
were infinitely periodic => DFT is really the representation of the % [n ] = extended periodic function, x
r =
x[n + rN ]
alternative (equivalent) view is that all sequence indices must be interpreted modulo N % [n ] = x
r =
76
DFT Properties
N-point sequences N-point DFT
1. Linearity 2. Shift
aX1[k ] + bX 2 [k ] e j 2 kn0 / N X [k ] X [k ]
N
N 1
X [k ] H [k ] 1 N 1 X [r ]W ([k r ])N N r =0
x[n ] w [n ]
78
13
Sampling Function
x[n]
...
0
multiplication
j j
...
2M
[k nM ]
j 2 nk / M
X [k]
...
0 1 2 3 4 5 M-1 (M-1)2 M
80
X 2 [k ] = [n ] e
= 1, k = 0,1,..., M 1
1 M 1 1 M 1 x2 [n ] = X 2 [k ] e j 2 nk / M = e j 2 nk / M sampling function M k =0 M k =0
0 2 4 6 M M M
79
Summary of DSP-Part 1
speech signals are inherently bandlimited => must sample appropriately in time and amplitude LTI systems of most interest in speech processing; can characterize them completely by impulse response, h(n) the z-transform and Fourier transform representations enable us to efficiently process signals in both the time and frequency domains both periodic and time-limited digital signals can be represented in terms of their Discrete Fourier transforms sampling in time leads to aliasing in frequency; sampling in frequency leads to aliasing in time => when processing time-limited signals, must be careful to sample in frequency at a sufficiently high rate to avoid time-aliasing
81
Digital Filters
82
Digital Filters
digital filter is a discrete-time linear, shift invariant system with input-output relation:
y [n ] = x[n ] h[n ] = Y (z ) = X (z) H (z) H (z) is the system function with H (e j ) as the complex frequency response H (e j ) = Hr (e j ) + jHi (e j ) H (e j ) =| H (e j ) | e j arg|H ( e
j
Digital Filters
causal linear shift-invariant => h[n]=0 for n<0 stable system => every bounded input produces a bounded output => a necessary and sufficient condition for stability and for the existence of
H (e j )
m =
x[m] h[n m]
)|
n =
83
| h[n] |<
84
14
Digital Filters
1 H(z) is a rational function in z
O
evaluating
H (z) =
A (1 cr z )
1
Y (z) (1 ak z k ) = X (z) br z r
k =1 r =0
(1 dk z 1 )
k =1
r =1 N
O O O
X X
Y (z ) H (z) = = X (z)
b z
r =0 N r k =1
=> all poles of H (z ) inside the unit circle for a stable, causal system
1 ak z k
86
FIR Systems
y [n ] = br x[n r ] = b0 x[n ] + b1 x[n 1] + ... + bM x[n M ] 1. h[n ] = bn 0 n M =0
M n =0
=>
otherwise
2. H (z ) = bn z n =>
(1 c
m =0
M 1
z 1 ) => M zeros
3. if h[n ] = h[M n ] (symmetric, antisymmetric) H(e j ) = A(e j )e jM / 2 , A(e j ) = real (symmetric), imaginary (anti-symmetric)
linear phase filter => no signal dispersion because of non-linear phase => precise time alignment of events in signal event at t0 FIR Linear Phase Filter event at t0 + fixed delay
87
88
FIR Filters
cost of linear phase filter designs
can theoretically approximate any desired response to any degree of accuracy requires longer filters than non-linear phase designs
89
90
15
0.2
0.4
Frequency
0.6
0.8
91
0.2
0.4
Frequency
0.6
0.8
92
0.25
Frequency
0.5
0.75
4. Hamming 5. Hanning
6. Kaiser
0 0.25
Frequency
}
94
0.5
0.75
93
Window
Mainlobe Width
Sidelobe Attenuation 13 dB 27 dB 32 dB 43 dB 58 dB
0 0.2 0.4
Frequency
0.6
0.8
95
0.2
0.4
Frequency
0.6
0.8
96
16
p = normalized edge of passband frequency s = normalized edge of stopband frequency p = peak ripple in passband s = peak ripple in stopband =s p = normalized transition bandwidth
97
98
N=30 F=[0 0.4 0.5 1]; A=[1 1 0 0]; B=firpm(N,F,A) NF=512; number of frequency points [H,W]=freqz(B,1,NF); 99 plot(W/pi,20log10(abs(H))); 100
FIR Implementation
x[n]
x[ n 1]
x[n 2]
x[n 3]
x[n M ]
y[n]
linear phase filters can be implemented with half the multiplications (because of the symmetry of the coefficients)
101 102
17
IIR Systems
y [n ] = ak y [n k ] + br x[n r ]
k =1 r =0 N M
y [n ] depends on y [n 1], y [n 2],..., y [n N ] as well as x[n ], x[n 1],..., x[n M ] for M < N H (z ) =
b z
r =0 N r k =1 N
1 ak z
=
k =1
Butterworth Design
0.2
0.4
Frequency
0.6
0.8
105
0.2
0.4
Frequency
0.6
0.8
106
0.2
0.4
Frequency
0.6
0.8
107
0.2
0.4
Frequency
0.6
0.8
108
18
0.2
0.4
Frequency
0.6
0.8
0.2
0.4
Frequency
0.6
0.8
0.2
0.4
Frequency
0.6
0.8
109
0.2
0.4
Frequency
0.6
0.8
110
IIR Filters
IIR filter issues:
efficient implementations in terms of computations can approximate any desired magnitude response with arbitrarily small error non-linear phase => time dispersion of waveform
y [n ] = ak y [n k ] + br x[n r ]
k =1 N r =0
w [n ] = ak w [n k ] + x[n ]
k =1 M
y [n ] = br w [n r ]
[b,a]=ellip(6,0.1,40,0.45); [h,w]=freqz(b,a,512); x=[1,zeros(1,511)]; y=filter(b,a,x); zplane(b,a); appropriate plotting commands; 113
r =0
114
19
(1 d z
k =1 k K
r =1 N
- zeros at z = cr , poles at z = d k
- since ak and br are real, poles and zeros occur in complex conjugate pairs =>
b0k + b1k z + b2 k z N + 1 , K = 1 a1k z 1 a2k z 2 2 - cascade of second order systems H(z) = A
k =1 1 2
a21
c02
a12
c12
116
Sampling of Waveforms
xa(t) Sampler and Quantizer Period, T x[n],x(nT)
x[n ] = xa (nT ), < n < T = 1/ 8000 sec =125 sec for 8kHz sampling rate T = 1/10000 sec = 100 sec for 10 kHz sampling rate T = 1/16000 sec = 67 sec for 16 kHz sampling rate T = 1/ 20000 sec = 50 sec for 20 kHz sampling rate
118
xa (t ) X a ( j ) = x[n ] X (e j T ) =
(t ) e j t dt (nT )e j nT
xa(nT)
n =
1 X (e j T ) = T
xa(nT) = xa(t) uT(nT), where uT(nT) is a periodic pulse train of period T, with periodic spectrum of period 2/T
119
k =
( j + j 2 k / T )
120
20
Sampling Rates
FN = Nyquist frequency (highest frequency with significant spectral level in signal) must sample at at least twice the Nyquist frequency to prevent aliasing (frequency overlap)
telephone speech (300-3200 Hz) => FS=6400 Hz wideband speech (100-7200 Hz) => FS=14400 Hz audio signal (50-21000 Hz) => FS=42000 Hz AM broadcast (100-7500 Hz) => FS=15000 Hz
can always sample at rates higher than twice the Nyquist frequency (but that is wasteful of processing)
122
121
X (e j T ) =
1 X a ( j ), | | < T T
can show that the original signal can be recovered from the sampled signal by interpolation using an ideal LPF of bandwidth /T, i.e.,
x a (t ) =
sin( (t nT ) / T ) xa (nT ) (t nT ) / T n =
bandlimited sample interpolationperfect at every sample point, perfect in-between samples via interpolation
x[n ] = xa (nT ), X a ( j ) = 0 for | |> 2 FN if 1/ T > 2FN (adequate sampling) then X(e j T ) =
digital-to-analog converter
123
1 X a ( j ), | |< T T
124
Decimation
Standard Sampling: begin with digitized signal: x[ n] = xa (nT ) X a ( j) = 0, | | 2 FN ( a) 1 2 FN T 1 X (e ) = X a ( j), | |< T T X (e jT ) = 0, 2 FN | | 2 ( Fs FN ) Fs =
j T
(b)
can achieve perfect recovery of xa (t ) from digitized samples under these conditions
125
126
21
Decimation
want to reduce sampling rate of sampled signal by factor of M 2 want to compute new signal xd [n] with sampling rate Fs ' = 1/ T ' = 1( MT ) = Fs / M such that xd [n] = xa (nT '' ) with no aliasing one solution is to downsample x[n] = xa (nT ) by retaining one out of every M samples of x[n], giving xd [n] = x[nM ]
Decimation
need Fs ' 2 FN to avoid aliasing for M = 2 when Fs ' < 2 FN we get aliasing for M = 2 (c )
(d )
127
128
Decimation
DTFTs of x[n] and xd [n] related by aliasing relationship: 1 M 1 X (e j ( 2 k )/ M ) M k =0 or equivalently (in terms of analog frequency): X d (e j ) = X d (e
j T '
Decimation
to decimate by factor of M with no aliasing, need to ensure that the highest frequency in x[n] is no greater than Fs / (2M ) thus we need to filter x[n] using an ideal lowpass filter with response: | |< / M 1 H d (e j ) = 0 / M <| | using the appropriate lowpass filter, we can downsample the reuslting lowpass-filtered signal by a factor of M without aliasing
1 )= M
M 1 k =0
X (e
j ( T ' 2 k )/ M
assuming Fs ' =
1 2 FN , (i.e., no aliasing) we get: MT 1 1 1 1 j T ' jT '/ M )= X d (e ) = X (e X (e jT ) = X a ( j) M M MT 1 = X a ( j), < < T' T' T'
129
130
Decimation
using a lowpass filter gives: 1 Wd (e jT ' ) = H d (e jT ) X a ( j), < < T' T' T' if filter is used, the down-sampled signal, wd [ n], no longer represents the original analog signal, xa (t ), but instead the lowpass filtered version of xa (t ) the combined operations of lowpass filtering and downsampling are called decimation.
Interpolation
assume we have x[n] = xa ( nT ), (no aliasing) and we wish to increase the sampling rate by the integer factor of L we need to compute a new sequence of samples of xa (t ) with period T '' = T / L, i.e., xi [ n] = xa (nT '') = xa ( nT / L) It is clear that we can create the signal xi [ n] = x[ n / L] for n = 0, L, 2 L,... but we need to fill in the unknown samples by an interpolation process can readily show that what we want is: sin[ (nT '' kT ) / T ] [ ( nT '' kT ) / T ] equivalently with T '' = T / L, x[n] = xa ( nT ) we get xi [ n] = xa (nT '') =
k =
x (kT )
a
xi [ n] = xa (nT '') =
131
k =
x (k )
a
sin[ (n k ) / L] [ ( n k ) / L]
132
22
Interpolation
implementing the previous equation by filtering the upsampled sequence x [n / L] n = 0, L, 2 L,... xu [ n] = otherwise 0 xu [ n] has the correct samples for n = 0, L, 2 L,..., but it has zero-valued samples in between (from the upsampling operation) The Fourier transform of xu [n] is simply: X u (e j ) = X (e j L ) X u (e
j T ''
Interpolation
(a ) Plot of X ( e jT ) (b) Plot of X u (e jT '' ) showing double periodicity for L = 2, T '' = T / 2 (c ) DTFT of desired signal with | | 2 FN (2 / T ) X a ( j) X i ( e jT '' ) = 0 2 FN <| | / T '' can obtain results of ( c) by applying ideal lowpass filter with gain L (to restore amplitude) and cutoff frequency 2 FN = / T , giving: (1 / T '') X (e j L ) 0 | |< / L X i ( e j ) = 0 / L | | | |< / L L H i ( e j ) = 0 / L | |
134
) = X (e
j T '' L
) = X (e
j T
Thus X u (e jT '' ) is periodic with two periods, namely with period 2 / L, due to upsampling) and 2 due to being a digital signal
133
Interpolation
Original signal, x[n], at sampling period, T , is first upsampled to give signal xu [n] with sampling period T '' = T / L lowpass filter removes images of original spectrum giving: xi [ n] = xa (nT '') = xa ( nT / L)
Lowpass Filter
Interpolation LPF
Decimation LPF
need to combine specifications of both LPFs and implement in a single stage of lowpass filtering
can approximate almost any rate conversion with appropriate values of L and M
135
for large values of L, or M, or both, can implement in stages, i.e., L=1024, use L1=32 followed by L2=32
136
Summary of DSP-Part II
digital filtering provides a convenient way of processing signals in the time and frequency domains can approximate arbitrary spectral characteristics via either IIR or FIR filters, with various levels of approximation can realize digital filters with a variety of structures, including direct forms, serial and parallel forms once a digital signal has been obtain via appropriate sampling methods, its sampling rate can be changed digitally (either up or down) via appropriate filtering and decimation or interpolation
137
23