Tahmod
Newbie level 1
- Joined
- Dec 3, 2013
- Messages
- 1
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 15
-I have design a chebyshev filter.With The following specification.
pass band 0-2khz
pass band ripple=0.5dB
sampling frequency 60khz
and the transfer function given which is :
H(s)=1.5161/(s^2+1.4526s+1.5161)
-When I have done the design by hand I done I got (bi-linear )
H(z)=(0.0143+0.029z^-1+0.0143z^-2)/(1-1.682z^-1+0.8695z^-2)
-The problem is when I put it in Matlab to check, I cant get the it working.
-What is the problem with the code?
-Do I have to use another function instead of cheb1ord to allow only the bandpass frequency and not the other one?
-The error says:
error using cheb1ord (line 62)
The cutoff frequencies must be non-negative for analog filters.
Error in chebyshevIIR (line 93)
[N,Wn]=cheb1ord(wpp,wss,ap,as,'s') %Until here it is write
-Code
Fp=2000;
Fs=0;
ap=0.5;
as=0;
Ft=60000; % Sampling frequency
wp=2*pi*Fp/Ft
ws=2*pi*Fs/Ft
wpp=tan(wp/2)
wss=tan(ws/2)
[N,Wn]=cheb1ord(wpp,wss,ap,as,'s')
[B,A]=cheby1(N,1,Wn,'s');
[BT,AT]=lp2hp(B,A,wpp);
[num,den]=bilinear(BT,AT,1/Ft);
tfHlp=tf(B,A) %Transfer function Glp(s) of the prototype analog lowpass filter
tfHhp=tf(BT,AT) %Transfer function Hhp(s) of the analog highpass filter
tfGhp=tf(num,den) %The transfer funcition Ghp(z) of the desired digital IIR highpass filter
pass band 0-2khz
pass band ripple=0.5dB
sampling frequency 60khz
and the transfer function given which is :
H(s)=1.5161/(s^2+1.4526s+1.5161)
-When I have done the design by hand I done I got (bi-linear )
H(z)=(0.0143+0.029z^-1+0.0143z^-2)/(1-1.682z^-1+0.8695z^-2)
-The problem is when I put it in Matlab to check, I cant get the it working.
-What is the problem with the code?
-Do I have to use another function instead of cheb1ord to allow only the bandpass frequency and not the other one?
-The error says:
error using cheb1ord (line 62)
The cutoff frequencies must be non-negative for analog filters.
Error in chebyshevIIR (line 93)
[N,Wn]=cheb1ord(wpp,wss,ap,as,'s') %Until here it is write
-Code
Fp=2000;
Fs=0;
ap=0.5;
as=0;
Ft=60000; % Sampling frequency
wp=2*pi*Fp/Ft
ws=2*pi*Fs/Ft
wpp=tan(wp/2)
wss=tan(ws/2)
[N,Wn]=cheb1ord(wpp,wss,ap,as,'s')
[B,A]=cheby1(N,1,Wn,'s');
[BT,AT]=lp2hp(B,A,wpp);
[num,den]=bilinear(BT,AT,1/Ft);
tfHlp=tf(B,A) %Transfer function Glp(s) of the prototype analog lowpass filter
tfHhp=tf(BT,AT) %Transfer function Hhp(s) of the analog highpass filter
tfGhp=tf(num,den) %The transfer funcition Ghp(z) of the desired digital IIR highpass filter