Downsampler
Overview
Downsampler (or decimator) - keeps 1 out of every D samples
Discussion
Multichannel downsampling module. When downsampling by a factor of D, the module will keep 1 of every D samples, with the other samples being discarded. No filtering is incorporated within the module. It is expected that the user will incorporate the filters of their choice to systems that incorporate downsampling.
Type Definition
typedef struct _ModuleDownsampler
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 D; // Decimation factor. 1 out of every D samples is output.
} ModuleDownsamplerClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
D | int | const | 0 | 2 | 1:1:1024 |
Pins
Input Pins
Name: in
Description: Input signal
Data type: {float, int, fract32}
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Output signal
Data type: {float, int, fract32}
MATLAB Usage
File Name: downsampler_module.m
M=downsampler_module(NAME, D)
Creates a multi-input downsampler module for use in the Audio Weaver
environment. This module keeps only 1 out of every D samples.
Arguments:
NAME - name of the module.
D - decimation factor.
The decimation factor is set at construction time and cannot be changed
during tuning. Note, the decimation factor must evenly divide the
block size.