swharden/FftSharp

Filters : BandPass issue

fpavlic opened this issue · 2 comments

Hi,
I'm using Band filters and example from here #23

However I'm not getting clear frequency filtering like I would do in e.g. Audacity Low/High Pass filters. Any idea why is this and how to fix/avoid it?

From picture is clear where filtering was done, but there are still some values present which I need to remove.
https://i.gyazo.com/ca6107a6336f9222fe9017f9d5b0f0ee.png

Thanks

Hi @fpavlic thanks for sharing your spectrogram

image

Can you share some of the data and the C# code you used to generate this so I can try to reproduce the issue?

Do you have a similar spectrogram showing the spectrogram using Audacity's lowpass filter?

Without seeing the data I can't know for sure, but two ideas are (1) the input signal is extremely loud and the inverse FFT is clipping, and clipped sine waves produce higher frequency components or (2) mixing two sine waves together produces mixing products at the sum and difference of their frequencies, so maybe some of the remaining low frequencies are mixing to produce the higher frequencies we see here?

I tried this with FFTSharp and another package, same result. I'm using PCM values, transforming to FFT with FFTSharp, doing BandPass, then inverting fft to pcm and feeding back to get recording. When doing this process without modifying FFT sound is correct. But with filtering I'm getting hum/clicking sound, like it is in spectogram.

I've also tried (1) to do clipping myself, there is not much above 1, I've dropped to 1, and finally I've divided amplitudes by 2 so inverting shouldn't have loud sounds. (2) any suggestions for this ?

This is one example:
Filtered = FftSharp.Filter.BandPass(buffer, 44100, 50, 3000);

Another usage is from this #23