Halfband and FIR filter for decimation
9 views (last 30 days)
Show older comments
Hi,
I want to design a decimation filter for a Sigma-Delta modulator. The modulator input is 20Khz sinus signal. And this signal is oversampled to 2.5Mhz. So decimation ratio is about 64. First I designed a CIC filter which has a decimation ratio of 16. After a halfband filter and an FIR filter. So halfband filter output is 80 Khz, FIR filter output is 40 khz. Anyway, I want to design halfband and FIR filter with Matlab firhalfband and remez functions. (6th order halfband and 11th order FIR) I'm confused to determine the passband edge frequencies. My aim is at the output 20 khz signal is passed and the noise over 50 khz is supressed. For halfband filter
b=firhalfband(6,fp);
Fs=160000;
[H, f] = freqz(b, 1, 512, Fs);
mag = 20*log10(abs(H));
plot(f, mag)
For FIR filter
b=remez(11,[0,fp,fs,1],[1 1 0 0]);
Fs=80000;
[H, f] = freqz(b, 1, 512, Fs);
mag = 20*log10(abs(H));
plot(f, mag)
How can I determine fp and fs? Thanks
0 Comments
Answers (1)
Rob Graessle
on 2 Feb 2011
First of all, REMEZ is an obsolete function for designing an equiripple FIR filter. You should use FIRPM instead. FIRPM has the same syntax as REMEZ.
The second argument of FIRPM (which you have defined as [0 fp fs 1]) is a vector of pairs of normalized frequency points, specified in the range between 0 and 1, where 1 corresponds to the Nyquist frequency. The Nyquist frequency in this case is 40 kHz, so for a 20 kHz passband edge, fp should be set to 0.5.
You can experiment with fs to suppress the desired noise frequencies. fs = 1 will still allow some noise between 20 and 40 kHz to pass through, while placing fs closer to 0.5 (such as 0.6) will suppress more of the noise. Note that decreasing the distance between the passband and stopband while keeping the order constant will increase passband and stopband ripple.
0 Comments
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!