sos2tf: different result in filtfilt by using SOS vs tf

11 views (last 30 days)
Dear all,
I am using filtfilt() on WAVE audio data. The specifics of the filter I am using are: IIR Butterworth bandpass of order 40. Sample rate is 16kHz and the cut-off frequencies are 200 and 1200 Hz.
The issue is: if I create SOS and G parameters by using the filterDesigner tool, or by using designfilt() and create a filter object and use this as the input parameters for filtfilt, this will output the expected result. Whilst, if I convert the SOS matrix to the b and a transfer function vectors by using the sos2tf() function, the resulting filtfilt(b,a,in) output will be a series of NaNs.
For my undestanding, the result of filtering by using the combination SOS/G and the resulting b/a should be the same hence this is either a bug or (most probably) I am missing something. Please let me know if you ideas and/or suggestions.
MATLAB version: (R2018a) on Linux.

Accepted Answer

Christoph F.
Christoph F. on 29 May 2018
> IIR Butterworth bandpass of order 40
IIR filters with orders this high are fairly susceptible to numerical effects like coefficient quantization errors. How pronounced these effects are depends on the filter structure and implementation.
Remember that even using double precision floating point arithmetics still means that quantization errors occur.
  1 Comment
Mihai G.
Mihai G. on 29 May 2018
Yeah, sounds reasonable. I guess I cannot do much about it at this point, beside lower the order. Thanks for the help!

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!