In: Advanced Math
#1. Represent the function: e(t)=5sin31.4t+2sin44t+6sin15.74t+2sin37.68t as a discrete set of N=128 numbers seperated by a time increment of (1/N). Using MatLab construct an amplitude spectrum from the data set.
#2. Repeat problem #1 using a data set of 256 numbers at sigma(t)=(1/N) and sigma(t)=(1/2N) seconds. Please show the full code used in matlab to solve the problems.
%%Matlab code for plotting amplitude spectrum
clear all
close all
figure(1)
t=0:1/128:1;
e=5*sin(31.4*t)+2*sin(44*t)+6*sin(15.74*t)+2*sin(37.68*t);
stem(t,e)
title('Amplitude spectrum for N=128')
xlabel('t')
ylabel('e(t)')
figure(2)
t=0:1/256:1;
e=5*sin(31.4*t)+2*sin(44*t)+6*sin(15.74*t)+2*sin(37.68*t);
stem(t,e)
title('Amplitude spectrum for N=256')
xlabel('t')
ylabel('e(t)')
%%%%%%%%%% End of Code %%%%%%%%%