0% found this document useful (0 votes)
48 views4 pages

Lab 07: CT-Fourier Series

This document discusses computing the Fourier series of a periodic square wave signal. It provides 3 problems: 1) plot the square wave signal, 2) compute the Fourier series coefficients for 11 values from 0 to 10, and 3) shift the signal amplitude by 1 and observe the effect on the Fourier series coefficients. Code is provided to generate the square wave signal, compute the Fourier series coefficients using integrals, and plot the original signal alongside the reconstructed signal from the Fourier series.

Uploaded by

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

Lab 07: CT-Fourier Series

This document discusses computing the Fourier series of a periodic square wave signal. It provides 3 problems: 1) plot the square wave signal, 2) compute the Fourier series coefficients for 11 values from 0 to 10, and 3) shift the signal amplitude by 1 and observe the effect on the Fourier series coefficients. Code is provided to generate the square wave signal, compute the Fourier series coefficients using integrals, and plot the original signal alongside the reconstructed signal from the Fourier series.

Uploaded by

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

Signals and Systems Lab DEE, FURC

Lab 07: CT-Fourier series

Consider a periodic square-wave function:

 A, 0  t  T0 / 2
f t   .
 A, T0 / 2  t  T0

Note that the square-wave function exhibits quarter-wave symmetry.


Furthermore, the function is periodic with period T0 .

Problem 1: plot f (t).

Problem 2: Compute the Fourier Series of f  t  in the exponential form for


11 values from 0 to 10.
Period (T0) = 2;
Amplitude (A) = 2;
no_of_points (len) = 400;

Problem 3: Shifting the function amplitude by one,


 A  1, 0  t  T0 / 2
f t   means that there won’t be any negative value in
 A  1, T0 / 2  t  T0
the graph, as the result, a0 is not zero here.

Answer:

% A script to compute Fourier Series coefficients of rectangular signal


%
% x(t) = A for 0=< t <1
% x(t) = -A for 1=< t <2

% x(t )  k
jkw0 t
ck e
 

% c k  1 / T0 T f (t )e
 jkw t
0
dt
0

% c0  1 / T0  f (t )dt
T0

echo off

1
Signals and Systems Lab DEE, FURC

clear all
close all
% A script to compute Fourier Series coefficients
of rectangular signal
% x(t) = A for 0=< t <1
% x(t) = -A for 1=< t <2

Problem 1:

A = 2;
T = 2;
len = 400; % play with this value
t = linspace(0, T, len); % or t = 0:0.005:2
f = A*[(t>0).*(t<1) - (t<2).*(t>1)];
% or f= 2*stepfun(1,t).*stepfun(t,0)-
2*stepfun(t,1).*stepfun(2,t)

figure(1)
plot(t,f);

Problem 2:

w0 = 2*pi/T;
c0 = (1/T)*sum((T/len)*f);

Note: T/len is the dt inside the integral. As we


know the integration of a signal is the area
underneath the waveform. So to find the integral we
will multiply the function ‘f’ with delta t(dt).

K = 10;
for k=1:K

c(k) = (1/T)*sum((T/len)*f.*exp(-j*k*(w0)*t)

end

figure(2)

2
Signals and Systems Lab DEE, FURC

k=0:K;
stem(k,[c0 abs(c)]);

x=c0;

for k = 1:K

x = x+c(k).*exp(j*k*(w0)*t);
end

figure(3)
plot(t,x)
grid

F = abs(fft(f))./(len); % changing to frequency


domain
figure(4)
plot(F)

Problem 3:

f = A*[(t>0).*(t<1) - (t<2).*(t>1)]+1;
figure(5)
plot(t,f);

c0 = (1/T)*sum((T/len)*f); %it is not zero here.


K = 10; % play with this value change it to 100,…

for k=1:K

c(k) = (1/T)*sum((T/len)*f.*exp(-j*k*(w0)*t));
end

figure(6)
k=0:K;
stem(k,[c0 abs(c)]);
x = c0;

3
Signals and Systems Lab DEE, FURC

for k = 1:K;
x = x+c(k)*exp(j*k*w0*t);
end

figure(7)
plot(t,x)
grid

F = abs(fft(f))./(len);
figure(8)
plot(F)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy