You are on page 1of 6

PHYS 352

More “Advanced” Digital Signal Processing


Techniques

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

 can be faster in computation than the


standard FIR filter, especially for long
kernels

FFT Convolution in Real Time?


 however, in real-time applications, it may not be possible
for FFT convolution, of the desired quality, to keep up
 take a chunk of data
 note: smaller chunks have less Δf resolving ability
 FFT it
 apply the transfer function
 inverse FFT it
 produce your output
 must be ready for the next chunk of data
 FFT convolution filter quality is ultimately limited by
computation time just as for FIR filters (where the
sharpness of the roll-off comes at the expense of kernel
length)
Output of FFT Convolution
 the output extends to later times than the input – why?
 it’s because you are multiplying by a transfer function in
frequency domain
 this is mathematically equivalent to time domain
convolution
 output length: N+M−1
due to time domain
convolution

e.g. last x value [128] but


y[130]=...+h[2]x[130-2]+h[1]x[130-1]+...

Circular Convolution – an Error!


 example: 128 samples in the input
 FFT give 64 complex-valued frequency components
 you manipulate those 64 frequency components
(multiplying with a 64-component complex-valued
transfer function)
 that’s as though you were convolving with a 128-
point impulse response
 in frequency domain you have 64 complex-valued
frequency components waiting for inverse FFT
 you can only generate 128 samples in your output
 but, time domain convolution would insist that the
output length is 255 samples
 those output samples that get pushed off the end (to
the right) roll back into the beginning (at the left)
 introduces what’s known as circular convolution error
Overlap-Add
 overlap-add applies in
time-domain filtering and
hence must be necessary
in FFT convolution filtering
(because, they are the
same mathematically)

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)

FFT Signal Processing - Deconvolution


 deconvolution is certainly a place for FFT signal
processing...
 your signal goes through a physical system (or
measurement system) and that process alters the
signal
 the system has convolved it’s response function with
your signal
 if you want to get back your original signal you must
do deconvolution
 deconvolution in time domain is fraught with peril
 deconvolution in frequency domain is trivial in comparison

You might also like