(8.D.2.6) PulseGenFract32
Overview
Generates a periodic rectangular pulse
Discussion
This module generates a periodic rectangular pulse. The overall period of the pulse, in msec, is specified by the variable period. The pulse starts at a value of 1.0 and stays on for onTime msec.
You can enable and disable the pulse generate by setting the isOn variable. When turned off, the pulse generator completes the last period of the wave form.
Type Definition
typedef struct _ModulePulseGenFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
FLOAT32 period; // Total period of the pulse.
FLOAT32 onTime; // Duration of the positive portion of the pulse.
INT32 isOn; // Boolean that turns the beeping on or off.
INT32 periodSamples; // Total period of the pulse in samples.
INT32 onTimeSamples; // Duration of the positive period of the pulse in samples.
INT32 count; // Sample counter that increments for each value output.
} ModulePulseGenFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
period | float | parameter | 0 | 500 | 0:1000 | msec |
onTime | float | parameter | 0 | 100 | 0:1000 | msec |
isOn | int | parameter | 0 | 1 | 0:1 | Â |
periodSamples | int | derived | 1 | 24000 | Unrestricted | Â |
onTimeSamples | int | derived | 1 | 4800 | Unrestricted | Â |
count | int | state | 1 | 0 | Unrestricted | Â |
Pins
Output Pins
Name: out
Description: output data
Data type: fract32
MATLAB Usage
File Name: pulse_gen_fract32_module.m
M=pulse_gen_fract32_module(NAME, BLOCKSIZE, SAMPLERATE)
This module creates a period rectangular pulse with amplitude 0.0
and 1.0.
Arguments:
NAME - name of the module.
BLOCKSIZE - number of samples per output channel. By default,
BLOCKSIZE inherits from the input pin.
SAMPLERATE - sample rate of the output signal, in Hz. By default,
SAMPLERATE inherits from the input pin.
Â