FFT for Highpass, Bandpass, Bandstop filtering

Discussion around the SDL Component Suite
Post Reply
dwilbourn
Posts: 6
Joined: Fri Nov 20, 2020 2:01 pm

FFT for Highpass, Bandpass, Bandstop filtering

Post by dwilbourn »

I have been looking at your FFT Filter example program, trying to work out how I can use the FFT for other types of filters, namely: Highpass, Bandpass & Bandstop. But so far I have failed completely! This is probably due to my limited grasp of how FFT really works. I have tried reading all sorts of explanations but I just don't have the maths skills to understand any of it. :cry:

I had assumed that if setting the RealSpec & ImagSpec values above the cutoff gives you a Lowpass filter, setting the values below the cutoff should give you a HighPass filter but this does not work. I am hoping you give me some clues or simple examples of what I need to do to get these other types of filter to work.

You can download my modified FFTFilter code and app from this link if you want to see what I have been doing: https://we.tl/t-Zp5f5fetKm

Thanks in advance,
David.
dwilbourn
Posts: 6
Joined: Fri Nov 20, 2020 2:01 pm

Re: FFT for Highpass, Bandpass, Bandstop filtering

Post by dwilbourn »

I worked it out, I had not realized the significance of the comment:

Code: Select all

 // set both positive and negative frequencies to zero 
in the example. You need to set both the 'high' and 'low' half of the spectrum to zero, then all the filters work exactly as expected. Unfortunately the low pass example appears to work just as well with only the 'low' half set to zero - which really confused me! (not hard to do :? )
dwilbourn
Posts: 6
Joined: Fri Nov 20, 2020 2:01 pm

Re: FFT for Highpass, Bandpass, Bandstop filtering

Post by dwilbourn »

Just to show I can sometimes make things work! :oops:

This link will download my expanded FFTFilter example program with Lowpass, Highpass, Bandpass & Bandstop modes.

https://we.tl/t-AZ4vsANK1A
fftfilter2.png
fftfilter2.png (32.57 KiB) Viewed 26002 times
Post Reply