Using 'single' arrays with the "filter" command

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일

0 개 추천

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일

0 개 추천

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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2012년 11월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by