You are on page 1of 27

Professor A G Constantinides 1

Spectral Analysis
Spectral analysis is concerned with the
determination of the energy or power
spectrum of a continuous-time signal

It is assumed that is sufficiently
bandlimited so that its spectral
characteristics are reasonably estimated
from those of its of its discrete-time
equivalent g[n]
) (t g
a
) (t g
a
Professor A G Constantinides 2
Spectral Analysis
To ensure bandlimited nature is
initially filtered using an analogue anti-
aliasing filter the output of which is
sampled to provide g[n]
Assumptions:
(1) Effect of aliasing can be ignored
(2) A/D conversion noise can be neglected
) (t g
a
Professor A G Constantinides 3
Spectral Analysis
Three typical areas of spectral analysis are:

1) Spectral analysis of stationary sinusoidal
signals
2) Spectral analysis of of nonstationary
signals
3) Spectral analysis of random signals

Professor A G Constantinides 4
Spectral Analysis of
Sinusoidal Signals
Assumption - Parameters characterising
sinusoidal signals, such as amplitude,
frequency, and phase, do not change with
time
For such a signal g[n], the Fourier analysis
can be carried out by computing the DTFT

n
n j j
e n g e G
e e
] [ ) (
Professor A G Constantinides 5
Spectral Analysis of
Sinusoidal Signals
Initially the infinite-length sequence g[n] is
windowed by a length-N window w[n] to
yield
DTFT of then is assumed to
provide a reasonable estimate of
is evaluated at a set of R ( )
discrete angular frequencies using an R-
point FFT
] [n
] [n
) (
e j
e G
) (
e j
e I
) (
e j
e I
N R >
Professor A G Constantinides 6
Spectral Analysis of
Sinusoidal Signals
Note that

The normalised discrete-time angular
frequency corresponding to DFT bin k is


while the equivalent continuous-time
angular frequency is


1 0 , ) ( ] [
/ 2
s s I = I
=
R k e k
R k
j
t e
e
R
k
k
t
e
2
=
RT
k
k
t 2
= O
Professor A G Constantinides 7
Spectral Analysis of
Sinusoidal Signals
Consider
expressed as

Its DTFT is given by
< < + = n n n g
o
), cos( ] [ | e
( )
) ( ) (
2
1
] [
| e | e + +
+ =
n j n j
o o
e e n g

+ =

=
) 2 ( ) ( t e e o t
| e
o
j j
e e G

+ +

) 2 ( t e e o t
|
o
j
e
Professor A G Constantinides 8
Spectral Analysis of
Sinusoidal Signals
is a periodic function of e with a period
2t containing two impulses in each period
In the range , there is an impulse at
of complex amplitude and an
impulse at of complex amplitude
To analyse g[n] using DFT, we employ a finite-
length version of the sequence given by
) (
e j
e G
t e t s s
o
e e =
o
e e =
|
t
j
e
|
t
j
e

1 0 ), cos( ] [ s s + = N n n n
o
| e
Professor A G Constantinides 9
Spectral Analysis of
Sinusoidal Signals
Example - Determine the 32-point DFT of a
length-32 sequence g[n] obtained by
sampling at a rate of 64 Hz a sinusoidal
signal of frequency 10 Hz
Since Hz the DFT bins will be
located in Hz at ( k/NT)=2k, k=0,1,2,..,63
One of these points is at given signal
frwquency of 10Hz
) (t g
a
64 =
T
F
Professor A G Constantinides 10
Spectral Analysis of
Sinusoidal Signals
DFT magnitude plot






0 10 20 30
0
5
10
15
k
|
I
[
k
]
|
Professor A G Constantinides 11
Spectral Analysis of
Sinusoidal Signals
Example - Determine the 32-point DFT of a
length-32 sequence [n] obtained by sampling at a
rate of 64 Hz a sinusoid of frequency 11 Hz
Since

the impulse at f = 11 Hz of the DTFT appear
between the DFT bin locations k = 5 and k = 6
the impulse at f= -11 Hz appears between the DFT
bin locations k = 26 and k = 27
5 . 5
64
32 11
=

=
T
F
R f
Professor A G Constantinides 12
Spectral Analysis of
Sinusoidal Signals
DFT magnitude plot





Note: Spectrum contains frequency
components at all bins, with two strong
components at k = 5 and k = 6, and two
strong components at k = 26 and k = 27
0 10 20 30
0
5
10
15
k
|
I
[
k
]
|
Professor A G Constantinides 13
Spectral Analysis of
Sinusoidal Signals
The phenomenon of the spread of energy from a
single frequency to many DFT frequency locations
is called leakage





Problem gets more complicated if the signal
contains more than one sinusoid
0 10 20 30
0
5
10
15
k
|
I
[
k
]
|
|I(e
j
e
)|
Professor A G Constantinides 14
Spectral Analysis of
Sinusoidal Signals
Example

-





From plot it is difficult to determine if there is one
or more sinusoids in x[n] and the exact locations of
the sinusoids
34 . 0 , 22 . 0 , 16
2 1
= = = f f N
0 5 10 15
0
2
4
6
k
|
X
[
k
]
|
N = 16, R = 16
1 0 ), 2 sin( ) 2 sin( ] [
2 1
2
1
s s + = N n n f n f n x t t
Professor A G Constantinides 15
Spectral Analysis of
Sinusoidal Signals





An increase in resolution and accuracy of
the peak locations is obtained by increasing
DFT length to R = 128 with peaks occurring
at k = 27 and k =45
0 50 100
0
2
4
6
8
k
|
X
[
k
]
|
N = 16, R = 128
Professor A G Constantinides 16
Spectral Analysis of
Sinusoidal Signals
Reduced resolution occurs when the
difference between the two frequencies
becomes less than 0.4

As the difference between the two
frequencies gets smaller, the main lobes of
the individual DTFTs get closer and
eventually overlap

Professor A G Constantinides 17
Spectral Analysis of
Nonstationary Signals
An example of a time-varying signal is the
chirp signal and shown
below for




The instantaneous frequency of x[n] is
5
10 10

= t e
o
) cos( ] [
2
n A n x
o
e =
n
o
e 2
0 100 200 300 400 500 600 700 800
-1
-0.5
0
0.5
1
Time index n
A
m
p
l
i
t
u
d
e
Professor A G Constantinides 18
Spectral Analysis of
Nonstationary Signals
Other examples of such nonstationary
signals are speech, radar and sonar signals
DFT of the complete signal will provide
misleading results
A practical approach would be to segment
the signal into a set of subsequences of
short length with each subsequence centered
at uniform intervals of time and compute
DFTs of each subsequence
Professor A G Constantinides 19
Spectral Analysis of
Nonstationary Signals
The frequency-domain description of the
long sequence is then given by a set of
short-length DFTs, i.e. a time-dependent
DFT
To represent a nonstationary x[n] in terms
of a set of short-length subsequences, x[n] is
multiplied by a window w[n] that is
stationary with respect to time and move
x[n] through the window
Professor A G Constantinides 20
Spectral Analysis of
Nonstationary Signals
Four segments of the chirp signal as seen
through a stationary length-200 rectangular
window
100 150 200 250 300
-1
0
1
Time index n
A
m
p
l
i
t
u
d
e
0 50 100 150 200
-1
0
1
Time index n
A
m
p
l
i
t
u
d
e
200 250 300 350 400
-1
0
1
Time index n
A
m
p
l
i
t
u
d
e
300 350 400 450 500
-1
0
1
Time index n
A
m
p
l
i
t
u
d
e
Professor A G Constantinides 21
Short-Time Fourier Transform
Short-time Fourier transform (STFT),
also known as time-dependent Fourier
transform of a signal x[n] is defined by


where w[n] is a suitably chosen window
sequence
If w[n] = 1, definition of STFT reduces to
that of DTFT of x[n]

m
m j j
e m w m n x n e X
e e
] [ ] [ ) , (
STFT
Professor A G Constantinides 22
Short-Time Fourier Transform
is a function of 2 variables:
integer time index n and continuous
frequency e
is a periodic function of e
with a period 2t
Display of is the
spectrogram
Display of spectrogram requires normally
three dimensions
) , (
STFT
n e X
je
) , (
STFT
n e X
je
) , (
STFT
n e X
je
Professor A G Constantinides 23
Short-Time Fourier Transform
Often, STFT magnitude is plotted in two
dimensions with the magnitude represented
by the intensity of the plot
Plot of STFT magnitude of chirp sequence
with
for a length of 20,000 samples computed
using a Hamming window of length 200
shown next


) cos( ] [
2
n A n x
o
e =
5
10 10

= t e
o
Professor A G Constantinides 24
Short-Time Fourier Transform





STFT for a given value of n is essentially
the DFT of a segment of an almost
sinusoidal sequence
Time
F
r
e
q
u
e
n
c
y
0 5000 10000 15000
0
0.1
0.2
0.3
0.4
0.5
Professor A G Constantinides 25
Short-Time Fourier Transform
Shape of the DFT of such a sequence is
similar to that shown below
Large nonzero-valued DFT samples around
the frequency of the sinusoid
Smaller nonzero-valued DFT samples at
other frequency points
0 0.5t t 1.5t 2t
0
5
10
15
20
e
M
a
g
n
i
t
u
d
e
Professor A G Constantinides 26
STFT on Speech
An example of a narrowband
spectrogram of a segment of speech signal
Professor A G Constantinides 27
STFT on Speech
The wideband spectrogram of the speech signal
is shown below






The frequency and time resolution tradeoff
between the two spectrograms can be seen

You might also like