Skip to content

Space and music: beamforming, sound localization, DDSP and transcription

Several microphones let a model listen in one direction and say where sounds come from (MVDR, SELDnet). Music adds structure: synthesizers with readable controls (DDSP), notes from audio (MT3) and models of note events (Music Transformer).

Advanced ~17 min10 steps

What runs in CodeSplash

You will be able to

  • Describe mask-based MVDR beamforming and its distortionless constraint
  • Explain joint sound-event detection and localization, and angular error
  • Build a harmonic synthesizer from DDSP-style controls in Python and R
  • Tell audio-to-notes transcription from symbolic note-event modeling, and score each properly

Read first

01

Listening in one direction

Read

With several microphones, sound from one direction reaches each at slightly different times. BeamformingBeamformingWeighting and adding several microphones so sound from one direction adds up and sound from other directions cancels. weights and adds the channels so the target direction adds up and others partly cancel. In the STFT domain the output for a bin is wHYtfw^{H} Y_{tf}, with YtfY_{tf} the vector of microphone values and ww the weights.

The MVDR beamformerMVDR beamformerPasses the target direction unchanged while making the total noise power as small as possible, from speech and noise covariances. picks ww to pass the target unchanged, wHd=1w^H d = 1 for the target's direction dd, while making the total output power as small as possible. That leaves as little noise as the geometry allows.

02

Masks estimate the statistics

Read

MVDR needs the speech and noise covariance matrices, Φs\Phi_s and Φn\Phi_n, at each frequency. In neural mask-based MVDR, a network predicts time–frequency masks, and mask-weighted averages of YtfYtfHY_{tf}Y_{tf}^{H} give the two matrices. The Souden form then needs no explicit direction:

w=Φn−1Φs utr⁡(Φn−1Φs),w = \frac{\Phi_n^{-1} \Phi_s\, u}{\operatorname{tr}\bigl(\Phi_n^{-1} \Phi_s\bigr)},

with uu selecting a reference microphone. With known toy covariances, the reference's example checks the constraint: the gain toward the target is 1. Solve linear systems rather than inverting matrices. The enhanced output often feeds a recognizer.

Reference · SEQ006 · Needs a data type CodeSplash doesn't load yetNeural mask-based MVDR beamformingA hybrid multichannel speech system in which neural time–frequency masks estimate speech/noise spatial statistics and a minimum-variance distortionless beamformer combines microphone signals.
03

A beam pattern is not a word error rate

Read

A beam pattern shows how much each direction is let through at one frequency, under ideal assumptions: no echo, matched microphones, a still talker. Real rooms break all three, and recognition depends on much more than one frequency.

DExplorable · Beamforming: delay-and-sum, MVDR and a misaimed beam

How can a row of microphones listen to one talker and tune out another?

With these settings, what happens to the talker's level at the output?

How sure?
8

Microphones in a straight row. More of them give a narrower beam and more nulls to place.

0.50

Gap between neighbors in wavelengths. Above one half, copies of the beam (grating lobes) appear.

0

Where the wanted talker is, in degrees from straight ahead.

35

Where the unwanted sound comes from.

20

How loud the interferer is at each microphone, relative to the sensor noise.

0

How loud the talker is at each microphone, relative to the sensor noise.

Beamformer

Delay-and-sum lines the microphones up toward the talker; MVDR also uses the measured covariance to cancel what it hears from elsewhere.

Covariance

Noise and interference only (known silent moments), or everything the array hears, the talker included.

0.0

How far the assumed talker direction is from the true one.

0.0

Adds this much white noise to the covariance before inverting: a robustness fix that shallows the nulls.

talkerinterferer−2.4 dBDelay-and-sum9.0 dBAs set9.0 dBIdeal MVDR

Orange dot: the direction the beam was told to keep at 0 dB. Gains below −60 dB are drawn at −60. Bars below zero are drawn flat; read their numbers.

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

