Problem:2
a)For N=6
1)Function script:(save it as ctfss.m and negelct the error during execution)
function [y,t]=ctfss(an,T,N)
k=0;
w0=2*pi/T;
n=-N:1:N
for t=0:0.01:T
k=k+1;
xN(k)=sum(an.*(exp(j*n*w0*t)));
end
t=0:0.01:T
y=xN
endfunction
2)MAIN SCRIPT: save it in any name as you wish and execute after the execution of ctfss,m
clc;
clear all;
close all;
T=4;t=0:0.01:T;A=10;
x=(A*(1-(t/4)))
t1=linspace(-20,20,10*length(t))
x1=[x x x x x x x x x x]
subplot(3,2,[1,2])
plot(t1,x1,'r')
xlabel('t')
ylabel('x(t)')
title('Periodic signal x(t)')
subplot(323)
plot(t,x,'r')
xlabel('t')
ylabel('x(t)')
title('one period of x(t)')
%To caclculate fourier series coefficients of x(t)
w0=2*pi/T;N=6
t=0:0.01:T
k=0;
for n=-N:1:N
k=k+1;
a(k)=(trapz(t,x.*exp(-j*n*w0*t)));
end
a=a/T
n=-N:1:N
subplot(324)
stem(n,abs(a))
title('Amplitude spectra')
xlabel('k..>')
ylabel('|ak|')
subplot(325)
stem(n,angle(a))
title('Phase spectra')
xlabel('k..>')
ylabel('<ak>')
%output xN(t) for N=6
[xN,t]=ctfss(a,T,N)
subplot(326)
plot(t,xN,'r',t,x,'b')
title('xN(t) for N=6')
xlabel('t')
ylabel('xN(t)')
b)N=64
clc;
clear all;
close all;
T=4;t=0:0.01:T;A=10;
x=(A*(1-(t/4)))
t1=linspace(-20,20,10*length(t))
x1=[x x x x x x x x x x]
subplot(3,2,[1,2])
plot(t1,x1,'r')
xlabel('t')
ylabel('x(t)')
title('Periodic signal x(t)')
subplot(323)
plot(t,x,'r')
xlabel('t')
ylabel('x(t)')
title('one period of x(t)')
%To caclculate fourier series coefficients of x(t)
w0=2*pi/T;N=64
t=0:0.01:T
k=0;
for n=-N:1:N
k=k+1;
a(k)=(trapz(t,x.*exp(-j*n*w0*t)));
end
a=a/T
n=-N:1:N
subplot(324)
stem(n,abs(a))
title('Amplitude spectra')
xlabel('k..>')
ylabel('|ak|')
subplot(325)
stem(n,angle(a))
title('Phase spectra')
xlabel('k..>')
ylabel('<ak>')
%output xN(t) for N=64
[xN,t]=ctfss(a,T,N)
subplot(326)
plot(t,xN,'r',t,x,'b')
title('xN(t) for N=64')
xlabel('t')
ylabel('xN(t)')
Problem 2: A periodic signalxit) is shown below A =10, T-4 sec. -T Write a MATLAB script to plot ...
A periodic signal, x(t) is shown below. A = 10, T-4 sec. -T Write a MATLAB script to plot the signal, using enough points to get a smooth curve. Compute the Fourier series coefficients for the signal (if you can find them in the text, that is ok). Plot the single-sided or double-sided spectra for each signal. Include enough frequencies in the plots to adequately represent the frequency content of the signals. Plot partial sums of the Fourier series for...
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 send the Matlab code 2. Compute the Fourier series coefficients for x(t) using MATLAB and plot the double-sided spectra up to the 10th harmonic. (20 points) 수 x(t) -10 10 20 30
PLZ shows you Matlab Code X(t) 2 2 46 1. compute the Fourier Series coefficients, ck for the signal x(t) 2. plot magnitude of c and the phase of ck in separate plots (use subplot command) plot the Fourier Series coefficients for the square wave signal: ck(12/9) sinc(2"k/3)
Part 1: Exponential Fourier series The following MATLAB code calculates the exponential Fourier series coefficient for the signal x(t) shown in the figure below, plots it's double sided amplitude spectrum IDn l, double sided phase spectrem LDn, and the resulting signal xn(t). 4r 4a Periodic signal x(t) 1.1 Show that the complex Fourier Series Coefficients written as: D 1.2 Use the following Matlab to general the two sided spectral line. 1.3 Execute the Matlab code with To = 2π and...
During lab 4, we have seen numerical implementation of Fourier Series for periodic signals. As first part of this assignment, you need to write a Matlab function that would take an array representing a single period of a signal (x), corresponding time array (t), and return the Fourier Series coefficients (Ck) in exponential form. The function should also be able to take two (2) optional input arguments: number of Fourier coefficients (Nk) and plot option (p). Use the template ‘fourier_series_exp.m’...
Question 3 (30 points) Consider the signals defined below: *:(t) = cos(2) xz(t) = cos(4+) a) Determine the fundamental period for each signal. b) Determine the fundamental period and fundamental frequency of the signal: y(t) = x;(C)x(0) (t) and x2(c) when the fundamental frequency is c) Determine the Fourier Series coefficients of defined as determined in part (b). d) Using Parseval's relation, determine the power of xy(t) and xy(t) e) Determine and plot the Fourier Series Coefficients of y(t). Show...
Q1) For the periodic signals x() and ) shown below: x(t) YCO y(t) a) Find the exponential Fourier series for x(t) and y). b) Sketch the amplitude and phase spectra for signal x(). c) Use Parseval's theorem to approximate the power of the periodic signal x() by calculating the power of the first N harmonics, such that the strength of the Nth harmonic is 10% or more of the power of the DC component. Q1) For the periodic signals x()...
Questions a) Write a (Matlab) function, which accepts the following inputs: -the finite set of Fourier series coefficients a-N, a-N+1,.. , a-1, ao, a1, aN-1, aN the fundamental period T of the signal to be reconstructed a vector t representing the times for which the signal will be constructed - and produces as output xv(t) (i.e., the output of the (Matlab) function should be a vector x of length equal to the length of t containing the values of xN...
SIGNALS AND SYSTEMS: PLEASE UPLOAD MATLAB CODING FOR QUESTIONS. 1. In class we found that the Fourier series of a unit amplitude square wave of period 2 seconds was given by (a) Show that this series can be rewritten as 0o 2 (b) Produce plots of x (t) for n-1 to N for N-1,3,9,19,and 199, that is, truncate the infinite sum to these values of N and plot the result. Remember that only odd terms are included in the sum...