[62fbef]: wavelets / wavfun.m  Maximize  Restore  History

Download this file

43 lines (35 with data), 846 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function [w,s,xvals] = wavfun(g,N)
% WAVFUN Wavelet Function
% Usage: [w,s,xvals] = wavfun(g,N)
%
% Input parameters:
% g : Wavelet filterbank
% N : Number of iterations
% Output parameters:
% w : J+1 cell array of analysing filters impulse reponses
%
% Iteratively generate a discrete approximation of wavelet and scaling functions
%
if(isstruct(g))
g=g.g;
end
gLen = length(g);
lo = g{1}(:);
s = lo;
wtemp = cell(gLen-1,1);
for ii=1:gLen-1
wtemp{ii} = g{ii+1}(:);
end
for n=1:N
for ii=1:gLen-1
wtemp{ii} = convolve(ups(wtemp{ii},2,1),lo);
end
s = convolve(ups(s,2,1),lo);
end
w = zeros(length(wtemp{1}),gLen-1);
for ii=1:gLen-1
w(:,ii) = wtemp{ii};
end
if(nargout>2)
xvals=linspace(0,length(lo),length(s));
end

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks