berndporr / iirj

An efficient IIR filter library written in JAVA
Apache License 2.0
134 stars 36 forks source link

Noob question on high pass and notch filter #30

Closed rakadambi closed 1 week ago

rakadambi commented 1 week ago

Hi there,

I am learning this and this works great. I want to apply high pass and then notch filter of 50.Hz This is a newbie question

So, do I do this?

Butterworth butterworth = new Butterworth(); butterworth.highPass(4, 250, 1); butterworth.bandStop(4, 250, 50, 0);

and then

butterworth.filter(myVal)

Thank you

berndporr commented 1 week ago

Yes but you can't have a bandwidth of 0 for a notch. Perhaps start with 5Hz bandwidth and then make it smaller. Damping at 50Hz will get worse the more narrow it is. Sooo there is the classical tradeoff as always in DSP!

rakadambi commented 1 week ago

Thank you very much. Fantastic library.

I'll close the issue now