Digital Signal Processing Reference
In-Depth Information
w ¼ filter(B,1,x); % Anti-aliasing filtering
% Compute the single-sided amplitude spectrum for the filtered signal
W ¼ 2*abs(fft(w,N))/N;W(1) ¼ W(1)/2;
% Downsampling
y ¼ w(1:M:N);
NM ¼ length(y);
% Compute the single-sided amplitude spectrum for the downsampled signal
Y
¼
2*abs(fft(y,NM))/NM;Y(1)
¼
Y(1)/2;
% Plot spectra
subplot(2,1,1);plot(f,W(1:1:N/2));grid; xlabel(
Frequency (Hz)
);
'
'
subplot(2,1,2);plot(fsM,Y(1:1:NM/2));grid; xlabel(
);
Now we focus on how to design an anti-aliasing FIR filter, or decimation filter. We will discuss this
topic via the following example.
Frequency (Hz)
'
'
EXAMPLE 12.1
Consider a DSP downsampling system with the following specifications:
Sampling rate ¼ 6,000 Hz
Input audio frequency range ¼ 0e800 Hz
Passband ripple ¼ 0.02 dB
Stopband attenuation ¼ 50 dB
Downsample factor M ¼ 3
Determine the FIR filter length, cutoff frequency, and window type if the window method is used.
Solution:
The specifications are reorganized as
Anti-aliasing filter operating at the sampling rate ¼ 6,000 Hz
Passband frequency range ¼ 0e800 Hz
Stopband frequency range ¼ 1e3 kHz
Passband ripple ¼ 0.02 dB
Stopband attenuation ¼ 50 dB
Filter type ¼ FIR
The block diagram and specifications are depicted in Figure 12.4 .
y ()
x ()
w ()
Anti-aliasing
filter H(z)
3
6
6
2
f
0
0.
1
2
3
FIGURE 12.4
Filter specifications for Example 12.1.
 
Search WWH ::




Custom Search