04

What and where at once

Read

A tagger says a dog barked; it can't say where. Sound event localization and detectionSound event localization and detectionSaying which sound events happen when, and where each comes from, at once. Detecting a class alone doesn't locate it. (SELD) does both. SELDnet reads multichannel spectra, including phase differences between microphones, through a convolutional recurrent network with two heads: event activity per class over time, and a direction of arrivalDirection of arrivalThe direction a sound comes from, as angles or a unit vector. Errors are the angle between the true and the predicted direction. per class as a unit vector.

Direction errors are angles. Predicting the direction (0.9,0.1,0.1)(0.9, 0.1, 0.1), normalized, for a true direction (1,0,0)(1, 0, 0) is off by 8.9 degrees in the reference's example. Score direction only where the event is truly active, and check whether two events of one class at once can even be expressed.

Reference · SEQ007 · Needs a data type CodeSplash doesn't load yetSELDnetA convolutional recurrent approach to joint sound-event detection and localization, predicting both event activity and associated directions.
05

DDSP: a synthesizer with readable knobs

Read

A generic decoder must learn every waveform from scratch. Differentiable signal processingDifferentiable signal processingA network predicts controls for oscillators and filters, which then make the sound, so the controls stay readable as pitch and loudness. (DDSP) has a network predict controls, such as the fundamental frequencyFundamental frequencyThe lowest frequency of a periodic sound, heard as its pitch. Harmonics sit at whole-number multiples of it., loudness and harmonic amplitudes, and lets fixed oscillators and filters make the sound, x(t)=∑kak(t)sin⁡(k ϕ(t))x(t) = \sum_k a_k(t) \sin(k\,\phi(t)). Because the synthesizer is differentiable, a spectral loss trains the network through it.

Python
import numpy as np
fs = 8000; t = np.arange(800) / fs                 # a tenth of a second
f0 = 220.0                                         # control: pitch
amps = np.array([1.0, 0.3, 0.1])                   # control: harmonic amplitudes
k = np.arange(1, 4)                                # harmonics 1, 2, 3
wave = (amps[:, None] * np.sin(2 * np.pi * k[:, None] * f0 * t)).sum(axis=0)
print(float(np.sqrt(np.mean(wave ** 2))), int(k[-1] * f0))   # RMS level, highest partial (Hz)
R
fs <- 8000; t <- (0:799) / fs                      # a tenth of a second
f0 <- 220                                          # control: pitch
amps <- c(1, 0.3, 0.1)                             # control: harmonic amplitudes
k <- 1:3                                           # harmonics 1, 2, 3
wave <- colSums(amps * sin(2 * pi * outer(k * f0, t)))
print(c(sqrt(mean(wave^2)), max(k) * f0))          # RMS level, highest partial (Hz)

The tone's RMS level is 0.742, and its highest partial sits at 660 Hz. A control's name doesn't guarantee it can be recovered from every recording.

Reference · SEQ008 · Explained hereDDSP: differentiable digital signal processingA framework that places differentiable signal-processing components inside learned audio systems. Instead of asking a generic decoder to learn all waveform structure, it predicts controls for interpretable synthesis…
06

MT3: from audio to notes

Read

Music transcriptionMusic transcriptionTurning recorded music into note events (pitch, onset, offset, instrument). Score it by matching notes, not by token likelihood. turns a recording into note events: pitch, onset, offset and instrument. MT3 treats it as translation: a Transformer encoder reads spectrogram frames and a decoder writes a sequence of event tokens (time shifts, instrument changes, note-ons and note-offs), one vocabulary for many instruments and datasets.

It trains on token cross-entropy, 0.364 on the reference's toy table, but that isn't how transcription is judged. Decode the tokens to notes and match them to reference notes within an onset tolerance, then report note-level precision, recall and F1.

