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).
What runs in CodeSplash
- SEQ006Neural mask-based MVDR beamforming Needs a data type CodeSplash doesn't load yet
- SEQ007SELDnet Needs a data type CodeSplash doesn't load yet
- SEQ008DDSP: differentiable digital signal processing Explained here
- SEQ009MT3: Multi-Task Multitrack Music Transcription Explained here
- AUD062Music Transformer Needs a data type CodeSplash doesn't load yet
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
Listening in one direction
ReadWith 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 , with the vector of microphone values and 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 to pass the target unchanged, for the target's direction , while making the total output power as small as possible. That leaves as little noise as the geometry allows.
Masks estimate the statistics
ReadMVDR needs the speech and noise covariance matrices, and , at each frequency. In neural mask-based MVDR, a network predicts time–frequency masks, and mask-weighted averages of give the two matrices. The Souden form then needs no explicit direction:
with 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.A beam pattern is not a word error rate
ReadA 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?
Microphones in a straight row. More of them give a narrower beam and more nulls to place.
Gap between neighbors in wavelengths. Above one half, copies of the beam (grating lobes) appear.
Where the wanted talker is, in degrees from straight ahead.
Where the unwanted sound comes from.
How loud the interferer is at each microphone, relative to the sensor noise.
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.
How far the assumed talker direction is from the true one.
Adds this much white noise to the covariance before inverting: a robustness fix that shallows the nulls.
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 to see the result.
What and where at once
ReadA 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 , normalized, for a true direction 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.DDSP: a synthesizer with readable knobs
ReadA 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, . Because the synthesizer is differentiable, a spectral loss trains the network through it.
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)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…MT3: from audio to notes
ReadMusic 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.Music Transformer: notes, not sound
ReadMusic 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, . 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.Where it stands in CodeSplash
Read| Entry | In 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.
Check: space and music
CheckpointCheck yourself
What does "distortionless" mean in MVDR?
Show the answer
Answer: b
Subject to , 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 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 : 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.
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