hi, John,
You can compute theirs spectrums , the only thing you need is the sample rate , here is an example :
1) Functions :
K=2.33;
A=1.45;
Fs=20;
t=0:1/Fs:10;
a=0.45;
u=@(t) cos(t)
f1=K*t.*(u(t+a/2)-u(t-a/2));
f2=A*cos(pi*t/2).*(u(t+2)-u(t-2));
f3=A*exp(-2*(t-1)).*u(t-1);
figure, plot(t,f1,t,f2,'r',t,f3,'g'), legend('f1','f2','f3');
grid on,
2) Spectrums :
n=length(f1);
N=ceil(log2(n));
F1=fft(f1,2^N);
F2=fft(f2,2^N);
F3=fft(f3,2^N);
Freq=(Fs/2^N)*(0:2^(N-1)-1);
figure,
plot(Freq,abs(F1(1:end/2))), xlabel(' Frequ in Hz'), title(' F1');
figure,
plot(Freq,abs(F2(1:end/2))), xlabel(' Frequ in Hz'), title(' F2');
figure,
plot(Freq,abs(F3(1:end/2))), xlabel(' Frequ in Hz'), title(' F3');
Best Answer