clear all
close all

% generate data example
t = linspace(0,1,50);
x = sin(2*pi*t);

figure(1)
plot(t,x)

% compute FT
ft=fft(x);
freq = linspace(0,24,25);
freq_min=linspace(25,1,25);
allfreq=[-freq_min;freq];
all_data_imag=[imag(ft(26:50));imag(ft(1:25))]
all_data_real=[real(ft(26:50));real(ft(1:25))]



% show real and imaginary part
figure(2)
plot(allfreq,all_data_real,'r',allfreq,all_data_imag,'b');
xlabel('frequency')
ylabel('real and imaginary part')

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

subplot(2,1,2)
plot(freq,angle(ft(1:25)),'-*')
xlabel('frequency')
ylabel('phase angle')
