PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

386 Practical MATLAB® Applications for Engineers


Example 4.3

Let the FS expansion for a periodic sawtooth wave be given by

ft()


 11
1

6
 n nw t^0
n

∑ sin ( )
(same as in Example 4.2)

with period T = 2 s, and fundamental frequency given by w 0 = 2 π/T = π.
Let f(t) represent the voltage drop across a resistor R = 5 Ω. Create the script fi le
Fourier_ applic that returns the following:


  1. The fi rst 10 FS coeffi cients

  2. Its RMS value

  3. The percentage of the total harmonic distortion

  4. The average power dissipated by R = 5 Ω

  5. The power concentrated in the fi rst 10 harmonics

  6. The plot of the percentage of total power (dissipated) versus its harmonic
    frequencies

  7. Check the % of total power dissipated in the fi rst 10 harmonics.
    MATLAB Solution
    % Script file: Fourier _ applic
    % Calculations of the Fourier coefficient
    for n = 1:10;
    c(n) = -1/(n*pi);
    p(n) = c(n).^2;
    end
    C = c;
    % RMS calculations


FIGURE 4.37
Plots of part e of Example 4.2.


error1(t) = sawtooth wave-harmonics 1

error3(t) = sawtooth wave-harmonics 1,2,3

error5(t) = sawtooth wave-harmonics 1,2,3,4,5

error2(t) = sawtooth wave-harmonics 1,2

error4(t) = sawtooth wave-harmonics 1,2,3,4

error6(t) = sawtooth wave-harmonics 1,2,3,4,5,6

0.5

0.5

−0.5

−0.5

0

0

0.5

−0.5

0

0.5

−0.5

0

0.5

−0.5

0

0.5

−0.5

0

Amplitude

Amplitude

Amplitude

Amplitude

Amplitude

Amplitude

01 2 3 4

01 23 4

01 23 4
time (in sec) time (in sec)

0123 4

0123 4

0123 4
Free download pdf