Highpass Blackman Filter Design
63 views (last 30 days)
Show older comments
Hello, I'm looking for some help designing a highpass filter that uses a blackman window and has a cutoff frequency at 0.001Hz for an input signal sampled at 1Hz. I've tried playing around with designfilt(), but can't seem to get the magnitude response quite right. Any suggestions?
0 Comments
Accepted Answer
Star Strider
on 20 Jun 2017
There is no relevant documentation for designing with Blackman windows with fir1, or in my references.
This took a bit of experimentation to get to work:
Fs = 1;
Fn = Fs/2; % Nyquist Frequency
Fc = 0.001;
N = 120;
N = 2*fix(N/2);
wndw = blackman(N+1);
b = fir1(N, Fc/Fn, 'high', wndw);
figure(1)
freqz(b, 1, 2^17, Fs)
The filter order ‘N’ must be even, so I included a line that enforces that. Longer filters are more likely to match your requirements, however they are less efficient.
More Answers (1)
Samuel Low
on 10 Apr 2018
if true
clc; clear all;
fs = 10000; % Sampling frequency in Hz
Wp = 2000; % Passband frequency in Hz
Ws = 2500; % Stop band frequency in Hz
f = [Wp,Ws];
fStop = 0.5*(Wp+Ws)/fs;
dev = [0.005,0.005];
a = [1,0];
[n,Wn,beta,ftype] = kaiserord(f,a,dev,fs);
% We use the order estimated in kaiserord
BMWindow = blackman(n+1)
b = fir1(n,fStop,'high',BMWindow) % Normalise the frequencies
freqz(b,1,512)
title('Highpass Filter Design')
end
I determined the filter length using the Kaiser Order function (which determines what my filter length should be) but you can just set any arbitrary N that you like, it just happens to have this requirement for one of my assignments and I was lazy to change it. I then defined a Blackman window using the 'blackman' function, and used this window function as one of the arguments in the variable 'b'.
Hope this helps.
0 Comments
See Also
Categories
Find more on Blackman 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!