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?

 채택된 답변

Star Strider
Star Strider 2017년 6월 20일

0 개 추천

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.

댓글 수: 2

Craig Kelley
Craig Kelley 2017년 6월 20일
Thanks a bunch.
Star Strider
Star Strider 2017년 6월 20일
My pleasure.

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

추가 답변 (1개)

Samuel Low
Samuel Low 2018년 4월 10일

0 개 추천

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.

카테고리

질문:

2017년 6월 19일

답변:

2018년 4월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by