clear all
close all

% generate data example
dt = 0.02
duration = 1.0
n = duration / dt

f1 = 4.0
f2 = 15.0
t = linspace(0,duration-dt,n);
x1 = sin(2*pi*f1*t);
x2 = sin(2*pi*f2*t);


figure(1)
plot(t,x1,'r-*',t,x2,'b-*')
xlabel('time')
ylabel('x1,x2')

% compute FT
ft1=fft(x1);
ft2=fft(x2);
freq = linspace(0,24,25);

% show absolute and phase value
figure(2)
subplot(2,1,1)
plot(freq,abs(ft1(1:25)),'-*')
xlabel('frequency')
ylabel('amplitude power')

subplot(2,1,2)
plot(freq,abs(ft2(1:25)),'-*')
xlabel('frequency')
ylabel('amplitude power')
