Debian Codegraph @

pywt/_extensions/c/wavelets.c

raw symbols SCIP
1 /* Copyright (c) 2006-2012 Filip Wasilewski <http://en.ig.ma/>
2 * Copyright (c) 2012-2016 The PyWavelets Developers
3 * <https://github.com/PyWavelets/pywt>
4 * See COPYING for license details.
5 */
6
7 /* Allocating, setting properties and destroying wavelet structs */
8 #include "wavelets.h"
9 #include "wavelets_coeffs.h"
10
11 #define SWAP(t, x, y) {t tmp = x; x = y; y = tmp;}
12 #define NELEMS(x) (sizeof(x) / sizeof(*x))
13
14 int is_discrete_wavelet(WAVELET_NAME name)
15 {
16 switch(name){
17 case HAAR:
18 return 1;
19 case RBIO:
20 return 1;
21 case DB:
22 return 1;
23 case SYM:
24 return 1;
25 case COIF:
26 return 1;
27 case BIOR:
28 return 1;
29 case DMEY:
30 return 1;
31 case GAUS:
32 return 0;
33 case MEXH:
34 return 0;
35 case MORL:
36 return 0;
37 case CGAU:
38 return 0;
39 case SHAN:
40 return 0;
41 case FBSP:
42 return 0;
43 case CMOR:
44 return 0;
45 default:
46 return -1;
47 }
48
49 }
50
51
52 DiscreteWavelet* discrete_wavelet(WAVELET_NAME name, unsigned int order)
53 {
54 DiscreteWavelet *w;
55 /* Haar wavelet */
56 if(name == HAAR){
57
58 /* the same as db1 */
59 w = discrete_wavelet(DB, 1);
60 w->base.family_name = "Haar";
61 w->base.short_name = "haar";
62 return w;
63
64 /* Reverse biorthogonal wavelets family */
65 } else if (name == RBIO) {
66 /* rbio is like bior, only with switched filters */
67 w = discrete_wavelet(BIOR, order);
68 if (w == NULL) return NULL;
69
70 SWAP(size_t, w->dec_len, w->rec_len);
71 SWAP(float*, w->rec_lo_float, w->dec_lo_float);
72 SWAP(float*, w->rec_hi_float, w->dec_hi_float);
73 SWAP(double*, w->rec_lo_double, w->dec_lo_double);
74 SWAP(double*, w->rec_hi_double, w->dec_hi_double);
75
76 {
77 size_t i, j;
78 for(i = 0, j = w->rec_len - 1; i < j; i++, j--){
79 SWAP(float, w->rec_lo_float[i], w->rec_lo_float[j]);
80 SWAP(float, w->rec_hi_float[i], w->rec_hi_float[j]);
81 SWAP(float, w->dec_lo_float[i], w->dec_lo_float[j]);
82 SWAP(float, w->dec_hi_float[i], w->dec_hi_float[j]);
83
84 SWAP(double, w->rec_lo_double[i], w->rec_lo_double[j]);
85 SWAP(double, w->rec_hi_double[i], w->rec_hi_double[j]);
86 SWAP(double, w->dec_lo_double[i], w->dec_lo_double[j]);
87 SWAP(double, w->dec_hi_double[i], w->dec_hi_double[j]);
88 }
89 }
90
91 w->base.family_name = "Reverse biorthogonal";
92 w->base.short_name = "rbio";
93
94 return w;
95 }
96
97 switch(name){
98 /* Daubechies wavelets family */
99 case DB: {
100 size_t coeffs_idx = order - 1;
101 if (coeffs_idx >= NELEMS(db_float) ||
102 coeffs_idx >= NELEMS(db_double))
103 return NULL;
104 w = blank_discrete_wavelet(2 * order);
105 if(w == NULL) return NULL;
106
107 w->vanishing_moments_psi = order;
108 w->vanishing_moments_phi = 0;
109 w->base.support_width = 2*order - 1;
110 w->base.orthogonal = 1;
111 w->base.biorthogonal = 1;
112 w->base.symmetry = ASYMMETRIC;
113 w->base.compact_support = 1;
114 w->base.family_name = "Daubechies";
115 w->base.short_name = "db";
116 {
117 size_t i;
118 for(i = 0; i < w->rec_len; ++i){
119 w->rec_lo_float[i] = db_float[coeffs_idx][i];
120 w->dec_lo_float[i] = db_float[coeffs_idx][w->dec_len-1-i];
121 w->rec_hi_float[i] = ((i % 2) ? -1 : 1)
122 * db_float[coeffs_idx][w->dec_len-1-i];
123 w->dec_hi_float[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
124 * db_float[coeffs_idx][i];
125 }
126 }
127
128 {
129 size_t i;
130 for(i = 0; i < w->rec_len; ++i){
131 w->rec_lo_double[i] = db_double[coeffs_idx][i];
132 w->dec_lo_double[i] = db_double[coeffs_idx][w->dec_len-1-i];
133 w->rec_hi_double[i] = ((i % 2) ? -1 : 1)
134 * db_double[coeffs_idx][w->dec_len-1-i];
135 w->dec_hi_double[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
136 * db_double[coeffs_idx][i];
137 }
138 }
139
140 break;
141 }
142
143 /* Symlets wavelets family */
144 case SYM: {
145 size_t coeffs_idx = order - 2;
146 if (coeffs_idx >= NELEMS(sym_float) ||
147 coeffs_idx >= NELEMS(sym_double))
148 return NULL;
149
150 w = blank_discrete_wavelet(2 * order);
151 if(w == NULL) return NULL;
152
153 w->vanishing_moments_psi = order;
154 w->vanishing_moments_phi = 0;
155 w->base.support_width = 2*order - 1;
156 w->base.orthogonal = 1;
157 w->base.biorthogonal = 1;
158 w->base.symmetry = NEAR_SYMMETRIC;
159 w->base.compact_support = 1;
160 w->base.family_name = "Symlets";
161 w->base.short_name = "sym";
162 {
163 size_t i;
164 for(i = 0; i < w->rec_len; ++i){
165 w->rec_lo_float[i] = sym_float[coeffs_idx][i];
166 w->dec_lo_float[i] = sym_float[coeffs_idx][w->dec_len-1-i];
167 w->rec_hi_float[i] = ((i % 2) ? -1 : 1)
168 * sym_float[coeffs_idx][w->dec_len-1-i];
169 w->dec_hi_float[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
170 * sym_float[coeffs_idx][i];
171 }
172 }
173
174 {
175 size_t i;
176 for(i = 0; i < w->rec_len; ++i){
177 w->rec_lo_double[i] = sym_double[coeffs_idx][i];
178 w->dec_lo_double[i] = sym_double[coeffs_idx][w->dec_len-1-i];
179 w->rec_hi_double[i] = ((i % 2) ? -1 : 1)
180 * sym_double[coeffs_idx][w->dec_len-1-i];
181 w->dec_hi_double[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
182 * sym_double[coeffs_idx][i];
183 }
184 }
185 break;
186 }
187
188 /* Coiflets wavelets family */
189 case COIF: {
190 size_t coeffs_idx = order - 1;
191 if (coeffs_idx >= NELEMS(coif_float) ||
192 coeffs_idx >= NELEMS(coif_double))
193 return NULL;
194 w = blank_discrete_wavelet(6 * order);
195 if(w == NULL) return NULL;
196
197 w->vanishing_moments_psi = 2*order;
198 w->vanishing_moments_phi = 2*order -1;
199 w->base.support_width = 6*order - 1;
200 w->base.orthogonal = 1;
201 w->base.biorthogonal = 1;
202 w->base.symmetry = NEAR_SYMMETRIC;
203 w->base.compact_support = 1;
204 w->base.family_name = "Coiflets";
205 w->base.short_name = "coif";
206 {
207 size_t i;
208 for(i = 0; i < w->rec_len; ++i){
209 w->rec_lo_float[i] = coif_float[coeffs_idx][i] * sqrt2_float;
210 w->dec_lo_float[i] = coif_float[coeffs_idx][w->dec_len-1-i]
211 * sqrt2_float;
212 w->rec_hi_float[i] = ((i % 2) ? -1 : 1)
213 * coif_float[coeffs_idx][w->dec_len-1-i] * sqrt2_float;
214 w->dec_hi_float[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
215 * coif_float[coeffs_idx][i] * sqrt2_float;
216 }
217 }
218
219 {
220 size_t i;
221 for(i = 0; i < w->rec_len; ++i){
222 w->rec_lo_double[i] = coif_double[coeffs_idx][i] * sqrt2_double;
223 w->dec_lo_double[i] = coif_double[coeffs_idx][w->dec_len-1-i]
224 * sqrt2_double;
225 w->rec_hi_double[i] = ((i % 2) ? -1 : 1)
226 * coif_double[coeffs_idx][w->dec_len-1-i] * sqrt2_double;
227 w->dec_hi_double[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
228 * coif_double[coeffs_idx][i] * sqrt2_double;
229 }
230 }
231 break;
232 }
233
234 /* Biorthogonal wavelets family */
235 case BIOR: {
236 unsigned int N = order / 10, M = order % 10;
237 size_t M_idx;
238 size_t M_max;
239 switch (N) {
240 case 1:
241 if (M % 2 != 1 || M > 5) return NULL;
242 M_idx = M / 2;
243 M_max = 5;
244 break;
245 case 2:
246 if (M % 2 != 0 || M < 2 || M > 8) return NULL;
247 M_idx = M / 2 - 1;
248 M_max = 8;
249 break;
250 case 3:
251 if (M % 2 != 1) return NULL;
252 M_idx = M / 2;
253 M_max = 9;
254 break;
255 case 4:
256 case 5:
257 if (M != N) return NULL;
258 M_idx = 0;
259 M_max = M;
260 break;
261 case 6:
262 if (M != 8) return NULL;
263 M_idx = 0;
264 M_max = 8;
265 break;
266 default:
267 return NULL;
268 }
269
270 w = blank_discrete_wavelet((N == 1) ? 2 * M : 2 * M + 2);
271 if(w == NULL) return NULL;
272
273 w->vanishing_moments_psi = order/10;
274 w->vanishing_moments_phi = order % 10;
275 w->base.support_width = -1;
276 w->base.orthogonal = 0;
277 w->base.biorthogonal = 1;
278 w->base.symmetry = SYMMETRIC;
279 w->base.compact_support = 1;
280 w->base.family_name = "Biorthogonal";
281 w->base.short_name = "bior";
282 {
283 size_t n = M_max - M;
284 size_t i;
285 for(i = 0; i < w->rec_len; ++i){
286 w->rec_lo_float[i] = bior_float[N - 1][0][i+n];
287 w->dec_lo_float[i] = bior_float[N - 1][M_idx+1][w->dec_len-1-i];
288 w->rec_hi_float[i] = ((i % 2) ? -1 : 1)
289 * bior_float[N - 1][M_idx+1][w->dec_len-1-i];
290 w->dec_hi_float[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
291 * bior_float[N - 1][0][i+n];
292 }
293 }
294
295 {
296 size_t n = M_max - M;
297 size_t i;
298 for(i = 0; i < w->rec_len; ++i){
299 w->rec_lo_double[i] = bior_double[N - 1][0][i+n];
300 w->dec_lo_double[i] = bior_double[N - 1][M_idx+1][w->dec_len-1-i];
301 w->rec_hi_double[i] = ((i % 2) ? -1 : 1)
302 * bior_double[N - 1][M_idx+1][w->dec_len-1-i];
303 w->dec_hi_double[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
304 * bior_double[N - 1][0][i+n];
305 }
306 }
307
308 break;
309 }
310
311 /* Discrete FIR filter approximation of Meyer wavelet */
312 case DMEY:
313 w = blank_discrete_wavelet(62);
314 if(w == NULL) return NULL;
315
316 w->vanishing_moments_psi = -1;
317 w->vanishing_moments_phi = -1;
318 w->base.support_width = -1;
319 w->base.orthogonal = 1;
320 w->base.biorthogonal = 1;
321 w->base.symmetry = SYMMETRIC;
322 w->base.compact_support = 1;
323 w->base.family_name = "Discrete Meyer (FIR Approximation)";
324 w->base.short_name = "dmey";
325 {
326 size_t i;
327 for(i = 0; i < w->rec_len; ++i){
328 w->rec_lo_float[i] = dmey_float[i];
329 w->dec_lo_float[i] = dmey_float[w->dec_len-1-i];
330 w->rec_hi_float[i] = ((i % 2) ? -1 : 1)
331 * dmey_float[w->dec_len-1-i];
332 w->dec_hi_float[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
333 * dmey_float[i];
334 }
335 }
336
337 {
338 size_t i;
339 for(i = 0; i < w->rec_len; ++i){
340 w->rec_lo_double[i] = dmey_double[i];
341 w->dec_lo_double[i] = dmey_double[w->dec_len-1-i];
342 w->rec_hi_double[i] = ((i % 2) ? -1 : 1)
343 * dmey_double[w->dec_len-1-i];
344 w->dec_hi_double[i] = (((w->dec_len-1-i) % 2) ? -1 : 1)
345 * dmey_double[i];
346 }
347 }
348 break;
349 default:
350 return NULL;
351 }
352 return w;
353 }
354
355 ContinuousWavelet* continuous_wavelet(WAVELET_NAME name, unsigned int order)
356 {
357 ContinuousWavelet *w;
358 switch(name){
359 /* Gaussian Wavelets */
360 case GAUS:
361 if (order > 8)
362 return NULL;
363 w = blank_continuous_wavelet();
364 if(w == NULL) return NULL;
365
366 w->base.support_width = -1;
367 w->base.orthogonal = 0;
368 w->base.biorthogonal = 0;
369 if (order % 2 == 0)
370 w->base.symmetry = SYMMETRIC;
371 else
372 w->base.symmetry = ANTI_SYMMETRIC;
373 w->base.compact_support = 0;
374 w->base.family_name = "Gaussian";
375 w->base.short_name = "gaus";
376 w->complex_cwt = 0;
377 w->lower_bound = -5;
378 w->upper_bound = 5;
379 w->center_frequency = 0;
380 w->bandwidth_frequency = 0;
381 w->fbsp_order = 0;
382 break;
383 case MEXH:
384 w = blank_continuous_wavelet();
385 if(w == NULL) return NULL;
386
387 w->base.support_width = -1;
388 w->base.orthogonal = 0;
389 w->base.biorthogonal = 0;
390 w->base.symmetry = SYMMETRIC;
391 w->base.compact_support = 0;
392 w->base.family_name = "Mexican hat wavelet";
393 w->base.short_name = "mexh";
394 w->complex_cwt = 0;
395 w->lower_bound = -8;
396 w->upper_bound = 8;
397 w->center_frequency = 0;
398 w->bandwidth_frequency = 0;
399 w->fbsp_order = 0;
400 break;
401 case MORL:
402 w = blank_continuous_wavelet();
403 if(w == NULL) return NULL;
404
405 w->base.support_width = -1;
406 w->base.orthogonal = 0;
407 w->base.biorthogonal = 0;
408 w->base.symmetry = SYMMETRIC;
409 w->base.compact_support = 0;
410 w->base.family_name = "Morlet wavelet";
411 w->base.short_name = "morl";
412 w->complex_cwt = 0;
413 w->lower_bound = -8;
414 w->upper_bound = 8;
415 w->center_frequency = 0;
416 w->bandwidth_frequency = 0;
417 w->fbsp_order = 0;
418 break;
419 case CGAU:
420 if (order > 8)
421 return NULL;
422 w = blank_continuous_wavelet();
423 if(w == NULL) return NULL;
424
425 w->base.support_width = -1;
426 w->base.orthogonal = 0;
427 w->base.biorthogonal = 0;
428 if (order % 2 == 0)
429 w->base.symmetry = SYMMETRIC;
430 else
431 w->base.symmetry = ANTI_SYMMETRIC;
432 w->base.compact_support = 0;
433 w->base.family_name = "Complex Gaussian wavelets";
434 w->base.short_name = "cgau";
435 w->complex_cwt = 1;
436 w->lower_bound = -5;
437 w->upper_bound = 5;
438 w->center_frequency = 0;
439 w->bandwidth_frequency = 0;
440 w->fbsp_order = 0;
441 break;
442 case SHAN:
443
444 w = blank_continuous_wavelet();
445 if(w == NULL) return NULL;
446
447 w->base.support_width = -1;
448 w->base.orthogonal = 0;
449 w->base.biorthogonal = 0;
450 w->base.symmetry = ASYMMETRIC;
451 w->base.compact_support = 0;
452 w->base.family_name = "Shannon wavelets";
453 w->base.short_name = "shan";
454 w->complex_cwt = 1;
455 w->lower_bound = -20;
456 w->upper_bound = 20;
457 w->center_frequency = 1;
458 w->bandwidth_frequency = 0.5;
459 w->fbsp_order = 0;
460 break;
461 case FBSP:
462
463 w = blank_continuous_wavelet();
464 if(w == NULL) return NULL;
465
466 w->base.support_width = -1;
467 w->base.orthogonal = 0;
468 w->base.biorthogonal = 0;
469 w->base.symmetry = ASYMMETRIC;
470 w->base.compact_support = 0;
471 w->base.family_name = "Frequency B-Spline wavelets";
472 w->base.short_name = "fbsp";
473 w->complex_cwt = 1;
474 w->lower_bound = -20;
475 w->upper_bound = 20;
476 w->center_frequency = 0.5;
477 w->bandwidth_frequency = 1;
478 w->fbsp_order = 2;
479 break;
480 case CMOR:
481
482 w = blank_continuous_wavelet();
483 if(w == NULL) return NULL;
484
485 w->base.support_width = -1;
486 w->base.orthogonal = 0;
487 w->base.biorthogonal = 0;
488 w->base.symmetry = ASYMMETRIC;
489 w->base.compact_support = 0;
490 w->base.family_name = "Complex Morlet wavelets";
491 w->base.short_name = "cmor";
492 w->complex_cwt = 1;
493 w->lower_bound = -8;
494 w->upper_bound = 8;
495 w->center_frequency = 0.5;
496 w->bandwidth_frequency = 1;
497 w->fbsp_order = 0;
498 break;
499 default:
500 return NULL;
501 }
502 return w;
503 }
504
505
506 DiscreteWavelet* blank_discrete_wavelet(size_t filters_length)
507 {
508 DiscreteWavelet* w;
509
510
511 /* pad to even length */
512 if(filters_length > 0 && filters_length % 2)
513 ++filters_length;
514
515 w = wtmalloc(sizeof(DiscreteWavelet));
516 if(w == NULL) return NULL;
517
518 w->dec_len = w->rec_len = filters_length;
519 if (filters_length > 0)
520 {
521 w->dec_lo_float = wtcalloc(filters_length, sizeof(float));
522 w->dec_hi_float = wtcalloc(filters_length, sizeof(float));
523 w->rec_lo_float = wtcalloc(filters_length, sizeof(float));
524 w->rec_hi_float = wtcalloc(filters_length, sizeof(float));
525
526 w->dec_lo_double = wtcalloc(filters_length, sizeof(double));
527 w->dec_hi_double = wtcalloc(filters_length, sizeof(double));
528 w->rec_lo_double = wtcalloc(filters_length, sizeof(double));
529 w->rec_hi_double = wtcalloc(filters_length, sizeof(double));
530
531 if(w->dec_lo_float == NULL || w->dec_hi_float == NULL ||
532 w->rec_lo_float == NULL || w->rec_hi_float == NULL ||
533 w->dec_lo_double == NULL || w->dec_hi_double == NULL ||
534 w->rec_lo_double == NULL || w->rec_hi_double == NULL){
535 free_discrete_wavelet(w);
536 return NULL;
537 }
538 }
539 else
540 {
541 w->dec_lo_float = NULL;
542 w->dec_hi_float = NULL;
543 w->rec_lo_float = NULL;
544 w->rec_hi_float = NULL;
545
546 w->dec_lo_double = NULL;
547 w->dec_hi_double = NULL;
548 w->rec_lo_double = NULL;
549 w->rec_hi_double = NULL;
550 }
551 /* set w->base properties to "blank" values */
552 w->base.support_width = -1;
553 w->base.orthogonal = 0;
554 w->base.biorthogonal = 0;
555 w->base.symmetry = UNKNOWN;
556 w->base.compact_support = 0;
557 w->base.family_name = "";
558 w->base.short_name = "";
559 w->vanishing_moments_psi = 0;
560 w->vanishing_moments_phi = 0;
561 return w;
562 }
563
564 ContinuousWavelet* blank_continuous_wavelet(void)
565 {
566 ContinuousWavelet* w;
567
568
569
570 w = wtmalloc(sizeof(ContinuousWavelet));
571 if(w == NULL) return NULL;
572
573
574 /* set properties to "blank" values */
575 w->center_frequency = -1;
576 w->bandwidth_frequency = -1;
577 w->fbsp_order = 0;
578 return w;
579 }
580
581 DiscreteWavelet* copy_discrete_wavelet(DiscreteWavelet* base)
582 {
583 DiscreteWavelet* w;
584
585 if(base == NULL) return NULL;
586
587 w = wtmalloc(sizeof(DiscreteWavelet));
588 if(w == NULL) return NULL;
589
590 memcpy(w, base, sizeof(DiscreteWavelet));
591 if (base->dec_len > 0)
592 {
593 w->dec_lo_float = wtmalloc(w->dec_len * sizeof(float));
594 w->dec_hi_float = wtmalloc(w->dec_len * sizeof(float));
595 w->dec_lo_double = wtmalloc(w->dec_len * sizeof(double));
596 w->dec_hi_double = wtmalloc(w->dec_len * sizeof(double));
597 if(w->dec_lo_float == NULL || w->dec_hi_float == NULL ||
598 w->dec_lo_double == NULL || w->dec_hi_double == NULL){
599 free_discrete_wavelet(w);
600 return NULL;
601 }
602 }
603 else
604 {
605 w->dec_lo_float = NULL;
606 w->dec_hi_float = NULL;
607
608 w->dec_lo_double = NULL;
609 w->dec_hi_double = NULL;
610 }
611 if (base->rec_len > 0)
612 {
613 w->rec_lo_float = wtmalloc(w->rec_len * sizeof(float));
614 w->rec_hi_float = wtmalloc(w->rec_len * sizeof(float));
615 w->rec_lo_double = wtmalloc(w->rec_len * sizeof(double));
616 w->rec_hi_double = wtmalloc(w->rec_len * sizeof(double));
617 if( w->rec_lo_float == NULL || w->rec_hi_float == NULL ||
618 w->rec_lo_double == NULL || w->rec_hi_double == NULL){
619 free_discrete_wavelet(w);
620 return NULL;
621 }
622 }
623 else
624 {
625 w->rec_lo_float = NULL;
626 w->rec_hi_float = NULL;
627
628 w->rec_lo_double = NULL;
629 w->rec_hi_double = NULL;
630 }
631
632
633 // FIXME: Test coverage, the only use in `wavelet` overwrites the filter
634 if (base->dec_len > 0)
635 {
636 memcpy(w->dec_lo_float, base->dec_lo_float, w->dec_len * sizeof(float));
637 memcpy(w->dec_hi_float, base->dec_hi_float, w->dec_len * sizeof(float));
638 memcpy(w->dec_lo_double, base->dec_lo_double, w->dec_len * sizeof(double));
639 memcpy(w->dec_hi_double, base->dec_hi_double, w->dec_len * sizeof(double));
640 }
641 if (base->rec_len > 0)
642 {
643 memcpy(w->rec_lo_float, base->rec_lo_float, w->rec_len * sizeof(float));
644 memcpy(w->rec_hi_float, base->rec_hi_float, w->rec_len * sizeof(float));
645 memcpy(w->rec_lo_double, base->rec_lo_double, w->rec_len * sizeof(double));
646 memcpy(w->rec_hi_double, base->rec_hi_double, w->rec_len * sizeof(double));
647 }
648 return w;
649 }
650
651 void free_discrete_wavelet(DiscreteWavelet *w){
652
653 /* deallocate filters */
654 if (w->dec_len > 0)
655 {
656 wtfree(w->dec_lo_float);
657 wtfree(w->dec_hi_float);
658 wtfree(w->dec_lo_double);
659 wtfree(w->dec_hi_double);
660 }
661 if (w->rec_len > 0)
662 {
663 wtfree(w->rec_lo_float);
664 wtfree(w->rec_hi_float);
665 wtfree(w->rec_lo_double);
666 wtfree(w->rec_hi_double);
667 }
668 /* finally free struct */
669 wtfree(w);
670 }
671
672 void free_continuous_wavelet(ContinuousWavelet *w){
673
674 /* finally free struct */
675 wtfree(w);
676 }
677
678
679
680
681
682
683
684 #undef SWAP
685 #undef NELEMS