Using 'single' arrays with the "filter" command

1 回表示 (過去 30 日間)
Jim Clay
Jim Clay 2012 年 11 月 19 日
We have to minimize our application's memory footprint and execution time, so I'm trying to move from "double" data arrays to "single" data arrays. The problem is that the "filter" command appears to return "double" filter states. Is there a way to use "single" data with the filter or even the "conv" command?
  1 件のコメント
Matt J
Matt J 2012 年 11 月 19 日
編集済み: Matt J 2012 年 11 月 19 日
if your inputs are single, so should the output be.

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

回答 (2 件)

Jonathan Sullivan
Jonathan Sullivan 2012 年 11 月 19 日
Make sure all your inputs to filter are singles.
Here's an example for a simple moving average:
x = rand(100,1,'single');
a = ones(1,10,'single')/single(10);
b = single(1);
xf = filter(a,b,x);
class(x)
  1 件のコメント
Jim Clay
Jim Clay 2012 年 11 月 20 日
I have done that, but the second output, the final filter state, is still double.

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


Jan
Jan 2012 年 11 月 20 日
編集済み: Jan 2012 年 11 月 20 日
See: FEX: FilterM, which accepts singles also.
Do you mean the 2nd output of filter with "double filter states"?
  1 件のコメント
Jim Clay
Jim Clay 2012 年 11 月 20 日
Yes, I mean the 2nd output of filter. I will check out the FilterM command.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by