Professional Documents
Culture Documents
FFT Convolution
take a chunk of your signal (say N=128 samples)
apply FFT to it
multiply the frequency domain signal by your desired
transfer function
inverse FFT back to time domain
that’s your output signal
sounds easy?
and it works!
FFT Convolution versus FIR
Filter
if you can acquire all of your data in memory (disk), and
only need to do offline processing, you can certainly use
FFT convolution
to achieve “ideal” low-pass filter response
how ideal is ideal? how sharp frequency response can be
acheived?
Δf = 1/T, where T is the total length in time of the N samples
T = NΔt, where Δt is the time interval between samples
fs = 1/Δt, where fs is the sampling frequency
Δf = fs / N
Complication #1
requires padding with zeroes
say you want to use a 1024-point FFT
contains real-valued c0 and c512, complex-valued c1…c511, or
1024 real values
contains frequencies c−1…c−511 which are not independent
values
inverse FFT would generate 1024 samples in the output
for example, you could use a kernel with 600 non-zero
points and 424 padded zeros at the end
you could use an input with 425 values and 599 padded
zeros at the end...it’s going to be N+M−1
the end result is that a 1024-point input is fed to the FFT,
you always have 1024 points in frequency domain, you
multiply bin-by-bin with a 1024 point transfer function, and
your output is ready for inverse FFT, and has 1024 samples
Complication #2
negative frequencies – don’t forget about those!
say you want to perform zero-phase, unity gain,
low-pass, from 0-5 rad/s (ω)
your transfer function should process the
negative frequencies…unless you want trouble
from -5 to 5: f(t) = 5/π sinc(5t)
from 0 to 5: f(t) = 5/(2π) sinc(5t/2) ejt5/2
if you forget to process the negative
frequencies, your transfer function is equivalent
to time domain convolution with a complex
impulse response!?!
that’s very bad!
Complication #3
phase
zero phase results in an impulse response that is
symmetrical about t=0
non-causal! your output signal will have values
at earlier times than your input signal
Fourier transform pairs: f(t-t0)
time delayed impulse response (to preserve
causality) implies linear phase
so…it’s best not to ignore phase when you
process in frequency domain
FFT Convolution Summary
faster, and much faster for large kernels
even more ideal filter performance can be achieved
but more “complicated”
complex-valued FFT with negative frequencies
complex-valued multiplication in frequency domain
don’t forget about phase!
pad your input and impulse response with extra zeroes
overlap-add to stitch together the time domain output
in contrast…
FIR filter: easy to implement (addition/multiplication of
real numbers)