You are on page 1of 19

1

II. Short-time Fourier Transform


II-A Definition
Short-time Fourier transform (STFT)

X t , f w t x e j 2 f d

Alternative definition

X t , w t x e j d

[1] S. Qian and D. Chen, Section 3-1 in Joint Time-Frequency Analysis:


Methods and Applications, Prentice-Hall, 1996.
[2] S. H. Nawab and T. F. Quatieri, Short time Fourier transform, in
Advanced Topics in Signal Processing, pp. 289-337, Prentice Hall, 1987.
2

STFT X t , f w t x e j 2 f d


X t , w t x e j d

Inverse of the STFT: To recover x(t),



x t w 1
t1 t X t1 , f e j 2 f t df
where w(t1 t) 0.

For the alternative definition,


1 1
x t w t1 t X t1 , e j t d
2
The mask function w(t) always has the property of 3

(a) even: w(t) = w(t), ( )


(b) max(w(t)) = w(0), w(t1) w(t2) if |t2| > |t1|
(c) w(t) 0 when |t| is large

w(t) = (t) (triangular function) w(t) = exp(a|t|b)


(hyper-Laplacian function)
t=1 t=1

Max[(t)] = 1
4
II-B Rec-STFT
Rectangular mask STFT (rec-STFT)
tB
X t, f x e j 2 f d
t B

Inverse of the rec-STFT



x t X t1 , f e j 2 f t df

where t B < t1 < t + B

The simplest form of the STFT

Other types of the STFT may require more computation time than the
rec-STFT.
5
II-C Properties of the Rec-STFT
(1) Integration:
(a)
X t , f df
tB
x e j 2 f df d

tB
tB
x d
tB

x 0 when t - B 0 t B, B t B

0 otherwise


(b) X t , f e j 2 f v df x v when v B < t < v + B,

=0 otherwise
6
(2) Shifting property ( )
tB
x 0 e j 2 f d X t 0 , f e j 2 f 0
tB

(3) Modulation property ( )


tB
[ x e j 2 f0 ] e j 2 f d X t , f f 0
tB
7
(4) Special inputs:
(1) When x(t) = (t),
X t , f 1 when B < t < B, X t , f 0 otherwise
(2) When x(t) = 1
X t , f 2 B sinc 2 B f e j 2 f t

B
8
(5) Linearity property
If h(t) = x(t) + y(t) and H(t, f ), X(t, f ) and Y(t, f ) are their rec-STFTs, then

H(t, f ) = X(t, f ) + Y(t, f ).


(6) Power integration property
tB
X t , f df x d
2 2
tB


X t , f df dt 2 B x d
2 2

(7) Energy sum property (Parsevals theorem)



X t , f Y t , f df dt 2 B x y d

tB
X t , f Y t , f df x y d
t B
9
:
(1) Fourier transform

(2) STFT

Shifting w t x 0 e j 2 f d


w t 0 x e j 2 f e j 2 f 0 d

X (t 0 , f ) e j 2 f 0

Modulation
tB
w t [ x e j 2 f0 ] e j 2 f d X t , f f 0
tB
10
Example: x(t) = cos(2 t) when t < 10,
x(t) = cos(6 t) when 10 t < 20,
x(t) = cos(4 t) when t 20

B=1
5
F re q u e n c y (H z )

-5
0 5 10 15 20 25
Time (Sec)
B = 0.5 11
5
Frequency (Hz)

-5
0 5 10 15 20 25
Time (Sec)
B=2
5
Frequency (Hz)

-5
0 5 10 15 20 25
Time (Sec)
12
II-D Advantage and Disadvantage

Compared with the Fourier transform:

All the time-frequency analysis methods has the advantage of:


The instantaneous frequency can be observed.

All the time-frequency analysis methods has the disadvantage of:


Higher complexity for computation
13
Compared with other types of time-frequency analysis:

The rec-STFT has an advantage of the least computation time for digital
implementation

but its performance is worse than other types of time-frequency analysis.


14
II-E STFT with Other Windows

(1) Rectangle
(2) Triangle -B B

-B B
(3) Hanning
0.5 0.5cos t / B when t B
w t
0 otherwise

(4) Hamming
0.54 0.46cos t / B when t B
w t
0 otherwise

(5) Gaussian
w t exp t 2
15
(6) Asymmetric window

-B1 t = 0 B2 t-axis

B1 B2

seismic wave analysis, collision detection


(The applications that require real-time processing)
onset detection
16

(1) Are there other ways to choose the mask of the STFT?
(2) Which mask is better?

17
II-F Spectrogram
STFT Spectrogram

2
SPx t , f Gx t , f w t e x d
2

j 2 f

spectrogram STFT
spectrogram STFT
18
Matlab Show

(1) mesh
( )
(2) amplitude gray-level

y
image(abs(y)/max(max(abs(y)))*C) % C
C=400
colormap(gray(256)) % gray-level
set(gca,Ydir,normal) % , y-axis
19
set(gca,Fontsize,12) % font sizes
xlabel('Time (Sec)','Fontsize',12) % x-axis
ylabel('Frequency (Hz)','Fontsize',12) % y-axis
title(STFT of x(t)','Fontsize',12) % title

tic ( )
toc (show )

You might also like