Implement overlap-save method of frequency-domain filtering
Filtering / Filter Implementations
dsparch4
The Overlap-Save FFT Filter block uses an FFT to implement the overlap-save method, a technique that combines successive frequency-domain filtered sections of an input sequence.
The block accepts vector or matrix inputs, and treats each column of the input as an individual channel. The block unbuffers the input data into row vectors such that the length of the output vector is equal to the number of channels in the input. The data output rate of the block is M times faster than its data input rate, where M is the length of the columns in the input (frame-size).
Overlapping sections of input u
are circularly
convolved with the FIR filter coefficients
$$H(z)=B(z)={b}_{1}+{b}_{2}{z}^{-1}+\dots +{b}_{n+1}{z}^{-n}$$
The numerator coefficients for H(z)
are specified as a vector by the FIR coefficients parameter.
The coefficient vector, b = [b(1) b(2) ... b(n+1)]
,
can be generated by one of the filter design functions in the Signal Processing Toolbox™ product,
such as fir1
. All filter states
are internally initialized to zero.
When either the filter coefficients or the inputs to the block
are complex, the Output parameter should be set
to Complex
. Otherwise, the default Output setting, Real
,
instructs the block to take only the real part of the solution.
The circular convolution of each section is computed by multiplying the FFTs of the input section and filter coefficients, and computing the inverse FFT of the product.
y = ifft(fft(u(i:i+(L-1)),nfft) .* fft(b,nfft))
where you specify nfft
in the FFT
size parameter as a power of two value greater (typically much greater)
than n+1
. Values for FFT size that
are not powers of two are rounded upwards to the nearest power-of-two
value to obtain nfft
.
The first n
points of the circular convolution
are invalid and are discarded. The Overlap-Save FFT Filter block outputs
the remaining nfft-n
points, which are equivalent
to the linear convolution.
In single-tasking operation, the Overlap-Save
FFT Filter block has a latency of nfft-n+1
samples.
The first nfft-n+1
consecutive outputs from the
block are zero; the first filtered input value appears at the output
as sample nfft-n+2
.
In multitasking operation, the Overlap-Save
FFT Filter block has a latency of 2*(nfft-n+1)
samples.
The first 2*(nfft-n+1)
consecutive outputs from
the block are zero; the first filtered input value appears at the
output as sample 2*(nfft-n)+3
.
Note: For more information on latency and the Simulink^{®} environment tasking modes, see Excess Algorithmic Delay (Tasking Latency) and Time-Based Scheduling and Code Generation in the Simulink Coder™ documentation. |
The size of the FFT, which should be a power of two value greater than the length of the specified FIR filter.
The filter numerator coefficients.
The complexity of the output; Real
or Complex
.
When the input signal or the filter coefficients are complex, this
should be set to Complex
.
Specify how the block treats sample-based M-by-1 column vectors and unoriented sample-based vectors of length M. You can select one of the following options:
One channel
— When
you select this option, the block treats M-by-1
and unoriented sample-based inputs as a column vector (one channel).
M channels (this choice will be removed
– see release notes)
— When you select
this option, the block treats M-by-1 and unoriented
sample-based inputs as a 1-by-M row vector.
Note: This parameter will be removed in a future release. At that time, the block will always treat M-by-1 and unoriented vectors as a single channel. |
Oppenheim, A. V. and R. W. Schafer. Discrete-Time Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.
Proakis, J. and D. Manolakis. Digital Signal Processing. 3rd ed. Englewood Cliffs, NJ: Prentice-Hall, 1996.
Double-precision floating point
Single-precision floating point
Overlap-Add FFT Filter | DSP System Toolbox |