sos2tf: different result in filtfilt by using SOS vs tf
11 views (last 30 days)
Show older comments
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: 9.4.0.813654 (R2018a) on Linux.
0 Comments
Accepted Answer
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.
More Answers (0)
See Also
Categories
Find more on Single-Rate Filters in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!