lab 6

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Title:

Laboratory Report on Fourier Series Representation of Basic Signals and Addition of


Periodic Signals in MATLAB

Objective :

This laboratory report investigates the Fourier Series Representation of basic signals such as
square waves, triangular waves, and the addition of periodic signals in MATLAB. The
primary objective is to understand how to represent periodic signals using Fourier series and
to analyze the combined signals when they are added together. MATLAB is used as the
primary tool for signal generation, Fourier analysis, and visualization.

Introduction:

The Fourier series is a powerful mathematical tool for representing periodic signals in the
frequency domain. It allows us to break down complex signals into simpler sinusoidal
components, making it easier to analyze and manipulate them. In this laboratory experiment,
we will explore the representation of basic signals and examine the results of adding periodic
signals using MATLAB.

Experimental Setup & Procedure :

The experimental setup consists of MATLAB as the main tool for signal generation, Fourier
analysis, and visualization. The following sections outline the steps involved in this
experiment:

Fourier Series Representation of Square Wave Signal:

In this section, we aim to represent a square wave signal using the Fourier series. The
MATLAB code provided below is used to generate the representation and plot the results.

MATLAB code for Fourier Series Representation of Square Wave Signal:

clc; clear all ;

t=linspace(-2,2,10000);

f=0;

for k=1000:1000

if k==0
continue;

end

a=((1)/(pi*k*1i)*(1-(exp(-pi*1i*k))));

x=a*exp(2*pi*1i*k.*t);

f=f+t;

end

plot (t,f)

title (‘Furier series representation of squqre wave signal’)

grid on;

grid mirror;

xlabel (‘t’);

ylabel (‘f(t)’);

Output visualization :
Fourier Transform:

This section investigates the Fourier Transform of an unspecified signal. The provided code is
designed for the Fourier Transform; however, the nature of the signal is not specified. You
can modify this section as needed, replacing the signal with one of your choice.

MATLAB code for Fourier Transform:

clc; clear all ;

x=0;

k=1;

t=-2:0.001:2;

for f=-5:0.001:5;

x(k)=trapz(t,exp(-1i*2*pi*f*t));

k=k+1;

end

f=-5:0.001:5;

plot (f,x)

title (‘Furier Transform’)

grid on;

grid mirror;

Output visualization :
Addition of Periodic Signals:

This section explores the addition of two periodic signals. The MATLAB code provided is
intended to represent the sum of two cosine signals in the frequency domain.

MATLAB code for Addition of Periodic Signals:

clc; clear all ;

x=0;

k=1;

t=-2:0.001:2;

for f=0:800;

x(k)=trapz(t,cos(2*pi*100*t).*exp(-1i*2*pi*f*t))+trapz(t,cos(2*pi*500*t).*exp(-
1i*2*pi*f*t));
k=k+1;

end

f=0:800;

plot (f,x)

title (‘Furier Transform’)

grid on;

grid mirror;

Output visualization :

Fourier Series Representation of Triangular Signal:

In this section, we focus on the representation of a triangular signal using the Fourier series.
The provided code is used to generate the representation and plot the results.
MATLAB code for Fourier Series Representation of Triangular Signal:

clc; clear all ;

x=0;

k=1;

t=-20:0.001:2;

f=0;

for k=-200:200;

if k==0

continue;

end

a=(-1(2*pi))*(((pi*exp(-1j*k*pi))/(1j*k))+((exp(-1j*k*1j*k)));

x=a*exp(1j*k.*t);

f=f+x;

end

f=-5:0.001:5;

plot (t,f)

title (‘Furier series representation of Triangular signal’)

grid on;

grid mirror;
Output visualization :

Results and Analysis:

This section discusses the results obtained from the MATLAB simulations in each of the
above sections. It includes the time domain and frequency domain plots, highlighting the key
observations and findings. Specifically, you can discuss:

- The accuracy of Fourier series representation in capturing the characteristics of the square
wave and triangular wave signals.

- The frequency components revealed by the Fourier Transform.

- The impact of adding periodic signals and how the frequency domain representation
changes.
Conclusion:

In conclusion, this laboratory experiment demonstrates the utility of Fourier series in


representing basic signals and analyzing the addition of periodic signals. MATLAB serves as
an invaluable tool for signal processing and visualization, enabling a better understanding of
signal analysis techniques.

You might also like