Reference · SEQ009 · Explained hereMT3: Multi-Task Multitrack Music TranscriptionA supervised sequence-to-sequence system transcribing polyphonic audio into symbolic note events across multiple instrument tracks.
07

Music Transformer: notes, not sound

Read

Music Transformer models symbolic music: sequences of note events such as MIDI, not audio samples. Musical patterns repeat at fixed distances (the same motif a bar later), so it uses relative attentionRelative attentionAttention with a learned score for the distance between positions, so a pattern such as one beat later carries over anywhere.: the score between two positions adds a learned term for their distance, qi⊤kj+qi⊤ri−jq_i^\top k_j + q_i^\top r_{i-j}. In the reference's example that sum is 0.64.

Its outputs are events you render with a synthesizer. Symbolic music follows its own data contractData contract: symbolic musicNote events with timing, pitch, duration and instrument: quantize consistently and split by composition or performer, not by bar.: tempo, time signature, quantization and tracks.

Reference · AUD062 · Needs a data type CodeSplash doesn't load yetMusic TransformerA symbolic-music sequence model using relative attention to capture relationships in event-based musical performances. Its outputs are events such as note onsets, offsets, velocity, or time shifts, not raw audio samples.
08

Where it stands in CodeSplash

Read
EntryIn CodeSplash
Mask-based MVDR (SEQ006)Needs a data type CodeSplash doesn't load yet: spatial audio. CodeSplash reads multichannel files, but no method uses spatial information
SELDnet (SEQ007)Needs a data type CodeSplash doesn't load yet, for the same reason
DDSP (SEQ008)Explained here
MT3 (SEQ009)Explained here; its software stack and multi-gigabyte weights put it out of scope
Music Transformer (AUD062)Needs a data type CodeSplash doesn't load yet: symbolic music (MIDI)

The reference programs are small calculations, verified in Python and R.

09

Check: space and music

Checkpoint

Check yourself

What does "distortionless" mean in MVDR?

Show the answer

Answer: b

Subject to wHd=1w^H d = 1, MVDR minimizes total output power, so noise drops while the target stays intact.

Check yourself

In neural mask-based MVDR, what does the neural network predict?

Show the answer

Answer: b

The weights then follow analytically from the two covariance estimates.

Check yourself

What does SELDnet output that an audio tagger doesn't?

Show the answer

Answer: b

Detection says what happens when; localization adds where it comes from.

Check yourself

How should SELD direction errors be summarized?

Show the answer

Answer: b

Scoring directions for inactive classes would measure noise. Angles are the natural unit.

Check yourself

What does a DDSP network output?

Show the answer

Answer: b

Fixed, differentiable oscillators and filters turn the controls into sound, so training can still use a spectral loss.

Check yourself

A harmonic synthesizer uses f0=220f_0 = 220 Hz and five harmonics. What is the frequency of the highest partial, in Hz?

Show the answer

Answer: 1100

Harmonics sit at whole-number multiples of f0f_0: 5×220=11005 \times 220 = 1100 Hz.

Check yourself

How should an MT3-style transcriber be evaluated?

Show the answer

Answer: b

Token likelihood is a training signal; transcription quality is about which notes were found.

Check yourself

What does MT3 produce?

Show the answer

Answer: b

It is audio-to-symbol translation. A score from it isn't proof the transcription is unique.

Check yourself

What does Music Transformer model?

Show the answer

Answer: c

Its outputs must be rendered by a synthesizer to be heard.

Check yourself

Why does Music Transformer use relative attention?

Show the answer

Answer: a

A motif repeated a bar later has the same relative offsets wherever it occurs.

10

Recap

Recap
  • MVDR passes the target direction unchanged and minimizes noise; neural masks estimate its covariances.
  • SELDnet says what and where; score directions as angles on active events.
  • DDSP predicts synthesizer controls; MT3 writes note events; Music Transformer models notes with relative attention.
  • All are explained here; spatial methods and symbolic music aren't in CodeSplash.

Concepts in this lesson