Overview
Vector convolution
Discussion
This module convolves the signals on its input pins a block at a time. It differs from the FIR module because it doesn't maintain any history between blocks. The output is computed by $s[n] = \sum_{k=0}^{M-1} x[n-k] y[k]$, where $x[n]$ is on pin 1 with length $M$ and $y[n]$ is on pin 2, also of length $M$. This operation could be generalized to allow different block sizes if needed.
The parameters shape, skip and length allows control of the range of $n$ that gets calculated. Shape is for quick setting of common ranges. shape = 0: sets skip=0, olen=2*M-1 to compute the full convolution shape = 1: sets skip=M/2, olen=M to compute the center part that has the same length as the inputs. shape = 2: leaves skip and olen to be user-defined. skip: starts storing output at $n = \mathit{skip}$ olen: writes only this many output samples, so $\mathit{skip} <= n < \mathit{skip} + \mathit{olen}$.
Type Definition
Code Block |
---|
typedef struct _ModuleConvolve { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 shape; // Shape of subsection INT32 skip; // Number of samples of full convolution to skip at output INT32 olen; // Length of output } ModuleConvolveClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
shape | int | parameter | 0 | 0 | 0:2 | |
skip | int | parameter | 0 | 0 | 0:63 | samples |
olen | int | parameter | 0 | 63 | 0:63 | samples |
Pins
Input Pins
Name: in0
Description: Input signal 0
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: Convolution output
Data type: float
MATLAB Usage
File Name: convolve_module.m
...