フィルターのクリア

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

1 回表示 (過去 30 日間)
bethel o
bethel o 2019 年 11 月 13 日
編集済み: Daniel M 2019 年 11 月 14 日
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 件のコメント
Daniel M
Daniel M 2019 年 11 月 14 日
編集済み: Daniel M 2019 年 11 月 14 日
It seems that this is what freqz() does internally to check for FIR filters too.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeFilter Analysis についてさらに検索

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by