DSP
Design a low pass chebyshev filter with
specifications
pass band edge frequency=250Hz
stop band edge frequency=375Hz
sampling frequency=1000Hz
stopband attenuation=13.98dB
pass band gain=3.01dB
use bilinear transformation
PROGRAM:
clc;
clear all;
close all;
ap=3.01
as=13.98
fp=250
fs=375
Fs=1000
T=1/Fs
wp=2*pi*fp/Fs
ws=2*pi*fs/Fs
ohmp=(2/T)*tan(wp/2)
ohms=(2/T)*tan(ws/2)
%% To find the order N
s1=10^(0.1*as)-1
s2=10^(0.1*ap)-1
s3=ohms/ohmp
N=acosh(sqrt(s1/s2))/acosh(s3)
%% to make the order upper side
N=ceil(N)
%% To find epslm value(e)
e=sqrt(s2)
%% To find the value of Bita(b)
b=(sqrt(1+(e*e))+1/e)^(1/N)
%% to find the r
s4=b*b-1
r=ohmp*(s4)/(2*b)
%% To find the R
s5=(b*b)+1
R=ohmp*(s5)/(2*b)
%% To find the Thita Qk
Q=0
for k=1:N
Q(k)=(pi/2)+(2*(k-1)+1)*pi/(2*N)
s(k)=r*cos(Q(k))+j*R*sin(Q(k))
end
%% To find the gain(K) Order=2 i.e (Even)
q=poly(s)
b0=q(N+1)
r1=rem(N,2)
if(r1==0)
K=b0/(sqrt(1+e^2))
else
K=b0
end
K=abs(K)
freqs(K,q,100000)
No comments:
Post a Comment