Table of Contents
QccFilterMultiRateFilterVector - perform FIR filtering of a one-dimensional
signal in conjuction with sampling rate change of the signal
#include "libQccPack.h"
int QccFilterMultiRateFilterVector(const QccVector
input_signal, int input_length, QccVector output_signal, int output_length,
const QccFilter *filter, int input_sampling, int output_sampling, int
boundary_extension);
QccFilterMultiRateFilterVector() implements
the one-dimensional FIR filtering of a signal. In addition, the sampling
rate of the signal can optionally be changed before and/or after the filtering
operation. filter gives the FIR filter, input_signal is the one-dimensional
input signal (of QccVector data type) to be filtered, and output_signal
is the resulting filtered signal. The lengths of the input and output signals
are given, respectively, by input_length and output_length.
The optional
sampling rate changes are specified by input_sampling and output_sampling.
input_sampling specifies the sampling-rate change before the filtering
is perform, output_sampling gives the rate change after the filter. Allowed
values for these variables are:
- QCCFILTER_SAMESAMPLING
- Do not change
sampling rate
- QCCFILTER_SUBSAMPLEEVEN
- Even decimation (discard odd samples)
- QCCFILTER_SUBSAMPLEODD
- Odd decimation (discard even samples)
- QCCFILTER_UPSAMPLEEVEN
- Even upsampling
- QCCFILTER_UPSAMPLEODD
- Odd upsampling
Upsampling and
subsampling are implemented by calling QccVectorUpsample(3)
and QccVectorSubsample(3)
;
see those pages for more details on how the sampling-rate changes are
effectuated.
output_length must be appropriately set for the specified
input_length and sampling-rate changes. Sufficient storage space for output_signal
must be allocated (by a call to QccVectorAlloc(3)
) prior to calling QccFilterMultiRateFilterVector().
The FIR filtering operation is implemented by calling QccFilterVector(3)
;
see that page for the possible values of boundary_extension, which specifies
the method to employ to handle the left and right signal boundaries.
QccFilterMultiRateFilterVector() returns 0 on success, 1
on failure.
QccFilterVector(3)
, QccFilter(3)
, QccVectorSubsample(3)
,
QccVectorUpsample(3)
, QccVector(3)
, QccPack(3)
Copyright (C) 1997-2021
James E. Fowler
Table of Contents