can you tell me how to apply a butterworth bandwith filter which only allows frequency of 0.5-25hz where sampling frequency is 1000 samples per second to a signal .

답변 (1개)

Star Strider
Star Strider 2020년 5월 13일

1 개 추천

Try this:
Fs = 1000; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = [1 25]/Fn; % Normalised Passband (Passband = 1 Hz To 25 Hz)
Ws = [0.5 35]/Fn; % Normalised Stopband (Passband = ½ Hz To 35 Hz)
Rp = 1; % Passband Ripple/Attenuation
Rs = 60; % Stopband Ripple/Attenuation
[n,Wn] = buttord(Wp, Ws, Rp, Rs); % Calculate Filter Optimum Order
[z,p,k] = butter(n, Wn,'bandpass'); % Create Filter
[sos,g] = zp2sos(z,p,k); % Second-Order-Section For Stability
figure
freqz(sos, 2^26, Fs)
That is a (reasonably) complete way to design filters using the individual function syntax.

댓글 수: 4

Udit Narayan
Udit Narayan 2020년 5월 14일
can you tell me how to apply this filter to my signal ????
Star Strider
Star Strider 2020년 5월 14일
Udit Narayan
Udit Narayan 2020년 5월 14일
편집: Udit Narayan 2020년 5월 14일
should i directly use [sos,g] in place of (b,a )in filtfilt( b , a , x ) or there is another way
??
Yes.
Use ‘sos’ and ‘g’ as:
y_filt = filtfilt(sos, g, y);
.

댓글을 달려면 로그인하십시오.

카테고리

제품

릴리스

R2015a

질문:

2020년 5월 13일

댓글:

2020년 5월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by