% Example, Time-Frequency Analysis course
% Signal with events both localized in time, and in frequency
%
t=[1:1024]./512;
l=4 %Length 4 Daubechies filter
[h,g,rh,rg]=daub(l);
k=5;
n=64;
x=zeros(1,1024);
for s=2:2:6
x=sin(2.017*n*s/2*pi*(t))+x;
end
x(300)=25+x(300);
x(500:700)=x(500:700)+ones(size(x(500:700)));
x(900)=15+x(900);
% Uncomment the next two lines to see a plot of the signal.
%figure
%plot(t,x)
b=k*ones(1,2^k); %Level k=5 basis
y=wpk(x,h,g,0,b);
figure
tfp4(b,y)

b=[5 5 4 3 2 1]; %Usual wavele transform basis
y=wpk(x,h,g,0,b);
figure
tfp4(b,y)
