how to obtain the impulse response of halfband FIR filter

5 ビュー (過去 30 日間)
Aly Khafagy
Aly Khafagy 2022 年 5 月 7 日
回答済み: Mathieu NOE 2022 年 5 月 9 日
how to obtain the impulse response of halfband FIR filter??
clc;
close all;
n1= 15; %order
Fs= 100; %sampling frequency
fc= Fs/4; %cutoff frequency
%nyq_f= Fs/2; %normalize cutoff frequency wrt to nyquist freq
%wn= fc/nyq_f; %normalized fc
wc= (2*pi*fc)/Fs;
wn= wc/pi;
%window= hamming(n+1)
H1= fir1(n1,wn,hamming(n1+1));
h1= freqz(H1); %frequency response
f1= linspace(0,Fs/2,512);
w1= (2*pi*f1)/Fs;
w= w1/pi;
figure
plot (w, abs(h1))
  1 件のコメント
Star Strider
Star Strider 2022 年 5 月 8 日
See if the impz funciton will do what you want.

サインインしてコメントする。

回答 (1 件)

Mathieu NOE
Mathieu NOE 2022 年 5 月 9 日
hello
by definition H1 array is your impulse response (a FIR filter coefficients array is its impulse response)
clc;
close all;
n1= 15; %order
Fs= 100; %sampling frequency
fc= Fs/4; %cutoff frequency
%nyq_f= Fs/2; %normalize cutoff frequency wrt to nyquist freq
%wn= fc/nyq_f; %normalized fc
wc= (2*pi*fc)/Fs;
wn= wc/pi;
%window= hamming(n+1)
H1= fir1(n1,wn,hamming(n1+1));
h1= freqz(H1); %frequency response
f1= linspace(0,Fs/2,512);
w1= (2*pi*f1)/Fs;
w= w1/pi;
figure
plot (w, abs(h1))
% IR
figure
plot (H1)
xlabel('samples')

カテゴリ

Help Center および File ExchangeDigital Filter Design についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by