Reputation: 157
First off, this is intended as some research for a future application.
I want to be able to extract the coefficients from a c header file that is generated by the Matlab Filter Design and Analysis Tool (FDATool).
fdatool settings http://dl.dropbox.com/u/39710897/fdatool.png
I have used the above settings for the FDATool and then I generated the following C header file: http://dl.dropbox.com/u/39710897/fdacoefs.h
As I understand it I can implement a filter from this by using a direct form difference equation. I believe the equation to be y(n) = b0x(n) + b1x(n–1) + b2x(n–2) – a1y(n–1) – a2y(n–2)
where the b0-b2 coefficients are the zeroes and the a1 and a2 coefficients are the poles.
The problem here is that I'm not entirely sure what is in the header file. This information seems surprisingly hard to find which probably means I'm missing something really obvious...
Here is the information I think I've been able to extract:
Questions:
Upvotes: 2
Views: 2712
Reputation: 212979
Looking at the screen shot you appear to be using Direct Form II biquad sections (aka Canonical Form) - see Wikipedia page: https://en.wikipedia.org/wiki/Digital_biquad_filter and note the difference equations for Direct Form II (you seem to be using the difference equation for Direct Form I above).
Note that the w terms are not labelled on the diagram on the Wikipedia page but they are the delayed terms in the middle.
Upvotes: 1