fft – Freq domain filtering in a sample by sample basis

Im simulating a system in code, the real system uses a 3Mhz sample rate on PDM, trying to simulate the feedback response, in the feedback path there is a system, this system has a impulse response of ~512k coeficients, currently processing the feedback in a time domain basis, meaning, once a sample is received, then a full convolution is done.
Trying to benchmark a frequency domain solution to see if it will be quicker, is it possible to do sample by sample?

My implementation in time domain has all H coefficients in memory and there is a buffer filled with the current sample, and all previous samples,
the hard part is to calculate the position in which to overlap H with the signal and then H is flipped, and a dot product is done.
ie.
first input signal is received, this sample is multiplied by the last H coefficient (H(n)),
second sample arrived, then first sample is multiplied by the H(n-1) coef, and second sample against H(n), then they are all added.

As you may imagine this process is very slow, when the input samples reach 512k samples, we have a full signal to H convolution, this takes around 3 seconds.

is it possible to have the operations done in frequency domain? probably will need to do FFT at every sample of the full buffer or at least H size right? FFT is pretty optimized so could I shave some milliseconds off?

Read more here: Source link