
clear

fs=100e3; %frequencia de amostragem
tf=1; %tempo final

t=0:1/fs:tf; %vetor tempo

A=[1 5 2 4];
f=[1000 2000 5000 1500];

y(length(t))=0;
for ii=1:length(A)

    y = y + A(ii)*sin(2*pi*f(ii)*t);
end


transf=fft(y)/length(y);

plot(linspace(0,fs,length(t)),2*abs(transf))
axis([0 10e3 0 max(2*abs(transf))])