Hey JUCE forum! I was wondering if anyone has run into this issue with FFTs: I wanted to multiply a pointer array of floats with an FFT of my buffer (e.g. samples, also pointer array), so I thought I could multiply in the picture below and then inverse transform it back like this:
In this particular example, it’s a 440hz wave at 48kHz (buffer size of 512 samples), being convolved with a bandpass filter with 0 dB peak at 12kHz, shown here:
I may have gotten some other parts wrong, so please correct me before I go down the wrong path!
It’ll also help if I give a bit more context:
I want to make a freeform filter graph, where the user can draw in their filter kernel like this:
(I’m making a vocal synthesizer, so I want custom, complex formant shapes)
This graph I put in a vector* of floats which I wanted to filter the input signal with. I originally thought I could just multiply the FFT of the input signal with the filter kernel, then IFFT out, but the real and imaginary parts now imply I can’t just do that.
Because I’m already in the frequency domain with the filter kernel, I can’t just do FFT on it to get the corresponding imaginary part. I’m not sure if I can even calculate the imaginary filter kernel either, but here’s what I think the solution may be:
Convert the rectangular coordinates of the filter kernel to polar coordinates, so r (amplitude) = sqrt(x^2 + y^2), and θ (angle) = atan(y/x)?
Multiply the real part of the FFT input signal with r (amplitude), and multiply the imaginary part of the FFT input signal with θ (angle)?
IFFT the input signal back into the time domain.
However, doing this in code results in the same pop in the beginning and back of the buffer, so while I think this is more correct, I’m not sure what these extremities are the result of:
Would you happen to know of any JUCE tutorials that apply filter graphs to input signals? Thank you again for taking the time to point me to some resources!