%kz
close all
clear all
N=128;
n=[0:N-1]';
xx=2*pi*n/N;
w=1-cos(xx) %okno hamminga
u=[0:0.1:N-1]';
x=0.5+sin(5.4*xx)+ 0.0005*sin(30*xx);
save wyniki999 x
plot(n,x,'o');
y=intprob(x,u);
figure(1)
hold on;
plot (u,y,'r')
plot (n,w,'y')
plot (n, x.*w, 'g')
f=fft(x);
f1=fft(x.*w);
modf=abs(f)/(N/2);
modf1=abs(f1)/(N/2);
%dla skladowej stalej dzielimy przez N
% fk=k/(N*T) = k* fs/N
figure(2)
plot(n,modf);
hold on
plot(n,modf1,'r');
ind=find(modf<=0.00001);
figure(3)
plot(n,20*log10(modf))
hold on
plot(n,20*log10(modf1), 'r')
axis([0 N-1 -100 0])
fazf=angle(f);
fazf(ind)=NaN
figure(4)
plot(n,fazf, '.');