Signal Processing and Data Analysis Simon Godsill Lent 2015 Demos Signal Processing and Data Analysis Simon Godsill Lent 2015
Handout 3 and 4 – Fourier Transforms Spectrum of a sine-wave
Spectrum of a square wave
Handout 5 – Sampling theory Aliasing example Flute correctly sampled at f_0=44.1kHz Low-pass Pre-filtered to 20kHz Flute incorrectly sampled at much lower f_0 - same low-pass pre-filtering at 20kHz
Handout 6 Discrete Fourier Transform DFT of Musical Audio (f_s=44 Handout 6 Discrete Fourier Transform DFT of Musical Audio (f_s=44.1kHz, N=40000)
Non-stationary (time-varying) audio and the Spectrogram For a long time-varying signal, can split up the data into lots of shorter `frames’ and Perform the DFT on each. Then piece the |DFT|s all back together as an image intensity `time-frequency’ plot, the Spectrogram:
Spectrogram of saxophone extract The |DFT | of one short data frame, plotted as a vertical slice of the image
DFT of sinewave, 1kHz, f_s=44.1kHz, N=1000 fs=44100; % Sampling rate, Hz x=sin([1:44100]./fs*1000*2*pi); % Generate 1s of 1kHz sinewave X=fft(x(1:1000)); % Take the DFT of first N=1000 data points
DFT of square wave, 1kHz, f_0=44.1kHz, N=1000 x=square([1:44100]./fs*1000*2*pi); % Generate 1s of square wave X=fft(x(1:1000)); % Take the DFT of N=1000 data points
Sampling and Aliasing Take Spectrogram of a `chirp’ signal Use a sampling frequency of 10kHz (> twice maximum frequency in chirp):
Aliased Chirp Now, the same chirp signal but sampled at only at 5kHz (< twice maximum frequency of chirp). No pre-filtering is applied to remove components above 5kHz: Now get aliasing of the high frequency components
Why does this happen? Consider one frequency occurring at around 1.8 s, frequency is roughly 3.5kHz. Fourier Transform of this should look like:
But, we are sampling at 5kHz, with no prefiltering to remove high frequency components. Sampled spectrum has form: Viewed graphically we get:
This is the bit plotted in the Spectrogram at t=1.8s