Functions
Single Pass Spectrogram Inversion

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[])
 

Detailed Description

Algorithm Description

The implementation follows papers [1] .

Function Documentation

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

Parameters
[in]sTarget magnitude, size M2 x N x W
[in]LTransform length
[in]WNumber of signal channels
[in]aHop factor
[in]MNumber 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]cCoefficients with reconstructed phase, size M2 x N x W

Versions

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[]);

Returns
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

Parameters
[in]cinitInitial coefficients, size M2 x N x W
[in]maskMask of known coefficients
[in]LTransform length
[in]WNumber of signal channels
[in]aHop factor
[in]MNumber 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]cCoefficients with reconstructed phase, size M2 x N x W

Versions

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[]);

Returns
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