Professional Documents
Culture Documents
LAB EXPERIMENT # 07
Approximation of continuous-time periodic signals using Exponential Fourier
Series in MATLAB
OBJECTIVE:
This experiment aims to demonstrate approximations of periodic signals by truncated
exponential Fourier series. Using MATLAB students will plot the actual approximate
signals and observe, for large values of N, the Gibbs phenomenon at the jump
discontinuity points. In addition, students will use MATLAB to plot the system
frequency spectra and determine the average power from Parseval’s identity.
Fourier Series:
x ( t+T O ) =x ( t ) ∀ t
1
where T O is the fundamental period, and =f is referred as fundamental frequency.
To o
N
x N ( t )= ∑ c n e jnω t
o
n=−N
where c n are called exponential Fourier series coefficients and are given by:
❑
1
c n= ∫ x ( t ) e− jn ω t dt o
To T o
Fourier analysis is the study of the way general functions may be represented or
approximated by sums of simpler trigonometric functions. In the sciences and engineering,
the process of decomposing a function into simpler pieces is often called Fourier analysis,
while the operation of rebuilding the function from these pieces is known as Fourier
synthesis.
7-1
Parseval’s Identity
The Parseval’s identity states that the average power of a periodic signal x(t) with period T
equals the sum of the squares of the complex exponential Fourier series coefficients.
Mathematically,
❑ n =∞
1
∫ |x ( t )| = ∑ |c n|2
2
P x=
T T n=−∞
Example 1: Find the exponential form of the Fourier series for the periodic signal presented
in following figure. Use MATLAB to calculate the coefficients of the Fourier series N = 30.
Plot the amplitude and phase line spectra of the periodic signal. Determine the Fourier series
expansion and plot approximations x N ( t )) for N = 5, 10, 20 and 30. Observe the Gibbs
phenomenon and determine the average power.
a) Fourier Analysis
MATLAB Code
syms n t
T0 = 2;
w0 = (2*pi) / T0;
n = 1:5;
a0 = (1/T0) * int(1, t, 0, 1);
cn = (1/T0) * int(exp(-j*n*w0*t), t, 0, 1);
Output:
cn =
[ -1i/pi, 0, -1i/(3*pi), 0, -1i/(5*pi)]
b) Fourier Synthesis
For N = 5, Fourier synthesis of x(t) is given by:
7-2
Code
T0 = 2;
w0 = (2*pi) / T0;
N = 5;
t=-1:0.001:1;
x = a0;
for n = 1:N
x = x + cn(n)*exp(i*n*w0*t);
end
plot(t,x);
xlabel('time');
ylabel('Amplitude');
title('x_N(t)');
7-3
7-4
Lab Tasks:
Task 1: Find the exponential form of the Fourier series for the periodic signal presented in
following figure. Use MATLAB to calculate the coefficients of the Fourier series for n = 0, 1,
2 … N. Plot the approximations x N ( t )) for N = 1, 2, 5, 10, 30. Observe the Gibbs
phenomenon and determine the average power.
MATLAB Code:
syms n t
T0 = 1;
w0 = (2*pi) / T0;
n = 1:5;
a0 = (1/T0) * int(1,t,-0.25,0.25);
cn = (1/T0) * int(1*exp(-i*n*w0*t),t,-0.25,0.25);
T0 = 1;
w0 = (2*pi) / T0;
N = 5;
t=-1:0.001:1;
x = a0;
for n = 1:N
x = x + cn(n)*exp(i*n*w0*t);
end
plot(t,x);
xlabel('time');
ylabel('Amplitude');
title('N=5');
7-5
Output:
Task 2: Find the exponential form of the Fourier series for the periodic signal presented in
following figure. Use MATLAB to calculate the coefficients of the Fourier series for n = 0, 1,
2 … N. Plot the approximations x N ( t )) for N = 5, 10, 25, 50. Observe the Gibbs phenomenon
and determine the average power.
MATLAB Code:
syms n t
T0 =2*pi;
w0 = (2*pi) / T0;
n = 1:5;
a0= (1/T0) * [int(t,t,0,pi)+int((t-2),t,pi,2*pi)];
cn = (1/T0) * [int(t*exp(-i*n*w0*t),t,0,pi)+int((t-2)*exp(-i*n*w0*t),t,pi,2*pi)];
T0 = 2*pi;
w0 = (2*pi) / T0;
N = 5;
7-6
t=-1:0.001:1;
x = a0;
for n = 1:N
x = x + cn(n)*exp(i*n*w0*t);
end
plot(t,x);
xlabel('time');
ylabel('Amplitude');
title('N=5');
Outputs:
7-7