MATLAB: Highpass Blackman Filter Design

blackman windowfilteringsignal processing

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?

Best Answer

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.