

// signal
N=256;
%x=rand(N,1);
%x=x-mean(x);
f0=0;f1=.5;
a=(f1-f0)/N;
x=real(exp(%pi*%i*a*(0:N-1)'.^2));

// spectrogramme
[tfr,t,f]=tfrsp(x);

// frequences positives seulement
f=f(1:N/2);
tfr=tfr(1:N/2,:);

// changer la palette de couleur
m=228;
 n= fix(3/8*m);
 r=[(1:n)'/n; ones(m-n,1)];
 g=[zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
 b=[zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
 h=[r g b];
 xset("colormap",h)

// affichage
xbasc();
f_zoom=N*f;
driver("Rec");
//plot3d1(f_zoom,t,tfr,0,0,"frequence@temps@ampl",[-1 2 4]);
plot3d1(mtlb_flipud(f_zoom),t,mtlb_flipud(-tfr),0,180,"frequence@temps@ampl",[-1 2 4]);

