


1)matlab code and result
clear;clc;
%% for orignal time signal
T=1;%time period of signal
t=0:0.001:(T-0.001);%time index vector upto one period
t1=0:0.001:(2*T-0.001);%time index vector upto two period
xt=zeros(1,length(t));
%time signal over one period
xt(t>=0&t<T/4)=1;
xt(t>=T/4&t<T/2)=1-4*(t(t>=T/4&t<T/2)-T/4);
xt(t>=T/2&t<3*T/4)=8*(t(t>=T/2&t<3*T/4)-T/2);
xt(t>=3*T/4&t<T)=2-4*(t(t>=3*T/4&t<T)-3*T/4);
xt1=repmat(xt,1,2);%time signal over two periods
%% for approximation ofsignal X_N(t) N=2
N1=2;
K1=-N1:N1;
CK1=-(1-exp(-j*0.5*pi*K1)).*(1+3*exp(-j*pi*K1)).*(1./((pi*K1).^2));
CK1(K1==0)=1;
xN1=CK1*exp(j*pi*2*K1'*t1);
%% for approximation ofsignal X_N(t) N=5
N2=5;
K2=-N2:N2;
CK2=-(1-exp(-j*0.5*pi*K2)).*(1+3*exp(-j*pi*K2)).*(1./((pi*K2).^2));
CK2(K2==0)=1;
xN2=CK2*exp(j*pi*2*K2'*t1);
%% for approximation ofsignal X_N(t) N=20
N3=20;
K3=-N3:N3;
CK3=-(1-exp(-j*0.5*pi*K3)).*(1+3*exp(-j*pi*K3)).*(1./((pi*K3).^2));
CK3(K3==0)=1;
xN3=CK3*exp(j*pi*2*K3'*t1);
%% for signals plots
figure(1)
plot(t,xt)
title('plot of orignal signal X(t) over one period');
xlabel('time(second)');ylabel('X(t)');grid on;
figure(2)
plot(t1,xt1,t1,xN1)
title('plot of orignal signal X(t) and it''s aproximation for
N=2');
xlabel('time(second)');ylabel('magnitude');grid on;
legend('orignal X(t)','X_N(t) N=2');
figure(3)
plot(t1,xt1,t1,xN2)
title('plot of orignal signal X(t) and it''s aproximation for
N=5');
xlabel('time(second)');ylabel('magnitude');grid on;
legend('orignal X(t)','X_N(t) N=5');
figure(4)
plot(t1,xt1,t1,xN3)
title('plot of orignal signal X(t) and it''s aproximation for
N=20');
xlabel('time(second)');ylabel('magnitude');grid on;
legend('orignal X(t)','X_N(t) N=20');




Problem 2 Periodic Force First Cycle The graph at the right depicts the first period of a non-harmonic periodic force (measured in Newtons). This first cycle is described by the piecewise functio...
For the function y 1-x for 0 s x s 1 Graph the function's 3 periods 1) Find its formulas for the Fourier series and Fourier coefficients 2) Write out the first three non-zero terms of the Fourier Series 3) 4) Graph the even extension of the function 5) Find the Fourier series and Fourier coefficients for the even extension 6) Write out the first three non-zero terms of the even Fourier series 7) Graph the odd extension of the...
Problem 2: Consider the following periodic signals x(t), a square wave, and yt), a saw tooth 2T The pulses width of x(t) т, wave. Both have the same amplitude A and the same frequency - equal T. The duty-cycle of x(t) is defined as d- T. -A From tables of Fourier Series ofvarious periodic signals, the following formulas are given for your convenience x(= Ad+2Adnacos at+2Ad sna cos 2at+2Adl sun 3xdcos3at яd 2лd Зяd 24 (sin a 1 sin 2asin3ajain...
1. Using the Fourier series analysis Equation 3 for the periodic function r(t) shown in Figure 2.1, determine both the DC coefficient ao and a general expression for the other Fourier series coefficients ak. Do this by hand, not in Matlab. Show all your work in your lab report. You can add these pages as hand-written pages, rather than typing them in to your lab report, if you prefer Hint 1: It will be easiest to integrate this function from...
Use MATLAB to :
("j" is the imaginary number.) The term lo is the fundamental frequency of the periodic signal, 2/T, where T is the period. Frequencies nlo, where n is an integer, are the harmonics. This infinite sum is an exact representation of the original function. If we use a finite sum, where n goes from -N to N, we will get an approximation "X-(t)". In this problem we will calculate and plot the Fourier series representation of a...
Please answer "b" only.
%Example code
function plotFS(m);
%m = user provided number of terms desired in the Fourier series;
%this code computes the Fourier series of the function
%f(x)=0, for -pi<= x <0,
% =cos(x) for 0<= x <pi
%generate the interval from -pi to pi with step size h;
h = pi/100;
xx1=[-pi:h:0];
xx2=[0:h:pi];
xx = [xx1, xx2];
%generate the given function f so that it can be graphed
ff = [zeros(size(xx1)), cos(xx2)];
%compute the first partial sum...