Phase History Swap — User Guide
Self-cross-synthesis that combines the late segment’s spectral magnitude with phase taken from an earlier segment, then creates a related stereo pair.
What this does
Phase History Swap divides one mono analysis driver into an early and a late time segment, then constructs a new spectrum whose magnitude comes from the late segment and whose phase comes from the early segment. The reconstructed signal is therefore not a splice of early and late audio; it is a spectral hybrid.
The operation is performed twice with slightly different split positions to create a synthetic stereo pair. The left channel uses Split_at_percent; the right uses Split_at_percent + Stereo_offset_percent, clamped to 1…99%.
What is “phase history” here?
In a Fourier spectrum, each frequency bin has a magnitude and a phase. Magnitude describes how much energy is present at that frequency; phase describes the angular relationship needed to reconstruct the waveform in time.
The script uses the word history because the phase donor is taken from an earlier time region of the same recording. It does not track a continuously evolving phase history sample-by-sample. Instead, it analyzes two entire segments separately and combines one segment's spectral phase with the other's magnitude.
Quick start
- Select exactly one Sound.
- Run
Phase_History_Swap.praat. - Start with Subtle Swap (50%).
- Use Frequency-aligned swap when you want early and late spectra matched by their actual FFT frequency grids.
- Move the split earlier for a longer late-magnitude segment; move it later for a shorter, more compressed output core.
- Increase stereo offset to make L/R use more different early/late divisions.
Presets
| Preset | Left split | Stereo offset |
|---|---|---|
| Custom | Form value | Form value |
| Subtle Swap | 50% | 1.0% |
| Early Swap | 30% | 1.5% |
| Late Swap | 70% | 1.5% |
| Extreme Early | 20% | 2.0% |
| Extreme Late | 80% | 2.0% |
| Ghost Echo | 10% | 3.0% |
| Time Smear | 90% | 2.0% |
| Wide Stereo | 50% | 5.0% |
| Narrow Focus | 50% | 0.5% |
| Asymmetric | 40% | 3.0% |
Presets change only split and stereo offset. Phase mapping, tail, fade, scale peak and output switches remain whatever is set in the form.
Phase mapping modes
| Mode | Mapping | Meaning |
|---|---|---|
| Warped history (v0.3 character) | Early phase-bin index is scaled by split_time / late_duration. | Preserves the original duration-ratio warp. Frequencies are not matched directly in hertz. |
| Frequency-aligned swap | Maps late bins to early bins using the measured FFT bin widths. | Matches the same physical frequency as closely as the two zero-padded FFT grids allow. DC/Nyquist imaginary components are forced to zero. |
Controls
| Control | Default | Meaning |
|---|---|---|
| Split_at_percent | 50 | Left-channel division between early phase donor and late magnitude donor. Must be >0 and <100. |
| Stereo_offset_percent | 1.0 | Added to the right split; 0 is allowed. Final right split is clamped to 1…99%. |
| Tail_duration_seconds | 0.5 | Maximum inverse-FFT tail retained beyond the late segment. The actual retained tail depends on FFT reconstruction and is reported separately for L/R. |
| Fade_out_seconds | 0.3 | Raised-cosine fade to zero at the end. 0 disables it. |
| Scale_peak | 0.95 | Final target peak for non-silent output. |
Processing pipeline
- Choose one mono analysis driver. Mono input is copied directly; for multichannel input the highest-RMS channel is selected instead of averaging.
- For the left channel, split that driver into early and late sections at the requested percentage.
- FFT the early section and retain its phase information.
- FFT the late section and retain its magnitude.
- Map early phase bins according to the selected phase-mapping mode and combine them with late magnitudes.
- Inverse-transform the hybrid spectrum. Keep at most
late_duration + Tail_duration_seconds. - Repeat the complete process at the offset split to create the right channel.
- Pad the shorter reconstructed channel with silence so L/R durations match, combine to stereo, apply the optional end fade, then target-normalize to
Scale_peak.
Channels, duration and level
- Output: always stereo.
- Multichannel input: only the highest-RMS source channel drives the effect; the original spatial image is not preserved.
- Sample rate: original rate; processing is full-bandwidth at that rate.
- Core duration: approximately the duration of the late segment, not the full source duration.
- Tail: only FFT-generated material beyond the late segment is retained, up to the requested maximum. L/R can retain different amounts.
- Level: every non-silent result is target-normalized to
Scale_peak. - Randomness: none; the transform is deterministic for the same source and settings.
Output name: <source>_phaseswap_<preset>.
Visualization
The figure shows the mono analysis driver and stereo result on one shared amplitude scale, driver/output spectrograms, the source split diagram, the output core plus actual retained FFT tail, and a summary of mapping, split and tail values. Red marks the source split; orange marks the final fade region.
Technological and compositional context
Fourier-domain processing makes it possible to separate two properties that are inseparable in an ordinary waveform display: spectral magnitude and spectral phase. That separation has long been central to spectral analysis, phase-vocoder techniques and experimental cross-synthesis. Phase History Swap applies the idea within one recording: one time region provides spectral energy, another provides phase geometry.
Compositionally, this creates a kind of temporal self-cross-synthesis. The past is not replayed; it acts as a structural template for the later spectrum. Moving the split changes both the donor material and the output duration, while the stereo offset creates two related but non-identical hybridizations. The legacy warped mapping pushes the idea further by deliberately decoupling phase-bin position from exact physical frequency.