Title: MM3FC Mathematical Modeling 3 LECTURE 10
1MM3FC Mathematical Modeling 3LECTURE 10
- Times
- Weeks 7,8 9.
- Lectures Mon,Tues,Wed 10-11am, Rm.1439
- Tutorials Thurs, 10am, Rm. ULT.
- Clinics Fri, 8am, Rm.4.503
Dr. Charles Unsworth, Department of Engineering
Science, Rm. 4.611 Tel 373-7599 ext.
82461 Email c.unsworth_at_auckland.ac.nz
2This LectureWhat are we going to cover Why ?
- Spectral Analyser.
- (Understand the DSP behind a spectrum
analyser) - Discrete Fourier Transform (DFT).
- (From understanding the spectrum analyser
- we will learn a DFT can be represented as a
filter bank) - Calculating a DFT.
- Determine the Magnitude spectrum of a
complicated digitised sequence.
3Spectral Analysis
- The basic idea of spectral analysis is to create
a system that will compute the values of the
spectral components from the digital sequence of
numbers xn - The general form for representing a real signal
xn as a sum of complex exponentials is - For the case where N3, the spectrum would be
(10.1)
4- However, an equivalent plot could be used to
translate the ve frequencies to their ve alias
frequencies, using - e-jwn ej2?n e-jwn ej(2? jw)n
- We will find this form of the spectrum useful
when we discuss the DFT.
5A Spectrum Analyser
- The job of a Spectrum Analyser is to extract
the frequency, magnitude and phase of each
spectral component in xn. - The analyser will only have a finite number of
electronic channels (N1) to separate the
spectral components into. - However, there is an infinite amount of
frequencies that could exist in the range 0lt w lt
2? of the signal xn. - Thus, we must choose the frequencies of the
spectral components that are going to be
dedicated to each channel first. - So we will have to pick our frequencies ahead of
time, independent of the signal. - Since there is a finite number of channels (N1),
one obvious is to cover the total 2? frequency
range with equally spaced frequencies - wk 2?k/N
- Thus, the spectrum is only an approximate
representation.
(10.2)
6Spectrum Analysis by Filtering
- Each channel of the analyser must do two jobs
- - Isolate the frequency of interest.
- - Compute the complex amplitude (Xk) for that
frequency. - Isolating the frequency of interest
- Is suited to a BPF with a narrow passband.
- Once xn is passed through the BPF we can
measure the ouput for its amplitude and phase. -
- Rather than design individual BPFs for each
channel, we shall introduce the
frequency-shifting property of the spectrum. - (In this way, all channels can share the same
filter).
7Frequency-Shifting
- The frequency of a complex exponential can be
shifted if it is multiplied by another complex
exponential. - Let the signal xn be multiplied by exp(-jwsn).
- The entire spectrum of xn if shifted in the ve
direction by (ws). - The idea is to shift the desired frequency to the
zero frequency position.
(10.3)
8- Thus, if we wanted to move the frequency (w1) to
the zero frequency position. We would multiply
xn by exp(-jw1n). - Thus, the power spectrum of xn below
- Would become the power spectrum of xn
exp(-jw1n).
X0
X2
X2
X1
X1
X3
X3
w
w3-w1
-2w1
-w2-w1
-w1
-w3-w1
w2-w1
0
?
9Channel Filters
- Why have we translated the desired frequency to
the w0 position ? - Measurement at w0 is equivalent to finding the
average value of the signal with a lowpass
filter. - When a lowpass filter extracts the DC component
of the shifted spectrum it is actually measuring
the complex amplitude of the shifted spectral
components in xn. - A system for doing this must not only measure the
average value but null out all other competing
sinusoidal components.
Preserves whats at w0
Places over
spectrum
SHIFTS spectrum By w to the left
10Spectrum Analysis of Periodic Signals
- A spectrum analyser will work perfectly for
periodic signals. - The same approach can be used for non-periodic
signals but will have approximation errors. - A periodic signal can be defined by the shifting
property - xn N xn
- Where, N is the period. (i.e if we delay xn by
N we will get xn again) - If a complex exponential is periodic with period
N, - For the last equation to be true,
-
- Equating exponents we get wN 2?k, Thus any
periodic exponential can be expressed as
11- Once the period is specified we can create
different complex exponential signals by changing
the value of (k). However, there are actually
only (N) different frequencies because - So k has the range k 0,1,2, , N-1
- Spectrum of a Periodic Discrete-time Signal
- If xn has period (N). Then its spectrum can
contain only complex exponentials with the same
period. Hence, the general representation of a
periodic discrete-time signal xn is - The range is from 0 to (N-1) as there are only N
different frequencies. - The frequencies are all multiples of a common
fundamental frequency -
- w 2?/N
(10.4)
12- Now we will change the notation in anticipation
for the DFT. - We will replace Xk by X k/N. Thus,
- Later on, we will see that this is the inverse
DFT. - Filtering with a running Sum
- Earlier, we showed that FIR filters can
calculate a running sum or running average. - Lets consider the L-point running sum with the
difference equation - As we can see all the co-efficients are equal to
one.
(10.5)
13- Procedure is Take a typical signal xn with
power spectrum below
- Shift desired spectral component to zero
position. - Put through running sum filter.
Gain 10
Null
Frequency response of a Running sum filter
Null
- Only the spectral component at zero position is
preserved.
5x10 50
Spectral component of interest Is magnified by
the gain of 10. All other components are nulled.
14- As we can see, the running-sum FIR has nulls
in its frequency response curve at w 2?k/L. - And this works very well for nulling out a
signal if its constituient frequencies are also
equally spaced. - If xn is periodic and
- Running sum filter length period of xn
- yn is
- A constant signal
- Thus, for a periodic signal, each channel is
composed of the filter combination below that
produces one spectral component. - The structure is called a filter bank.
15The Discrete-Fourier Transform (D.F.T.)
- The previous discussion is a roundabout way to
describe the DFT. - The Forward DFT (Xk) or Analysis Equation
is given below - By substituting in xn we can calculate the
spectral components Xk can be found. - Similarly, the Inverse DFT (xn) or Synthesis
Equation is given below - By subsituting, in the spectral components Xk
we can synthesise the input signal xn.
(10.6)
(10.7)
16- The filter bank of the DFT to compute Xk for
k0,1,2,,(N-1)
17- Thus,
- We will use the DFT formulas for computation.
- And the filter-bank for interpretation and
insight. - The DFT transforms an n-domain(or time-domain)
signal - into its frequency-domain representation.
18Computing the Forward DFT
- So how do we go about computing the DFT and
determining the Magnitude Spectrum from an input
sequence xn ? - Consider a simple continuous sinusoid with a
frequency f 1Hz - x(t) cos(2?(1)t)
- Thus, 1 period of the signal will occur in 1
second. - And the one sided Magnitude spectrum will give a
single peak at 1Hz. - Lets see if the forward DFT can predict this !
- Okay lets sample the signal 8 times in 1 sec,
fs 8Hz and Ts1/8 secs - The digitised signal is therefore
- xn x(nTs) cos(2?nTs) cos(2?n(1/8))
cos((?/4)n) - We have 8 samples, N8 occurring when n
0,1,2,3, , (N-1 7)
19- Using the forward DFT formula we will determine
the spectral components.
20For k0,
For k1,
21- The best way to calculate what xn is
multiplied is to identify the smallest increment
that the exponential goes up in. Consider X1
again
- The exponential power is always a multiple of
?/4. - In general the exponential power is a multiple
of 2?/no.samples - Next create a unit circle which is split up into
these partitions. - Then at each of the multiples write in the
values the exponent has at these positions.
Values of xn at each position
Unit circle in partitions
22For k 2,
- We can read off the values from the unit circle
to determine what the exponent value is.
23For k3,
24k1 ?/4 increments
k2 ?/2 increments
k3 3?/4 increments
- So as (k) increases, the sample frequency
decreases. - Also we are autocorrelating the sequence xn
with differently sampled versions of itself.
25- We can write all of this in a matrix notation
Power of the exponent (e-j?/4)
n increases
xn
k increases
Goes up in p/4 s
Goes up in p/2 s
Goes up in 3p/4 s
Goes up in p s
Goes up in 5p/4 s
Goes up in 3p/2 s
Goes up in 7p/4 s
So only need to remember this bit really.
- Now we can read off the unit circle the values
at these frequencies.
26Reflection in the line of 1s and 1s
27 28- So discounting the aliassed frequency, due to
finite data length, we have located the frequency
of the sinusoid. - This is a special case, as the sinusoid had an
integer number of cycles in the sequence. - What DFT do we get if a sinusoid had a
non-integer number of cycles in the sequence ? - Thus, for a non-integer number of cycles in the
sequence, leakage at the outputs occurs.
However, the main component still has the most
power in it.
29So endeth the course ! Good luck in the exams,
folks !!!