zero phase spectrum and filtfilt function

조회 수: 4 (최근 30일)
Roger
Roger 2015년 6월 4일
댓글: Star Strider 2015년 6월 5일
Fs = 1; % Sampling Frequency
N = 50; % Order
Fc1 = 1/f1;%7s % First Cutoff Frequency
Fc2 = 1/f2; % Second Cutoff Frequency
flag = 'scale'; % Sampling Flag
% Create the window vector for the design algorithm.
win = hamming(N+1);
% Calculate the coefficients using the FIR1 function.
[b,a] = fir1(N, [Fc1 Fc2]/(Fs/2), 'bandpass', win, flag);
% Hd = dfilt.dffir(b);
out=filtfilt(b,a,data);
if using filter function ,we can get spectrum and phase using fvtool , while using filtfilt , how can i get the two lines?

채택된 답변

Star Strider
Star Strider 2015년 6월 4일
With your [b,a] vectors, use the freqz function to get the Bode plot.
  댓글 수: 2
Roger
Roger 2015년 6월 5일
freqz(b,a) is just the fir filter spectrum, i mean the zero phase spectrum.
Star Strider
Star Strider 2015년 6월 5일
What do you mean ‘zero phase spectrum’?
The Bode plot gives you the magnitude and phase. That’s all you need.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by