Functions
Real-Time Spectrogram Inversion with Look Ahead

Functions

int rtisila_init (const LTFAT_REAL g[], ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, rtisila_state **p)
 
int rtisila_init_win (LTFAT_FIRWIN win, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, rtisila_state **p)
 
int rtisila_set_lookahead (rtisila_state *p, ltfat_int lookahead)
 
int rtisila_execute (rtisila_state *p, const LTFAT_REAL s[], LTFAT_COMPLEX c[])
 
int rtisila_reset (rtisila_state *p)
 
int rtisila_done (rtisila_state **p)
 
int rtisilaoffline (const LTFAT_REAL s[], const LTFAT_REAL g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, LTFAT_COMPLEX c[])
 

Detailed Description

Algorithm Description

The implementation follows paper [8].

Function Documentation

int rtisila_done ( rtisila_state **  p)

Destroy a RTISILA Plan.

Parameters
[in]pRTISILA Plan

Versions

phaseret_rtisila_done_d(phaseret_rtisila_state_d** p);

phaseret_rtisila_done_s(phaseret_rtisila_state_s** p);

Returns
Status code Description
LTFATERR_SUCCESS Indicates no error
LTFATERR_NULLPOINTER p or *p was NULL.
int rtisila_execute ( rtisila_state *  p,
const LTFAT_REAL  s[],
LTFAT_COMPLEX  c[] 
)

Execute RTISILA plan for a single time frame

The function is intedned to be called for consecutive stream of frames as it reuses some data from the previous frames stored in the state.

c is lagging behind s by lookahead frames.

M2=M/2+1

Parameters
[in]pRTISILA plan
[in]sTarget magnitude, size M2 x W
[out]cReconstructed coefficients, size M2 x W

Versions

phaseret_rtisila_execute_d(phaseret_rtisila_state_d* p, const double s[], ltfat_complex_d c[]);

phaseret_rtisila_execute_s(phaseret_rtisila_state_s* p, const float s[], ltfat_complex_s c[]);

Returns
Status code Description
LTFATERR_SUCCESS Indicates no error
LTFATERR_NULLPOINTER At least one of the following was NULL: p, s and c
int rtisila_init ( const LTFAT_REAL  g[],
ltfat_int  gl,
ltfat_int  W,
ltfat_int  a,
ltfat_int  M,
ltfat_int  lookahead,
ltfat_int  maxit,
rtisila_state **  p 
)

Create a RTISILA state.

Parameters
[in]gAnalysis window
[in]glWindow length
[in]WNumber of signal channels
[in]aHop size
[in]MNumber of frequency channels (FFT length)
[in]lookahead(Maximum) number of lookahead frames
[in]maxitNumber of iterations. The number of per-frame iterations is (lookahead+1) * maxit.
[out]pRTISILA state

Versions

phaseret_rtisila_init_d(const double g[], ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, phaseret_rtisila_state_d** p);

phaseret_rtisila_init_s(const float g[], ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, phaseret_rtisila_state_s** p);

Returns
Status code Description
LTFATERR_SUCCESS Indicates no error
LTFATERR_NULLPOINTER p or g was NULL
LTFATERR_BADARG lookahead was a negative number
LTFATERR_BADSIZE gl was not positive
LTFATERR_NOTPOSARG One of the following was not positive: W, a, M, maxit
LTFATERR_NOTAFRAME System is not a frame.
LTFATERR_NOTPAINLESS System is not painless.
LTFATERR_INITFAILED FFTW plan creation failed
LTFATERR_NOMEM Indentifies that heap allocation failed
int rtisila_init_win ( LTFAT_FIRWIN  win,
ltfat_int  gl,
ltfat_int  W,
ltfat_int  a,
ltfat_int  M,
ltfat_int  lookahead,
ltfat_int  maxit,
rtisila_state **  p 
)

Create a RTISILA Plan from a window.

Parameters
[in]winAnalysis window
[in]glWindow length
[in]WNumber of signal channels
[in]aHop size
[in]MNumber of frequency channels (FFT length)
[in]lookahead(Maximum) number of lookahead frames
[in]maxitNumber of iterations. The number of per-frame iterations is (lookahead+1) * maxit.
[out]pRTISILA state

Versions

phaseret_rtisila_init_win_d(LTFAT_FIRWIN win, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, phaseret_rtisila_state_d** p);

phaseret_rtisila_init_win_s(LTFAT_FIRWIN win, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, phaseret_rtisila_state_s** p);

Returns
Status code Description
LTFATERR_SUCCESS Indicates no error
LTFATERR_CANNOTHAPPEN win is not a valid value from the LTFAT_FIRWIN enum
LTFATERR_NULLPOINTER p or g was NULL
LTFATERR_BADARG lookahead was a negative number
LTFATERR_BADSIZE gl was not positive
LTFATERR_NOTPOSARG One of the following was not positive: W, a, M, maxit
LTFATERR_NOTAFRAME System is not a frame.
LTFATERR_NOTPAINLESS System is not painless.
LTFATERR_INITFAILED FFTW plan creation failed
LTFATERR_NOMEM Indentifies that heap allocation failed
int rtisila_reset ( rtisila_state *  p)

Reset buffers of rtisila_state

Versions

phaseret_rtisila_reset_d(phaseret_rtisila_state_d* p);

phaseret_rtisila_reset_s(phaseret_rtisila_state_s* p);

Returns
Status code Description
LTFATERR_SUCCESS Indicates no error
LTFATERR_NULLPOINTER p or *p was NULL.
int rtisila_set_lookahead ( rtisila_state *  p,
ltfat_int  lookahead 
)

Change number of lookahead frames

The number of frames can only be less or equal to the number of lookahead frames specified in the init function.

Note
This is not thread safe.
Parameters
[in]pRTISILA Plan
[in]lookaheadNumber of lookahead frame

Versions

phaseret_rtisila_set_lookahead_d(phaseret_rtisila_state_d* p, ltfat_int lookahead);

phaseret_rtisila_set_lookahead_s(phaseret_rtisila_state_s* p, ltfat_int lookahead);

Returns
Status code Description
LTFATERR_SUCCESS Indicates no error
LTFATERR_NULLPOINTER p was NULL
LTFATERR_BADARG lookahead was a negative number or greater than max lookahead
int rtisilaoffline ( const LTFAT_REAL  s[],
const LTFAT_REAL  g[],
ltfat_int  L,
ltfat_int  gl,
ltfat_int  W,
ltfat_int  a,
ltfat_int  M,
ltfat_int  lookahead,
ltfat_int  maxit,
LTFAT_COMPLEX  c[] 
)

Do RTISI-LA for a complete magnitude spectrogram and compensate delay

This function just creates a plan, executes it for each col in s and c and destroys it.

M2 = M/2 + 1, N = L/a The total number of per-frame iterations is: maxit x (lookahead + 1)

Parameters
[in]sMagnitude spectrogram, size M2 x N x W
[in]gAnalysis window, size gl x 1
[in]LTransform length
[in]glWindow length
[in]WNumber of signal channels
[in]aHop size
[in]MNumber of frequency channels (FFT length)
[in]lookaheadNumber of lookahead frames
[in]maxitNumber of per-frame iterations
[out]cReconstructed coefficients M2 x N array

Versions

phaseret_rtisilaoffline_d(const double s[], const double g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, ltfat_complex_d c[]);

phaseret_rtisilaoffline_s(const float s[], const float g[], ltfat_int L, ltfat_int gl, ltfat_int W, ltfat_int a, ltfat_int M, ltfat_int lookahead, ltfat_int maxit, ltfat_complex_s c[]);