# Second-order sections from complex coefficients

I have an impulse response ir that I need to approximate with an iir because of realtime requirements. For stability I want to break down the 10th order IIR generated with Steiglitz-Mcbride to biquads / second-order sections. However, I can't use tf2sos with the complex transfer function that stmcb() generates like the following:

[b,a] = stmcb(ir,10,10);
[sos,g] = tf2sos(real(b),real(a));


When I compare bode plots of

freqz(b,a)


and

freqz(sos)


I find that the contour is preserved but there is a large difference in magnitude and phase. Am I missing some scaling factor or limitation? Thanks for any help.

• I don't understand why a and b are complex-valued. They shouldn't be I guess. Is ir complex-valued? Could you post the coefficients a and b, and maybe link to the desired ir? – Matt L. Apr 3 '15 at 16:12
• Could it be that your function generates pole/zero locations instead of coefficients? Those would be expected to be complex-valued. Digital filters with complex coefficients are somewhat rare (although they are used in some applications). I've never seen an IIR filter implemented with complex coefficients. – Jason R Apr 3 '15 at 16:17
• @JasonR: That's a good idea, but according to this it shouldn't be the case. – Matt L. Apr 3 '15 at 16:26
• @MattL.: Thanks for the correction. I wasn't aware that the function was a standard one in MATLAB. Sorry for the confusion. – Jason R Apr 3 '15 at 16:31
• The IR is in fact complex. Taking the real portion shifts the phase by 360 degrees. The bode plot magnitude of the complex IR. I can't post b,a, and the IR but I can tell you they are complex. The phase requirements are critical for this application. – panthyon Apr 3 '15 at 17:06