1mlib_SignalFFTW_4(3MLIB) mediaLib Library Functions mlib_SignalFFTW_4(3MLIB)
2
3
4
6 mlib_SignalFFTW_4, mlib_SignalFFTW_4_S16_S16, mlib_Sig‐
7 nalFFTW_4_S16C_S16C, mlib_SignalFFTW_4_S16C_S16, mlib_SignalFFTW_4_S16,
8 mlib_SignalFFTW_4_S16C - signal Fast Fourier Transform with windowing
9 (FFTW)
10
12 cc [ flag... ] file... -lmlib [ library... ]
13 #include <mlib.h>
14
15 mlib_status mlib_SignalFFTW_4_S16_S16(mlib_s16 *dstr, mlib_s16 *dsti,
16 const mlib_s16 *srcr, const mlib_s16 *srci, const mlib_s16 *window,
17 mlib_s32 order, mlib_s32 *scale);
18
19
20 mlib_status mlib_SignalFFTW_4_S16C_S16C(mlib_s16 *dstc,
21 const mlib_s16 *srcc,const mlib_s16 *window, mlib_s32 order,
22 mlib_s32 *scale);
23
24
25 mlib_status mlib_SignalFFTW_4_S16C_S16(mlib_s16 *dstc,
26 const mlib_s16 *srcr,const mlib_s16 *window, mlib_s32 order,
27 mlib_s32 *scale);
28
29
30 mlib_status mlib_SignalFFTW_4_S16(mlib_s16 *srcdstr,
31 mlib_s16 *srcdsti,const mlib_s16 *window, mlib_s32 order,
32 mlib_s32 *scale);
33
34
35 mlib_status mlib_SignalFFTW_4_S16C(mlib_s16 *srcdstc,
36 const mlib_s16 *window,mlib_s32 order, mlib_s32 *scale);
37
38
40 Each of the functions in this group performs Fast Fourier Transform
41 with windowing (FFTW).
42
43
44 The FFTW functions use the following equation:
45
46 1 N-1
47 dst[k] = ---- SUM {src[n] * window[n] * exp(-j2*PI*n*k/N)}
48 C1 n=0
49
50
51
52 and the IFFTW functions use the following equation:
53
54 1 N-1
55 dst[n] = ---- SUM {src[k] * window[k] * exp(j2*PI*n*k/N)}
56 C2 k=0
57
58
59
60 where
61
62 k = 0, 1, ..., (N - 1)
63 n = 0, 1, ..., (N - 1)
64 N = 2**order
65
66
67
68 The signal FFTW/IFFTW functions can be categorized into four groups
69 according to the ScaleMode in the function names in the following form:
70
71 mlib_Signal[FFTW|IFFTW]_ScaleMode_OutType_InType_OpMode()
72 mlib_Signal[FFTW|IFFTW]_ScaleMode_DataType_OpMode()
73
74
75
76 The scaling factors C1 and C2 used in the equations are defined as fol‐
77 lows:
78
79 o For ScaleMode = 1, C1 = 1 and C2 = 2**order.
80
81 o For ScaleMode = 2, C1 = 2**order and C2 = 1.
82
83 o For ScaleMode = 3, C1 = C2 = 2**(order/2) when order is
84 even, or C1 = 2**((order+1)/2) and C2 = 2**((order-1)/2)
85 when order is odd.
86
87 o For ScaleMode = 4, C1 = 2**P and C2 = 2**Q, where P and Q
88 are adaptive scaling factors and are generated by the func‐
89 tions.
90
91
92 For functions with only real parts for the source signal, the imaginary
93 parts are assumed to be all zero. For functions with only real parts
94 for the destination signal, the imaginary parts are discarded. The
95 functions with only one data type in their names perform the operation
96 in place.
97
99 Each function takes some of the following arguments:
100
101 dstr Destination signal array that contains the real parts.
102
103
104 dsti Destination signal array that contains the imaginary parts.
105
106
107 srcr Source signal array that contains the real parts.
108
109
110 srci Source signal array that contains the imaginary parts.
111
112
113 dstc Complex destination signal array. dstc[2*i] contains the
114 real parts, and dstc[2*i+1] contains the imaginary parts.
115
116
117 srcc Complex source signal array. srcc[2*i] contains the real
118 parts, and srcc[2*i+1] contains the imaginary parts.
119
120
121 srcdstr Source and destination signal array that contains the real
122 parts.
123
124
125 srcdsti Source and destination signal array that contains the imagi‐
126 nary parts.
127
128
129 srcdstc Complex source and destination signal array. srcdstc[2*i]
130 contains the real parts, and srcdstc[2*i+1] contains the
131 imaginary parts.
132
133
134 window Window coefficient array with 2**order real elements. The
135 window coefficients are in Q15 format for the S16 data type,
136 or in float format for the F32 data type.
137
138
139 order Order of the transformation. The base-2 logarithm of the
140 number of data samples.
141
142
143 scale Adaptive scaling factor.
144
145
147 Each function returns MLIB_SUCCESS if successful. Otherwise it returns
148 MLIB_FAILURE.
149
151 See attributes(5) for descriptions of the following attributes:
152
153
154
155
156 ┌─────────────────────────────┬─────────────────────────────┐
157 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
158 ├─────────────────────────────┼─────────────────────────────┤
159 │Interface Stability │Committed │
160 ├─────────────────────────────┼─────────────────────────────┤
161 │MT-Level │MT-Safe │
162 └─────────────────────────────┴─────────────────────────────┘
163
165 mlib_SignalFFTW_1(3MLIB), mlib_SignalFFTW_2(3MLIB), mlib_Sig‐
166 nalFFTW_3(3MLIB), mlib_SignalIFFTW_1(3MLIB), mlib_SignalIFFTW_2(3MLIB),
167 mlib_SignalIFFTW_3(3MLIB), mlib_SignalIFFTW_4(3MLIB), attributes(5)
168
169
170
171SunOS 5.11 2 Mar 2007 mlib_SignalFFTW_4(3MLIB)