Confusion implementing chebyshev type 2 band pass filter in matlab
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to implement chebyshev type 2 band pass filter in matlab;actually i am not getting band pass oytput,output looks like low pass
My code is below
% Design a band pass Chebyshev Type II filter using analog prototyping. The
% order of filter is 20 with a value of 60 dB stop band attenuation and 0.75 dB pass band
% ripple where,
% Pass band edge = 800 Hz
% Stop band edge = 2000 Hz
% Sampling frequency = 6000
clc; close all; clear all;
Rp = 0.75; Rs = 60;
fp = 800;
fs = 2000;
Fs = 6000;
fn = Fs/2; % nyquist frequency
wp = fp/fn; % Pass band corner frequency
ws = fs/fn; % Stop band corner frequency
[n,Wn] = cheb2ord(wp,ws,Rp,Rs);
[num,den] = cheby2(20,Rs,Wn);
freqz(num,den,512,Fs);
I have also attached snapshot of output which shows that output frequency plot looks like low pass,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/330389/image.png)
1 comentario
Haseeb Ahmed
el 28 de Abr. de 2021
Just use cheby2 commands by putting cut off frequiencies in square box, and your issue will be solved.
Respuestas (1)
Haseeb Ahmed
el 28 de Abr. de 2021
Editada: Haseeb Ahmed
el 28 de Abr. de 2021
[b,a] = cheby2 (10,Rs, [wp ws],'bandpass');
Use the above mentioned command, it will provide a band pass responce. Square brakets must have two cut off frequencies.
code:
clc; clear all; close all;
fp = 800; %pass band edge
fs = 2000; %stop band edge
Rp = 0.75; % pass band ripple
Rs = 60; % stop band attenuation
fsampling = 6000; % sampling frequency
wp=2*fp/fsampling ; % convert to radians per second
ws=2*fs/fsampling ; % convert to radians per second
n = 10 ; % order always 2n for band pass
[b,a] = cheby2 (10,Rs, [wp ws],'bandpass');%designs a lowpass, highpass, bandpass,
% or bandstop Chebyshev Type II filter, depending on the value of ftype
% and the number of elements of Ws. The resulting bandpass and bandstop designs
% are of order 2n.
freqz(b,a) %frequency response of digital filter
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/599360/image.png)
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!