Académique Documents
Professionnel Documents
Culture Documents
Summer II 2008
Why multirate?
In many practical applications, a sampling rate needs to be converted (either increased or decreased). For instance, a sampling rate of 44.1 kHz is used in audio CD, while video DVD ( d DVD audio) f di CD hil id (and di ) format assumes audio signals t di i l sampled at 48 kHz. To make an audio CD of a movie sound-track, decrease of sampling rate is needed. Another example is conversion of composite video signals from NTSC (sampling rate of 14.3181818 MHz) to PAL (sampling rate of 17.734475 MHz) and back. Digital component video signal is sampled at 13.5 MHZ and 6.75 MHz for the luminance and chrominance components respectively, which requires rete conversion too too Sampling Rate conversion can be done by: 1. D/A conversion followed by A/D conversion at a different rate advantage: arbitrary sampling rate disadvantage: distortion during A/D and quantization noise during D/A; 2. Sampling rate conversion in digital domain subject of our discussion;
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
7/3/2008
Introduction
Terminology:
Tx and Ty are the corresponding sampling intervals for xn and ym. Constrain:
Fy Fx
I D
(2.3.1)
Summer II 2008
Introduction
Sampling rate conversion can also be viewed as resampling of the same analog signal.
Thus, obtaining ym from xn is equivalent to sampling x(t) at the other sampling rate. ym is a time-shifted version of xn. Such a shift can be done by a linear filter with a flat magnitude and linear phase responses: i e with a frequency response of i.e., exp(-ji), where i is the time delay. Not equal sampling rates imply that the amount of time shift vary from sample to sample. Therefore, a rate converter can be implemented with a set of linear filters having the same flat magnitude response but generating different time delays.
Summer II 2008
7/3/2008
Decimation by a factor D
A signal xn with a spectrum X(ej) needs to be downsampled by an integer factor D. g A signal is band limited to
(2.5.1) (2 5 1)
Simple selecting every Dth sample of xn would result in aliasing in the frequency domain with a folding frequency Fx/2D. Therefore, to avoid aliasing, the bandwidth should be reduced to Fmax = Fx/2D or to
max =
(2.5.2)
D=2
aliasing
D=2
D=2
No aliasing
Summer II 2008
Decimation by a factor D
The input sequence is passed through a LPF with an impulse response hn and a frequency response:
1, H D ( ) = 0,
The filter output vn is
D
otherwise
(2.6.1)
vn = hk xn k
k =0
(2.6.2)
ym = vmD = hk xmD k
k =0
ELEN 5301 Adv. DSP and Modeling
(2.6.3)
Summer II 2008
7/3/2008
Decimation by a factor D
The filtering operation on xn is linear and time invariant. However, the downsampling results in a time variant system: xn-n0 does not imply yn-n0 unless n0 is a multiple of D The output in the z-domain:
Y ( z) =
m =
ym z m =
m =
vmD z m =
m =
z m D
m
1 D 1 j 2 mk j 2 mk 1 1 D 1 = vm e D z m D = vm e D z D D k =0 m = m = D k =0 =
mk 1 k k j 2 mk 1 j 2 mk 1 1 D 1 j 2D k D 1 D 1 V e z = HD e D z D X e D z D D k =0 D k =0
(2.7.1)
The spectrum of the output can be found by evaluating Y(z) on the unit circle.
Summer II 2008
Decimation by a factor D
The output sampling rate is Fy. Therefore, the output frequency variable is
y =
2 F = 2 FTy Fy
(2.8.1)
Fy =
Fx D
(2.8.2)
x =
are related as
2 F = 2 FTx Fx
(2.8.3)
y = D x
ELEN 5301 Adv. DSP and Modeling
(2.8.4)
Summer II 2008
7/3/2008
Decimation by a factor D
Therefore, the frequency range 0 x D is stretched into the frequency range 0 y by the downsampling process. The output spectrum is
Y ( y ) = =
2 k 2 k 1 D 1 HD y D X y D D k =0 1 1 HD y X y = X y D D D D D
( (2.9.1) )
Summer II 2008
10
Decimation by a factor D
Summer II 2008
7/3/2008
11
Interpolation by a factor I
An increase in the sampling rate by an integer factor I can be achieved by interpolating I-1 new samples between successive values of the signal. p preserving the spectral shape of the signal xn. g p p g We are interested in the process p Let vm is the sequence obtained from a signal xn by adding I-1 zeros between successive values of xn and, therefore, with a rate Fy = IFx.
xm I , vm = 0,
m = 0, I , 2 I ,...
(2.11.1)
otherwise
V ( z) =
m =
vm z m =
m =
z mI X ( z I )
(2.11.2)
V ( y ) = X ( y I )
Summer II 2008
(2.11.3)
12
Interpolation by a factor I
The new frequency variable is
y = 2
F F x = 2 = Fy IFx I
input
( (2.12.1) )
The sampling rate increase by addition of I1 zeros between the values of xn results in a signal whose spectrum is an I-fold periodic repetition of the input signal spectrum X().
output
Summer II 2008
7/3/2008
13
Interpolation by a factor I
Since only the frequency components of xn in the range [0, /I] are unique, the images of X() above y = /I should be rejected by a LPF with the frequency response p
C , H I ( y ) = 0,
0 y I otherwise
(2.13.1)
Where C is a scale factor required to normalize the output ym. Therefore, the output spectrum is
CX ( y I ) , Y ( y ) = 0,
I
0 y I otherwise
( (2.13.2) )
The scale factor C is selected so that the output ym = xm/I for m = 0, I, 2I, For m = 0
y0 =
1 2
Y ( y ) d y =
C 2
X ( y I ) d y =
Summer II 2008
C 1 I 2
X ( ) d
x
C x0 I
(2.13.3)
14
Interpolation by a factor I
Therefore, C = I is the needed normalization factor. Finally, th Fi ll the output sequence is a convolution of the vn sequence and th LPF unit t t i l ti f th d the LPFs it pulse response:
ym =
k =
mk k
(2.14.1)
ym =
k =
m kI
xk
(2.14.2)
Summer II 2008
7/3/2008
15
Performing interpolation followed by decimation allows to preserve the desired spectral characteristics of xn. Also, since two filters hu and hd are working at the same rate, they can be combined into a single LPF with the characteristic:
I , H (v ) = 0,
ELEN 5301 Adv. DSP and Modeling
0 v min ( D , I ) otherwise
Summer II 2008
(2.15.1)
16
v = 2 F Fv = 2 F IFx = x I
(2.16.1)
ym = =
ELEN 5301 Adv. DSP and Modeling
n =
h mD
mD mD I + nI x I n I
I
n =
h ( nI + [ mD ] ) x
modulo
Summer II 2008
mD n I
Largest integer
(2.16.2)
7/3/2008
17
1 D 1 y 2 k Y ( y ) = V D k =0 D
(2.17.1)
y = Dv
I y X , Y ( y ) = D D 0, D 0 y min , I otherwise
(2.17.2)
(2.17.3)
Summer II 2008
18
Summer II 2008
7/3/2008
19
Summer II 2008
20
Summer II 2008
10
7/3/2008
21
Summer II 2008
22
Up-sampler embedded within the FIR filter Transposed form of FIR filter
ELEN 5301 Adv. DSP and Modeling
11
7/3/2008
23
The transpose of a decimator is an interpolator and the transpose of an interpolator is a decimator. It is possible to build an efficient interpolator using a symmetry property similarly to a decimator seen
Summer II 2008
24
pk ,n = hk + nI
where an integer
k = 0,1,..., I 1; n = 0,1,..., K 1
(2.24.1)
K=
M I
(2.24.2)
Summer II 2008
12
7/3/2008
25
g n ,m = hnI + mD
(2.25.1)
I
We note that gn,m varies periodically with period I. Consequently, a different set of coefficients is used to generate the set of I output samples ym. Also, pk,n is obtained from hn by decimation with a factor I. Therefore, if the original filter frequency response is flat over 0||/I, each polyphase filter will have a (relatively) flat response over 0||. I.e., the polyphase filters are all-pass filters and differ by their phase characteristics. The polyphase filter can also be viewed as a set of I subfilters connected to a common delay line. Their frequency responses are
pk ,n = e j k I
ELEN 5301 Adv. DSP and Modeling
(2.25.2)
Summer II 2008
26
pk ,n = hk + nD
where an integer
(2.26.1)
k = 0,1,..., D 1; n = 0,1,..., K 1
K=
M D
pk , n = hnI k pk , n = hnD k k = 0,1,..., I 1 k = 0,1,..., D 1
Summer II 2008
(2.26.2)
13
7/3/2008
27
g n ,m = hnI + mD
ym = g
n=0 K 1
(2.25.1)
I
where hn is the impulse response of the LP FIR filter. Selecting the filter length as I and since gn,m is periodic with period I, the filter output may be expressed as
m n ,m I I
x mD
(2.25.2)
I n
These computations can be performed by processing blocks of data of length K by a set of K filter coefficients gn,m-L. There are I such sets of coefficients, one set for each block of I output points of ym. For each block of I output points, there is a corresponding block of D input points of xn entering in the computation.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
28
Summer II 2008
14
7/3/2008
29
I , H (v ) = 0,
ELEN 5301 Adv. DSP and Modeling
0 v min ( D , I ) otherwise
Summer II 2008
(2.29.1)
30
Summer II 2008
15
7/3/2008
31
I = Ii
i =1
D = Di
i =1
(2.31.1)
interpolation can be performed by a cascade of L stages of interpolation and filtering. The filter in each of the interpolators eliminates the images introduced by the upsampling in the correspon -ding interpolator.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
32
Fi =
Fi 1 , i = 1, 2,..., J Di
(2.32.1)
The input sampling rate for the sequence xn is F0 = Fx. To avoid aliasing, filters in each stage must be selected to avoid aliasing within the overall frequency band of interest. If the desired passband and transition band of the overall decimator are:
16
7/3/2008
33
For example, in the first filter stage: F1 = Fx/D1, and the filter will have
After decimation by D1, aliasing from the signal components falling in the filter transition band occurs. However, this aliasing will be at frequencies above Fsc. Therefore, there is no aliasing in the frequency band 0 F Fsc.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
34
Fi 1 = I i Fi ,
The output sampling rate is
i = J , J 1,...,1
(2.34.1)
F0 = IFJ
when th i h the input sampling rate i FJ. Th corresponding f t li t is The di frequency b d band specifications are
(2.34.2)
0 F Fp Fp F Fi Fsc
(2.34.3)
Summer II 2008
17
7/3/2008
35
bandpass signals have equivalent lowpass representation that can be obtained by frequency translation of Fc (usually, the center frequency). An analog bandpass signal may be represented as:
x(t ) = A(t ) cos [ 2 Fct + (t ) ] = A(t ) cos (t ) cos 2 Fct A(t ) sin (t ) sin 2 Fc t = uc (t ) cos 2 Fc t us (t ) sin 2 Fc t = Re u (t )e j 2 Fct
ELEN 5301 Adv. DSP and Modeling
(2.35.1)
Summer II 2008
36
A(t) is the amplitude (envelope) of the signal, (t) is the phase, and uc(t) and us(t) are the quadrature components of the signal. To translate x(t) to its lowpass equivalent, it needs to be multiplied (mixed) by the quadrature carriers cos2Fct and sin2Fct and lowpass filtering the two products to eliminate the double-frequency terms (components concentrated around 2Fc). All the information content of the bandpass signal will be preserved in the lowpass signal. To avoid aliasing and preserve the content of a bandpass signal with the bandwidth B, it must be samples at the rate:
2 B Fs 4 B
ELEN 5301 Adv. DSP and Modeling
(2.36.4)
Summer II 2008
18
7/3/2008
37
1, H ( ) = 0,
B 2
otherwise
(2.37.1)
Summer II 2008
38
1, H D ( ) = 0,
D D
otherwise
(2.38.1)
where D is any desired frequency in the range 0 D . In the case of interpolation by an integer factor I, the filter for rejecting the images in the spectrum should approximate the ideal frequency response:
I , H I ( ) = 0,
B 2 I
otherwise
(2.38.2)
In this case, the LPF used to reject the double-frequency components is redundant since its function is performed by the filter HI.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
19
7/3/2008
39
Only one image rejection/antialiasing filter is needed in this situation, whose frequency response approximates the following ideal characteristic:
I , H I ( ) = 0,
0 min (B 2 I , B 2 D ) otherwise
( (2.39.1) )
After sampling rate conversion, a bandpass signal can be regenerated by amplitude modulating the quadrature components by corresponding signal components and adding them together. The center frequency c can be selected in the range:
min (B 2 I , B 2 D ) c
ELEN 5301 Adv. DSP and Modeling
(2.39.2)
Summer II 2008
40
( m + 1) m D D
(2.40.1)
where m is a positive integer. A bandpass filter is used to eliminate unwanted frequency components and then a direct decimation of the bandpass signal by the factor D results in a spectrum
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
20
7/3/2008
41
If m is odd
If m is even
For an odd m, the signal spectrum is inverted, which can be undone by multiplying each sample of the decimated signal by
( 1)
, n = 0,1,...
(2.41.1)
Summer II 2008
42
Summer II 2008
21
7/3/2008
43
Summer II 2008
44
1 k = + r I
where k and I are positive integers and is a number in the range:
(2.44.1)
0 < <1 I
Therefore:
(2.44.2) (2 44 2)
k 1 k +1 < < I r I
(2.44.3)
We note that I is the interpolation factor (and a number of polyphase filters) that needs to be determined to satisfy specifications on the tolerable distortion.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
22
7/3/2008
45
Summer II 2008
46
Summer II 2008
23
7/3/2008
47
1 Ps = 2
X ( ) d =
2
A2 x
(2.47.1)
We can show that the total error power due to the sampling-time distortion is
1 Pe 2
x
x
3 A2 x 0.5 2 d = A 12 I 2 I 2 2
(2.47.2)
The error power is inversely proportional to the square of the number of subfilters I I. The ratio of signal-to-distortion due to a sampling-time error for the 1st-order approximation is 2 s t 2 e x
SD R1 =
P 12 I P
(2.47.3)
Summer II 2008
48
Summer II 2008
24
7/3/2008
49
1 Pe 2
5 A2 x 0.25 4 A I d = 80 I 4 x 2 2
(2.49.1)
The error power is inversely proportional to I4 (error magnitude proportional to the square of the number of subfilters). The ratio of signal-to-distortion due to a sampling-time error for the 2nd-order approximation is 4 s t 4 e x
SD R 2 =
P 80 I P
(2.49.2)
Summer II 2008
50
k d = Tx I
( ) =
k I
(2.50.1)
where k and I are integers and Tx is the sampling interval. This delay corresponds to a linear phase shift:
(2.50.2)
Design of all pass linear phase filter with such a delay is not very simple We may all-pass linear-phase simple. use the methods of sampling rate conversion instead
Summer II 2008
25
7/3/2008
51
Summer II 2008
52
The system A output at rate Fx is upsampled by a factor of I, fed at the rate Ifx to a digital sample-and-hold that serves as an interface to system B, and read out into system B at the clock rate DFy. Therefore, after decimation by D, two systems will be synchronized. In a special case when I = D, two clock rates are comparable but not identical.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
26
7/3/2008
53
p , stage =
p
# of stages
(2.53.1)
Fx
Summer II 2008
54
M 5152
Reduction of sampling rate by a factor of D = 50 would reduce the Nyquist frequency to 80 Hz and, therefore, the system would automatically satisfy the specifications. We need to ensure that the antialiasing filters meet the ripples specifications. A single-rate filter would be of length of approximately 5480. implementing two stages with D1 = 25, D2 = 2, I1 = 2, and I2 = 25, will reduce filter lengths to approximately 177 and 233.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
27
7/3/2008
55
In multistage implementations, generally, the greatest decimation factor goes first and the smallest last. Interpolation is reversed (i.e., the greatest factor goes last).
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
56
Summer II 2008
28
7/3/2008
57
Summer II 2008
58
2 k H k ( ) = H 0 , k = 1, 2,..., N 1 N
(2.58.1)
The frequency responses of the filters are obtained by uniformly shifting the frequency response of the prototype filter by multiples of 2/N; or in the time domain:
hk ,n = h0,n e j 2 nk N , k = 0,1,..., N 1
where h0,n is the impulse response of the prototype filter.
(2.58.2)
Summer II 2008
29
7/3/2008
59
X k ,m = h0,mD n xn e j 2 nk N ,
n
ELEN 5301 Adv. DSP and Modeling
k = 0,1,..., N 1; m = 0,1,...
(2.59.1)
60
vn =
1 N
e
k =0
N 1
j 2 n
k N
Yk , m g 0, n mI = g 0, n mI m m
1 N
Yk ,me
k =0
N 1
j 2 n
k N
(2.60.1) = g 0,n mI yn ,m m
where 1/N is the normalization factor and yn,m represent samples of the IDFT Yk(m).
Summer II 2008
30
7/3/2008
61
hk , n = h0, n e j 2 nk N k = 0,1,..., N 1
(2.61.1)
g k ,n = g 0 n e j 2 nk N 61 2) (2.61.2) (2 0, k = 0,1,..., N 1
where h0,n and g0,n are the responses of the prototype filters.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
62
pk ,n = h0,nN k
(2.62.1)
k = 0,1,..., N 1
The outputs in frequency domain can be described:
N 1 j 2 n N X k , m = pn ,l xn , ml e , k = 0,1,...D 1 n=0 l k
(2.62.2)
N-point DFT
ELEN 5301 Adv. DSP and Modeling
convolution
Summer II 2008
Here N = D.
31
7/3/2008
63
qk , n = g 0,nN + k
(2.63.1)
k = 0,1,..., N 1
The output of the lth polyphase filter can be expressed as:
1 vl ,n = ql ,n m m N
convolution
Yk ,me
k =0
N 1
j 2 k
l N
= ql , n m yl ,m , l = 0,1,...N 1 m
(2.63.2)
N-point DFT
Summer II 2008
64
Summer II 2008
32
7/3/2008
65
Summer II 2008
66
Subband coding is an effective method for achieving a bandwidth compression in a digital signal (or image), when its energy is in a particular frequency band.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
33
7/3/2008
67
2 H0 2 1 2 2 X a1 ( ) = X H1 + X H1 2 2 2 2 2 X a 0 ( ) =
ELEN 5301 Adv. DSP and Modeling
1 2 X H0 + X 2 2 2 2
(2.67.1)
Summer II 2008
68
(2.68.1)
H 0 ( )G0 ( ) + H1 ( )G1 ( ) = 0
which can be satisfied by selecting
(2.68.2) (2 68 2)
G0 ( ) = H1 ( ),
G1 ( ) = H 0 ( )
(2.68.3)
Summer II 2008
34
7/3/2008
69
H 0 ( ) = H ( ) H1 ( ) = H ( )
or, on the time domain:
(2.69.1)
h0,n = hn h1,n = ( 1) hn
n
(2.69.2)
Summer II 2008
70
G0 ( ) = 2 H ( ) G1 ( ) = 2 H ( )
( (2.70.1) )
(2.70.2)
The scale factor 2 corresponds to the interpolation factor used to normalize the overall frequency response of the QMF. Therefore, the synthesis QMFB output is
X ( ) = H 2 ( ) H 2 ( ) X ( )
Ideally, a 2-channel QMFB should have a unity gain:
(2.70.3)
H 2 ( ) H 2 ( ) = 1,
ELEN 5301 Adv. DSP and Modeling
(2.70.4)
Summer II 2008
35
7/3/2008
71
H ( ) = H r ( )e
where N is the filter length. Then
N 1 2
( (2.71.1) )
H 2 ( ) = H r2 ( )e
H 2 ( ) = H r2 ( )e
j ( N 1)
= H r2 ( ) e
N 1
j ( N 1)
j ( N 1)
(2.71.2)
j ( )( N 1)
= ( 1)
H r2 ( ) e
(2.71.3)
Therefore, the overall transfer function of the 2-channel QMFB that uses linear phase FIR fil h filters is i
X ( ) 2 2 j N 1 = H ( ) (1) N 1 H ( ) e ( ) X ( )
The overall delay of the QMFB is N 1 samples.
ELEN 5301 Adv. DSP and Modeling
(2.71.4)
Summer II 2008
72
A ( ) = H ( ) (1) N 1 H ( )
2
( (2.72.1) )
A ( ) = H ( ) + H ( )
2
(2.72.2)
A ( ) = H ( ) + H ( ) = 1, ,
2 2
(2.72.3)
However, any real (and nontrivial) linear phase FIR filter will introduce some amplitude distortion. A perfect reconstruction QMFB can be designed using a linear phase half-band FIR filter that is defined as a zero-phase FIR with response
constant, b2 n = 0,
ELEN 5301 Adv. DSP and Modeling
n=0 n0
(2.72.4)
Summer II 2008
36
7/3/2008
73
B ( ) =
n = K
be
n
j n
(2.73.1)
B ( ) + B ( ) = const ,
(2.73.2)
The typical frequency response is symmetric about /2; the band edges are symmetric about /2; the stopband and passband ripples are equal. The filter can be made causal by introducing a Ksample delay.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
74
B+ ( ) = B ( ) + e
j ( N 1)
(2.74.1)
B+ ( z ) = H ( z ) H (1 z ) z
or, equivalently:
( N 1)
(2.74.2)
B+ ( ) = H ( ) + e
2
ELEN 5301 Adv. DSP and Modeling
j ( N 1)
(2.74.3)
Summer II 2008
37
7/3/2008
75
B+ ( z ) + ( 1)
N 1
B+ ( z ) = z
( N 1)
(2.75.1) (2 75 1) (2.75.2)
or:
B+ ( ) + ( 1)
N 1
B+ ( ) = e
j ( N 1)
H ( z ) H (1 z ) + H ( z ) H ( 1 z ) =
H0 ( z ) = H ( z ) F0 ( z ) = z F1 ( z ) = z
( N 1)
(2.75.3)
H1 ( z ) = z ( N 1) H 0 ( 1 z ) H 0 (1 z )
(2.75.4)
( N 1)
H1 (1 z ) = H 0 ( z )
Summer II 2008
76
A 2-channel QMFB can be realized efficiently when using polyphase filters with the responses:
pi ,m = h2 m+i , i = 0,1
(2.76.1)
Summer II 2008
38
7/3/2008
77
An analog SDM produces a 1-bit per sample output at a very high sampling rate. This 1-bit output is passed through a LPF producing a high precision (multiple-bit) output that is decimated to a lower sampling rate. The decimated output is passed through a HPF that attenuates the quantization noise at the lower frequencies.
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
78
A digital signal passes through a HPF, whose output is interpolated (upsampled and filtered by anti-imaging filter). This high sampling rate high precision digital signal is input to the digital SDM that provides a high sampling rate 1-bit per sample output. This 1-bit output is converted t an analog signal b l l t t Thi 1 bit t t i t d to l i l by lowpass filtering and further smoothing with an analog filter.
Questions?
ELEN 5301 Adv. DSP and Modeling
Summer II 2008
39