MDS Space Navigator — User Guide

Automatically segments sounding regions, measures formant, pitch, or MFCC cues, builds pairwise acoustic distances, embeds those dissimilarities in a two-dimensional non-metric MDS space, and reorders the original multichannel segments by one of three navigation rules.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4 (2026) License: MIT License Repo: GitHub
Contents:

What this does

MDS Space Navigator treats detected sounding regions as discrete audio segments. It first computes acoustic distances between every pair, then creates a two-dimensional MDS map of those dissimilarities. The final playback order can follow the raw distance matrix, one coordinate of the MDS embedding, or the original timeline.

Analysis and rendering are separated. Stereo and multichannel sources are converted to mono only for segmentation and feature measurement. Reordered segments are extracted from the original Sound, and inserted silence uses the original channel count. Mono remains mono; stereo and N-channel input remain N-channel.

The complete path is:

Sound → mono analysis copy when needed → Intensity segmentation → Formant / Pitch / MFCC descriptors → pairwise distance matrix → 2-D monotone MDS → choose playback order → extract original-channel segments → insert silence → concatenate

What does MDS mean here?

Multidimensional scaling (MDS) places objects in a geometric space so that distances between plotted points approximate the structure of the supplied dissimilarities. Here, the objects are detected sounding segments and the dissimilarities come from acoustic features.

The MDS map is not the feature extractor. Formants, pitch or MFCCs create the original pairwise distances first. MDS is a lower-dimensional representation of those distances.

Also, the MDS axes are geometric coordinates, not named acoustic variables. Dimension 1 should not automatically be interpreted as F2, pitch, a principal component, “brightness”, or any other specific cue. MDS configurations can be reflected or rotated without changing their distance structure.

Quick start

  1. Select exactly one Sound object.
  2. Run MDS_Space_Navigator.praat.
  3. Set the silence segmentation controls.
  4. Choose Formants, Pitch, or MFCC as the similarity metric.
  5. Choose Nearest neighbor, MDS Dimension 1, or Original order.
  6. Set Silence_between_words_s.
  7. Run the script. The result is named <source>_reordered.
“Word” is only the script's internal label. A detected segment is simply a continuous sounding interval according to the intensity-based segmentation; it can be a word, syllable, note, gesture or other sound event.

Automatic segmentation

The analysis Sound is converted to an Intensity object with a 100 Hz pitch-floor setting. The script then calls Praat's Intensity: To TextGrid (silences) command using:

silence threshold: -Silence_threshold_dB minimum silent interval: Minimum_silent_interval_s minimum sounding interval: Minimum_sounding_interval_s

With the default form value 25, the script passes −25 dB as the silence threshold relative to the maximum Intensity. Praat removes sounding intervals that are too short, joins the resulting neighboring silences, then removes silences that are too short and joins the neighboring sounding intervals.

Only intervals labelled sounding are retained. They are renamed internally as:

word_1, word_2, word_3, ...

At least two sounding segments are required. The segmentation TextGrid is an intermediate analysis object and is removed during cleanup; it is not a final output.

Feature extraction & raw distances

No z-score normalization, perceptual rescaling or feature weighting is applied before the pairwise distances. Each metric therefore has its own native numerical scale.

1. Formants — F1/F2 midpoint distance

The script creates one Burg Formant object from the complete mono analysis signal:

To Formant (burg): time step = 0 number of formants = Number_of_formants maximum formant = Max_formant_Hz window length = 0.025 s pre-emphasis = 50 Hz

For each sounding segment, F1 and F2 are sampled at its temporal midpoint. Undefined values are replaced with 0.

d(i,j) = sqrt[ (F1_i - F1_j)^2 + (F2_i - F2_j)^2 ]

The distance is therefore a raw two-dimensional distance in Hz. Number_of_formants affects the Burg analysis object, but the similarity metric itself uses only F1 and F2.

2. Pitch — mean-F0 difference

The script creates a Pitch object with fixed bounds 75–600 Hz, then measures mean F0 over each sounding interval:

d(i,j) = |meanF0_i - meanF0_j|

Undefined mean pitch is replaced with 0 Hz. Consequently, two unvoiced segments both assigned 0 have zero pitch distance from each other, while an unvoiced segment and a voiced segment are separated by the voiced segment's F0 in Hz.

This is a linear-Hz distance, not a semitone or log-frequency distance.

3. MFCC — mean-vector Euclidean distance

Each sounding segment is extracted separately and converted to MFCC with:

Number_of_MFCC_Coefficients window length = 0.015 s time step = 0.005 s first filter = 100 Hz distance between filters = 100 Hz maximum frequency = 0 (Praat default behavior)

The script converts the MFCC to TableOfReal, averages every requested coefficient across the segment, and computes Euclidean distance:

d(i,j) = sqrt[ Σ_c (MFCC_i,c - MFCC_j,c)^2 ]

