Periodic signals

A periodic discrete-time signal repeats every T = 1 / f seconds, or every fs / f samples (not necessarily an integer). All eight generators share amplitude A, waveform frequency f (Nyquist-limited), sampling frequency fs, DC, and N. Normalized phase p[n] is defined in equation (4).

1. Sine wave

x[n] = A sin(2π p[n]) + DC = A sin(2π f n / fs) + DC (5)

ControlSymbolNotes
AmplitudeAPeak of the sinusoid (volts or counts)
Sine frequencyf1 Hz … fs/2
Sampling frequencyfs1–192 kHz
DC levelDCConstant offset

Peak-to-peak span is 2A about the DC line. A pure tone at f = fs / 4 has exactly four samples per cycle when N is a multiple of 4.

2. Square wave

A bipolar square wave of 50 % duty (odd-harmonic Fourier series):

x[n] = A · sgn( sin(2π p[n]) ) + DC  =  { +A + DC if p < ½;   −A + DC if p ≥ ½ } (6)

Transitions fall on sample boundaries determined by p[n]. There is no separate duty control; use Pulse train for a unipolar width setting.

3. Triangle wave

A bipolar triangle (even symmetry about the peaks):

x[n] = A · (4p − 1) + DC   if p < ½
x[n] = A · (3 − 4p) + DC   if p ≥ ½ (7)

The waveform reaches +A at p = ½ and −A at p = 0 (modulo 1). Its spectrum decays as 1/k².

4. Sawtooth wave

Rising ramp, discontinuous reset:

x[n] = A (2 p[n] − 1) + DC (8)

Values run from −A to +A inside each period. The harmonic amplitudes fall as 1/k.

5. Reverse sawtooth wave

x[n] = A (1 − 2 p[n]) + DC (9)

This is the time-reversal of (8) within each period (falling ramp).

6. Impulse train

A discrete impulse train (Dirac comb sampled on the grid): one sample of height A at the start of each period T = 1/f, zeros elsewhere, then DC.

x[n] = A · Σk δ[n − round(k · fs / f)] + DC (10)

In the implementation, an impulse is placed when the wrapped phase crosses the period boundary (one sample per cycle). If fs / f is not an integer, the spacing jitters by at most one sample — the usual discrete-time approximation to a uniform train.

7. Pulse train

Unipolar rectangular pulses of width (S/100)·T, where T = 1/f and S is the pulse-width slider (20 steps from 5 % to 100 % of T). The leftover fraction of the period is the low level (0).

x[n] = A + DC   if 0 ≤ p[n] < S/100
x[n] = DC         otherwise (11)

ControlRange
Pulse frequency1 Hz … fs/2
Pulse width5, 10, …, 100 % of T

8. Trapezoidal wave

Each period is partitioned into rise, high plateau, and fall. Rise and fall are percentages S1 and S2 of T (20 steps of 5 %). The constraint

S1 + S2 < 100 (12)

is enforced so a nonempty high interval remains. Leftover time is the high plateau (not a low dwell). With r = S1/100 and d = S2/100,

rise:   x = A (p / r) + DC    (0 ≤ p < r)
high:   x = A + DC           (r ≤ p < 1 − d)
fall:   x = A (1 − (p − (1−d)) / d) + DC    (p ≥ 1 − d) (13)

The frequency dial is labelled Trapezoidal frequency. Rise sits under the left column; fall sits under DC (right column).

Shared Nyquist rule. Every frequency dial on this page is limited to fs/2. See Common controls — Nyquist and Wikipedia: Nyquist–Shannon sampling theorem.