ΣSigmaStudio Ask AI Русский Log in

1st-order filter implementation question

SigmaDSP & SigmaStudio dimitris. Mar 16, 2015 00:00 4 replies Original on forum ↗
Subscribe
dimitris. Question
Mar 16, 2015 00:00

Hi forum,

I was wondering if there is anything wrong with the definition of the first-order filter in the help of SigmaStudio.

I found the following definition for the first-order filter:

However when I am trying a high pass filter with a cut-off frequency at 1000 Hz then get the coefficients that appear below:

Now, if the definition of the implementation is right, then for a gainLinear operator of 1 (meaning gain 0), for a highpass filter, I should get a1=b0=-b1.

But clearly this is not the case as the 3 coefficients that are being produced in SigmaStudio are not all the same.

Could you please enlighten me on if I am missing something?

thank you

d7c79fc3e381941bfb957f4c4b7a7ec0.png
d7c79fc3e381941bfb957f4c4b7a7ec0.png
d7c79fc3e381941bfb957f4c4b7a7ec0.png-550x577.png
d7c79fc3e381941bfb957f4c4b7a7ec0.png-550x577.png
2b7ed7cf846f2f8e16b2e34a0daf18a9.png
2b7ed7cf846f2f8e16b2e34a0daf18a9.png
2b7ed7cf846f2f8e16b2e34a0daf18a9.png-552x282.png
2b7ed7cf846f2f8e16b2e34a0daf18a9.png-552x282.png
74405b27e5890d196fcb918e2e8541c7.png
74405b27e5890d196fcb918e2e8541c7.png
74405b27e5890d196fcb918e2e8541c7.png-620x38.png
74405b27e5890d196fcb918e2e8541c7.png-620x38.png
jobo23 Reply
Mar 16, 2015 00:00

Moving to the SigmaStudio forum for discussion.

-Joe

KJBob Reply
Mar 16, 2015 00:00

Hello dimitris,

The formulas above are OK for lowpass, but Steven W. Smith's DSP book shows different ones for hi-pass (it also swaps the "a" and "b" coefficients compared to SigmaStudio's convention, besides flipping the sign of the "a" coefficient). Here's how to calculate the coefficients (these formulas cover only the case of gainlinear = unity):

fo (cutoff freq) = 1000 Hz

fs (sample rate) = 48000 Hz

First calculate w = 2*pi*fo/fs = 0.1308997

Then, calculate x = e^(-w) = e^ (-0.1308997) = 0.8773

Finally figure the coefficients: b0 = (1 + x) / 2 = 0.98365

b1 = - bo = -0.98365

a1 = x = 0.8773

One of the General Second-Order filters allows you to type in coefficients as shown above -- this is handy when troubleshooting coefficients.

Best regards,

Bob

2dd4c24099144ad2a09f5c9c247795ff.png
2dd4c24099144ad2a09f5c9c247795ff.png
2dd4c24099144ad2a09f5c9c247795ff.png-620x320.png
2dd4c24099144ad2a09f5c9c247795ff.png-620x320.png
KJBob Reply
Mar 19, 2015 00:00

Hello once again,

The book I referenced for the above answer is available for download at:

The Scientist & Engineer's Guide to Digital Signal Processing

The particular chapter is Recursive Filters, at:

http://www.analog.com/media/en/technical-documentation/dsp-book/dsp_book_Ch19.pdf

Best regards,

Bob

dimitris. Reply
Mar 24, 2015 00:00

Bob,

thank you very much for your replies and youre references, I will give them a look right away.

regards,

Dimitris