Typedefs | |
| typedef int | gla_callback_status(dgtreal_plan *p, void *userdata, LTFAT_COMPLEX c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, double *alpha, ltfat_int iter) |
| typedef int | gla_callback_cmod(void *userdata, LTFAT_COMPLEX c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M) |
| typedef int | gla_callback_fmod(void *userdata, LTFAT_REAL f[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M) |
Functions | |
| int | gla (const LTFAT_COMPLEX cinit[], const LTFAT_REAL g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int iter, LTFAT_COMPLEX c[]) |
| int | gla_init (const LTFAT_COMPLEX cinit[], const LTFAT_REAL g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, const double alpha, LTFAT_COMPLEX c[], phaseret_dgtreal_params *params, gla_plan **p) |
| int | gla_execute (gla_plan *p, ltfat_int iter) |
| int | gla_execute_newarray (gla_plan *p, const LTFAT_COMPLEX cinit[], ltfat_int iter, LTFAT_COMPLEX c[]) |
| int | gla_done (gla_plan **p) |
| int | gla_set_status_callback (gla_plan *p, gla_callback_status *callback, void *userdata) |
| int | gla_set_cmod_callback (gla_plan *p, gla_callback_cmod *callback, void *userdata) |
| int | gla_set_fmod_callback (gla_plan *p, gla_callback_fmod *callback, void *userdata) |
The implementation follows papers [2] [5]
| typedef int gla_callback_cmod(void *userdata, LTFAT_COMPLEX c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M) |
Function prototype for coefficient modification callback
M2 = M/2 + 1, N = L/a
| [in] | userdata | User defined data |
| [in,out] | c | Set of coefficients to by updated, size M2 x N x W |
| [in] | L | Signal length |
| [in] | W | Number of signal channels |
| [in] | a | Time hop factor |
| [in] | M | Number of frequency channels |
phaseret_gla_callback_cmod_d(void* userdata, ltfat_complex_d c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M);
phaseret_gla_callback_cmod_s(void* userdata, ltfat_complex_s c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M);
| Status code | Meaning |
|---|---|
| 0 | Signalizes that callback exited without error |
| <0 | Callback exited with error |
| typedef int gla_callback_fmod(void *userdata, LTFAT_REAL f[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M) |
Function prototype for signal modification callback
| [in] | userdata | User defined data |
| [in,out] | f | Time-domain signal to be updated, size L x W |
| [in] | L | Signal length |
| [in] | W | Number of signal channels |
| [in] | a | Time hop factor |
| [in] | M | Number of frequency channels |
phaseret_gla_callback_fmod_d(void* userdata, double f[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M);
phaseret_gla_callback_fmod_s(void* userdata, float f[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M);
| Status code | Meaning |
|---|---|
| 0 | Signalizes that callback exited without error |
| <0 | Callback exited with error |
| typedef int gla_callback_status(dgtreal_plan *p, void *userdata, LTFAT_COMPLEX c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, double *alpha, ltfat_int iter) |
Function prototype for status callback
The callback is executed at the end of each iteration.
M2 = M/2 + 1, N = L/a
| [in] | p | DGTREAL analysis-synthesis plan |
| [in] | userdata | User defined data |
| [in,out] | c | Set of coefficients at the end of iteration, size M2 x N x W |
| [in] | L | Signal length |
| [in] | W | Number of signal channels |
| [in] | a | Time hop factor |
| [in] | M | Number of frequency channels |
| [in] | alpha | Acceleration parameter |
| [in] | iter | Current iteration |
phaseret_gla_callback_status_d(phaseret_dgtreal_plan_d* p, void* userdata, ltfat_complex_d c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, double* alpha, ltfat_int iter);
phaseret_gla_callback_status_s(phaseret_dgtreal_plan_s* p, void* userdata, ltfat_complex_s c[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, double* alpha, ltfat_int iter);
| Status code | Meaning |
|---|---|
| 0 | Signalizes that callback exited without error |
| >0 | Signalizes that callback exited without error but terminate the algorithm prematurely |
| <0 | Callback exited with error |
| int gla | ( | const LTFAT_COMPLEX | cinit[], |
| const LTFAT_REAL | g[], | ||
| ltfat_int | L, | ||
| ltfat_int | gl, | ||
| ltfat_int | W, | ||
| ltfat_int | a, | ||
| ltfat_int | M, | ||
| ltfat_int | iter, | ||
| LTFAT_COMPLEX | c[] | ||
| ) |
Griffin-Lim algorithm
M2 = M/2 + 1, N = L/a
| [in] | cinit | Initial set of coefficients, size M2 x N x W |
| [in] | g | Analysis window, size gl x 1 |
| [in] | L | Signal length |
| [in] | gl | Window length |
| [in] | W | Number of signal channels |
| [in] | a | Time hop factor |
| [in] | M | Number of frequency channels |
| [in] | iter | Number of iterations |
| [out] | cout | Coefficients with reconstructed phase, size M2 x N x W |
phaseret_gla_d(const ltfat_complex_d cinit[], const double g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int iter, ltfat_complex_d c[]);
phaseret_gla_s(const ltfat_complex_s cinit[], const float g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int iter, ltfat_complex_s c[]);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | cinit or g or cout was NULL |
| LTFATERR_BADSIZE | Signal length L is less or equal to 0. |
| LTFATERR_NOTPOSARG | At least one of W, a, M, gl was less or equal to zero. |
| LTFATERR_BADTRALEN | L is not divisible by both a and M. |
| LTFATERR_NOTAFRAME | System does not form a frame |
| LTFATERR_INITFAILED | The FFTW plan creation failed |
| LTFATERR_NOTSUPPORTED | This is a non-painless system but its support was not compiled |
| LTFATERR_NOMEM | Memory allocation error occurred |
| int gla_done | ( | gla_plan ** | p | ) |
Destroy Griffin-Lim algorithm plan
| [in] | p | Griffin-lim algorithm plan |
phaseret_gla_done_d(phaseret_gla_plan_d** p);
phaseret_gla_done_s(phaseret_gla_plan_s** p);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | p or *p was NULL |
| int gla_execute | ( | gla_plan * | p, |
| ltfat_int | iter | ||
| ) |
Execute Griffin-Lim algorithm plan
M2 = M/2 + 1, N = L/a
| [in] | p | Griffin-lim algorithm plan [in] iter Number of iterations |
phaseret_gla_execute_d(phaseret_gla_plan_d* p, ltfat_int iter);
phaseret_gla_execute_s(phaseret_gla_plan_s* p, ltfat_int iter);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | p was NULL or the plan was created with cinit or cout being NULL |
| LTFATERR_NOTPOSARG | iter was not positive |
| LTFATERR_BADARG | alpha was set to a negative number in the status callback |
| LTFATERR_NOMEM | Memory allocation error occurred |
| any | Error code from some of the callbacks |
| int gla_execute_newarray | ( | gla_plan * | p, |
| const LTFAT_COMPLEX | cinit[], | ||
| ltfat_int | iter, | ||
| LTFAT_COMPLEX | c[] | ||
| ) |
Execute Griffin-Lim algorithm plan on a new array
M2 = M/2 + 1, N = L/a
| [in] | p | Griffin-lim algorithm plan |
| [in] | cinit | Initial set of coefficients, size M2 x N x W [in] iter Number of iterations |
| [in] | cout | Coefficients with reconstructed phase, size M2 x N x W |
phaseret_gla_execute_newarray_d(phaseret_gla_plan_d* p, const ltfat_complex_d cinit[], ltfat_int iter, ltfat_complex_d c[]);
phaseret_gla_execute_newarray_s(phaseret_gla_plan_s* p, const ltfat_complex_s cinit[], ltfat_int iter, ltfat_complex_s c[]);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | p or cinit or cout was NULL |
| LTFATERR_NOTPOSARG | iter was not positive |
| LTFATERR_BADARG | alpha was set to a negative number in the status callback |
| LTFATERR_NOMEM | Memory allocation error occurred |
| any | Error code from some of the callbacks |
| int gla_init | ( | const LTFAT_COMPLEX | cinit[], |
| const LTFAT_REAL | g[], | ||
| ltfat_int | L, | ||
| ltfat_int | gl, | ||
| ltfat_int | W, | ||
| ltfat_int | a, | ||
| ltfat_int | M, | ||
| const double | alpha, | ||
| LTFAT_COMPLEX | c[], | ||
| phaseret_dgtreal_params * | params, | ||
| gla_plan ** | p | ||
| ) |
Initialize Griffin-Lim algorithm plan
M2 = M/2 + 1, N = L/a
| [in] | cinit | Initial set of coefficients, size M2 x N x W or NULL |
| [in] | g | Analysis window, size gl x 1 |
| [in] | L | Signal length |
| [in] | gl | Window length |
| [in] | W | Number of signal channels |
| [in] | a | Time hop factor |
| [in] | M | Number of frequency channels |
| [in] | alpha | Acceleration constant |
| [in] | c | Array for holding coefficients with reconstructed phase, size M2 x N x W or NULL if flags == FFTW_ESTIMATE |
| [in] | hint | DGT algorithm hint |
| [in] | flags | FFTW planning flag |
| [out] | p | GLA Plan |
phaseret_gla_init_d(const ltfat_complex_d cinit[], const double g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, double alpha, ltfat_complex_d c[], phaseret_dgtreal_hint hint, unsigned flags, phaseret_gla_plan_d** p);
phaseret_gla_init_s(const ltfat_complex_s cinit[], const double g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, double alpha, ltfat_complex_s c[], phaseret_dgtreal_hint hint, unsigned flags, phaseret_gla_plan_s** p);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | cinit or g or or p was NULL or c was NULL and flags != FFTW_ESTIMATE |
| LTFATERR_BADSIZE | Signal length L is less or equal to 0. |
| LTFATERR_NOTPOSARG | At least one of W, a, M, gl was less or equal to zero. |
| LTFATERR_BADTRALEN | L is not divisible by both a and M. |
| LTFATERR_NOTAFRAME | System does not form a frame |
| LTFATERR_INITFAILED | The FFTW plan creation failed |
| LTFATERR_NOTSUPPORTED | This is a non-painless system but its support was not compiled |
| LTFATERR_BADARG | alpha was set to a negative number |
| LTFATERR_CANNOTHAPPEN | hint does not have a valid value from phaseret_dgtreal_hint or ptype is not valid value from ltfat_phaseconvention enum |
| LTFATERR_NOMEM | Memory allocation error occurred |
| int gla_set_cmod_callback | ( | gla_plan * | p, |
| gla_callback_cmod * | callback, | ||
| void * | userdata | ||
| ) |
Register coefficient modification callback
| [in] | p | Griffin-lim algorithm plan |
| [in] | callback | Callback function |
| [in] | userdata | User defined data |
phaseret_gla_set_cmod_callback_d(phaseret_gla_plan_d* p, phaseret_gla_callback_cmod_d* callback, void* userdata);
phaseret_gla_set_cmod_callback_s(phaseret_gla_plan_s* p, phaseret_gla_callback_cmod_s* callback, void* userdata);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | p or callback was NULL |
| int gla_set_fmod_callback | ( | gla_plan * | p, |
| gla_callback_fmod * | callback, | ||
| void * | userdata | ||
| ) |
Register signal modification callback
| [in] | p | Griffin-lim algorithm plan |
| [in] | callback | Callback function |
| [in] | userdata | User defined data |
phaseret_set_fmod_callback_d(phaseret_gla_plan_d* p, phaseret_gla_callback_fmod_d* callback, void* userdata);
phaseret_set_fmod_callback_s(phaseret_gla_plan_s* p, phaseret_gla_callback_fmod_s* callback, void* userdata);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | p or callback was NULL |
| int gla_set_status_callback | ( | gla_plan * | p, |
| gla_callback_status * | callback, | ||
| void * | userdata | ||
| ) |
Register status callback
| [in] | p | Griffin-lim algorithm plan |
| [in] | callback | Callback function |
| [in] | userdata | User defined data |
phaseret_gla_set_status_callback_d(phaseret_gla_plan_d* p, phaseret_gla_callback_status_d* callback, void* userdata);
phaseret_gla_set_status_callback_s(phaseret_gla_plan_s* p, phaseret_gla_callback_status_s* callback, void* userdata);
| Status code | Description |
|---|---|
| LTFATERR_SUCCESS | No error occurred |
| LTFATERR_NULLPOINTER | p or callback was NULL |