I. Harmonic Components of Periodic Signals

advertisement
ECE 2111 Signals and Systems
Spring 2013, UMD
Experiment 5: Fourier Series
Consider the continuous time signal given by
y(t) = A + A cos (2π f t + θ ) + A cos (4π f t + θ ) + A cos (6π f t + θ ) +…..
0
1
0
1
2
0
2
3
0
3
where A is the DC component of the signal, A are the amplitude of the harmonics, k is
0
k
the harmonic number, and θ are the phase angle of the harmonics. The expression for a
k
Fourier Series representation of a function signal x(t) with N harmonics is
The features of a signal given by this equation can be studied in terms of the frequency,
amplitudes, and phases of the sinusoidal terms. The amplitudes A , A , A , . . , A specify
1
2
3
n
the relative weights of the frequency components of the particular signal. These weights
are a major factor in determining the shape of the signal. The phase angle of a
trigonometric component controls the position of the component along the time axis.
In the first part of the experiment you will investigate the effect of the magnitude and
phase angle components. You will be asked to change the amplitude and phase values
and compare the resulting waveform to the original one.
I. Harmonic Components of Periodic Signals
Consider that signal
y(t) = A + A cos (2π f t + θ ) + A cos (4π f t + θ ) + A cos (6π f t + θ )
0
1
0
1
2
0
2
3
0
3
with period of T = 0.1 sec and the component values given in the following Table
0
1
a) Show the harmonic components and waveforms synthesized by using
2 and 3 harmonic components.
f0=10; % Define the frequency of the signal
t = 0:0.001:1;
harm1 = cos(2*pi*10*t);
harm2 = 2*cos(2*pi*20*t+45/180*pi);
signa2 = harm1 + harm2;
harm3 = 1*cos(2*pi*30*t+60/180*pi);
signa3 = signa2 + harm3
figure(1)
subplot(2,3,1); plot(t,harm1)
subplot(2,3,2); plot(t,harm2)
subplot(2,3,3); plot(t,harm3)
subplot(2,3,4); plot(t,signa2)
subplot(2,3,5); plot(t,signa3)
Now you will study the importance of the magnitude and the phase angle of each
harmonic component by changing them and comparing the resulting waveform to the
original one.
Lab report:
1)Labeled plots
b) Changing the magnitude of the harmonics
Change the magnitude of the second harmonic from A = 2 to A = 1.6, 1.2 and 1
2
2
respectively. Modify the MATLAB script of a).
Lab report:
2)Labeled plots (A =1.6, 1.2, 1)
2
3)Comment on the change of waveform shape
c) Changing the phase of the harmonics
o
o
o
o
Change the phase angle of the second harmonic from θ = 45 to θ = 35 , 25 , and 10
2
2
respectively. Modify the MATLAB script of a).
Lab report:
o
o
o
4)Labeled plots (θ =35 , 25 , 10 )
2
5)Comment on the change of waveform shape
d) Adding an harmonic to the signal y(t)
2
Using the original waveform with the three harmonics given in Table 1, create another
o
waveform by adding a 4th harmonic with a magnitude of 1.5 and a phase angle of 120 .
Lab report:
6)Labeled plots showing the signal containing the 4th harmonic
7)Comparison between the new signal and the original signal
II. Magnitude Spectra and the partial Fourier Series
Compute and plot the magnitude spectrum and the partial Fourier series sums of two
periodic signals: a square wave, and a triangular wave.
a) Magnitude Spectrum of a Square Wave
The following MATLAB script defines an odd square wave (period 1 sec, no DC level, 2
Vpp)
% Program to give partial Fourier sums of an
% odd square wave of 2 Vpp amplitude
n_max = input('Enter vector of highest harmonic values desired
(odd):');
f = 1;
N = n_max;
t = 0:0.002:1;
omega_0 = 2*pi*f;
x=zeros(size(t));
n=1:1:N;
b_n=zeros(size(n));
for i=1:(N+1)/2;
k=2*i-1;
b_n(k)=4/(pi*k);
% This part is for plotting the Magnitude spectrum
figure(1)
subplot(2,1,1),stem(b_n);
xlabel('Integer Multiple of Fundamental Frequency');
ylabel('Amplitude'),grid;
% This part is for plotting the partial Fourier sum
x=x+b_n(k)*sin(omega_0*k*t);
subplot(2,1,2),plot(t,x),xlabel('t'),ylabel('partial sum');
axis([0 1 -1.5 1.5]),text(0.05,-0.5, ['max.har.=',num2str(k)]);
grid;
end
Type the number of harmonics (e.g. 1, 3, up to 15) you want to plot, when you see the
following line as you run the program
Enter vector of highest harmonic values desired (odd):
The Fourier series components for this signal is a summation of odd harmonics of the
sine wave with a magnitude of 4/(πk) , where k is the harmonic number. Using
3
MATLAB compute the magnitude of the harmonics coefficients, that is, b , b , b , b ,…,
1
2
3
4
b . Plot the amplitude spectrum (line spectrum) of the square wave and plot the partial
n
Fourier sums starting from 1 harmonic till 15 harmonics.
Lab report:
8)Labeled plot(for 15 harmonics)
9)Find magnitude b , b , …, b in Workspace and put them down
1
2
15
10)Describe how the command a = input (‘b’) works
b) Magnitude Spectrum of a triangular Wave
The following MATLAB script defines a triangular wave (period 1 sec, no DC level, 2
Vpp)
% Program to give partial Fourier sums of a
% Triangular wave of 2 Vpp amplitude
n_max = input('Enter vector of highest harmonic values desired
(odd):');
f = 1;
N = n_max;
t = 0:0.002:1;
omega_0 = 2*pi*f;
x=zeros(size(t));
n=1:1:N
a_n=zeros(size(n));
for i=1:(N+1)/2;
k=2*i-1;
a_n(k)=8/(pi^2*k*k)
% This part is for plotting the Magnitude spectrum
figure(2)
subplot(2,1,1);
stem(a_n);
xlabel('Integer Multiple of Fundamental Frequency');
ylabel('Amplitude'),grid;
% This part is for plotting the partial Fourier sum
x=x+a_n(k)*cos(omega_0*k*t);
subplot(2,1,2),plot(t,x),xlabel('t'),ylabel('partial sum');
axis([0 1 -1.5 1.5]),text(0.05,-0.5, ['max.har.=',num2str(k)]),grid;
end
The Fourier series components for this signal is a summation of the harmonics of the
2 2
cosine wave with a magnitude of 8/(π k ) , where k is the harmonic number. Using
MATLAB compute the magnitude of the harmonics coefficients, that is, a , a , a , a ,…,
1
2
3
4
a . Plot the amplitude spectrum (line spectrum) of the square wave and plot the partial
n
Fourier sums starting from 1 harmonic till 15 harmonics.
Lab report:
11)Labeled plot (for 15 harmonics)
4
12)Find magnitude a , a , …, a in Workspace and put them down.
1
2
15
Report Requirements:
•
Individual lab report
•
Attached with the cover page (available on the website)
This lab report should contain the following:
1. Statement of the Problem: Define the problem and goals of the experiment.
2. Results: Points 1-12 given in the lab sheet above
3. Exercises: Attached
4. Conclusions: Give comments to the lab.
Exercises:
Connect the correct Fourier Series name with its corresponding representation:
Trigonometric
Complex Exponential
Compact
5
Download