MATLAB: Does the output of IIR Band Pass filter have a huge spike when filtering a noisy sinusoid in Filter Design Toolbox 4.5 (R2009a)

Filter Design Toolbox

I am generating a noisy sinusoid using the SIN and WGN functions. Next I design a band pass IIR Butterworth filter using FDATOOL. I export the SOS and G variables to workspace. I convert these to a transfer function using SOS2TF and apply this filter on the signal using the FILTER command.
I see the output has a huge spike. I am wondering what went wrong.

Best Answer

The unexpected output is due to the quantization errors occuring during conversion of a SOS filter into a transfer function.
To resolve this issue export the filter as an object. Apply this filter object on the input signal using the FILTER command. This way filter does not have to be converted to TF and therefore generates expected results.