WaveWarp 2.0 Component
      

Signal Generators:
Functional Description
Generates an audio signal with a selectable waveform.
For efficiency, the waveform is pre-calculated and
stored in a wavetable (buffer).
NOTE: the sample rate at which this component is executed can be arbitrarily set via the
"Sample-rate setting for Signal Generators and
Input ASCII files" button
(or the "Sample-Rate Setting" command under the "Edit" menu) on the toolbar, which is
activated whenever the component is selected on the DrawingBoard.
Equivalently, it can be set via the dialog box which (i) appears
when the component is initially
dragged on to the DrawingBoard or (ii) is activated using the right-mouse-button when
the component is selected on the DrawingBoard.
This procedure allows the component to either (i) enforce
a user-determined sample rate on the downstream component(s), or (ii) to inherit the sample rate from
the downstream component(s). Different signal generators can run at different
sample rates on a DrawingBoard, as long as the rules of connectivity
for multiple sample rates are adhered to (see the
WaveWarp Users' Guide
for more information.)
The characteristics of the waveform are adjustable via
the Parameter Window, as summarised in the
following table.
| Parameter | Purpose |
| "Waveform" selection buttons |
Selects the waveform from a choice of built-in profiles or from an
external ASCII file (for total flexibility). The chosen waveform
is depicted in the plot window. The "Wavetable length" (i.e. the number of data points
used to represent
one cycle of the waveform) is displayed in the "Playback parameters"
window.
The 5 built-in profiles are summarised as follows:
- "Sine" -- sine wave
- "Triangular" -- triangular wave
- "Square" -- square (rectangular) wave
- "Random (uniform)" -- (pseudo-)random uniform noise sequence, repeating over the length of the wavetable
- "Random (telegraph)" -- telegraph (two-state) sequence with (pseudo-)random distribution of change-points,
repeating over the length of the wavetable
|
| "Frequency" slider |
Adjusts the frequency of the output signal. When the wavetable is played,
it is scanned at the appropriate "Playback increment" (dependent
on the wavetable length) to generate the desired signal frequency.
The time-scale in the plot
automatically adjusts to reflect the duration of a single waveform cycle (in accordance with
the selected signal frequency).
|
| "Amplitude" slider |
Adjusts the amplitude of the output signal.
|
| "Skew" slider |
Adjusts the asymmetry of the "Triangular"
waveform and the aspect ratio of the
"Square" (rectangular) waveform
(de-activated for all other options).
|
| "Harmonics" slider |
Activated when "Enable band-limiting" is selected.
Adjusts the number of harmonics used to construct the "Triangular" and "Square" waveforms
(de-activated for all other options). Useful for band-limiting the waveforms to avoid
undesirable audible fold-over associated with the finite bandwidth of the digital
representation of an analog waveform.
|
| "Length" slider |
Adjusts the length of the wavetable (de-activated when "Load from file" is selected).
|
| "Load wavetable from file" dialog |
Activated when
"Load from file" is selected. The wavetable is imported from
an ASCII file containing an arbitrary
user-defined profile, and interpolated (to a suitable length) via the
selected "Interpolation" method. If "Enable amplitude scaling [-1:1]" is selected,
the imported waveform will be automatically scaled to the range from -1 to 1 (as required
to avoid digital clipping). Otherwise, the raw values from the file will be used verbatim (not
recommended in most circumstances).
The ASCII file format is
described in the
WaveWarp Users' Guide.
This simple file structure
enables
files to be written by hand (e.g. via a text editor).
For
MATLAB®
users, the process of creating waveforms
is particularly straightforward.
The "wwmatlab" sub-directory of the WaveWarp root directory contains
the necessary function m-files (plus example scripts) for exporting
wavetables from MATLAB, thereby providing ready access to
MATLAB's powerful mathematical tools for creating
elaborate waveforms.
(Refer to the
WaveWarp Users' Guide
for
a summary of all bundled m-files for working with MATLAB
in a variety of areas in addition to waveform design).
|
| "Save wavetable to file" dialog |
Exports the current wavetable to an ASCII file
for future import or off-line analysis.
|
Algorithm
The waveform is stored
in a wavetable, and is scanned using a table-lookup oscillator algorithm
(see
[Moore]
section 3.1.7
and
[Roa] p. 90-95
for further information).
For a discussion on band-limited waveforms, see
[Moore] p. 170-171 and
p. 270-273. The harmonic expansions used for the skewed triangular and
rectangular waveforms
were obtained from the appropriate Fourier series expansions (see any elementary applied mathematics
textbook).
Signal Implementations
| Audio signals | Control signals | Description |
| Single output mono | n/a | Generates a mono signal, sent to the mono output |
| Single output stereo | n/a | Generates a mono signal,
sent (in duplicate) to the stereo output channels |
Related components:
Example DrawingBoards illustrating usage:

      
|