Fourier and Laplace
391
−2
−1
0
1
2
time (in sec)
0.2
−0.2
0
Fifth harmonic
Third harmonic
0.5
−0.5
−2
−1
0
0
1
2
−2
−1
0
1
2
1
−1
0
Fundamental frequency
DC component
Second harmonic
2
1
−1
0
Amplitude (FO)
Amplitude of F2
Amplitude of F3
Amplitude of F5
Amplitude of F4
Amplitude of F1
−2
0
1
2
5
−5
−5
0
−2
−2
−1
−1
−1
0
1
0
1
2
Fourth harmonic
5
0
2
time (in sec)
× 10 −17
× 10 −17
FIGURE 4.40
Plots of part a of Example 4.4.
disp(‘ ’);
syms x;
intft = 1/2*int(‘Heaviside(x+.5)’,-.5,.5);
Pavesym = vpa(intft);
disp(‘ ’);
disp(‘*********************************’);
disp(‘ ’);
disp(‘The average power using integration in time is:’);
vpa(intft)
disp(‘ ’);
disp(‘*********************************’);
disp(‘ ’);
disp(‘The percentage error is :’); % parts (2g)
error = (Pavesym-Pave)*100/Pavesym;disp(error)
disp(‘ ’);disp(‘**********************************’);
The script fi le Fourier_series is executed and the results are as follows:
>> Fourier _ series
*************************************************
Verification of Parseval’s theorem
*************************************************
The average power using summation of Fn (coefficients) is:
0.4833
*************************************************
The average power using integration in time is:
ans =
.50000000000000000000000000000000
*************************************************
The percentage error is :
3.3472238873502480061006281175660
**************************************************
CRC_47760_CH004.indd 391
CRC_47760_CH004.indd 391
7/28/2008 12:26:10 PM
7/28/2008 12:26:10 PM
391
−2
−1
0
1
2
time (in sec)
0.2
−0.2
0
Fifth harmonic
Third harmonic
0.5
−0.5
−2
−1
0
0
1
2
−2
−1
0
1
2
1
−1
0
Fundamental frequency
DC component
Second harmonic
2
1
−1
0
Amplitude (FO)
Amplitude of F2
Amplitude of F3
Amplitude of F5
Amplitude of F4
Amplitude of F1
−2
0
1
2
5
−5
−5
0
−2
−2
−1
−1
−1
0
1
0
1
2
Fourth harmonic
5
0
2
time (in sec)
× 10 −17
× 10 −17
FIGURE 4.40
Plots of part a of Example 4.4.
disp(‘ ’);
syms x;
intft = 1/2*int(‘Heaviside(x+.5)’,-.5,.5);
Pavesym = vpa(intft);
disp(‘ ’);
disp(‘*********************************’);
disp(‘ ’);
disp(‘The average power using integration in time is:’);
vpa(intft)
disp(‘ ’);
disp(‘*********************************’);
disp(‘ ’);
disp(‘The percentage error is :’); % parts (2g)
error = (Pavesym-Pave)*100/Pavesym;disp(error)
disp(‘ ’);disp(‘**********************************’);
The script fi le Fourier_series is executed and the results are as follows:
>> Fourier _ series
*************************************************
Verification of Parseval’s theorem
*************************************************
The average power using summation of Fn (coefficients) is:
0.4833
*************************************************
The average power using integration in time is:
ans =
.50000000000000000000000000000000
*************************************************
The percentage error is :
3.3472238873502480061006281175660
**************************************************
CRC_47760_CH004.indd 391
CRC_47760_CH004.indd 391
7/28/2008 12:26:10 PM
7/28/2008 12:26:10 PM
