Experiment 7
Experiment 7
AIM: To analyze and reconstruct Exponential Fourier Series and compute its Fourier
coefficients, magnitude spectrum, and phase spectrum using MATLAB.
EQUIPMENTS:
Operating System – Windows XP
Constructor - Simulator
Software - MATLAB 2012a
Theory
Program:
% Exponential Fourier Series of a Continuous-Time Signal
clc;
clear;
close all;
for k = k_vals
% Integral over one period (numerical integration using trapz)
integrand = @(t) square(2*pi*t/T) .* exp(-1j*k*omega0*t);
C_k(k + N + 1) = (1/T) * integral(integrand, 0, T);
end
% Original signal
subplot(3,1,1);
plot(t, x_t, 'LineWidth', 1.5);
xlabel('Time (t)');
ylabel('x(t)');
title('Original Signal');
grid on;
PROCEDURE:
1. Open the Mat lab software by clicking on icon.
2. Create a new file (file🡪new🡪.m file).
3. Now type the program in that file.
4. Save the program as .m file(file🡪save)
5. Run the program(debug🡪run)
6. Observe the output plots.
RESULT: Exponential Fourier Series and compute its Fourier coefficients, magnitude spectrum, and
phase spectrum using MATLAB is observed.