Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

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

Code Block
typedef struct _ModulePulseGen
{
    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.
} ModulePulseGenClass;

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: float

MATLAB Usage

File Name: pulse_gen_module.m

...