chebyshev II BPF magnitude response is not equal to 1 in the passband – incorrect magnitude response when using freqz(b,a)
I need to exctract frequency bands of eeg signal using iir filterbanks , i got the optimum order of chebyshev type II BPF , I designed the filter but I get magntitude response not equal to 1 in the passbands , also I get incorrect magntuide response when using freqz(b,a) , code given below and magnitude response figure when using freqz(sos,[],Fs)and freqz(b,a) , kindly check .
clear
close all
clc
% Delta (0.5 – 4) Hz
% theta (4 – 7.9) Hz
% Lower Alpha (7.9 – 10) Hz
% Upper Alpha (10.1 – 12.9) Hz
% LOW BETA (12-15) Hz
% MID BETA (15-18) Hz
Fs=173.61;% Sampling Frequency
Fn=Fs/2; % Nyquist Frequency
Wpm=[0.5 4;4 7.9;7.9 10;10.1 12.9;12 15;15 18];% Passbands
Rp=3;% Passband Ripple
Rs=40;% Stopband Ripple
for m=1:size(Wpm,1)
Wp=Wpm(m,:)/Fn;
Ws=Wp.*[0.9 1.05];
%% Design a bandpass filters
[n(m,:),Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Determine filter Order
[b{m},a{m}]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass");
[z,p,k]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass"); % Transfer Function Coefficients
[sos{m},g{m}]=zp2sos(z,p,k);
[H{m},f]=freqz(sos{m},[],Fs);
[H1{m},f]=freqz(b{m},a{m},[],Fs);
subplot(size(Wpm,1),2,2*m-1)
plot(f,abs(H{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H{m}))]),xlabel(‘Hz’) , ylabel(‘Magnitude’)
grid on , xticks([Wp*Fn Fn])
subplot(size(Wpm,1),2,2*m)
plot(f,abs(H1{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H1{m}))]),xlabel(‘Hz’), ylabel(‘Magnitude’),
grid on , xticks([Wp*Fn Fn])
grid on , xticks([Wp*Fn Fn])
endI need to exctract frequency bands of eeg signal using iir filterbanks , i got the optimum order of chebyshev type II BPF , I designed the filter but I get magntitude response not equal to 1 in the passbands , also I get incorrect magntuide response when using freqz(b,a) , code given below and magnitude response figure when using freqz(sos,[],Fs)and freqz(b,a) , kindly check .
clear
close all
clc
% Delta (0.5 – 4) Hz
% theta (4 – 7.9) Hz
% Lower Alpha (7.9 – 10) Hz
% Upper Alpha (10.1 – 12.9) Hz
% LOW BETA (12-15) Hz
% MID BETA (15-18) Hz
Fs=173.61;% Sampling Frequency
Fn=Fs/2; % Nyquist Frequency
Wpm=[0.5 4;4 7.9;7.9 10;10.1 12.9;12 15;15 18];% Passbands
Rp=3;% Passband Ripple
Rs=40;% Stopband Ripple
for m=1:size(Wpm,1)
Wp=Wpm(m,:)/Fn;
Ws=Wp.*[0.9 1.05];
%% Design a bandpass filters
[n(m,:),Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Determine filter Order
[b{m},a{m}]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass");
[z,p,k]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass"); % Transfer Function Coefficients
[sos{m},g{m}]=zp2sos(z,p,k);
[H{m},f]=freqz(sos{m},[],Fs);
[H1{m},f]=freqz(b{m},a{m},[],Fs);
subplot(size(Wpm,1),2,2*m-1)
plot(f,abs(H{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H{m}))]),xlabel(‘Hz’) , ylabel(‘Magnitude’)
grid on , xticks([Wp*Fn Fn])
subplot(size(Wpm,1),2,2*m)
plot(f,abs(H1{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H1{m}))]),xlabel(‘Hz’), ylabel(‘Magnitude’),
grid on , xticks([Wp*Fn Fn])
grid on , xticks([Wp*Fn Fn])
end I need to exctract frequency bands of eeg signal using iir filterbanks , i got the optimum order of chebyshev type II BPF , I designed the filter but I get magntitude response not equal to 1 in the passbands , also I get incorrect magntuide response when using freqz(b,a) , code given below and magnitude response figure when using freqz(sos,[],Fs)and freqz(b,a) , kindly check .
clear
close all
clc
% Delta (0.5 – 4) Hz
% theta (4 – 7.9) Hz
% Lower Alpha (7.9 – 10) Hz
% Upper Alpha (10.1 – 12.9) Hz
% LOW BETA (12-15) Hz
% MID BETA (15-18) Hz
Fs=173.61;% Sampling Frequency
Fn=Fs/2; % Nyquist Frequency
Wpm=[0.5 4;4 7.9;7.9 10;10.1 12.9;12 15;15 18];% Passbands
Rp=3;% Passband Ripple
Rs=40;% Stopband Ripple
for m=1:size(Wpm,1)
Wp=Wpm(m,:)/Fn;
Ws=Wp.*[0.9 1.05];
%% Design a bandpass filters
[n(m,:),Ws]=cheb2ord(Wp,Ws,Rp,Rs); % Determine filter Order
[b{m},a{m}]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass");
[z,p,k]=cheby2(ceil(n(m,:)/2),Rs,Ws,"bandpass"); % Transfer Function Coefficients
[sos{m},g{m}]=zp2sos(z,p,k);
[H{m},f]=freqz(sos{m},[],Fs);
[H1{m},f]=freqz(b{m},a{m},[],Fs);
subplot(size(Wpm,1),2,2*m-1)
plot(f,abs(H{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H{m}))]),xlabel(‘Hz’) , ylabel(‘Magnitude’)
grid on , xticks([Wp*Fn Fn])
subplot(size(Wpm,1),2,2*m)
plot(f,abs(H1{m}),"LineWidth",1.5)
title(sprintf(‘Frequency Response of digital Chebyshev II order n = %d’,n(m,:)))
ylim([0 1.2*max(abs(H1{m}))]),xlabel(‘Hz’), ylabel(‘Magnitude’),
grid on , xticks([Wp*Fn Fn])
grid on , xticks([Wp*Fn Fn])
end chebyshev ii, bandpass filter, freqz, magnitude response MATLAB Answers — New Questions









