owen_tam
Newbie level 1
- Joined
- May 18, 2013
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,290
here is the problem:
i use impulse invariance transform to design low-pass filter, butterworth,chebyshev1 can perfectly achieve the requirements,but ellipsoid and chebyshev 2 can't achieve the Rs(Stopband attenuation)
and here is my code and figure:
Fs=400
fp=100;fs=120;
Ap=1;As=20
Wp=2*fp*pi;Ws=2*fs*pi;
[n,Wn]=ellipord(Wp,Ws,Ap,As,'s');
[b,a]= ellip(n,Ap,As,Wn,'s');
[B,A]=impinvar(b,a,Fs);
[HK,f]=freqz(B,A,'whole');
plot(f*Fs/2/pi,20*log10(abs(HK)));
axis([0,200,-80,5]);
grid on
Fs=400
fp=100;fs=120;
Ap=1;As=20
Wp=2*fp*pi;Ws=2*fs*pi;
[n,Wn]=cheb2ord(Wp,Ws,Ap,As,'s');
[b,a]= cheby2(n,As,Wn,'s');
[B,A]=impinvar(b,a,Fs);
[HK,f]=freqz(B,A,'whole');
plot(f*Fs/2/pi,20*log10(abs(HK)));
axis([0,200,-80,5]);
grid on
Any help will be much appreciated
i use impulse invariance transform to design low-pass filter, butterworth,chebyshev1 can perfectly achieve the requirements,but ellipsoid and chebyshev 2 can't achieve the Rs(Stopband attenuation)
and here is my code and figure:
Fs=400
fp=100;fs=120;
Ap=1;As=20
Wp=2*fp*pi;Ws=2*fs*pi;
[n,Wn]=ellipord(Wp,Ws,Ap,As,'s');
[b,a]= ellip(n,Ap,As,Wn,'s');
[B,A]=impinvar(b,a,Fs);
[HK,f]=freqz(B,A,'whole');
plot(f*Fs/2/pi,20*log10(abs(HK)));
axis([0,200,-80,5]);
grid on
Fs=400
fp=100;fs=120;
Ap=1;As=20
Wp=2*fp*pi;Ws=2*fs*pi;
[n,Wn]=cheb2ord(Wp,Ws,Ap,As,'s');
[b,a]= cheby2(n,As,Wn,'s');
[B,A]=impinvar(b,a,Fs);
[HK,f]=freqz(B,A,'whole');
plot(f*Fs/2/pi,20*log10(abs(HK)));
axis([0,200,-80,5]);
grid on
Any help will be much appreciated