Problem with Filter Gain

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoDu_3224996
Level 2
Level 2

Hi!

I've been trying to use a 32th order Biquad Filter with custom coefficients. The problem is: when I insert the coefficients, I always get this warning message and the gain always decrease drastically (the max gain I have in Matlab is around 60 dB):

filterproblem.png

I've tried to apply an extra gain of 512 on Matlab and then add the coefficients back to the PSoC's Filter component but the final coefficients always end up being the same.

Also tried to change the Filter gain field on the filter configuration and the best I can get is a warning message saying "Apply an extra gain of 4 to the output..." when I insert -40dB.

The ideal maximum magnitude for this filter should actually be 0dB.

Is there anything I can do to solve this?
Thank you for your time!


Here are the coefficients:

1.00000000000000000

-0.11192647514720599

-0.96400443471863961

1.79163424055402440

0.92982899876558123

1.00000000000000000

-2.24203614838599790

2.17322168585312080

1.68252869498239370

0.76439563029127555

1.00000000000000000

-2.24599893622682690

1.31689168545892430

1.59300678878682870

0.92901713574616163

1.00000000000000000

-2.21069668985065440

1.42672842689078520

1.21113217488843980

0.80278561343587485

1.00000000000000000

-1.91031505635589170

1.44839673306603570

0.99465560621173310

0.80015259944525829

1.00000000000000000

-1.23701129406327090

1.33063929311793490

0.71678376382657638

0.78953750732639350

1.00000000000000000

-0.70854263959669983

1.35256218638642680

0.42002401727429584

0.75740979983927870

1.00000000000000000

-0.20781590295483104

1.33699786755327100

-1.83481164406594650

0.85583880865987827

1.00000000000000000

0.26010818929679075

1.30361896696455930

-1.75423156229973070

0.82428444216707253

1.00000000000000000

0.67684675423056018

1.26442830348144520

-1.59078924864704160

0.75095935950944503

1.00000000000000000

1.03365772591368170

1.22600881036990410

-1.36467690199077120

0.68844485592134430

1.00000000000000000

1.33731582414228180

1.19575231305313650

-1.12321177460803320

0.66203231012970232

1.00000000000000000

1.60539801990629010

1.18508704989970680

-0.83114238830183185

0.65809300876485277

1.00000000000000000

1.77375037199429600

1.10402308434488190

-0.54417999820749918

0.67893014845428623

1.00000000000000000

1.92262796766950350

1.15250494675583730

-0.21700177082596878

0.69786463424171374

1.00000000000000000

1.93985787185066720

0.98967728998483706

0.09589880946769032

0.73321518013835052

0 Likes
6 Replies
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

It seems like one stage is not sufficient to implement the filter described by the given co-efficients. Can you kindly try adding more stages to the filter?

Best regards,

Sampath Selvaraj

0 Likes

Thanks for your reply. I actually can't because I'm using all of the filter memory, since I'm also using channel B for a 18th order Biquad custom filter.

0 Likes
JoDu_3224996
Level 2
Level 2

Anyone?

0 Likes
brockr0-S
Level 4
Level 4
First like received Welcome!

I am not an expert when it comes to using the DFB but the error you are getting is because the gain of 60 dB you are trying to achieve will cause an accumulator overflow. The DFB accumulator is 24 bits. To achieve what you want in the PSoC you need to do what the error message indicates, externally multiply the filter result by 512. Note that this will probably result in a value of 33 bits.

Good luck.

0 Likes

Thanks for replying.

I already tried to change the gain of every biquad in such a way that none of them overpasses neither -40 nor 40 dB. Also, the convolution of all of them will result in the final filter, of course... and I adjusted it so that the final filter also doesn't overpass -40 / 40 dB.


Whatever value I externally multiply, I always end up with the same result.

0 Likes
JoDu_3224996
Level 2
Level 2

Still no luck on this...

0 Likes