Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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 Commento
Daniel M
Daniel M il 14 Nov 2019
Modificato: Daniel M il 14 Nov 2019
It seems that this is what freqz() does internally to check for FIR filters too.

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by