1 /*
2  * -------------------------------------------------------------------------
3  * beylkin.c -- Beylkin wavelets coefficents.
4  * SWT - Scilab wavelet toolbox
5  * Copyright (C) 2005-2007  Roger Liu
6  * Copyright (C) 20010-2012  Holger Nahrstaedt
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  * -------------------------------------------------------------------------
22  */
23 
24 #include "swtlib.h"
25 
26 /*********************************************
27  * Local Variable (Filter Coefficent)
28  ********************************************/
29 
30 static const double beylkin[18] = {
31 	0.099305765374,	0.424215360813,	0.699825214057,
32 	0.449718251149, -0.110927598348,-0.264497231446,
33 	0.026900308804, 0.155538731877, -0.017520746267,
34 	-0.088543630623, 0.019679866044, 0.042916387274,
35 	-0.017460408696, -0.014365807969, 0.010040411845,
36 	0.001484234782, -0.002736031626, 0.000640485329};
37 
38 /*********************************************
39  * Global Function
40  ********************************************/
41 
42 void
beylkin_analysis_initialize(int member,swt_wavelet * pWaveStruct)43 beylkin_analysis_initialize (int member, swt_wavelet *pWaveStruct)
44 {
45 //   double *pFilterCoef;
46 
47 //   pFilterCoef = beylkin;
48 
49   pWaveStruct->length = 18;
50 
51   wrev(beylkin, pWaveStruct->length,
52        LowDecomFilCoef, pWaveStruct->length);
53   qmf_wrev(beylkin, pWaveStruct->length,
54 	   HiDecomFilCoef, pWaveStruct->length);
55   pWaveStruct->pLowPass = LowDecomFilCoef;
56   pWaveStruct->pHiPass = HiDecomFilCoef;
57 
58   return;
59 }
60 
61 void
beylkin_synthesis_initialize(int member,swt_wavelet * pWaveStruct)62 beylkin_synthesis_initialize (int member, swt_wavelet *pWaveStruct)
63 {
64 //   double *pFilterCoef;
65 
66 //   pFilterCoef = beylkin;
67   pWaveStruct->length = 18;
68 
69   verbatim_copy(beylkin, pWaveStruct->length,
70 		LowReconFilCoef, pWaveStruct->length);
71   qmf_even(beylkin, pWaveStruct->length,
72       HiReconFilCoef, pWaveStruct->length);
73   pWaveStruct->pLowPass = LowReconFilCoef;
74   pWaveStruct->pHiPass = HiReconFilCoef;
75 
76   return;
77 }
78