Table of Contents
QccVectorSubsample, QccVectorUpsample - vector down/up sampling
#include "libQccPack.h"
int QccVectorSubsample(const QccVector
input_signal, int input_length, QccVector output_signal, int output_length,
int sampling_flag);
int QccVectorUpsample(const QccVector input_signal,
int input_length, QccVector output_signal, int output_length, int sampling_flag);
QccVectorSubsample() removes every other vector component
from input_signal, returning the result in output_signal. That is input_signal
is downsampled, or subsampled, by a factor of 2. If sampling_flag is QCCVECTOR_EVEN,
every odd-indexed vector component is discarded; if sampling_flag is QCCVECTOR_ODD,
every even-indexed vector component is discarded. The vector components
are assumed to be indexed such that the first component in the vector
is index 0 (and even index). The subsampling operation is performed until
either output_signal is full, as determined from output_length, or until
the end of input_signal is reached. Note that it is not necessary for
output_length to be exactly half of input_length; for example, it is permissible
for input_length to be odd. output_signal is assumed to be allocated with
length at least output_length.
QccVectorUpsample() inserts zeros between
every other vector component of input_signal, returning the result as
output_signal, which is assumed to be allocated to length output_length
before the function call. If sampling_flag is QCCVECTOR_EVEN, the odd-indexed
vector components of output_signal are zeros; if sampling_flag is QCCVECTOR_ODD,
the even-indexed vector components of output_signal are zeros. The upsampling
operation is performed until either output_signal is completely filled
with samples or zeros, or the end of input_signal is reached. Note that
it is not necessary for output_length to be exactly twice input_length.
QccVector(3)
, QccPack(3)
Copyright (C) 1997-2021 James
E. Fowler
Table of Contents