The exposed Number_of_MFCC_Coefficients is used directly by the current implementation.

Distance matrix & 2-D MDS embedding

The script builds a symmetric TableOfReal containing the raw feature distances, casts it to a Praat Dissimilarity object, and runs:

To Configuration (monotone mds): dimensions = 2 approach = Primary tolerance = 1e-5 maximum iterations = 50 random starts = 1

This is a non-metric / monotone MDS embedding: the geometric configuration is chosen to represent the ordering and structure of the input dissimilarities in two dimensions.

Degenerate all-zero distance case

If every raw feature distance is effectively zero, there is no geometry for MDS to recover. The script then changes only the MDS copy of the matrix:

mdsValue(i,j) = |i-j| × 1e-6 for i != j

This tiny deterministic structure allows the map/order stage to run. The original dist[i,j] values remain zero, so Nearest Neighbor continues to use the true tied distances.

The MDS algorithm uses one random start and the script exposes no random seed. The exact orientation of the 2-D configuration — and therefore an MDS Dimension 1 sort — should not be treated as a uniquely defined or semantically fixed acoustic axis across separate runs.

Navigation / ordering modes

Nearest neighbor chain

This mode does not navigate using MDS coordinates. It uses the original feature-distance matrix directly:

start = segment 1 repeat: from current segment, choose unused segment with smallest raw feature distance

The process is greedy and anchored to original segment 1. It does not solve a globally shortest path. When several candidates have exactly equal distance, the first unused candidate encountered wins.

MDS Dimension 1

All segment indices are sorted by their first coordinate in the current 2-D MDS Configuration:

ascending mds1 coordinate

This creates a left-to-right traversal of the current map. “Low to high” means low-to-high coordinate value, not low-to-high pitch, F1/F2, brightness or any guaranteed acoustic property.

Original order

The source segment sequence is retained exactly. MDS is still computed for the visualization, but it does not alter playback order.

ModeWhat determines the order?Role of MDS
Nearest NeighborRaw pairwise feature distancesVisualization only
MDS Dimension 1First MDS coordinateDirectly determines order
OriginalOriginal segment indexVisualization only

Audio extraction & assembly

After the order is known, every sounding region is extracted from the original Sound with a rectangular window. This is why the source channel count is preserved even though analysis may have used a mono copy.

Between every adjacent pair, the script inserts a digital-silence Sound with:

channels = original channel count duration = Silence_between_words_s sample rate = original sample rate

The reordered timeline is then built by ordinary Praat Concatenate. There is no overlap, crossfade, edge fade or gain matching.

Rectangular extraction plus butt concatenation can produce discontinuities at segment boundaries. The inserted silence separates segments in time but does not itself create a fade.

Exact duration

outputDuration = Σ selected sounding-segment durations + (N - 1) × Silence_between_words_s

Parameters

ParameterDefaultExact role
Silence_threshold_dB25Script passes −25 dB by default to Praat's relative Intensity silence detector.
Minimum_silent_interval_s0.1Minimum silence retained by Praat's segmentation.
Minimum_sounding_interval_s0.1Minimum sounding interval retained by segmentation.
Similarity_metricFormantsFormants, Pitch or MFCC.
Max_formant_Hz5500Maximum Formant analysis frequency.
Number_of_formants5Number of formants requested from Burg analysis; only F1/F2 enter distance.
Number_of_MFCC_Coefficients12Dimension of the mean MFCC feature vector and its Euclidean distance.
OrderingNearest NeighborRaw-distance chain, MDS Dim 1 sort or original order.
Silence_between_words_s0.1Exact digital-silence duration inserted between consecutive rendered segments.
Play_resultOnPlay the completed reordered Sound.

There is no preset system and no separate visualization switch in v0.4; the Picture visualization is always drawn.

Visualization

The current v0.4 Picture layout is centered on the navigation concept:

  1. MDS similarity space: closer plotted points represent smaller dissimilarities in the two-dimensional embedding. The path connecting them follows the actual playback order for all three ordering modes.
  2. Point labels: w1, w2, … refer to original detected segment indices.
  3. Point size: encodes segment duration, capped for display.
  4. Point color: blue → red encodes playback position from first to last; it does not encode acoustic category or similarity.
  5. How the navigator works: Detect → Measure → Distances → 2-D MDS → Order/join.
  6. Playback order: shows up to the first 20 ordered items with their original index and duration.
  7. Reordered output: waveform of the final Sound; dotted red marks indicate segment-boundary positions after the inserted silences.
  8. Summary: metric, ordering method, segment count, gap, output duration, raw distance range and a reminder that MDS axes are geometric coordinates.
The path in the MDS map is an explanatory overlay. For Nearest Neighbor it visualizes a path chosen from raw feature distances, not a path optimized in the 2-D map itself.

Output behavior

The original Sound remains unchanged.

Further reading