Problem generating filter coefficients
Using Method 1 from https://ez.analog.com/message/5485 but on a 2nd order HighPass on an ADAU1442
I'm having trouble generating the coefficients for the 2nd order HPF algorithms, they don't match what I see in the Capture window and they mess the audio up when I implement them. Does anyone see what I'm doing wrong?
// 2nd Order High-Pass filter
HPFcutoff = 20; // Hz
gain = 1; // unity
Q = 0.53;
#define MyPI 3.14159265359
w0 = 2.0 * MyPI * (float)HPFcutoff / 48000.0; // 2*pi*f0/Fs
alpha = sin(w0)/(2.0*Q);
a1 = -2.0 * cos(w0);
a2 = 1 - alpha;
b0 = (1 + cos(w0)) * (gain / 2);
b1 =- (1 + cos(w0)) * (gain);
b2 = (1 + cos(w0)) * (gain / 2);
calculated by uP (and confirmed via Ti-89) as:
w0 = 0.0026179
alpha = 0.0024598
a1 = -1.9999932
a2 = 0.9975301
b0 = 0.9999982
b1 = -1.9999964
b2 = 0.99999982
Working example: Sigma Studio output seen in Caputure Window after pressing enable button:
Param Value: 0.997534513473511 (labled as b0)?
Param Value: -1.99506914615631 (labled as b1?)
Param Value: 0.997534513473511 (labled as b2?)
Param Value: 1.99506568908691 (labled as a1?)
Param Value: -0.995072603225708 (labled as a2?)
hpf
Audio Signal Processors
coefficient
filter
adau1442
sigmastudio
SigmaDSP Audio Processors
Show More
Hi MagicRub,
There is a typo in the help documentation. There is a discussion of this problem in this post.
The update to the help file is long overdue. I have it on my list for the next SigmaStudio release. Sorry for the trouble.
This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.
Thank you,
EZ Admin
Please log in to reply.