ΣSigmaStudio Ask AI Русский Log in

MATLAB SOS matrix to cascaded IIR blocks for higher order filters

SigmaDSP & SigmaStudio echoskope Aug 14, 2013 00:00 2 replies Original on forum ↗
Subscribe
echoskope Question
Aug 14, 2013 00:00

I have been trying to implement a filter I designed in MATLAB using the 2nd order IIR blocks in SigmaStudio but with no luck... I found that MATLAB's filter design tool will output a filter in a matrix for use in cascaded 2nd order IIR filters... but when I put these coefficients into the IIR block and do a Stimulus/Probe the resulting plot looks like the one MATLAB produces, but it appears inverted! Am I missing something simple here like a negative sign?

Maybe some screen shots will help...

This is from MATLAB, it is kind of hard to see but the bandpass is centered at 3222 Hz and is very sharp....

Here is the output from the filter design tool... According to the mathworks site ( http://www.mathworks.com/help/signal/ref/tf2sos.html) from left to right is b0, b1, b2, 1, a1, a2

So I plugged those values into the IIR filters in the order it gave me...

And this is the output from SigmaStudio.... The peak is around 3222 Hz which is why I think it has inverted itself somehow (the gains are way off too)...

Any suggestions would be greatly appreciated... I'm not sure where I went wrong here...

Thanks,

-Andrew

Audio Signal Processors

cascade

filter

adau1442

order

higher

matlab

sigmastudio

SigmaDSP Audio Processors

SigmaDSP

iir

Show More

804ddf99b07adfa3e50b9513e1163523.jpg
804ddf99b07adfa3e50b9513e1163523.jpg
804ddf99b07adfa3e50b9513e1163523.jpg-450x205.jpg
804ddf99b07adfa3e50b9513e1163523.jpg-450x205.jpg
36c9b09f145ea383359b8d8c1881048e.jpg
36c9b09f145ea383359b8d8c1881048e.jpg
36c9b09f145ea383359b8d8c1881048e.jpg-450x165.jpg
36c9b09f145ea383359b8d8c1881048e.jpg-450x165.jpg
e7b57e1c2346e057c07aaaecf662464b.jpg
e7b57e1c2346e057c07aaaecf662464b.jpg
e7b57e1c2346e057c07aaaecf662464b.jpg-450x234.jpg
e7b57e1c2346e057c07aaaecf662464b.jpg-450x234.jpg
42e2de2641e642f26c948a1dc4317cdc.jpg
42e2de2641e642f26c948a1dc4317cdc.jpg
42e2de2641e642f26c948a1dc4317cdc.jpg-450x317.jpg
42e2de2641e642f26c948a1dc4317cdc.jpg-450x317.jpg
echoskope Reply
Aug 16, 2013 00:00

Well, after playing around some more I have come to the conclusion that the filter I made was too steep. Once I made the passband wider the SigmaStudio plot started looking correct. I did notice that the gains are way off (MATLAB's "G" vector contains the gain entries, something else I learned) but in order to implement the gain that MATLAB gave me I would have to mix 5.23 and 28.0 formats, which I read was a dangerous thing to do since it could lead to a buffer overflow... So instead I just put a volume control at the very end of the filter and by viewing the plot and changing the volume control I could get the filter to look the way I wanted.

Hope my troubles and lesson learned are helpful to someone else...

-Andrew

andrewbaker.me

ADIApproved Reply
Aug 19, 2013 00:00

Hi Andrew,

Thanks for sharing your problem and solution. Let me know if you need further assistance.