Frequency response of a filter

Status
Not open for further replies.

bittersweet

Newbie level 5
Joined
Mar 2, 2008
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,368
Hi,
I have a simple question, I'm designing an FIR filter, I want to see the frequency response of that filter, sampling rate is 80 Khz

Code:
b=remez(11,[0 0.49 0.83 1],[1 1 0 0]);
Fs=80000;
[H, f] = freqz(b, 1, 512, Fs); 
mag = 20*log10(abs(H)); 
plot(f, mag)

My question is that when I plot this, I see half the sampling rate as the Nyquist frequency. So when I want to learn my cutoff frequency which one I use Fs=80khz or Fs=160khz ?
 

I'm not sure what you're asking. The plot will show the frequency response from DC to 40kHz (Fs/2 or the Nyquist rate). The frequency response from -40kHz to DC isn't shown as it is the same as from DC to Fs/2, i.e. |H(w)| is even.
 

well, I can generalize my question

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

Code:
b=firhalfband(6,fp);
Fs=160000;
[H, f] = freqz(b, 1, 512, Fs);
mag = 20*log10(abs(H));
plot(f, mag)

For FIR filter

Code:
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? Can I see the frequency response accurately with this code?
 

Actually the rule is that your sampling freq should be atleast twice the highest freq of the system. so you can totally double the sampling frequency to balance that. and maybe there is a good reason u code, but you can do the same stuff in a much easier way by using 'fda tool' in matlab.
 

Actually, I dont have a satisfying answer, if anyone can help me, I'll be appriciated
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…