How to create band pass filter in matlab

71 views
Skip to first unread message

VENKATA PHANIKRISHNA B

unread,
Aug 29, 2019, 6:10:23 AM8/29/19
to analyzingneura...@googlegroups.com
I want to design  0.15-45 Hz band-pass filter for filtering a signal whose sampling frequency is 100 Hz.
Please help me to do this.

I tried using following code.

Fs = 100;   % Sampling Frequency (Hz)
Fn = Fs/2;   % Nyquist Frequency (Hz)
Wp = [0.15   45]/Fn;  % Passband Frequency (Normalised)
Ws = [0.1  50]/Fn;  % Stopband Frequency (Normalised)
Rp =   1;   % Passband Ripple (dB)
Rs = 60;    % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs);   % Filter Order
[z,p,k] = cheby2(n,Rs,Ws);    % Filter Design
[sosbp,gbp] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
filtered_signal = filtfilt(sosbp, gbp, original_signal);    % Filter Signal

I am getting error at [n,Ws] = cheb2ord(Wp,Ws,Rp,Rs)
Error using cheb2ord (line 69) The cutoff frequencies must be within the interval of (0,1).

Please help me to solve this. or is there any way to create 0.15-45 Hz band-pass filter for filtering a signal whose sampling frequency is 100 Hz. please provide the information

--
************************
thanks


VENKATA PHANIKRISHNA B
9908261261
Reply all
Reply to author
Forward
0 new messages