filter function not linear in numerator coeffcients

2 ビュー (過去 30 日間)
Peter
Peter 2018 年 5 月 28 日
編集済み: Jan 2018 年 5 月 29 日
Why is the built-in "filter" function not linear in the numerator coefficients?
b = [1.000000000000000
0.156960680127524
-0.008820403825717];
a = [1.000000000000000
-1.829126729842689
0.834081514068486];
x = [1; zeros(250,1)];
scale = 0.941;
result1 = filter(scale*b,a,x);
result2 = scale*filter(b,a,x);
result1-result2
My intuition is that it should make no difference whether one scales the impulse b (as in result1) or the response (as in result2). Numerically there is, however, if only tiny.
Background: I am computing the MA coefficients for an ARMA process and want to test different impulses.
Any hints greatly appreciated!

採用された回答

Jan
Jan 2018 年 5 月 29 日
編集済み: Jan 2018 年 5 月 29 日
This difference between the solutions is tiny:
max(abs(result1 - result2))
>> 1.1546e-14
This is an expected effect for computations with numbers stored in floating point format with limited precision. See: Why is 0.3-0.2 not equal 0.1.
Search in the net for "IEE754", which defines the standard method of the type double. You will find many explanations of the expected effects.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by