SAF
Loading...
Searching...
No Matches
saf_utility_qmf.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
33#ifndef SAF_QMF_H_INCLUDED
34#define SAF_QMF_H_INCLUDED
35
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
40#include "saf_utility_complex.h"
41
48
62void qmf_create(/* Input Arguments */
63 void ** const phQMF,
64 int nCHin,
65 int nCHout,
66 int hopsize,
67 int hybridmode,
68 QMF_FDDATA_FORMAT format);
69
75void qmf_destroy(void ** const phQMF);
76
85void qmf_analysis(/* Input Arguments */
86 void * const hQMF,
87 float** dataTD,
88 int framesize,
89 /* Output Arguments */
90 float_complex*** dataFD);
91
100void qmf_synthesis(/* Input Arguments */
101 void * const hQMF,
102 float_complex*** dataFD,
103 int framesize,
104 /* Output Arguments */
105 float** dataTD);
106
114void qmf_channelChange(void * const hQMF,
115 int new_nCHin,
116 int new_nCHout);
117
119void qmf_clearBuffers(void * const hQMF);
120
129int qmf_getProcDelay(void * const hQMF);
130
132int qmf_getNBands(void * const hQMF);
133
144void qmf_getCentreFreqs(/* Input Arguments */
145 void * const hQMF,
146 float fs,
147 int nBands,
148 /* Output Arguments */
149 float* centreFreq);
150
164void qmf_FIRtoFilterbankCoeffs(/* Input Arguments */
165 float* hIR,
166 int N_dirs,
167 int nCH,
168 int ir_len,
169 int hopSize,
170 int hybridmode,
171 /* Output Arguments */
172 float_complex* hFB);
173
174
175#ifdef __cplusplus
176}/* extern "C" */
177#endif /* __cplusplus */
178
179#endif /* SAF_QMF_H_INCLUDED */
180
181 /* doxygen addtogroup Utilities */
void qmf_FIRtoFilterbankCoeffs(float *hIR, int N_dirs, int nCH, int ir_len, int hopSize, int hybridmode, float_complex *hFB)
Converts FIR filters into Filterbank Coefficients by passing them through the QMF filterbank.
void qmf_getCentreFreqs(void *const hQMF, float fs, int nBands, float *centreFreq)
Computes the QMF/hybrid-QMF centre frequencies.
QMF_FDDATA_FORMAT
Options for how the frequency domain data is permuted when using qmf.
int qmf_getProcDelay(void *const hQMF)
Returns the processing delay in samples.
void qmf_synthesis(void *const hQMF, float_complex ***dataFD, int framesize, float **dataTD)
Performs QMF synthesis of the input frequency-domain signals.
void qmf_channelChange(void *const hQMF, int new_nCHin, int new_nCHout)
Changes the number input and/or output channels.
void qmf_analysis(void *const hQMF, float **dataTD, int framesize, float_complex ***dataFD)
Performs QMF analysis of the input time-domain signals.
void qmf_destroy(void **const phQMF)
Destroys an instance of the qmf filterbank.
int qmf_getNBands(void *const hQMF)
Returns the number of frequency bands.
void qmf_clearBuffers(void *const hQMF)
Flushes the analysis and synthesis buffers with zeros.
void qmf_create(void **const phQMF, int nCHin, int nCHout, int hopsize, int hybridmode, QMF_FDDATA_FORMAT format)
Creates an instance of the qmf filterbank.
@ QMF_BANDS_CH_TIME
nBands x nChannels x nTimeHops
@ QMF_TIME_CH_BANDS
nTimeHops x nChannels x nBands
Contains wrappers for handling complex numbers across both C99-compliant compilers and Microsoft Visu...