[95fe2b]: wavelets / wfilt_lemarie.m  Maximize  Restore  History

Download this file

45 lines (36 with data), 1.0 kB

 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
function [h,g,a]=wfilt_lemarie(N)
%WFILT_LEMARIE Battle and Lemarie filters
% Usage: [h,g,a]=wfilt_lemarie(N)
%
% Input parameters:
% N : Filter length.
%
% `[h,g,a]=wfilt_lemarie(N)` calculates coeficients of orthonormal
% Battle-Lemarie wavelets. Filter coefficients are obtainded by
% frequency domain sampling and trunctating the impulse response.
%
% References: mallat89atheory
%
% % Examples:
% ---------
%
% Frequency responses of the analysis filters:::
%
% w = fwtinit({'lemarie',40});
% wtfftfreqz(w.h);
%
% Original copyright goes to:
% Copyright (C) 1994, 1995, 1996, by Universidad de Vigo
% Author: Jose Martin Garcia
% e-mail: Uvi_Wave@tsc.uvigo.es
num_coefs = N;
L = 1024;
H = wfreq_lemarie(L);
hh=real(ifft(H{1},L));
hh=[ hh(L-floor(num_coefs/2)+1:L) hh(1:ceil(num_coefs/2))];
hh=sqrt(2)/sum(hh)*hh;
g{1} = fliplr(hh);
g{2} = -(-1).^(1:length(hh)).*g{1}(end:-1:1);
h{1}=g{1}(length(g{1}):-1:1);
h{2}=g{2}(length(g{2}):-1:1);
a= [2;2];