MATLAB: Filtfilt does not work on single precision data in ver R2010b

filtfiltmatlab version r2010b

Hello, I had been using filtfilt on my data matrix which is single in a previous version of Matlab R2008a and it worked fine. I upgraded to R2010b and now it gives me an error saying 'input arguments have to be double'. Forcing my matrix to be double gives me warnings 'Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.281761e-024.
Please suggest a solution…..
thanks

Best Answer

Hi, in the overview for the Signal Processing Toolbox, it states:
"Supported Data Types
The Signal Processing Toolbox software supports only double-precision inputs. If you input single-precision floating-point or integer data, you should not expect to receive correct results, and in many cases, an error will occur. The DSP System Toolbox™ product, in conjunction with the Fixed-Point Toolbox™ product, enables single-precision floating-point and fixed-point support for filtering and filter design."
Can you cast your input to double for filtering?
y = filtfilt(B,A,double(x));