I am attempting to create my own filter coefficient generator in c and ran into an issue. I am using the formulas from the help documentation, which I have also confirmed elsewhere on the internet.

An example is the bandpass filter with equations shown here:

The result of the FilterTableGen, which also matches up what ends up in the compiled ram is shown here:

When you actually follow the formulas the A coefficients are the opposite sign of what they show in FilterTableGen and the RAM. a1 is shown as 1.99298 when the calculation gives -1.99298.

w0 = 2*pi*(f/Fs) which at 150 Hz and 96000 Hz sample rate, so w0 = 0.00981. and -2*cos(w0) then comes out to --1.99990, not 1.99298. Which happens to different in value and sign... This is the same for a2.

When you use back calculate the f0/Fs ratio from the values shown in this table using -2*cos(w0) you end up with a ratio of 0.013333 rather than 150/96000 which equals .001563. This is off by a factor of 10.

Is there something that I am missing about these coefficients? Is there a factor that I am missing? Am I calculating w0 incorrectly?

Thanks!

It looks like there is common procedure that I missed that is described at the very bottom of the help document:

"For all of the above filters, the coefficients are divided by a0, normalizing them and making a0 = 1 so that only 5 coefficients must be stored. In the actual implementation on the DSP, when the coefficients are stored in parameter RAM, a1 and a2 need to be inverted. This is done automatically, in software, before the parameters are written to memory."

The numbers now work out. I guess this is common in the DSP world, and I missed it.