...
and the output data is placed into
pWires[1]->buffer
...
Peak Hold Module
Anchor | ||||
---|---|---|---|---|
|
The peak hold module demonstrates the use of variable size arrays and shows how the constructor function can be specified completely in MATLAB code. The peak hold module has a single multichannel input pin. The module computes the maximum absolute value for each channel on a block-by-block basis. The module records the peak absolute value seen since the module started running and also computes a peak detector with settable attack and decay rates. In many ways, the peak hold module is similar to a meter module working in block-by-block mode. This module is contained within the file peak_hold_example_module.m. A related fixed-point version is found in peak_hold_example_fract32_module.m
...
There is also a fract32 version of this module called fader_example_fract32_module.m See this module for examples of fixed-point processing.
...
Downsampler Module
Anchor | ||||
---|---|---|---|---|
|
This module downsamples a signal by keeping only one out of every D input samples. This example demonstrates two further techniques used when creating audio modules. First, the module essentially copies 32-bit samples from input to output and doesn't care if the data type is float, fract32, or int. All of these types will work with the same processing function. This is obvious in C but this flexibility must be encoded into the MATLAB scripts. The second technique shown is how to change the block size and sample rate as part of the prebuild function.
...
The C processing function is similar. Although written for 32-bit floats, the function works equally well with any 32-bit data type.
Look Ahead Limiter Module
Anchor | ||||
---|---|---|---|---|
|
This example demonstrates some advanced code generation techniques. The look ahead limiter is a dynamics processor which applies a time-varying gain to a signal. The module m-file takes two arguments.
...