IIR biquad Coefficients from 'General Filter'?
Greetings,
One thing I immediately loved about Sigma Studio was the ability to specify a chain of many biquads by their coefficients by loading a text file. Since I often design filters in matlab, it was pretty straightforward to export a set of coefficients to a text file that Sigma Studio can read.
Of course, its also great to be able to directly specify a filter in Sigma Studio by it's Fc and Q (in the case of 2nd-order LP) using the 'General (2nd order) Filter' block, so sometimes that's the easier workflow.
Now, I need to verify the equivalence of some filters designed in Matlab to those specified in Sigma Studio using a 'General LP Filter.' for the same parameters and Fs (measurements indicate a discrepancy!) My question is: ** How can I view/export the coefficients generated by a General LP Filter block for a given set of parameters? **
Thanks!
Hi Peter
Unfortunately, there is not immediate way to export the parameters calculated by SigmaStudio in either a file or the clipboard. The only thing that comes to mind is by capturing the coefficients from either the capture window OR extracting them from the export files after clicking the "Export Files" button after compilation.
It's a good suggestion, for future releases to allow for loading the clipboard with the coefficients being calculated.
Hope this helps.
Miguel
Thanks Miguel,
I realized that the coefficients must be in the export files, so I started searching through them, and I think I've found them in the .params file. However, the naming convention is puzzling to me. For a filter cell with two second order sections, I see the following parameters in the .params file:
EQ1940Single10B1
EQ1940Single11B1
EQ1940Single12B1
EQ1940Single11A1
EQ1940Single12A1
EQ1940Single10B2
EQ1940Single11B2
EQ1940Single12B2
EQ1940Single11A2
EQ1940Single12A2
Most systems I've worked with denote the numerator coefficients as
[b0 b1 b2]
and denominator coefficients as
[a0 a1 a2]
I'm in the process of verifying now, but It looks like the numerator is
[ EQ1940Single10B1 EQ1940Single11B1 EQ1940Single12B1 ]
and the denominator is
[ 1 EQ1940Single11A1 EQ1940Single12A1 ]
for the 1st second-order section , and
[ EQ1940Single10B2 EQ1940Single11B2 EQ1940Single12B2 ]
_________________________________________________________
[ 1 EQ1940Single11A2 EQ1940Single12A2 ]
for the 2nd second-order section.
Is this correct? can you elaborate on the construction of these parameter names?
Thanks!
Hi Miguel,
After a bit of back-and-forth between Sigma Studio and Matlab, I've confirmed the coefficient mapping that I hypothesized above. (Though one needs to invert the signs of the 'An' coefficients when moving between the two environments).
Knowing that, I was able to compare my Matlab-generated filter to the Sigma Studio generated filter, and confirm that YES, they produced different coefficients, and therefore, different responses.
It came down to coefficient quantization. Sigma Studio's fixed point representation isn't precise enough for values in the range of 1E-7, so some were set to 0. I should have know better...
In addition to facilitating coefficient export from the 'General Filter' cell in a future release, perhaps it would be good to issue a warning when compiling if any filter coefficients are on the order of a single LSB, in order to save silly engineers like me from themselves...
Thanks,
P.
Please log in to reply.