Documente Academic
Documente Profesional
Documente Cultură
Spectrum
Representation 3
Extending the investigation of Chapter 2, we now consider
signals/waveforms that are composed of multiple sinusoids
having different amplitudes, frequencies, and phases
N
x t = A0 + Ak cos 2fk t + k
k=1
(3.1)
N
j2f k t
= X 0 + Re
X k e
k = 1
j k
where here X 0 = A 0 is real, X k = A k e is complex, and f k
is the frequency in Hz
We desire a graphical representation of the parameters in
(3.1) versus frequency
if nargin < 4
linetype = 'b';
end
my_linewidth = 2.0;
'LineWidth',my_linewidth);
hold on
plot([-fk(k) -fk(k)],[0 abs(Xk(k))],linetype,...
'LineWidth',my_linewidth);
end
for k=2:length(fk)
if fk(k) == 0
plot([fk(k) fk(k)],[0 abs(Xk(k))],linetype,...
'LineWidth',my_linewidth);
else
Xk(k) = Xk(k)/2;
plot([fk(k) fk(k)],[0 abs(Xk(k))],linetype,...
'LineWidth',my_linewidth);
plot([-fk(k) -fk(k)],[0 abs(Xk(k))],linetype,...
'LineWidth',my_linewidth);
end
end
grid
axis([-1.2*max(fk) 1.2*max(fk) 0 1.05*max(abs(Xk))])
ylabel('Magnitude')
xlabel('Frequency (Hz)')
hold off
case 'phase'
k = 1;
if fk(k) == 0
plot([fk(k) fk(k)],[0 angle(Xk(k))],linetype,...
'LineWidth',my_linewidth);
hold on
else
plot([fk(k) fk(k)],[0 angle(Xk(k))],linetype,...
'LineWidth',my_linewidth);
plot([-fk(k) -fk(k)],[0 -angle(Xk(k))],linetype,...
'LineWidth',my_linewidth);
hold on
end
for k=2:length(fk)
if fk(k) == 0
plot([fk(k) fk(k)],[0 angle(Xk(k))],linetype,...
'LineWidth',my_linewidth);
else
hold off
otherwise
error('mode must be mag or phase')
end
4.5
Line Spectrum X0 = a0
Magnitude Plot
4
3.5
Magnitude
2.5
X
2 -----1- = a 1
2
1.5
0.5
0
300 200 100 0 100 200 300
Frequency (Hz)
1.5
Line Spectrum
1 Phase Plot
X 1 = a 1
0.5
Phase (rad)
0.5
1.5
A Notation Change
The conversion to frequency/amplitude pairs is a bit cumber-
some since the factor of X k 2 must be carried for all terms
except X 0 , therefore the text advocates a more compact spec-
tral form where a k replaces X k according to the rule
X0 , k = 0
ak = 1--- (3.7)
X , k0
2 k
We can then write more compactly the general expression for
x t as
N j2f k t
xt = ak e (3.8)
k = N
Beat Notes
A special case that occurs when we have at least two sinu-
soids present, is an audio/musical effect known as a beat note
A beat note occurs when we hear the sum of two sinusoids
that are very close in frequency, e.g.,
x t = cos 2f 1 t + cos 2f 2 t (3.9)
where f 1 = f c f and f 2 = f c + f
In this definition
1
f c = --- f 1 + f 2 = center frequency
2
(3.10)
1
f = --- f 2 f 1 = deviation frequency
2
we further assume that f f c
0.35
Magnitude
0.3
0.25
0.2
0.15
0.1
0.05
0
100 50 0 50 100
Frequency (Hz)
0.5
Amplitude
0.5
1.5
2
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Time (s)
Multiplication of Sinusoids
In the study of beat notes we indirectly encountered sinusoi-
dal multiplication
Formally we may be interested in
x t = cos 2f 1 t cos 2f 2 t (3.12)
Using trig identity 5 from the notes Chapter 2, we know that
1
cos cos = --- cos + + cos (3.13)
2
Using this result to expand (3.12) we have that
x t = cos 2f 1 t cos 2f 2 t
1 (3.14)
= --- cos 2 f 1 f 2 t + cos 2 f 1 + f 2 t
2
In words, multiplying two sinusoids of different frequency
results in two sinusoids, one at the sum frequency and one at
the difference frequency
For the case where the frequencies are the same, we get
2 1
x t = cos 2f 0 t = --- 1 + cos 2 2f 0 t (3.15)
2
Amplitude Modulation
Multiplying sinusoids also occurs in a fundamental radio
communications modulation scheme known as amplitude
modulation (AM)
Today AM broadcasting is mostly sports and talk radio
v t in text
0.5
Amplitude
0.5
1.5
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Time (s)
0.3
0.25
0.2
0.15
0.1
0.05
95 105
0
100 50 0 50 100
Frequency (Hz)
Periodic Waveforms
We have been talking about signals composed of multiple
sinusoids, but until now we have not mentioned anything
about these signals being periodic
Recall that a signal is periodic if there exists some T 0 such
that x t + T 0 = x t
The smallest T 0 that satisfies this condition is the funda-
mental period of x t
Example: x t = 2 cos 28t cos 210t
Expanding we have
x t = cos 218t + cos 22t , (3.19)
which has component sinusoids at 2 Hz and 18 Hz
The fundamental period is T 0 = 0.5 s, with
f 0 = 1 T 0 = 2 Hz being the fundamental frequency
Since 18 = 9 2 , we refer to the 18 Hz term as the 9th har-
monic
f k = mf 0 , m an integer, k = 1 2 N , or in mathematical
terms the greatest common divisor
f 0 = gcd f k k = 1 2 N (3.21)
In the example with f 1 = 2 and f 2 = 18 the largest divisor
of {2,18} is 2, since 2/2 and 18/2 both result in integers, but
there is no larger value that works
Example: Suppose f k = 3 7 9 Hz
The fundamental is f 0 = 1 Hz since 7 is a prime number
Nonperiodic Signals
In the world of signal modeling both periodic and nonperi-
odic signals are found
In music, or least music that is properly tuned, periodic sig-
nals are theoretically what we would expect
It does not take much of a frequency deviation among the
various components to make a periodic signal into a nonperi-
odic signal
Example: Three Term Approximation to a Square Wave1
1 1
x p t = sin 2 100 t + --- sin 2 300 t + --- sin 2 500 t
3 5
This signal is composed of 1st, 3rd, and 5th harmonic com-
ponents; fundamental is 100 Hz
0
Start Time of Each Strip
0.1
Clearly periodic
0.2
0.3
0.4
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (s)
1/3*sin(2*pi*sqrt(89999)*t)+...
1/5*sin(2*pi*sqrt(149999)*t);
>> strips(x_nper,.1,50*500)
>> xlabel('Time (s)')
>> ylabel('Start Time of Each Strip')
0
Start Time of Each Strip
0.1
0.2
0.3
0.4
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (s)
0.4
Magnitude
0.3
0.2
0.1
0
600 400 200 0 200 400 600
Frequency (Hz) 300 500
0.4
Magnitude
0.3
0.2
0.1
0
600 400 200 0 200 400 600
89999 249999
Frequency (Hz)
Fourier Series
Through the study of Fourier1 series we will learn how any peri-
odic signal can be represented as a sum of harmonically related
sinusoids.
The synthesis formula is
j 2 T 0 kt
xt = ak e (3.22)
k =
where T 0 is the period
The analysis formula will determine the a k from x t
1. French mathematician who wrote a thesis on this topic in 1807.
2k
j --------- t + T 0
T0
vk t + T0 = e
2k 2k
j --------- t j --------- T 0
T0 T0
= e e
2k 1
j --------- t
T 0 j2k
= e e
= vk t
Orthogonality Property
T0
0, k l
0 v k t v *l t dt =
T0 , k = l
(3.27)
Note:
v *l t = exp j 2l T 0 t * = exp j 2l T 0 t
Proof:
2- kt j 2
------ lt
T0 T 0 j -----
T0 T0
0 vk t vl t dt = 0 e
* e dt
2- k l t
T 0 j -----
T0
= 0 e dt
2- k l t
T 0 j -----
T0 T0 T0
j0
0 e dt = 0 e dt = 0 dt = T0
When k l , but rather some integer, say m, we have
2- k l t 2- mt
T 0 j -----
T0 T 0 j -----
T0
0 e dt = 0 e dt = 0
2- kt j 2
------ lt
T 0 j -----
T0 T0
= a k 0 e e dt
k =
or
2
T0 j ------ lt
1 T0
a l = -----
T0 0 x t e dt
Summary
2
T0 j ------ kt
1 T0
a k = -----
T0 0 x t e dt Analysis
(3.28)
j 2 T 0 kt
xt = ak e Synthesis
k =
2
Example: x t = cos 2 1500 t
This signal has a Fourier series representation that we can
2
obtain directly by expanding cos
2
2 e j21500t + e j 21500t
cos 2 1500 t = --------------------------------------------------
2
j23000t j 23000t
e +2+e
= -----------------------------------------------------------
4
1 1 j23000t 1 j 23000t
= --- + --- e + --- e
2 4 4
1 2, k = 0
ak = 1 4 , k = 2
0, otherwise
Magnitude Spectrum 1
f 0 = ----- = 1500 Hz
1/2 T0
1/4 1/4
f (Hz)
-3000 0 3000
1
a0 = 1 2
t
T0 T 0 T0 T0 3T 0
-----0- ------ ---------
2 2 2
T0 2 (3.32)
j 2 T 0 kt jk
1 e 1e
= ----- ----------------------------- = --------------------
T 0 j 2 T 0 k j2k
0
j
Notice that e = 1 , so
k
1 - for k 0
a k = 1--------------------- (3.33)
j2k
and for k = 0 we have
1 T0 2
dt = 1--- (DC value)
j0
a 0 = -----
T0 0 1 e
2
(3.34)
0.1
... ...
0
15 10 5 0 5 10 15
Frequency (Hz)
1
Phase (rad)
...
0
...
Square wave
1 Phase
Line Spectra
15 10 5 0 5 10 15
Frequency (Hz)
if nargin < 5,
tstart = 0;
end
t = tstart:1/fs:dur;
x = zeros(size(t));
for k=1:length(fk)
x = x + ak(k)*exp(j*2*pi*fk(k)*t);
end
The code used to produce simulation results for x 15 t :
>> N = 15; k = -N:2:N;
>> ak = 1./(j*pi*k);
>> fk = 1*[0 k];
>> ak = [1/2 ak];
>> [x,t] = fs_synth(fk, ak, 50*15, 3);
>> plot(t,real(x)) % note x is not purely real
>> grid % due to numerical imperfections
>> xlabel('Time (s)')
>> ylabel('Amplitude')
1.2
x 15 t f 0 = 1 Hz
0.8
Amplitude
0.6
0.4
0.2
N = 15
0.2
0 0.5 1 1.5 2 2.5 3
Time (s)
2
N = 3
1
x3(t)
1
0 0.5 1 1.5 2 2.5 3
2
N = 7
1
x7(t)
1
0 0.5 1 1.5 2 2.5 3
2
N = 15
1
x15(t)
1
0 0.5 1 1.5 2 2.5 3
Time (s)
x lim t Bandpass
xt Filter yt
at 3f0
Limiter
Line Line Line
Spectra Spectra Retain Spectra
This
f f f
f0 f0 3f 0 3f 0 3f 0 3f 0
Triangle Wave
Another waveform of interest is the triangle wave
2t T 0 , 0 t T0 2
xt = (3.36)
2 T0 t T0 , T0 2 t T0
xt one period
a0 = 1 2
T0 T T0 T0 3T 0 t
-----0- 0 ------ ---------
2 2 2
We use the Fourier analysis formula to obtain the a k coef-
ficients, starting with the DC term
T0
1 1 1 T0
a 0 = ----- 0 x t dt = ----- area = ----- ----- = 1--- (3.37)
T0 T0 T0 2 2
The remaining terms are found using integration
T0 2
1 2t j 2 T 0 kt
a k = -----
T0 0 -----
T
0
e dt
(3.38)
1
T0
2 T 0 t j 2 T 0 kt
+ -----
T0 ---------------------
T0 2 T 0
e
dt
1 2t 2 T
I1 Integrate Exp k t, t, 0,
T T T 2
k 1 k k
2 k2 2
1 2T t 2 T
I2 Integrate Exp k t, t, , T
T T T 2
2 k 1 k 1 k
2 k2 2
ak FullSimplifyI1 I2
2-
k k
---------- , k = 1 3 5
1 1 1 = k
2 2
a k = ---------------------------------------- (3.39)
2 2
k 1 2, k = 0
0, k = 2 4 6
k k
since 1 1 1 = 2 when k is odd and zero other-
wise
0.3
0.2
0.1
0
15 10 5 0 5 10 15
Frequency (Hz)
0.5 f0 = 1
Triangle Wave
0.4
Magnitude
0.3
0.2
0.1
0
15 10 5 0 5 10 15
Frequency (Hz)
2
Note that the spectral lines drop off with 1 k for the trian-
gle wave, compared with just 1 k for the square wave
1
N = 3 f0 = 1
x3(t)
0.5
0
0 0.5 1 1.5 2 2.5 3
1
N = 7
x7(t)
0.5
0
0 0.5 1 1.5 2 2.5 3
1
N = 15
x15(t)
0.5
0
0 0.5 1 1.5 2 2.5 3
Time (s)
9%
9%
For the square wave the maximum error is always 1/2 the size
of the jump, and the overshoot, either side of the jump, is
always 9% of the jump
TimeFrequency Spectrum
The past modeling and analysis has dealt with signals having
parameters such as amplitude, frequency, and phase that do
not change with time
Most real world signals have parameters, such as frequency,
that do change with time
Stepped Frequency
A piano has 88 keys, with 12 keys per octave
An octave corresponds to the doubling of pitch/frequency
From one octave to the next there are 8 pitch steps, but
there are also half steps (flats and sharps)
Note Name C4 D4 E4 F4 G4 A4 B4 C5
Note Number 40 42 44 45 47 49 51 52
one octave
523 Hz
Theoretical 494
Time-Frequency 440
Plot 392
349
330
294
262 Hz
Spectrogram Analysis
The spectrogram is used to perform a timefrequency analy-
sis on a signal, that is a plot of frequency content versus time,
for a signal that has possibly time-varying frequencies
When using MATLABs signal processing toolbox, the func-
tion specgram() and spectrogram() are available for
this purpose
The spfirst toolbox also has the function plotspec()
Both specgram() and plotspec() plot frequency versus
time, whereas spectrogram() plots time versus frequency
The basic function interface to specgram() and plotspec is
>> specgram(x,N_window,fsamp)
>> plotspec(x,N_window,fsamp)
where N_window is the length of the spectrum analysis
window, typically 256, 512, or 1024, depending upon the
desired frequency resolution and the rate at which the fre-
quency content is changing
ECE 2610 Signals and Systems 339
TimeFrequency Spectrum
1000
900
800
700
Frequency (Hz)
600
500
400
300
200
100
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (s)
1 d t
f i t = ------ -------------- = f 0 Hz (3.44)
2 dt
The function t can take on different forms, but in particu-
lar it may be quadratic, i.e.,
2
t = 2t + 2f 0 t + rad (3.45)
which has corresponding instantaneous frequency
f i t = 2t + f 0 Hz (3.46)
In this case we have a linear chirp, since the instantaneous
frequency varies linearly with time
Example: Chirping from 100 to 1000 Hz in 1 s
The beginning and ending times are t 1 = 0 s and t 2 = 1 s
We need to have
f i 0 = f 0 = 100 Hz
(3.47)
f i 1 = 2 1 + 100 = 1000 Hz
so = 900 2 = 450
Finally,
f i t = 900t + 100 Hz 0 t 1 s (3.48)
The phase, t , is
2
t = 2 450t + 2 100t + rad (3.49)
We can implement this in MATLAB as follows:
>> t = 0:1/8000:1;
0.1
0.2
Start Time of Each Strip (s)
0.3
0.4
0.5
0.6
0.7
0.8
0.9
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
Time (s)
4000
3500
3000
Frequency (Hz)
2500
2000
1500
1000 1000
500
100
0
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Time (s)
Summary
The spectral representation of signals composed of sums of
sinusoids was the main focus of this chapter
The two-sided line spectra is the means to graphically display
the spectra
The concept of fundamental period and frequency was intro-
duced, along with harmonic number
The Fourier series was found to be a power tool for both anal-
ysis and synthesis of periodic signals