Delay Array — User Guide
A cascade of two-tap FIR difference filters. Each stage subtracts the current sample from a shifted sample, producing a comb-shaped frequency response whose spacing is determined either by a fraction of the file length or by an explicit millisecond delay.
What this does
Delay Array processes the selected Sound with between one and four successive two-tap FIR stages. Every stage uses the same operation:
where D is the active delay in samples. Because the current sample is subtracted from a shifted copy, the stage has zero response at DC and a repeating comb-shaped magnitude response. Multiple iterations cascade these responses, multiplying their spectral effects.
What is a delay-difference filter?
A two-tap difference filter compares two samples separated by D samples. In this script the shifted sample is the future sample x[n+D]:
The response is zero at DC and repeats zeros at integer multiples of:
The magnitude response is the same as the more familiar delayed-difference form x[n] - x[n-D]; using the future sample changes time alignment and finite-boundary behavior, not the comb magnitude.
Quick start
- Select exactly one Sound object.
- Run
Delay_Array.praat. - Choose one of the six presets or Custom.
- Choose how many stages to apply with Number_of_iterations (1–4).
- Leave Use_ms_delay off for file-relative delays, or enable it for explicit short delays in milliseconds.
- Set Scale_peak for the final peak-normalization target.
- Run the script. The result remains the same duration and channel count as the input.
Delay modes
File divisor mode — default
With Use_ms_delay = Off, each active delay is derived from the total sample count:
The delay therefore scales with the duration of the selected Sound. A divisor of 2 is approximately half the file duration; a divisor of 8 is approximately one eighth. Active divisors must be greater than 1.
Millisecond mode
With Use_ms_delay = On:
The actual delay is sample-quantized, so the Info window reports both the requested millisecond value and the realized sample/millisecond value.
Cascade behavior
Each stage processes the result of the previous stage:
In frequency-domain terms, the stage responses multiply. After K stages:
Every stage contributes its own regularly spaced zeros, so combinations of delays create a denser composite notch pattern. The process is linear and time-invariant apart from the finite-length boundary at the end of the Sound.
Presets
Each named preset supplies both divisor values and millisecond values. The active set depends on Use_ms_delay.
| Preset | Divisors | ms delays |
|---|---|---|
| Default | 2, 4, 8, 10 | 2, 4, 8, 10 ms |
| Fine | 2, 3, 5, 7 | 2, 3, 5, 7 ms |
| Coarse | 4, 8, 12, 16 | 4, 8, 12, 16 ms |
| Extreme | 2, 6, 12, 24 | 2, 6, 12, 24 ms |
| Harmonic | 2, 4, 8, 16 | 2, 4, 8, 16 ms |
| Prime | 2, 3, 5, 11 | 2, 3, 5, 11 ms |
| Custom | User values | User values |
Presets do not change Number_of_iterations, Use_ms_delay, Scale_peak, visualization, or playback.
Parameters
| Parameter | Default | Behavior |
|---|---|---|
| Preset | Default | Chooses one of six named arrays or Custom. |
| Divisor_1…4 | 2, 4, 8, 10 | Used only in divisor mode. Active values must be > 1. |
| Number_of_iterations | 4 | Number of active cascade stages; maximum 4. |
| Use_ms_delay | Off | Off = file divisors; On = millisecond delays. |
| Delay_1_ms…Delay_4_ms | 3, 5, 7, 11 in the form | Used only for Custom in ms mode; named presets replace them with their preset ms arrays. |
| Scale_peak | 0.99 | Final peak-normalization target. Must be > 0 and ≤ 1. |
| Draw_visualization | On | Draw Source → Delay cascade map → Output → Summary. |
| Play_result | On | Automatically plays the result. |
Finite-signal boundary
The formula is evaluated across the full Sound. Near the end, n + D may lie beyond the available samples. Praat returns zero for out-of-range self[index], so the operator becomes:
for those tail samples. This is equivalent to zero-padding the shifted branch rather than leaving the tail unprocessed or deleting it.
Visualization
When enabled, the Picture window shows:
- Source: mono display copy of the original Sound.
- Delay cascade map: one block per active stage, labelled with
x[n+D] - x[n], the realized delay, and the corresponding comb-zero spacing. - Output: mono display copy of the processed result.
- Summary: preset, delay mode, iteration count, realized delay range, comb-zero spacing range, duration, and peak target.
Source and Output use a shared amplitude scale, so their displayed amplitudes can be compared directly.
Output behavior
- The original Sound remains unchanged; processing is performed on a copy.
- Input duration and channel count are preserved.
- Each channel is filtered independently by the same cascade.
- Every active delay must be at least 1 sample and shorter than the Sound.
- The output name is
<source>_delayArray_<preset>_divin divisor mode or..._msin millisecond mode.
Peak scaling
After all active stages, the script measures the absolute sample extremum. If the result is non-silent, it always executes Scale peak to Scale_peak.