fftfilt
FFT-based FIR filtering using overlap-add method
Description
Examples
Input Arguments
Output Arguments
More About
Algorithms
fftfilt
filters data using the efficient FFT-based method of
overlap-add
[1], a frequency domain
filtering technique that works only for FIR filters by combining successive frequency domain
filtered blocks of an input sequence.
Assume an input signal vector x
with
Nx elements and a filter vector
b
with N elements, where b = [b1
b2 ⋯
bN]. The operation performed by fftfilt
is described in the
time domain by the difference equation:
An equivalent representation is the Z-transform or frequency domain description:
The fftfilt
function uses fft
to implement the overlap-add method. fftfilt
breaks
the input sequence x
into k
length-L data blocks, where L must be greater than the
filter length N, where k =
⌈Nx/L⌉ and the ⌈⌉ symbols denote the ceiling function.
The function convolves each block with the filter b
using
y = ifft(fft(x(i:i+L-1),nfft).*fft(b,nfft));
where i
= 1, L+1, 2L+1,
⋯ and nfft
is the FFT length. fftfilt
overlaps successive output sections by N–1 points and sums them.
fftfilt
chooses the key parameters L and
nfft
in different ways, depending on whether you specify an FFT length
nfft
for the filter and signal.
If you do not specify a value for
nfft
(which determines FFT length),fftfilt
chooses these key parameters automatically:If
length(x)
is greater thanlength(b)
,fftfilt
chooses values that minimize the number of blocks times the number of flops per FFT.If
length(b)
is greater than or equal tolength(x)
,fftfilt
uses a single FFT of length2^nextpow2(length(b) + length(x) - 1)
.These assumptions yield
y
as follows:y = ifft(fft(b,nfft).*fft(x,nfft))
If you specify a value for
nfft
,fftfilt
chooses an FFT length of2^nextpow2(nfft)
and a data block length ofnfft-length(b)+1
. Ifnfft
is less thanlength(b)
, thenfftfilt
chooses an FFT length of2^nextpow(length(b))
.
References
[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. 2nd Ed. Upper Saddle River, NJ: Prentice Hall, 1999.
Extended Capabilities
Version History
Introduced before R2006a
See Also
conv
| designfilt
| digitalFilter
| filter
| filtfilt