フィルターのクリア

Remove small numbers from transfer function

11 ビュー (過去 30 日間)
Jason Gauthier
Jason Gauthier 2020 年 4 月 9 日
コメント済み: Ameer Hamza 2020 年 4 月 10 日
Greetings,
Is there a simple way to remove small numbes from a transfer function?
-0.8921
-------------------------
s^2 + 1.035 s - 1.533e-14
The last term is so incredible small, it's pointless. I have a very set of TFs (12 outputs and 4 inputs.) I'd just like to sweep through and easily clean them up.

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 10 日
try this
sys(1) = tf(1, [1 2 1.2e-12]);
sys(2) = tf(1, [2 3 1.5e-11]);
sys(3) = tf(1, [3 4 5.5e-13]);
sys(4) = tf(1, [4 5 2.7e-12]);
[n,d] = tfdata(sys);
n = cellfun(@(x) {x.*(x>1e-7)}, n);
d = cellfun(@(x) {x.*(x>1e-7)}, d);
sys = tf(n, d);
It filters all coefficient with magnitude less than .
  2 件のコメント
Jason Gauthier
Jason Gauthier 2020 年 4 月 10 日
Thank you! I had to use
n = cellfun(@(x) {x.*(abs(x)>1e-7)}, n);
d = cellfun(@(x) {x.*(abs(x)>1e-7)}, d);
Since some of the coefficients were negative, but this worked great!
Ameer Hamza
Ameer Hamza 2020 年 4 月 10 日
Glad to be of help. On a side note, negative coefficients in a transfer function indicate instability. But if these values are just noise, then it should be fine to ignore it.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by