Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The objective of this home work is to use Matlab to find Fourier Series Coeffici

ID: 2249377 • Letter: T

Question

The objective of this home work is to use Matlab to find Fourier Series Coefficients for a given signal and then to use inverse Fourier Series Transform to recover the signal in time domain from the Fourier Coefficients. Follow the Example 3.19.2 on page 315 of the text book to find the Fourier Coefficient for the following signal. You will use the function fit to accomplish this. x[n]-1+sin(nt /12+3/8) Then use the function ifft to reconstruct the original signal from the Fourier Coefficients. 2. Use Matlab and find the Fourier Coefficients for the following signals. r[n] -2sin(4mn) + cos(10 n ) + 1 19 Use the function Fourier Coefficients. to determine the signal in the time domain for the following X[k] cos(i') = 4 19 19

Explanation / Answer

Please find the matlab code for the three questions. I have provided 3 seperate codes, one for each question. If you have found the answer helpful, please give a thumbs up rating. Thanks. Please copy the codes and run to generate all figures.

*************************Matlab code for q1***********************

n=0:0.1:50;
x = 1+sin((n*pi/12)+(3*pi/8)); % definition of signal x
subplot(3,1,1)                  % to draw 3 plots in one window
plot(n,x)                       % plotting original signal in 1st figure
grid;
title('Signal x')
xlabel('t');
ylabel('x');

subplot(3,1,2)                  % preparing 2nd figure
x_fft = fft(x);
L=length(x);
plot(abs(x_fft)/L)              % plotting magnitude of fft
grid;
title('FFT of x')
xlabel('k');
ylabel('X(k)')

subplot(3,1,3)                  % preparing 3rd figure
x_1 = downsample(ifft(x_fft),10); % downsampling by original value of samples/sec = 10, to plot from 1 till 50.
plot(x_1)                       % plotting reconstructed signal from ifft
xlim([1 50]);
grid;
title('Reconstructed signal from fft')
xlabel('n');
ylabel('x')

*************************************Matlab code for q2*****************************

n=0:0.1:50;
x = 2*sin(4*n*pi/19)+cos(10*pi*n/19)+1; % definition of signal x
y = cos((6*pi*n/17)+(pi/3));             % definition of signal y
subplot(2,2,1)                           % to draw 4 plots in one window
plot(n,x)                                % plotting signal x in 1st figure
grid;
title('Signal x')
xlabel('t');
ylabel('x');
xlim([0 50])

subplot(2,2,2)                           % to draw 3 plots in one window
plot(n,y)                                % plotting signal y in 2nd figure
grid;
title('Signal y')
xlabel('t');
ylabel('y');
xlim([0 50]);

subplot(2,2,3)                  % preparing 3rd figure
x_fft = fft(x);
L=length(x);
plot(abs(x_fft)/L)              % plotting magnitude of fft
grid;
title('FFT of x')
xlabel('k');
ylabel('X(k)');
xlim([0 500])

subplot(2,2,4)                  % preparing 4th figure
y_fft = fft(y);
L=length(y);
plot(abs(y_fft)/L)              % plotting magnitude of fft
grid;
title('FFT of y')
xlabel('k');
ylabel('Y(k)');
xlim([0 500])

***********************************Matlab code for q3***************************

k=0:0.1:50;
x1 = cos(8*k*pi/21);            % definition of fft of x1
subplot(2,1,1)                  % to draw 2 plots in one window
plot(abs(ifft(x1)))             % plotting x1 in 1st figure
grid;
title('Signal x1')
xlabel('k');
ylabel('x1');

x2 = cos(10*k*pi/19) + 2*i*sin(4*pi*k/19);            % definition of fft of x2
subplot(2,1,2)                                      
plot(abs(ifft(x2))) % plotting x2 in 2nd figure
grid;
title('Signal x2')
xlabel('k');
ylabel('x2');

***************************************End********************************

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote