0% found this document useful (0 votes)
35 views

Evaluating Exponential Fourier Series: Registration No. 2017-EE-352, 362 (B) Marks

The document discusses exponential Fourier series as an alternative to trigonometric Fourier series. It provides the theory behind exponential Fourier series, including Euler's identity that relates exponential and trigonometric bases. MATLAB code is then presented to [1] plot the amplitude and phase spectrum of exponential Fourier series coefficients and [2] plot a truncated exponential Fourier series approximation compared to an exact function. The results demonstrate plotting the coefficient spectrum and approximating a pulse train function using exponential Fourier series in MATLAB.

Uploaded by

Ghaznooq Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Evaluating Exponential Fourier Series: Registration No. 2017-EE-352, 362 (B) Marks

The document discusses exponential Fourier series as an alternative to trigonometric Fourier series. It provides the theory behind exponential Fourier series, including Euler's identity that relates exponential and trigonometric bases. MATLAB code is then presented to [1] plot the amplitude and phase spectrum of exponential Fourier series coefficients and [2] plot a truncated exponential Fourier series approximation compared to an exact function. The results demonstrate plotting the coefficient spectrum and approximating a pulse train function using exponential Fourier series in MATLAB.

Uploaded by

Ghaznooq Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Registration No.

2017-EE-352, 362 (B)


Marks

Evaluating Exponential Fourier Series


Objective:
• To familiarize with different MATLAB commands
• To find exponential Fourier series coefficients in MATLAB
• To plot exponential Fourier series as an approximation to the function
Theory:
Trigonometric Fourier series uses integration of a periodic signal multiplied by sines and cosines
at the fundamental and harmonic frequencies. If performed by hand, this can a painstaking
process. Even with the simplifications made possible by exploiting waveform symmetries, there
is still a need to integrate cosine and sine terms, be aware of and able to exploit the tigonometrc
identities, and the properties of orthogonal functions before we can arrive at the simplified
solutions. However, by exploiting the exponential function eat, we can derive a method for
calculating the coefficients of the harmonics that is much easier to calculate by hand and convert
into an algorithm that can be executed by computer.
The Exponential Fourier Series uses, instead of the bases of the sines and cosines of the
Trigonometric Fourier Series, an equivalent bases of exponential functions. This bases may look
like

where, as before, w0 is the base frequency of the signal and j = √-1


The relationship between this bases and the previous trigonometric bases you just looked at is
due to the very important identity often called Euler's Equation:
ejθ = cos(θ) + j sin(θ) (where j= √-1)
By use of trig. identities, it is relatively straight forward to show that:

and

We can use this result to convert the Trigonometric Fourier Series into an Exponential Fourier
Series which has only one integral term to solve per harmonic.
Next, for any signal f(t) over [0,T0], or any periodic f(t) with period T0 we can compute the
Exponential Fourier Series. We begin by writing
since our basis set is now . We must find the D0 and Dn coefficients to find the EFS
of the signal f.
As before with trigonometric Fourier

Series and

Code:
Task 1: Code for plotting Amplitude and Phase spectrum

clear
nneg = -10:-1;
npos = 1:10;
Fnneg = (1./(1j*nneg*pi)).*(-3*exp(-
1j*nneg*6*pi/7)+2*exp(1j*nneg*2*pi/7)+exp(-1j*nneg*12*pi/7));
Fnpos = (1./(1j*npos*pi)).*(-3*exp(-
1j*npos*6*pi/7)+2*exp(1j*npos*2*pi/7)+exp(-1j*npos*12*pi/7));
F0 = 10/7;

n = [nneg,0,npos];
Fn = [Fnneg,F0,Fnpos];
figure(1)
subplot(2,1,1)
stem(n,abs(Fn))
xlabel('n')
ylabel('abs(Fn)')
subplot(2,1,2)

stem(n,angle(Fn))
xlabel('n')
ylabel('angle(Fn)')
figure(2)
subplot(2,1,1)
stem(n*(1/7),abs(Fn))
xlabel('f(Hz)')
ylabel('abs(Fn)')
subplot(2,1,2)
stem(n*(1/7),angle(Fn))
xlabel('f(Hz)')
ylabel('angle(Fn)')
Task 2: Code for plotting the truncated Fourier Series

clear
nneg = -30:-1;
npos = 1:30;
Fnneg = (1./(1j*nneg*pi)).*(-3*exp(-
1j*nneg*6*pi/7)+2*exp(1j*nneg*2*pi/7)+exp(-1j*nneg*12*pi/7));
Fnpos = (1./(1j*npos*pi)).*(-3*exp(-
1j*npos*6*pi/7)+2*exp(1j*npos*2*pi/7)+exp(-1j*npos*12*pi/7));
F0 = 10/7;

n = [nneg,0,npos];
Fn = [Fnneg,F0,Fnpos];
k = 0;
for t= -1:0.01:6
k = k+1;
fapprox(k) = sum(Fn.*(exp(1j*n*2*pi*t/7)))
end
t = -1:0.01:6
fexact = 4*(t<=3)-2*(t>=3)
plot(t,fapprox,t,fexact)

Results:

Figure 1 Amplitude and phase vs 'n' spectrum


Figure 2 Amplitude and phase vs frequency spectrum

Figure 3 Co-plot of truncated FS and pulse train

Conclusion:
In this lab we learned about, different commands of MATLAB to deal with Fourier Series. In
first task we found Fourier Series coefficients of a given waveform and plotted them with
MATLAB. In second task we used Fourier Series to approximate the function f(t) and then co-
plotted it with exact waveform of function f(t).
Reference:
1. https://cpjobling.github.io/EG-247-Resources/week5/exp_fs1.pdf
2. https://users.wpi.edu/~goulet/Matlab/overlap/efs.html

You might also like