Table of Contents

NAME

QccVectorIntSubsample, QccVectorIntUpsample - integer-vector down/up sampling

SYNOPSIS

#include "libQccPack.h"

int QccVectorIntSubsample(const QccVectorInt input_signal, int input_length, QccVectorInt output_signal, int output_length, int sampling_flag);
int QccVectorIntUpsample(const QccVectorInt input_signal, int input_length, QccVectorInt output_signal, int output_length, int sampling_flag);

DESCRIPTION

QccVectorIntSubsample() 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 QCCVECTORINT_EVEN, every odd-indexed vector component is discarded; if sampling_flag is QCCVECTORINT_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.

QccVectorIntUpsample() 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 QCCVECTORINT_EVEN, the odd-indexed vector components of output_signal are zeros; if sampling_flag is QCCVECTORINT_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.

SEE ALSO

QccVectorInt(3) , QccPack(3)

AUTHOR

Copyright (C) 1997-2021 James E. Fowler


Table of Contents



Get QccPack at SourceForge.net. Fast, secure and Free Open Source software downloads