9/28/2013
Overview
Short-Time Fourier Transform
jaj
Window effect
Speech and Audio Signal Processing
Window Function
ECE554
Nikesh Bajaj
[email protected]
Asst. Prof. DSP, SECE
Lovely Professional University
2 By: Nikesh Bajaj
Short Time Fourier Transform
Ba Overview
Review of Limitation of FT
Introduction to STFT
Advantage of STT over FT
sh
Spectrogram
Effect of window size
Nikesh Bajaj
Limitation of STFT
[email protected]
Digital Signal Processing Summary
Lovely Professional University
4 By: Nikesh Bajaj
ke
Limitation of FT Limitation of FT
Ni
1= 10 x
x 2= 20
3= 40
4=100
x(t)=cos( 1 t)+cos( 2t)+cos( 3t)+cos( 4t)
x1(t)=cos( 4t)
x2(t)=cos( 3t)
x3(t)=cos( 2t)
x4(t)=cos( 1t)
x1(t) x2(t) x3(t) x4(t)
By: Nikesh Bajaj 6 By: Nikesh Bajaj
5
1
9/28/2013
Why So??? Solution to The Problem
Support region In space In frequency Computing the FT of signal for every short
sin(t) 0 time duration.
jaj
(t) 0
The basis function sin(t) is not localized in time!
This is called as SHORT TIME FOURIER
The (t) (sample) is not localized in frequency
TRANSFORM.
signal x(t)
Fourier Transform does not give any
information about occurrence of frequency window w(t)
~
x(t )w(t )e dt
it
components with time. X ( , )
7 By: Nikesh Bajaj 8 By: Nikesh Bajaj
Where we are???
Introduction to subject
Signal & System (in a glance)
Fourier Series
Ba Short Time Fourier Transform
Equidistant frequencies:
k
2
k
t
Review of Fourier Transform
sh
Limitation of Fourier Transform (FT)
Short Time Fourier Transform (STFT)
Window function
Fractional Fourier Transform t
Wavelet Transform
9 By: Nikesh Bajaj 10 By: Nikesh Bajaj
ke
Spectrogram Spectrogram 1: Sine wave at 660 Hz
Spectrogram is graphical representation of
x(t ) e i0 t
Ni
Short-Time Fourier Transform (STFT)
~
X ( ) 2 ( 0 )
Frequency
y(t)=Asin(2f0t)
f0=660 Hz
Time
11 By: Nikesh Bajaj 12 By: Nikesh Bajaj
2
9/28/2013
Spectrogram 2: White noise Spectrogram 3: Chirp signal
Impulse signal white noise Q????
jaj
x(t ) (t )
~
X ( ) 1
13 By: Nikesh Bajaj 14 By: Nikesh Bajaj
Spectrogram 4: Train whistle
Ba Spectrogram 5: Human voice Bat
sh
15 By: Nikesh Bajaj 16 By: Nikesh Bajaj
ke
Spectrogram 6: arbitary signal Match the signal with Spectrogram
Ni
17 By: Nikesh Bajaj 18 By: Nikesh Bajaj
3
9/28/2013
STFT with wide window STFT with narrow window
jaj
Signal and FT Spectrogram (STFT) Signal and FT Spectrogram (STFT)
19 By: Nikesh Bajaj 20 By: Nikesh Bajaj
STFT with medium window Ba STFT with MATLAB
spectrogram(x, window, overlap )
signals
x1=sin(2*pi*50*(0:0.001:2))
x2=sin(2*pi*300*(0:0.001:2))
sh
y1=x1+x2
y2=[x1 x2]
Check
Signal and FT Spectrogram (STFT) plot(y1), plot(y2), Plot(abs(fft(y1))) and for y2
spectrogram(y1, w) check for y2 and diff value of w
22 By: Nikesh Bajaj
ke
Effect of window size Effect of window size
t2
Ni
t2
Narrow window: a=0.01 Middle size window: a=0.001
4
9/28/2013
Effect of window size Effect of window size
t2 t2
jaj
Middle size window: a=0.0001 Wide window: a=0.00001
Trade-off in
Time-Frequency
Ba
High time and frequency resolution
cant be achieved simultaneously
Trade-off in
Time-Frequency
sh
t2
28 By: Nikesh Bajaj
ke
Problems with STFT Summery
Uncertainty Principle: t 1
4
t Limitation of FT
Ni
We cannot localize events in time and frequency Does not inform about position of frequency
simultaneously! occurrence in time.
STFT
Improved time resolutionDegraded frequency resolution Spectrogram gives time-frequency information.
Improved frequency resolution Degraded time resolution
But with limited resolution.
Solution is Wavelet Transform.
Problem : the same and t through the entire plane!
29 By: Nikesh Bajaj 30 By: Nikesh Bajaj
5
9/28/2013
Advance Transform Techniques
Course Code: ECE408
Window functions
Rectangular window /Boxcar
Hanning
Window Functions
jaj
Kaiser
Bartlett
Chebyshev
Hamming
Hann
Taylor
Nikesh Bajaj
[email protected]
Triangular
Asst. Prof. LSECA, ECE
Blackman
Lovely Professional University
31 By: Nikesh Bajaj
Properties of STFT
Linear
Complex valued
Time invariant
Ba
Where we are?
Introduction to Subject
Brief about Signal & System
Fourier Series
Fourier Transform & Its Limitations
Time shift
sh
Short Time Fourier Transform & its Limitations
Frequency shift With MATLAB
Many other properties of the FT also apply. Window Functions, with MATLAB
Fractional Fourier Transform
Introduction to Wavelet
33 By: Nikesh Bajaj 34 By: Nikesh Bajaj
ke
1
Overview Window Function t
Introduction to Window Function A mathematical function that is zero-valued outside of
some chosen interval.
Ni
Windowing is a technique used to shape the time portion
Summary of your measurement data, to minimize edge effects that
result in spectral leakage in the FFT spectrum. By using
Window Functions correctly, the spectral resolution of
your frequency-domain result will increase.
Applications of window functions include spectral
analysis, filter design, and beam-forming.
In typical applications, the window functions used are non-
negative smooth "bell-shaped" curves
35 By: Nikesh Bajaj 36
apodization function or tapering function By: Nikesh Bajaj
6
9/28/2013
Effect of Windowing Window Function
1
Spectral analysis of Cos(wt) low-dynamic-range. : excellent resolution for comparable
Use MATLAB strength signals
Rectangular Window: poor choice for signals of disparate
jaj
amplitudes
spectral leakage
high-dynamic-range : low-resolution, also poorest in terms
The leakage tends to be worst (highest) near
of sensitivity;
and least at frequencies farthest from
waveform contains random noise, the ability to find weak
leakage can interfere sinusoids amidst the noise is diminished by a high-dynamic-range
Any window (including rectangular) affects the window, used for wideband applications
spectral estimate computed by this method. Moderate windows: They are commonly used in
narrowband applications, such as the spectrum of a
telephone channel
37 By: Nikesh Bajaj 38 By: Nikesh Bajaj
Window Function
Ba
Spectral analysis involves a tradeoff between resolving
comparable strength signals with similar frequencies and
resolving disparate strength signals with dissimilar
frequencies. That tradeoff occurs when the window
High-resolution windows
Rectangular window
Also called as Dirichlet
1
function is chosen.
window
sh
The first side-lobe is only 13 dB lower
than the main lobe, with the rest falling
off at about 6 dB per octave
39 By: Nikesh Bajaj 40 By: Nikesh Bajaj
ke
Moderate-resolution windows Moderate-resolution windows
Hann window Hamming window
Ni
The ends of the cosine just touch zero, so the
side-lobes roll off at about 18 dB per octave.
N represents the width, in samples, of a
discrete-time window function. Typically it is
an integer power-of-2, such as 210 = 1024.
n is an integer, with values 0 n N-
1. So these are the time-shifted forms
of the window
41 By: Nikesh Bajaj 42 By: Nikesh Bajaj
7
9/28/2013
Tukey window Triangular windows
jaj
43 By: Nikesh Bajaj 44 By: Nikesh Bajaj
Kaiser windows
Ba Low-resolution (high-dynamic-range)
windows
Nuttall window, continuous first
derivative
sh
45 By: Nikesh Bajaj 46 By: Nikesh Bajaj
ke
Low-resolution (high-dynamic-range) Low-resolution (high-dynamic-
windows range) windows
BlackmanHarris window Flat top window
Ni
47 By: Nikesh Bajaj 48 By: Nikesh Bajaj
8
9/28/2013
Window functions
Rectangular window /Boxcar
The Hann and Hamming windows, both of
Hanning
which are in the family known as "raised
jaj
Kaiser
cosine" windows, are respectively named Bartlett
after Julius von Hann and Richard Chebyshev
Hamming. The term "Hanning window" is Hamming
sometimes used to refer to the Hann Hann
window Taylor
Triangular
Blackman
49 By: Nikesh Bajaj 50 By: Nikesh Bajaj
STFT- for Speech
STFT
Ba STFT for Speech
sh
51 By: Nikesh Bajaj 52 By: Nikesh Bajaj
ke
STFT for Speech Linear Filtering
.
Ni
53 By: Nikesh Bajaj 54 By: Nikesh Bajaj
9
9/28/2013
Linear Filtering Spectrogram
jaj
55 By: Nikesh Bajaj 56 By: Nikesh Bajaj
Pitch Detection Ba
sh
57 By: Nikesh Bajaj 58 By: Nikesh Bajaj
ke
Ni
59 By: Nikesh Bajaj
10