[3deeb5]: oct / comp_iwfac.cc Maximize Restore History

Download this file

comp_iwfac.cc    77 lines (61 with data), 2.1 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#define TYPEDEPARGS 0
#define SINGLEARGS
#define COMPLEXARGS
#define OCTFILENAME comp_iwfac // change to filename
#define OCTFILEHELP "Computes inverse window factorization.\n\
Usage: c=comp_iwfac(gf,L,a,M);\n\
Yeah."
#include "ltfat_oct_template_helper.h"
// octave_idx_type is 32 or 64 bit signed integer
static inline void fwd_iwfac( const Complex *gf,
const octave_idx_type L, const octave_idx_type R,
const octave_idx_type a, const octave_idx_type M,
Complex *g)
{
iwfac_cd(reinterpret_cast<const double _Complex*>(gf),
L,R,a,M,
reinterpret_cast<double _Complex*>(g));
}
static inline void fwd_iwfac( const FloatComplex *gf,
const octave_idx_type L, const octave_idx_type R,
const octave_idx_type a, const octave_idx_type M,
FloatComplex *g)
{
iwfac_cs(reinterpret_cast<const float _Complex*>(gf),
L,R,a,M,
reinterpret_cast<float _Complex*>(g));
}
template <class LTFAT_TYPE, class LTFAT_REAL, class LTFAT_COMPLEX>
octave_value_list octFunction(const octave_value_list& args, int nargout)
{
DEBUGINFO;
MArray<LTFAT_TYPE> gf = ltfatOctArray<LTFAT_TYPE>(args(0));
const octave_idx_type L = args(1).int_value();
const octave_idx_type R = gf.numel()/L;
const octave_idx_type a = args(2).int_value();
const octave_idx_type M = args(3).int_value();
MArray<LTFAT_COMPLEX> g(dim_vector(L,1));
g.fill(0);
fwd_iwfac(gf.data(),L,R,a,M,g.fortran_vec());
return octave_value(g);
}
/*
#include <octave/oct.h>
#include "config.h"
#include "ltfat.h"
DEFUN_DLD (comp_iwfac, args, ,
"Computes inverse window factorization.\n\
Usage: c=comp_iwfac(gf,L,a,M);\n\
Yeah.")
{
const ComplexMatrix gf = args(0).complex_matrix_value();
const int L = args(1).int_value();
const int R = gf.numel()/L;
const int a = args(2).int_value();
const int M = args(3).int_value();
ComplexMatrix g(L,1);
iwfac((const ltfat_complex*)gf.data(),L,R,a,M,
(ltfat_complex*)g.fortran_vec());
return octave_value (g);
}
*/