Time-Frequency Spectrum
Signals and systems
PhD. Alberth Ronal Tamo Calla
Spectrogram
• Time-frequency plot of a signal
Breaks signal x(t) into smaller segments
Performs Fourier analysis each segment separately
Fourier analysis implemented by fast Fourier transform (FFT)
FFT of segment of samples has same number of samples (N)
MATLAB: spectrogram( x, N, shift, N, ‘yaxis’)
Time-Domain Plot Spectrogram
x(t) f
FFT Segment
FFT Segment
FFT Segment
Shift start Shift start
of segment of segment
3
SegmentSegment
1 2Segment 3
t t
4-2
Spectrogram
• 50% overlap between adjacent segments common
• Consider “edge” effects in analyzing short sinusoid
SECTION
LOCATIONS
MIDDLE of SECTION
is REFERENCE TIME
• SPFirst adds plotspec (above) and spectgr functions
4-3
Chirp Signals
• Sinusoid with rising or falling frequency vs. time
Change in frequency occurs continuously
Linear sweep over range of frequencies (e.g. audio test signal)
• Revisit sinusoidal signal model
Assumes constant amplitude, frequency and phase over time
x(t) = Re{Ae j(2 p f0t+f ) } = Acos ( 2p f0t + f ) = Re{Ae jy (t) }
Angle in right term y(t) = 2 p f0 t + f varies linearly with time
Derivative of y(t) w/r to t is constant frequency 2 p f0 in rad/s
4-4
Chirp Signals
Linear sweep 261-3951 Hz
• Chirp x(t) = A cos(y(t)) x(t)
where y (t) = 2 p m t + 2 p f0 t
2
• Instantaneous freq. (Hz)
Scaled slope of angle y(t)
1 d
fi (t) = y (t) = 2mt + f0 t
2p dt
For x(t) over 0 ≤ t ≤ tmax,
instantaneous frequency
from f0 to f0 + 2 m tmax
• Linear frequency sweep
For 0 ≤ t ≤ tmax, sweep f1 to f2
f0 = f1 and m = (f2 – f1) / (2 tmax)
4-5
Spectrogram
Chirp Signals
• MATLAB code for previous slide
fs = 8000;
Ts = 1 / fs;
tmax = 5;
t = 0 : Ts : tmax;
f1 = 261; % note C4
f2 = 3951; % note B7
f0 = f1;
mu = (f2 - f1) / (2*tmax);
phi = 0;
angle = 2*pi*mu*t.^2 + 2*pi*f0*t + phi;
x = cos(angle);
sound(x, fs);
figure;
plot(t(1:800), x(1:800));
figure;
4-6
spectrogram(x, 1024, 512, 1024, fs, 'yaxis');