


%ttb1=mean(squeeze(Tb(:,:,1)),2);
corrected_Tb=[];
lwin=3000;
win=gausswin(lwin,0.5);

numoverlap=0;
non_re_use=lwin-numoverlap;
f = 1*(0:1500)/3000;
a=flipud(f);
a=flipud(f');
f1=[f';-a(2:end)];
f1=f1(2:end);
k = fix((length(ttb1)-numoverlap)/(lwin-numoverlap))
for i=1:k
     temp=ttb1(1+(i-1)*non_re_use :(i-1)*non_re_use+lwin);

Y = fft((win.*temp),3000);
Pyy = Y.* conj(Y) / 3000;

u=find(f1>=0.0040 & f1<=0.006);
v=find(f1<=-0.040 & f1>=-0.006);
f2=f1;
 f2(u)=NaN;
f2(v)=NaN;
w=find(isnan(f2)==1);
 f2(w)=[];
Y1=Y;
Y1(u)=NaN;
Y1(v)=NaN;

 Y1(w)=[];
Y1i=interp1(f2,Y1,f1);
y2=ifft(Y1i);
corrected_Tb = [corrected_Tb;abs(y2)];
end

