Manpage of filterVector
Section: User Commands (1)
Return to Main Contents
void filterVector( int bandWidth, int filterLength, int8 outputLength, int padStart, int padEnd, flt8 *fourierFilter, flt8 *input, flt8 *output);
This function calculates the convolution of a vector with a finite length
kernel. That is to say that the kernel is zero beyond some point. The
non-zero extent of the kernel is given by the input variable bandWidth.
This function takes the following inputs:
The time domain filter width in number of samples. This must
be odd and is equal to (2*c + 1) where c is the maximum
correlation length. That is to say that the time domain
filter is assumed to be zero for t < -c or t > c.
The size chunk that the FFT's will be done in. This is
also the length of fourierFilter. This should be a power
of two for best performance. Note that filterLength
must be larger than 2*bandWidth, and can be much longer.
For optimum performance filterLength should be the
smallest power of two such that
filterLength / (ln(filterLength) + 1) >= bandWidth - 1.
But note that filterLength should not be longer than
The length of the output vector.
A logical indicator of whether the beginning of input should
be padded with bandWidth/2 zeroes before filtering.
A logical indicator of whether the end of input should be padded
with bandWidth/2 zeros before filtering.
The Fourier transform of the real even (i.e. symmetric
about zero) time domain filter after it was zero padded
to be of length filterLength.
The vector to be filtered.
If padStart and padEnd then input is of length outputLength,
and it will be padded with zeros at the beginning and end of
the vector when the convolution is computed.
If padStart and not padEnd then input is of length
(outputLength + filterLength/2) and the beginning will be zero
If not padStart but padEnd then input is of length
(outputLength + filterLength/2) and the end will be zero padded.
If not padStart and not padEnd then input is of length
(outputLength + 2*(filterLength/2)) and no padding will be done.
The filtered vector of length outputLength.
Copyright (C) 2002 Christopher M. Cantalupo
invNMatrixMult is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Christopher Cantalupo <firstname.lastname@example.org>
Send bug reports or comments to the above address.
MADmap, NMatrixMult, invNMatrixMult, fftw, rfftw.
- SEE ALSO
This document was created by
using the manual pages.
Time: 21:13:52 GMT, October 25, 2002