Consider a pulse signal xt Acos0tutut Generate this signal
Consider a pulse signal x(t) = Acos(0t)(u(t)-u(t-)). Generate this signal (its discrete version) using MATLAB for arbitrary constants A (magnitude), 0 (frequency), and (duration). To illustrate correct functionality of your code, plot the signal x(t) for a few values of A, 0, and . Evaluate the Fourier transform of x(t) in MATLAB. Hint: since the signal you generated is actually discrete, you may use, for instance, the fft function. Plot magnitude and phase of FT for the same values of A, 0, and that you used before. What conclusions can you make based on the results you observed? Write a short report with the MATLAB codes you developed and the results you observed. Explain the procedure, discuss the results and conclusions.
Solution
close all;
clc;
t=0:0.05:2*pi;
x=cos(2*pi*t);
subplot(2,1,1);
plot(t,x);
xlabel(\'time\');
ylabel(\'amplitude\');
title(\'original signal\');
scale=3*sin(2*pi*t);
subplot(2,1,2);
plot(t,scale);
xlabel(\'time\');
ylabel(\'amplitude\');
