Functions | |
int | spsi (const LTFAT_REAL s[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, LTFAT_REAL initphase[], LTFAT_COMPLEX c[]) |
int | spsi_withmask (const LTFAT_COMPLEX cin[], const int mask[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, LTFAT_REAL initphase[], LTFAT_COMPLEX c[]) |
The implementation follows papers [1] .
int spsi | ( | const LTFAT_REAL | s[], |
ltfat_int | L, | ||
ltfat_int | W, | ||
ltfat_int | a, | ||
ltfat_int | M, | ||
LTFAT_REAL | initphase[], | ||
LTFAT_COMPLEX | c[] | ||
) |
SPSI algorithm implementation
M2 = M/2 + 1, N = L/a
[in] | s | Target magnitude, size M2 x N x W |
[in] | L | Transform length |
[in] | W | Number of signal channels |
[in] | a | Hop factor |
[in] | M | Number of frequency channels |
[in,out] | initphase | [in] phase of -1 frame, [out] phase of [N-1] frame, size M2 x W or NULL, but then a memory allocation will occur. |
[out] | c | Coefficients with reconstructed phase, size M2 x N x W |
phaseret_spsi_d(const double s[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, double initphase[], ltfat_complex_d c[]);
phaseret_spsi_s(const float s[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, float initphase[], ltfat_complex_s c[]);
Status code | Description |
---|---|
LTFATERR_SUCCESS | No error occurred |
LTFATERR_NULLPOINTER | s or c was NULL |
LTFATERR_NOTPOSARG | At least one of the following was not positive: L, W, a, M |
LTFATERR_NOMEM | Heap allocation failed |
int spsi_withmask | ( | const LTFAT_COMPLEX | cin[], |
const int | mask[], | ||
ltfat_int | L, | ||
ltfat_int | W, | ||
ltfat_int | a, | ||
ltfat_int | M, | ||
LTFAT_REAL | initphase[], | ||
LTFAT_COMPLEX | c[] | ||
) |
Masked SPSI algorithm implementation
Works as spsi() except c[ii]=cinit[ii] if mask[ii] evaluates to true.
M2 = M/2 + 1, N = L/a
[in] | cinit | Initial coefficients, size M2 x N x W |
[in] | mask | Mask of known coefficients |
[in] | L | Transform length |
[in] | W | Number of signal channels |
[in] | a | Hop factor |
[in] | M | Number of frequency channels |
[in,out] | initphase | [in] phase of -1 frame, [out] phase of [N-1] frame, size M2 x W or NULL, but then a memory allocation will occur. |
[out] | c | Coefficients with reconstructed phase, size M2 x N x W |
phaseret_spsi_withmask_d(const ltfat_complex_d cin[], const int mask[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, double initphase[], ltfat_complex_d c[]);
phaseret_spsi_withmask_s(const ltfat_complex_s cin[], const int mask[], ltfat_int L, ltfat_int W, ltfat_int a, ltfat_int M, float initphase[], ltfat_complex_s c[]);
Status code | Description |
---|---|
LTFATERR_SUCCESS | No error occurred |
LTFATERR_NULLPOINTER | cinit, c or mask was NULL |
LTFATERR_NOTPOSARG | At least one of the following was not positive: L, W, a, M |
LTFATERR_NOMEM | Heap allocation failed |