Title: Acoustics of Music
1Acoustics of Music
2Phase Vocoder
- Aims
- To introduce the concept of analysis synthesis
methods - Learning Outcomes
- Short-Time Fourier transform (STFT)
- The application of the phase vocoder
3Introduction
- The phase vocoder is an analysis synthesis
technique that can also be realised as a
sophisticated effects box - Transforms signal into time-varying spectra.
These can be altered and a new signal synthesised.
4Basic Concept
- The Discrete Fourier Transform
is a time series
5The Discrete Inverse Fourier Transform
6Phase Vocoder
- Take a signal (i.e. a signal indexed by k)
- Apply short time, windowed DFTs (or FFTs) to
successive sections of length M - Hop every by s samples after each section
- Store DFTs an array indexed by integers m,l
7Short Time Fourier Transform
- This gives the Short Time Fourier Transform
- Where
- M is the window length
- s is the hop size
- l is an integer (0,1,2,.L)
- h is the impulse response of the window
- The STFT is for Xm,l for all l (and m)
- Note each element of the STFT has frequency
Were fs is the sample rate
8In Matlab
clear all close all x,FS,NBITSwavread('bassoon.
wav') M4092 Window length sM/8 Hop
size sectionslength(x)/s - M/s Xzeros(M,sectio
ns) xwindowedzeros(M,1) for l0sections
xwindowedx((ls1)(lsM)) . hamming(M)
specabs(fft(xwindowed)) X(,l1)spec end
9Choosing Hop Size
- If hop size equals window size then half the
signal will be attenuated - If the overlap point corresponds to -3dB then the
subjective importance of any attenuation will be
very small. - Typically chose some fraction of window size,
e.g. M/8 - Decimation Factor e.g. a decimation factor of 2
will have two overlaps in the window.
10Re-synthesis
- Put the musical signal back together again from
the STFTs
11Re-synthesis
- Inverse STFTs
- where is now the part of the new time
signal valid for frame l - And knit them all together with the overlap-add
method - Where is the final output signal
12Time expansion or compression without pitch
distortion
- Vary the value of s on playback
13Pitch shifting without time distortion
- Spectrum scaling - Multiply all fm by scale
factor (or by a function) - Pitch shifting important tool in recording studio
for correcting poor vocal performance
14Tricks with a phase vocoder Vary of recorded
sound
- Can modify the amplitude and frequency content of
the STFTs in pretty much anyway you like - E.g. the phase vocoder can act as a very flexible
and accurate filter by varying to amplitude of
the values in the frequency bins of the STFTs.
15Other creative applications
- Timbral interpolation from one instrument to
another by interpolating between STFTs - Cross-synthesis using a characteristic from one
sound (amp, freq or phase) to modulate a
characteristic from another.
16Analogy of Subtractive Synthesiser Vocoders
- Included with popular synths (Moogs, Korgs, etc)
- Array of analog band pass filters that take say a
voice signal and split it up into a range of time
varying amplitudes corresponding to different
frequencies (a crude STFT). - These time varying amplitudes can then be used to
control another signal (carrier) such as a
synthesiser timbre or an electric guitar sound. - ELOs Mr Blue Sky
17Parameters and choices
- Window size M larger means good freq resolution,
poor time resolution, long calculation time - Window type anything non-rectangular (Hamming,
Hanning, Blackman, etc) - FFT size Optimisation restricts to 2n e.g. 1024
- Hop size, s fraction of M e.g. sM/8 overlap
at -3dB points of window
18Problems
- Transients not dealt with effectively
- The impulse response of window convolves signal
- Heisenberg uncertainty - We cannot exactly know
what frequency exists at what time instance , we
can only know what frequency bands exist at what
time intervals - Higher frequencies are better resolved in time
i.e. a HF signal can be located in time better
than frequency - Lower frequencies are better resolved in
frequency i.e. a LF signal is located in
frequency better than time.
19Improvements
- Window closing
- Repeat analysis of signal xk with smaller and
smaller window sizes - Tracking phase vocoder
- Find peaks in magnitude spectrum and attempt to
track these through successive spectra (producing
an envelop for each peak) discard other
magnitude information - Different Transforms
- Reduce effects of time/frequency trade off by
using another transform e.g. wavelet, Wigner
20E.g. Multiresolution analysis (MRA)
- Analyses the signal at different frequencies with
different resolutions - By choosing
- Good time resolution and poor frequency
resolution at high frequencies - Good frequency resolution and poor time
resolution at low frequencies - This leads onto wavelet analysis
21Wavelet Transform
is the mother wavelet, which serves as the
prototype for successive wavelets of different
width depending on spectral component required
is translation i.e. the starting time of a
section of signal
is scale higher scale (e.g. s1) means more of
the signal looked at hence lower frequencies
seen, lower scale (e.g. s0.1) means less of the
signal looked at but in more detail.
22Summary
- A phase vocoder can shift or scale a musical
spectrum, compress or expand signal duration and
interpolate timbres all independently of other
(unwanted) effects - The phase vocoder implements the STFT (and its
inverse), developed from the DFT - Understanding of the SFTF is essential for proper
control of a phase vocoder - The concept of the phase vocoder can be extended
by window closing, tracking or novel base
transforms (e.g. wavelet).