SAF
Loading...
Searching...
No Matches
afSTFTlib.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015 Juha Vilkamo
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 THE SOFTWARE.
21 */
22
50#ifndef __afSTFTlib_INCLUDED__
51#define __afSTFTlib_INCLUDED__
52
53#ifdef __cplusplus
54extern "C" {
55#endif /* __cplusplus */
56
63#define AFSTFT_USE_SAF_UTILITIES
64#ifdef AFSTFT_USE_SAF_UTILITIES
66#else
67# include <stdio.h>
68# include <stdlib.h>
69# include <string.h>
70#endif
71
73extern const float __afSTFT_protoFilter1024[10240];
74
76extern const float __afSTFT_protoFilter1024LD[10240];
77
84
99void afSTFT_create(void ** const phSTFT,
100 int nCHin,
101 int nCHout,
102 int hopsize,
103 int lowDelayMode,
104 int hybridmode,
105 AFSTFT_FDDATA_FORMAT format);
106
112void afSTFT_destroy(void ** const phSTFT);
113
122void afSTFT_forward(void * const hSTFT,
123 float** dataTD,
124 int framesize,
125 float_complex*** dataFD);
126
141void afSTFT_forward_knownDimensions(void * const hSTFT,
142 float** dataTD,
143 int framesize,
144 int dataFD_nCH,
145 int dataFD_nHops,
146 float_complex*** dataFD);
147
156void afSTFT_forward_flat(void * const hSTFT,
157 float* dataTD,
158 int framesize,
159 float_complex* dataFD);
160
169void afSTFT_backward(void * const hSTFT,
170 float_complex*** dataFD,
171 int framesize,
172 float** dataTD);
173
188void afSTFT_backward_knownDimensions(void * const hSTFT,
189 float_complex*** dataFD,
190 int framesize,
191 int dataFD_nCH,
192 int dataFD_nHops,
193 float** dataTD);
194
203void afSTFT_backward_flat(void * const hSTFT,
204 float_complex* dataFD,
205 int framesize,
206 float* dataTD);
207
216void afSTFT_channelChange(void * const hSTFT,
217 int new_nCHin,
218 int new_nCHout);
219
221void afSTFT_clearBuffers(void * const hSTFT);
222
224int afSTFT_getNBands(void * const hSTFT);
225
239int afSTFT_getProcDelay(void * const hSTFT);
240
242void afSTFT_getCentreFreqs(void * const hSTFT,
243 float fs,
244 int nBands,
245 float* freqVector);
246
261void afSTFT_FIRtoFilterbankCoeffs(/* Input Arguments */
262 float* hIR,
263 int N_dirs,
264 int nCH,
265 int ir_len,
266 int hopSize,
267 int LDmode,
268 int hybridmode,
269 /* Output Arguments */
270 float_complex* hFB);
271
272
273#ifdef __cplusplus
274}/* extern "C" */
275#endif /* __cplusplus */
276
277#endif /* __afSTFTlib_INCLUDED__ */
const float __afSTFT_protoFilter1024[10240]
Prototype filter used by afSTFTlib.
void afSTFT_backward_flat(void *const hSTFT, float_complex *dataFD, int framesize, float *dataTD)
Performs backward afSTFT transform (flattened arrays)
Definition afSTFTlib.c:434
void afSTFT_FIRtoFilterbankCoeffs(float *hIR, int N_dirs, int nCH, int ir_len, int hopSize, int LDmode, int hybridmode, float_complex *hFB)
Converts FIR filters into Filterbank Coefficients by passing them through the afSTFT filterbank.
Definition afSTFTlib.c:593
void afSTFT_forward_flat(void *const hSTFT, float *dataTD, int framesize, float_complex *dataFD)
Performs forward afSTFT transform (flattened arrays)
Definition afSTFTlib.c:311
int afSTFT_getNBands(void *const hSTFT)
Returns number of frequency bands.
Definition afSTFTlib.c:528
void afSTFT_clearBuffers(void *const hSTFT)
Flushes time-domain buffers with zeros.
Definition afSTFTlib.c:519
void afSTFT_create(void **const phSTFT, int nCHin, int nCHout, int hopsize, int lowDelayMode, int hybridmode, AFSTFT_FDDATA_FORMAT format)
Creates an instance of afSTFT.
Definition afSTFTlib.c:143
int afSTFT_getProcDelay(void *const hSTFT)
Returns current processing delay, in samples.
Definition afSTFTlib.c:537
AFSTFT_FDDATA_FORMAT
Options for how the frequency domain data is permuted when using afSTFT.
Definition afSTFTlib.h:79
@ AFSTFT_TIME_CH_BANDS
nTimeHops x nChannels x nBands
Definition afSTFTlib.h:81
@ AFSTFT_BANDS_CH_TIME
nBands x nChannels x nTimeHops
Definition afSTFTlib.h:80
const float __afSTFT_protoFilter1024LD[10240]
Prototype filter used by afSTFTlib (low-delay mode)
void afSTFT_backward_knownDimensions(void *const hSTFT, float_complex ***dataFD, int framesize, int dataFD_nCH, int dataFD_nHops, float **dataTD)
Performs backward afSTFT transform (dataFD dimensions are known)
Definition afSTFTlib.c:391
void afSTFT_forward(void *const hSTFT, float **dataTD, int framesize, float_complex ***dataFD)
Performs forward afSTFT transform.
Definition afSTFTlib.c:230
void afSTFT_forward_knownDimensions(void *const hSTFT, float **dataTD, int framesize, int dataFD_nCH, int dataFD_nHops, float_complex ***dataFD)
Performs forward afSTFT transform (dataFD dimensions are known)
Definition afSTFTlib.c:268
void afSTFT_getCentreFreqs(void *const hSTFT, float fs, int nBands, float *freqVector)
Returns current frequency vector.
Definition afSTFTlib.c:546
void afSTFT_destroy(void **const phSTFT)
Destroys an instance of afSTFT.
Definition afSTFTlib.c:199
void afSTFT_channelChange(void *const hSTFT, int new_nCHin, int new_nCHout)
Re-allocates memory to support a change in the number of input/output channels.
Definition afSTFTlib.c:477
void afSTFT_backward(void *const hSTFT, float_complex ***dataFD, int framesize, float **dataTD)
Performs backward afSTFT transform.
Definition afSTFTlib.c:348
Main header for the utilities module (SAF_UTILITIES_MODULE)