In analog filter design, I have a problem using IFFT with cheb2ap function.
2 views (last 30 days)
Show older comments
I'd like to design chebyshev type2(as known as inverse chebyshev filter) by using 'cheb2ap'.
t = -100:0.001:100;
dt = t(2)-t(1);
f = linspace(-1./(2.*dt),1./(2.*dt),length(t));
N=input('Enter the value of the N: ');
[z,p,k] = cheb2ap(N,50);
[num,den] = zp2tf(z,p,k);
f_cutoff = 0.06;
w_c = 2*pi*f_cutoff;
[num,den] = lp2lp(num,den,w_c);
w = 2.*pi.*f;
H = freqs(num,den,w);
irf_chebyshev2 = abs(ifft(ifftshift(H)));
irf = irf_chebyshev2./max(irf_chebyshev2);
figure(1);
plot(t,irf);
grid;
I choose odd number N, irf is reasonalbe form. but N is even, irf is unreasonable form.
this is N=5
and this is N=6
same problem happen to 'ellipap' function. how can i do to fix this problem?
0 Comments
Answers (1)
Star Strider
on 19 Jul 2016
You may be able to get a better result from the freqs function by increasing the number of frequency points it calculates. (The default is 200.)
From the documentation:
[h,w] = freqs(b,a,n) uses n frequency points to compute the frequency response, h, where n is a real, scalar value. The frequency vector w is auto-generated and has length n.
I would start with:
n = 2^12;
0 Comments
See Also
Categories
Find more on Analog Filters 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!