Is the really a correct way to check if a filter is an FIR filter?

2 Ansichten (letzte 30 Tage)
bethel o
bethel o am 13 Nov. 2019
Bearbeitet: Daniel M am 14 Nov. 2019
I found the following function in Matlab. It checks if a filter is has FIR. It basically checks that there is only one non-zero output term at at the first index. Is it really general? It is possible to design FIR filters with more than one non-zero output term.
function isfirflag = isfirisfir(b,a)
%ISFIR(B,A) True if FIR.
if nargin<2, a=[]; end
if isempty(a), a=1; end
if ~isvector(b) || ~isvector(a)
error(message('signal:signalpolyutils:InvalidDimensions'));
end
if find(a ~= 0, 1, 'last') > 1,
isfirflag = 0;
else
isfirflag = 1;
end
  1 Kommentar
Daniel M
Daniel M am 14 Nov. 2019
Bearbeitet: Daniel M am 14 Nov. 2019
It seems that this is what freqz() does internally to check for FIR filters too.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by