y=y';
% il faut absolument normaliser sinon il y a un escalier entre
% l'ondelette de moyenne nulle et le saut du signal de 0 a ...
% aux deux bords!!!!
%y=(y-mean(y))/std(y);
k0=5.4;
%
dt=1;
n1=length(y);
base2=fix(log(n1)/log(2)+0.4999);
if(2^base2-n1 < 0) base2=base2+1;
   end;
x=[y,zeros(1,2^base2-n1)];
y=y';
n=length(x);
%
k=[1:fix(n/2)];
k=k.*((2.*pi)/(n*dt));
k=[0., k, -k(fix((n-1)/2):-1:1)];
%
f=fft(x);
%
scale=aa;
J=length(aa);
wave=zeros(J,n);
wave=wave+sqrt(-1)*wave;
%
nn=length(k);
for a1=1:J;
expnt=-(scale(a1).*k - k0).^2/2.*(k > 0.);
norm=sqrt(scale(a1)*k(2))*(pi^(-0.25))*sqrt(nn);
daughter=norm*exp(expnt);
daughter=daughter.*(k>0.);
wave(a1,:)=ifft(f.*daughter)/sqrt(scale(a1));
end;
wave=wave(1:J,1:n1);



  



