butterworth band pass filter
10 views (last 30 days)
Show older comments
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 .
Answers (1)
Star Strider
on 13 May 2020
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.
See Also
Categories
Find more on Filter Analysis 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!