x
|
Go to the source code of this file.
Typedefs | |
typedef double(* | TBasicAnalyzer) (double *fs, double *as, double *phs, double *das, cdouble *x, int Count, int Wid, int Offst, __int16 *ref, int reserved, bool LogA) |
Functions | |
double | ddsincd_unn (double x, int N) |
double | dsincd_unn (double x, int N) |
cdouble * | Window (cdouble *x, double f, int N, int M, double *c, int K1, int K2) |
void | dWindow (cdouble *dx, cdouble *x, double f, int N, int M, double *c, int K1, int K2) |
void | ddWindow (cdouble *ddx, cdouble *dx, cdouble *x, double f, int N, int M, double *c, int K1, int K2) |
cdouble | IPWindowC (double f, cdouble *x, int N, int M, double *c, double iH2, int K1, int K2) |
double | IPWindow (double f, cdouble *x, int N, int M, double *c, double iH2, int K1, int K2, bool returnamplitude) |
double | IPWindow (double f, void *params) |
double | ddIPWindow (double f, void *params) |
double | ddIPWindow (double f, cdouble *x, int N, int M, double *c, double iH2, int K1, int K2, double &dipwindow, double &ipwindow) |
double | sIPWindow (double f, int L, cdouble **x, int N, int M, double *c, double iH2, int K1, int K2, cdouble *ej2ph=0) |
double | sIPWindow (double f, void *params) |
double | dsIPWindow (double f, int L, cdouble **x, int N, int M, double *c, double iH2, int K1, int K2, double &sip) |
double | dsIPWindow (double f, void *params) |
double | ddsIPWindow (double f, int L, cdouble **x, int N, int M, double *c, double iH2, int K1, int K2, double &dsip, double &sip) |
double | ddsIPWindow (double f, void *params) |
double | ddsIPWindow_unn (double f, cdouble *x, int N, int M, double *c, int K1, int K2, double &dsipwindow, double &sipwindow, cdouble *w_unn=0) |
double | sIPWindowC (double f, int L, double offst_rel, cdouble **x, int N, int M, double *c, double iH2, int K1, int K2, cdouble *ej2ph=0) |
double | sIPWindowC (double f, void *params) |
double | dsIPWindowC (double f, int L, double offst_rel, cdouble **x, int N, int M, double *c, double iH2, int K1, int K2, double &sip) |
double | dsIPWindowC (double f, void *params) |
double | ddsIPWindowC (double f, int L, double offst_rel, cdouble **x, int N, int M, double *c, double iH2, int K1, int K2, double &dsip, double &sip) |
double | ddsIPWindowC (double f, void *params) |
double | LSESinusoid (cdouble *x, int N, double B, int M, double *c, double iH2, double &a, double &pp, double epf=1e-6) |
void | LSESinusoid (double &f, cdouble *x, int N, double B, int M, double *c, double iH2, double &a, double &pp, double epf=1e-6) |
double | LSESinusoid (int f1, int f2, cdouble *x, int N, double B, int M, double *c, double iH2, double &a, double &pp, double epf) |
int | LSESinusoid (double &f, double f1, double f2, cdouble *x, int N, double B, int M, double *c, double iH2, double &a, double &pp, double epf) |
double | LSESinusoidMP (double &f, double f1, double f2, cdouble **x, int Fr, int N, double B, int M, double *c, double iH2, double *a, double *ph, double epf) |
void | IPMulti (int I, double *f, cdouble *lmd, cdouble *x, int Wid, int K1, int K2, int M, double *c, double eps=0) |
void | IPMulti (int I, double *f, cdouble *lmd, cfloat *x, int Wid, int K1, int K2, int M, double *c, double eps=0, double *sens=0, double *r1=0) |
void | IPMultiSens (int I, double *f, int Wid, int K1, int K2, int M, double *c, double *sens, double eps=0) |
double | IPMulti (int I, double *f, cdouble *lmd, cdouble *x, int Wid, int M, double *c, double iH2, int B) |
double | IPMulti_Direct (int I, double *f, double *ph, double *a, cdouble *x, int Wid, int M, double *c, double iH2, int B) |
double | IPMulti_GS (int I, double *f, double *ph, double *a, cdouble *x, int Wid, int M, double *c, double iH2, int B, double **L=0, double **Q=0) |
cdouble * | IPMulti (int I, int J, double *f, double *ph, double *a, cdouble *x, int Wid, int M, double *c, cdouble **wt=0, cdouble **Q=0, double **L=0, MList *RetList=0) |
double | WindowDuo (double df, int N, double *d, int M, cdouble *w) |
double | ddWindowDuo (double df, int N, double *d, int M, double &dwindow, double &window, cdouble *w) |
double | sIPWindowDuo (double f1, double f2, cdouble *x, int N, double *c, double *d, int M, double iH2, int K1, int K2, cdouble &lmd1, cdouble &lmd2) |
double | sIPWindowDuo (double f2, void *params) |
void | ddsIPWindowDuo (double *ddsip2, double f1, double f2, cdouble *x, int N, double *c, double *d, int M, double iH2, int K1, int K2, cdouble &lmd1, cdouble &lmd2) |
double | ddsIPWindowDuo (double f2, void *params) |
int | LSEDuo (double &f2, double fmin, double fmax, double f1, cdouble *x, int N, double B, double *c, double *d, int M, double iH2, cdouble &r1, cdouble &r2, double epf) |
void | TFReas (double &f, double &t, double &fslope, int Wid, cdouble *data, double *win, double *dwin, double *ddwin, double *plogaslope=0) |
void | TFReas (double &f, double t, double &a, double &ph, double &fslope, int Wid, cdouble *data, double *w, double *dw, double *ddw, double *win=0) |
void | AdditiveUpdate (double *fs, double *as, double *phs, double *das, cdouble *x, int Count, int Wid, int Offst, TBasicAnalyzer BasicAnalyzer, int reserved, bool LogA=false) |
void | AdditiveAnalyzer (double *fs, double *as, double *phs, double *das, cdouble *x, int Count, int Wid, int Offst, __int16 *ref, TBasicAnalyzer BasicAnalyzer, int reserved, bool LogA=false) |
void | MultiplicativeUpdate (double *fs, double *as, double *phs, double *das, cdouble *x, int Count, int Wid, int Offst, TBasicAnalyzer BasicAnalyzer, int reserved, bool LogA=false) |
void | MultiplicativeAnalyzer (double *fs, double *as, double *phs, double *das, cdouble *x, int Count, int Wid, int Offst, __int16 *ref, TBasicAnalyzer BasicAnalyzer, int reserved, bool LogA=false) |
void | MultiplicativeUpdateF (double *fs, double *as, double *phs, __int16 *x, int Fr, int frst, int fren, int Wid, int Offst) |
void | ReEstFreq (int FrCount, int Wid, int Offst, double *x, double *fbuf, double *abuf, double *pbuf, double *win, int M, double *c, double iH2, cdouble *w, cdouble *xc, cdouble *xs, double *ps, double *fa, double *fb, double *fc, double *fd, double *ns, int *Wids=0) |
void | ReEstFreq_2 (int FrCount, int Wid, int Offst, double *x, double *fbuf, double *abuf, double *pbuf, double *win, int M, double *c, double iH2, cdouble *w, cdouble *xc, cdouble *xs, double *f3, double *f2, double *f1, double *f0, double *ns) |
void | ReEstFreqAmp (int FrCount, int Wid, int Offst, double *x, double *fbuf, double *abuf, double *pbuf, double *win, int M, double *c, double iH2, cdouble *w, cdouble *xc, cdouble *xs, double *ps, double *as, double *fa, double *fb, double *fc, double *fd, double *aa, double *ab, double *ac, double *ad, double *ns, int *Wids=0) |
int | Reestimate2 (int FrCount, int Wid, int Offst, double *win, int M, double *c, double iH2, double *x, double *ae, double *fe, double *pe, double *aret, double *fret, double *pret, int maxiter, int *Wids=0) |
void | Derivative (int M, double(**h)(double t, void *), double(**dh)(double t, void *), cdouble *r, int p0s, int *p0, int q0s, int *q0, int Wid, double *s, double **win, double omg, void *harg) |
void | DerivativeLS (int K, int M, double(**h)(double t, void *harg), double(**dh)(double t, void *harg), cdouble *r, int p0s, int *p0, int q0s, int *q0, int Wid, double *s, double **win, double omg, void *harg, bool r0=false) |
void | DerivativeLS (int Fr, int K, int M, double(**h)(double t, void *harg), double(**dh)(double t, void *harg), cdouble *r, int p0s, int *p0, int q0s, int *q0, int Wid, double *s, double **win, double omg, void *harg, bool r0=false) |
void | TFAS05 (double &f, double &t, double &a, double &ph, double &aesp, double &fslope, int Wid, double *data, double *w, double res=1) |
void | TFAS05_enh (double &f, double &t, double &a, double &ph, double &aesp, double &fslope, int Wid, double *data, double *w, double res=1) |
void | TFAS05_enh (double &f, double &t, double &a, double &ph, int Wid, double *data, double *w, double res=1) |
void | DerivativePiecewise (int N, cdouble *aita, int L, double *f, int T, cdouble *s, double ***A, int M, double **h, int I, cdouble **u, cdouble **du, int endmode=0, cdouble *ds=0) |
void | DerivativePiecewise2 (int Np, double *p, int Nq, double *q, int L, double *f, int T, cdouble *s, double ***A, double ***B, int M, double **h, int I, cdouble **u, cdouble **du, int endmode=0, cdouble *ds=0) |
void | DerivativePiecewise3 (int Np, double *p, int Nq, double *q, int L, double *f, int T, cdouble *s, double ***DA, double ***B, int M, double **h, int I, cdouble **u, cdouble **du, int endmode=0, cdouble *ds=0, double **dh=0) |
void | seth (int M, int T, double **&h, MList *mlist) |
void | setdh (int M, int T, double **&dh, MList *mlist) |
void | setdih (int M, int T, double **&dih, MList *mlist) |
void | setu (int I, int Wid, cdouble **&u, cdouble **&du, int WinOrder=2, MList *mlist=0) |
void | ssALinearSpline (int L, int T, int M, int &N, double ***&A, MList *mlist, int mode=0) |
void | ssACubicHermite (int L, int T, int M, int &N, double ***&A, MList *mlist, int mode=0) |
void | ssACubicSpline (int L, int T, int M, int &N, double ***&A, MList *mlist, int mode=0) |
void | ssLinearSpline (int L, int T, int M, int &N, double **&h, double ***&A, MList *mlist, int mode=0) |
void | ssCubicHermite (int L, int T, int M, int &N, double **&h, double ***&A, MList *mlist, int mode=0) |
void | ssCubicSpline (int L, int T, int M, int &N, double **&h, double ***&A, MList *mlist, int mode=0) |
void | DerivativePiecewiseI (cdouble *aita, int L, double *f, int T, cdouble *s, int M, void(*SpecifyA)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode), int ssmode=0, int WinOrder=2, int I=2, int endmode=0, cdouble *ds=0) |
void | DerivativePiecewiseII (double *p, double *q, int L, double *f, int T, cdouble *s, int M, void(*SpecifyA)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode), int ssAmode, void(*SpecifyB)(int L, int T, int M, int &N, double ***&B, MList *mlist, int mode), int ssBmode, int WinOrder=2, int I=2, int endmode=0, cdouble *ds=0) |
void | DerivativePiecewiseIII (double *p, double *q, int L, double *f, int T, cdouble *s, int M, void(*SpecifyA)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode), int ssAmode, void(*SpecifyB)(int L, int T, int M, int &N, double ***&B, MList *mlist, int mode), int ssBmode, int WinOrder=2, int I=2, int endmode=0, cdouble *ds=0) |
double | AmpPhCorrectionExpA (cdouble *s2, int N, cdouble *aita, int L, int T, cdouble *sre, int M, double **h, double **dih, double ***A, void(*SpecifyA)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode), int WinOrder) |
template<class Ts > | |
cdouble | DerivativeLSv (int Wid, Ts *s, int I, cdouble **v, cdouble **dv, int M, double **h, cdouble *lmd, int p0s, int *p0, int q0s, int *q0) |
template<class Ts , class Tu > | |
cdouble | DerivativeLS (int Wid, Ts *s, int I, double omg, Tu **u, Tu **du, int M, double **h, cdouble *lmd, int p0s, int *p0, int q0s, int *q0) |
template<class Tu > | |
cdouble | DerivativeLS_AmpPh (int Wid, int M, double **integr_h, cdouble *lmd, double omg, Tu *u0, cdouble sv0) |
template<class Tu , class Ts > | |
cdouble | DerivativeLS_AmpPh (int Wid, int M, double **integr_h, cdouble *lmd, double omg, Tu *u0, Ts *s) |
cdouble | DerivativeLSv_AmpPh (int, int, double **, cdouble *, cdouble *, cdouble) |
template<class Ts > | |
void | DerivativeLSv (int Wid, Ts *s, int I, cdouble **v, cdouble **dv, int M, double **h, double **integr_h, cdouble *lmd, int p0s, int *p0, int q0s, int *q0) |
template<class Ts , class Tu > | |
void | DerivativeLS (int Wid, Ts *s, int I, double omg, Tu **u, Tu **du, int M, double **h, double **integr_h, cdouble *lmd, int p0s, int *p0, int q0s, int *q0) |
template<class T > | |
T ** | CosineWindows (int K, int Wid, T **w, int L=0) |
Detailed Description
- sinusoid estimation algorithms
Function Documentation
void AdditiveAnalyzer | ( | double * | fs, |
double * | as, | ||
double * | phs, | ||
double * | das, | ||
cdouble * | x, | ||
int | Count, | ||
int | Wid, | ||
int | Offst, | ||
__int16 * | ref, | ||
TBasicAnalyzer | BasicAnalyzer, | ||
int | reserved, | ||
bool | LogA | ||
) |
function AdditiveAnalyzer: sinusoid analyzer with one additive update
In: x[Count]: waveform data Wid, Offst: frame size and hop size BasicAnalyzer: pointer to a sinusoid analyzer ref[Count]: reference frequencies, in bins, used by BasicAnalyzer BasicAnalyzer: pointer to a sinusoid analyzer LogA: indicates if amplitudes are interpolated at cubic spline or exponential cubic spline Out: fs[Count], as[Count], phs[Count]: sinusoid parameter estimates das[Count]: estimate of amplitude derivative
No return value.
void AdditiveUpdate | ( | double * | fs, |
double * | as, | ||
double * | phs, | ||
double * | das, | ||
cdouble * | x, | ||
int | Count, | ||
int | Wid, | ||
int | Offst, | ||
TBasicAnalyzer | BasicAnalyzer, | ||
int | reserved, | ||
bool | LogA | ||
) |
function AdditiveUpdate: additive reestimation of time-varying sinusoid
In: x[Count]: waveform data Wid, Offst: frame size and hop fs[Count], as[Count], phs[Count]: initial estimate of sinusoid parameters das[Count]: initial estimate of amplitude derivative BasicAnalyzer: pointer to a sinusoid analyzer LogA: indicates if amplitudes are interpolated at cubic spline or exponential cubic spline Out: fs[Count], as[Count], phs[Count], das[Count]: estimates after additive update
No return value.
double AmpPhCorrectionExpA | ( | cdouble * | s2, |
int | N, | ||
cdouble * | aita, | ||
int | L, | ||
int | T, | ||
cdouble * | sre, | ||
int | M, | ||
double ** | h, | ||
double ** | dih, | ||
double *** | A, | ||
void(*)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode) | SpecifyA, | ||
int | WinOrder | ||
) |
function AmpPhCorrectionExpA: model-preserving amplitude and phase correction in piecewise derivative method.
In: aita[N]: inital independent coefficients L, T: number and size of pieces sre[LT]: waveform data h[M][T], dih[M][T]: piecewise basis functions and their difference-integrals A[L][M][N]: L coefficient mapping matrices SpecifyA: pointer to the function used for constructing A WinOrder: order(=vanishing moment) of window used for constructing test functions Out: aita[N]: corrected independent coefficients s2[LT]: reconstruct sinusoid BEFORE correction
Returns the estimate of phase angle at 0.
T** CosineWindows | ( | int | K, |
int | Wid, | ||
T ** | w, | ||
int | L = 0 |
||
) |
template CosineWindows: generates the Hann^(K/2) window and its L-1 derivatives as Result[L][Wid+1]
In: K, L, Wid Out: w[L][Wid+1]: Hann^(K/2) window function and its derivatives up to order L-1
Returns pointer to w. w is created anew if w=0 is specified on start.
double ddIPWindow | ( | double | f, |
cdouble * | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
double & | dipwindow, | ||
double & | ipwindow | ||
) |
function ddIPWindow: computes the norm of the truncated inner product of a windowed spectrum with that of a sinusoid at reference frequency f, as well as its 1st and 2nd derivatives.
In: x[0:N-1]: input spectrum f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: ipwindow and dipwindow: the truncated inner product norm and its derivative
Returns the 2nd derivative of the norm of the truncated inner product.
double ddsincd_unn | ( | double | x, |
int | N | ||
) |
function ddsincd_unn: 2nd-order derivative of unnormalized discrete sinc function
In: x, scale (equivalently, window size) N
Returns the 2nd-order derivative of sincd_unn(x, N)
double ddsIPWindow | ( | double | f, |
int | L, | ||
cdouble ** | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
double & | dsip, | ||
double & | sip | ||
) |
function ddsIPWindow: computes the total energy of truncated inner products between multiple windowed spectra and that of a sinusoid at a reference frequency f, as well as its 1st and 2nd derivatives. This does not consider phase synchronization between the spectra, supposedly measured at a sequence of known instants.
In: x[L][N]: input spectra f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: sip and dsip, the energy of the vector of inner products and its derivative.
Returns the 2nd derivative of the energy of the vector of inner products.
double ddsIPWindow_unn | ( | double | f, |
cdouble * | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
int | K1, | ||
int | K2, | ||
double & | dsipwindow, | ||
double & | sipwindow, | ||
cdouble * | w_unn | ||
) |
function dsdIPWindow_unn: computes the energy of unnormalized truncated inner products between a given windowed spectrum and that of a sinusoid at a reference frequency f, as well as its 1st and 2nd derivatives. "Unnormalized" indicates that the inner product cannot be taken as the actual amplitude- phase factor of a sinusoid, but deviate from that by an unspecified factor.
In: x[N]: input spectrum f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: sipwindow and dsipwindow, the energy and its derivative of the unnormalized inner product.
Returns the 2nd derivative of the inner product.
double ddsIPWindowC | ( | double | f, |
int | L, | ||
double | offst_rel, | ||
cdouble ** | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
double & | dsipwindow, | ||
double & | sipwindow | ||
) |
function ddsIPWindowC: computes the total energy of truncated inner products between multiple frames of a spectrogram and multiple frames of a spectrogram of a sinusoid at a reference frequency f, together with its 1st and 2nd derivatives.
In: x[L][N]: the spectrogram offst_rel: frame offset, relative to frame size f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: sipwindow, dsipwindow: energy of the vector of the inner products and its derivative
Returns the 2nd derivative of the energy of the vector of inner products.
void ddsIPWindowDuo | ( | double * | ddsip2, |
double | f1, | ||
double | f2, | ||
cdouble * | x, | ||
int | N, | ||
double * | c, | ||
double * | d, | ||
int | M, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
cdouble & | lmd1, | ||
cdouble & | lmd2 | ||
) |
function ddsIPWindowDuo: calculates the square norm, and its 1st and 2nd derivatives against f2,, of the orthogonal projection of a windowed spectrum onto the linear span of the windowed spectra of two sinusoids at reference frequencies f1 and f2.
In: x[N]: spectrum f1, f2: reference frequencies. M, c[], d[], iH2: cosine-family window specification parameters. K1, K2: spectrum truncation range, i.e. bins outside [K1, K2] are ignored.
Out: lmd1, lmd2: projection coefficients, interpreted as actual amplitude-phase factors ddsip[3]: the 2nd, 1st and 0th derivatives (against f2) of the square norm.
No return value.
void ddWindow | ( | cdouble * | ddx, |
cdouble * | dx, | ||
cdouble * | x, | ||
double | f, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
int | K1, | ||
int | K2 | ||
) |
function ddWindow: calculates the cosine-family-windowed spectrum and its 1st and 2nd derivatives of a complex sinusoid on [0:N-1] at frequency f bins with zero central phase.
In: f: frequency, in bins N: window size M, c[]: cosine-family window decomposition coefficients Out: x[0...K2-K1] containing the spectrum at bins K1, ..., K2, dx[0...K2-K1] containing the derivative spectrum at bins K1, ..., K2 ddx[0...K2-K1] containing the 2nd-order derivative spectrum at bins K1, ..., K2
No return value.
double ddWindowDuo | ( | double | df, |
int | N, | ||
double * | d, | ||
int | M, | ||
double & | dwindow, | ||
double & | window, | ||
cdouble * | w | ||
) |
function ddWindowDuo: calcualtes the square norm of the inner product between windowed spectra of two sinusoids at frequencies f1 and f2, df=f1-f2, with its 1st and 2nd derivatives
In: df: frequency difference, in bins N: DFT size M, d[]: cosine-family window specification parameters (see "further reading" for d[]). Out: w[0], the inner product, optional window, dwindow: square norm and its derivative, of the inner product
Returns 2nd derivative of the square norm of the inner product.
void Derivative | ( | int | M, |
double(**)(double t, void *) | h, | ||
double(**)(double t, void *) | dh, | ||
cdouble * | r, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0, | ||
int | Wid, | ||
double * | s, | ||
double ** | win, | ||
double | omg, | ||
void * | harg | ||
) |
function Derivative: derivative method for estimating the model log(s)=h[M]'r[M], by discarding extra equations
In: s[Wid]: waveform data win[][Wid]: window function and its derivatives h[M], dh[M]: pointers to basis functions and their derivatives harg: pointer argument to be used by calls to functions in h[] amd dh[]. p0[p0s]: zero-constraints on real parts of r, i.e. Re(r[p0[*]]) are constrained to 0. q0[q0s]: zero-constraints on imaginary parts of r, i.e. Im(r[q0[*]]) are constrained to 0. omg: initial angular frequency Out: r[M]: estimated coefficients to h[M].
No return value.
void DerivativeLS | ( | int | K, |
int | M, | ||
double(**)(double t, void *harg) | h, | ||
double(**)(double t, void *harg) | dh, | ||
cdouble * | r, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0, | ||
int | Wid, | ||
double * | s, | ||
double ** | win, | ||
double | omg, | ||
void * | harg, | ||
bool | r0 | ||
) |
function DerivativeLS: derivative method for estimating the model log(s)=h[M]'r[M], least-square implementation
In: s[Wid]: waveform data win[][Wid]: window function and its derivatives h[M], dh[M]: pointers to basis functions and their derivatives harg: pointer argument to be used by calls to functions in h[] amd dh[]. K: number of derivatives to take p0[p0s]: zero-constraints on real parts of r, i.e. Re(r[p0[*]]) are constrained to 0. q0[q0s]: zero-constraints on imaginary parts of r, i.e. Im(r[q0[*]]) are constrained to 0. omg: initial angular frequency Out: r[M]: estimated coefficients to h[M].
No return value.
void DerivativeLS | ( | int | Fr, |
int | K, | ||
int | M, | ||
double(**)(double t, void *harg) | h, | ||
double(**)(double t, void *harg) | dh, | ||
cdouble * | r, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0, | ||
int | Wid, | ||
double * | s, | ||
double ** | win, | ||
double | omg, | ||
void * | harg, | ||
bool | r0 | ||
) |
function DerivativeLS: derivative method for estimating the model log(s)=h[M]'r[M] using Fr measurement points a quarter of Wid apart from each other, implemented by least-square.
In: s[Wid+(Fr-1)*Wid/4]: waveform data win[][Wid]: window function and its derivatives h[M], dh[M]: pointers to basis functions and their derivatives harg: pointer argument to be used by calls to functions in h[] amd dh[]. Fr: number of measurement points K: number of derivatives to take at each measurement point p0[p0s]: zero-constraints on real parts of r, i.e. Re(r[p0[*]]) are constrained to 0. q0[q0s]: zero-constraints on imaginary parts of r, i.e. Im(r[q0[*]]) are constrained to 0. omg: initial angular frequency r0: specifies if r[0] is to be computed. Out: r[M]: estimated coefficients to h[M].
No return value.
cdouble DerivativeLS | ( | int | Wid, |
Ts * | s, | ||
int | I, | ||
double | omg, | ||
Tu ** | u, | ||
Tu ** | du, | ||
int | M, | ||
double ** | h, | ||
cdouble * | lmd, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0 | ||
) |
template DerivativeLS: local derivative algorithm for estimating time-varying sinusoids, "u" version, i.e. using base-band test functions.
In: s[Wid]: waveform data u[I][Wid], du[I][Wid]: base-band test functions and their derivatives omg: angular frequency onto which u[I] and du[I] are modulated to give the test functions h[M+1][Wid]: basis functions p0[p0s], q0[q0s]: zero-constraints, i.e. Re(lmd[p0[*]]) and Im(lmd[q0[*]]) are constrained zero. Out: lmd[1:M]: coefficients of h[1:M].
Returns inner product of s and v[0].
void DerivativeLS | ( | int | Wid, |
Ts * | s, | ||
int | I, | ||
double | omg, | ||
Tu ** | u, | ||
Tu ** | du, | ||
int | M, | ||
double ** | h, | ||
double ** | integr_h, | ||
cdouble * | lmd, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0 | ||
) |
template DerivativeLSv: local derivative algorithm for estimating time-varying sinusoids, "u" version.
In: s[Wid]: waveform data u[I][Wid], du[I][Wid]: base-band test functions and their derivatives omg: angular frequency onto which u[I] and du[I] are modulated to give the test functions h[M+1][Wid], integr_h[M+1][Wid]: basis functions and their integrals p0[p0s], q0[q0s]: zero-constraints, i.e. Re(lmd[p0[*]]) and Im(lmd[q0[*]]) are constrained zero. Out: lmd[M+1]: coefficients of h[M+1], including lmd[0].
No return value.
cdouble DerivativeLS_AmpPh | ( | int | Wid, |
int | M, | ||
double ** | integr_h, | ||
cdouble * | lmd, | ||
double | omg, | ||
Tu * | u0, | ||
cdouble | sv0 | ||
) |
template DerivativeLS_AmpPh: amplitude and phase estimation in the local derivative algorithm, "u" version
In: sv0: inner product of signal s[Wid] and test function v0 u0[Wid], omg: base-band test function and carrier frequency used for computing v0[] integr_h[M+1][Wid]: integrals of basis functions
Returns coefficient to integr_h[0]=1.
cdouble DerivativeLS_AmpPh | ( | int | Wid, |
int | M, | ||
double ** | integr_h, | ||
cdouble * | lmd, | ||
double | omg, | ||
Tu * | u0, | ||
Ts * | s | ||
) |
template DerivativeLS_AmpPh: amplitude and phase estimation in the local derivative algorithm, "u" version.
In: s[Wid]: waveform data u0[Wid], omg: base-band test function and carrier frequency used for computing v0[] integr_h[M+1][Wid]: integrals of basis functions
Returns coefficient to integr_h[0]=1.
cdouble DerivativeLSv | ( | int | Wid, |
Ts * | s, | ||
int | I, | ||
cdouble ** | v, | ||
cdouble ** | dv, | ||
int | M, | ||
double ** | h, | ||
cdouble * | lmd, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0 | ||
) |
template DerivativeLSv: local derivative algorithm for estimating time-varying sinusoids, "v" version, i.e. using tuned test functions.
In: s[Wid]: waveform data v[I][Wid], dv[I][Wid]: test functions and their derivatives h[M+1][Wid]: basis functions p0[p0s], q0[q0s]: zero-constraints, i.e. Re(lmd[p0[*]]) and Im(lmd[q0[*]]) are constrained zero. Out: lmd[1:M]: coefficients of h[1:M].
Returns inner product of s and v[0].
void DerivativeLSv | ( | int | Wid, |
Ts * | s, | ||
int | I, | ||
cdouble ** | v, | ||
cdouble ** | dv, | ||
int | M, | ||
double ** | h, | ||
double ** | integr_h, | ||
cdouble * | lmd, | ||
int | p0s, | ||
int * | p0, | ||
int | q0s, | ||
int * | q0 | ||
) |
template DerivativeLSv: local derivative algorithm for estimating time-varying sinusoids, "v" version.
In: s[Wid]: waveform data v[I][Wid], dv[I][Wid]: test functions and their derivatives h[M+1][Wid], integr_h[M+1][Wid]: basis functions and their integrals p0[p0s], q0[q0s]: zero-constraints, i.e. Re(lmd[p0[*]]) and Im(lmd[q0[*]]) are constrained zero. Out: lmd[M+1]: coefficients of h[M+1], including lmd[0].
No return value.
cdouble DerivativeLSv_AmpPh | ( | int | Wid, |
int | M, | ||
double ** | integr_h, | ||
cdouble * | lmd, | ||
cdouble * | v0, | ||
cdouble | sv0 | ||
) |
function DerivativeLSv_AmpPh: estimate the constant-term in the local derivative method. This is used by the local derivative algorithm, whose implementation is found in the header file as templates.
In: sv0: inner product <s, v0>, where s is the sinusoid being estimated. integr_h[M][Wid]: M vectors containing samples of the integral of basis functions h[M]. v0[M]: a test function lmd[M]: coefficients to h[M]
Returns coefficient of integr_h[0]=1.
void DerivativePiecewise | ( | int | N, |
cdouble * | aita, | ||
int | L, | ||
double * | f, | ||
int | T, | ||
cdouble * | s, | ||
double *** | A, | ||
int | M, | ||
double ** | h, | ||
int | I, | ||
cdouble ** | u, | ||
cdouble ** | du, | ||
int | endmode, | ||
cdouble * | ds | ||
) |
function DerivativePiecewise: Piecewise derivative algorithm. In this implementation of the piecewise method the test functions v are constructed from I "basic" (single-frame) test functions, each covering the same period of 2T, by shifting these I functions by steps of T. A total number of (L-1)I test functions are used.
In: s[LT+1]: waveform data ds[LT+1]: derivative of s[LT], used only if ERROR_CHECK is defined. L, T: number and length of pieces. N: number of independent coefficients h[M][T]: piecewise basis functions A[L][M][N]: L matrices that map independent coefficients onto component coefficients over the L pieces u[I][2T}, du[I][2T]: base-band test functions f[L+1]: reference frequencies at 0, T, ..., LT, only f[1]...f[L-1] are used endmode: set to 1 or 3 to apply half-size testing over [0, T], to 2 or 3 to apply over [LT-T, LT] Out: aita[N]: independent coefficients
No return value.
void DerivativePiecewise2 | ( | int | Np, |
double * | p, | ||
int | Nq, | ||
double * | q, | ||
int | L, | ||
double * | f, | ||
int | T, | ||
cdouble * | s, | ||
double *** | A, | ||
double *** | B, | ||
int | M, | ||
double ** | h, | ||
int | I, | ||
cdouble ** | u, | ||
cdouble ** | du, | ||
int | endmode, | ||
cdouble * | ds | ||
) |
function DerivativePiecewise2: Piecewise derivative algorithm in which the real and imaginary parts of the exponent are modelled separately. In this implementation of the piecewise method the test functions v are constructed from I "basic" (single-frame) test functions, each covering the same period of 2T, by shifting these I functions by steps of T. A total number of (L-1)I test functions are used.
In: s[LT+1]: waveform data ds[LT+1]: derivative of s[LT], used only if ERROR_CHECK is defined. L, T: number and length of pieces. N: number of independent coefficients h[M][T]: piecewise basis functions A[L][M][Np]: L matrices that do coefficient mapping (real part) over the L pieces B[L][M][Nq]: L matrices that do coefficient mapping (imaginary part) over the L pieces u[I][2T}, du[I][2T]: base-band test functions f[L+1]: reference frequencies at 0, T, ..., LT, only f[1]...f[L-1] are used endmode: set to 1 or 3 to apply half-size testing over [0, T], to 2 or 3 to apply over [LT-T, LT] Out: p[Np], q[Nq]: independent coefficients
No return value.
void DerivativePiecewise3 | ( | int | Np, |
double * | p, | ||
int | Nq, | ||
double * | q, | ||
int | L, | ||
double * | f, | ||
int | T, | ||
cdouble * | s, | ||
double *** | DA, | ||
double *** | B, | ||
int | M, | ||
double ** | h, | ||
int | I, | ||
cdouble ** | u, | ||
cdouble ** | du, | ||
int | endmode, | ||
cdouble * | ds, | ||
double ** | dh | ||
) |
function DerivativePiecewise3: Piecewise derivative algorithm in which the log amplitude and frequeny are modeled separately as piecewise functions. In this implementation of the piecewise method the test functions v are constructed from I "basic" (single-frame) test functions, each covering the same period of 2T, by shifting these I functions by steps of T. A total number of (L-1)I test functions are used.
In: s[LT+1]: waveform data ds[LT+1]: derivative of s[LT], used only if ERROR_CHECK is defined. L, T: number and length of pieces. N: number of independent coefficients h[M][T]: piecewise basis functions dh[M][T]: derivative of h[M][T], used only if ERROR_CHECK is defined. DA[L][M][Np]: L matrices that do coefficient mapping (real part) over the L pieces B[L][M][Nq]: L matrices that do coefficient mapping (imaginary part) over the L pieces u[I][2T}, du[I][2T]: base-band test functions f[L+1]: reference frequencies at 0, T, ..., LT, only f[1]...f[L-1] are used endmode: set to 1 or 3 to apply half-size testing over [0, T], to 2 or 3 to apply over [LT-T, LT] Out: p[Np], q[Nq]: independent coefficients
No return value.
void DerivativePiecewiseI | ( | cdouble * | aita, |
int | L, | ||
double * | f, | ||
int | T, | ||
cdouble * | s, | ||
int | M, | ||
void(*)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode) | SpecifyA, | ||
int | ssmode, | ||
int | WinOrder, | ||
int | I, | ||
int | endmode, | ||
cdouble * | ds | ||
) |
function DerivativePiecewiseI: wrapper for DerivativePiecewise(), doing the initialization ,etc.
In: L, T: number and length of pieces s[LT]: waveform signal ds[LT]: derivative of s[LT], used only when ERROR_CHECK is defined. f[L+1]: reference frequencies at knots M: polynomial degree of piecewise approximation SpecifyA, ssmode: pointer to a function that fills A[L], and mode argument to call it WinOrder: order(=vanishing moment) of window used for constructing test functions I: number of test functions per frame. endmode: set to 1 or 3 to apply half-size frame over [0, T], to 2 or 3 to apply over [LT-T, LT] Out: aita[N]: independent coefficients, where N is specified by SpecifyA.
No return vlue.
void DerivativePiecewiseII | ( | double * | p, |
double * | q, | ||
int | L, | ||
double * | f, | ||
int | T, | ||
cdouble * | s, | ||
int | M, | ||
void(*)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode) | SpecifyA, | ||
int | ssAmode, | ||
void(*)(int L, int T, int M, int &N, double ***&B, MList *mlist, int mode) | SpecifyB, | ||
int | ssBmode, | ||
int | WinOrder, | ||
int | I, | ||
int | endmode, | ||
cdouble * | ds | ||
) |
function DerivativePiecewiseII: wrapper for DerivativePiecewise2(), doing the initialization ,etc. This models the derivative of log ampltiude and frequency as separate piecewise polynomials, the first specified by SpecifyA, the second by SpecifyB.
In: L, T: number and length of pieces s[LT]: waveform signal ds[LT]: derivative of s[LT], used only when ERROR_CHECK is defined. f[L+1]: reference frequencies at knots M: polynomial degree of piecewise approximation SpecifyA, ssAmode: pointer to a function that fills A[L], and mode argument to call it SpecifyB, ssBmode: pointer to a function that fills B[L], and mode argument to call it WinOrder: order(=vanishing moment) of window used for constructing test functions I: number of test functions per frame. endmode: set to 1 or 3 to apply half-size frame over [0, T], to 2 or 3 to apply over [LT-T, LT] Out: p[Np], q[Nq]: independent coefficients, where Np and Nq are specified by SpecifyA and SpecifyB.
No reutrn value.
void DerivativePiecewiseIII | ( | double * | p, |
double * | q, | ||
int | L, | ||
double * | f, | ||
int | T, | ||
cdouble * | s, | ||
int | M, | ||
void(*)(int L, int T, int M, int &N, double ***&A, MList *mlist, int mode) | SpecifyA, | ||
int | ssAmode, | ||
void(*)(int L, int T, int M, int &N, double ***&B, MList *mlist, int mode) | SpecifyB, | ||
int | ssBmode, | ||
int | WinOrder, | ||
int | I, | ||
int | endmode, | ||
cdouble * | ds | ||
) |
function DerivativePiecewiseIII: wrapper for DerivativePiecewise3(), doing the initialization ,etc. Notice that this time the log amplitude, rather than its derivative, is modeled as a piecewise polynomial specified by SpecifyA.
In: L, T: number and length of pieces s[LT]: waveform signal ds[LT]: derivative of s[LT], used only when ERROR_CHECK is defined. f[L+1]: reference frequencies at knots M: polynomial degree of piecewise approximation SpecifyA, ssAmode: pointer to a function that fills A[L], and mode argument to call it SpecifyB, ssBmode: pointer to a function that fills B[L], and mode argument to call it WinOrder: order(=vanishing moment) of window used for constructing test functions I: number of test functions per frame. endmode: set to 1 or 3 to apply half-size frame over [0, T], to 2 or 3 to apply over [LT-T, LT] Out: p[Np], q[Nq]: independent coefficients, where Np and Nq are specified by SpecifyA and SpecifyB.
No reutrn value.
double dsincd_unn | ( | double | x, |
int | N | ||
) |
function dsincd_unn: derivative of unnormalized discrete sinc function
In: x, scale N
Returns the derivative of sincd_unn(x, N)
double dsIPWindow | ( | double | f, |
int | L, | ||
cdouble ** | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
double & | sip | ||
) |
function dsIPWindow: computes the total energy of truncated inner products between multiple windowed spectra and that of a sinusoid at a reference frequency f, as well as its derivative. This does not consider phase synchronization between the spectra, supposedly measured at a sequence of known instants.
In: x[L][N]: input spectra f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: sip, the energy of the vector of inner products.
Returns the derivative of the energy of the vector of inner products.
double dsIPWindowC | ( | double | f, |
int | L, | ||
double | offst_rel, | ||
cdouble ** | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
double & | sip | ||
) |
function dsIPWindowC: computes the total energy of truncated inner products between multiple frames of a spectrogram and multiple frames of a spectrogram of a sinusoid at a reference frequency f, together with its derivative.
In: x[L][N]: the spectrogram offst_rel: frame offset, relative to frame size f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: sip: energy of the vector of the inner products
Returns the 1st derivative of the energy of the vector of inner products.
function dWindow: calculates the cosine-family-windowed spectrum and its derivative of a complex sinusoid on [0:N-1] at frequency f bins with zero central phase.
In: f: frequency, in bins N: window size M, c[]: cosine-family window decomposition coefficients Out: x[0...K2-K1] containing the spectrum at bins K1, ..., K2, dx[0...K2-K1] containing the derivative spectrum at bins K1, ..., K2
No return value.
void IPMulti | ( | int | I, |
double * | f, | ||
cdouble * | lmd, | ||
cdouble * | x, | ||
int | Wid, | ||
int | K1, | ||
int | K2, | ||
int | M, | ||
double * | c, | ||
double | eps | ||
) |
function IPMulti: least square estimation of multiple sinusoids, given their frequencies and an energy suppression index of eps, i.e. the least square error is minimized with an additional eps*||lmd||^2 term.
In: x[Wid]: spectrum f[I]: frequencies M, c[]: cosine-family window specification parameters K1, K2: spectral truncation range, i.e. bins outside [K1, K2] are ignored eps: energy suppression factor Out: lmd[I]: amplitude-phase factors
No return value.
void IPMulti | ( | int | I, |
double * | f, | ||
cdouble * | lmd, | ||
cfloat * | x, | ||
int | Wid, | ||
int | K1, | ||
int | K2, | ||
int | M, | ||
double * | c, | ||
double | eps, | ||
double * | sens, | ||
double * | r1 | ||
) |
function IPMulti: least square estimation of multiple sinusoids, given their frequencies and an energy suppression index of eps, and optionally returns residue and sensitivity indicators for each sinusoid.
In: x[Wid]: spectrum f[I]: frequencies M, c[]: cosine-family window specification parameters K1, K2: spectral truncation range, i.e. bins outside [K1, K2] are ignored eps: energy suppression factor Out: lmd[I]: amplitude-phase factors sens[I]: sensitivity indicators r1[I]: residue indicators, measured by correlating residue with sinusoid spectra, optional
No return value. Sensibitily is computed BEFORE applying eps.
double IPMulti | ( | int | I, |
double * | f, | ||
cdouble * | lmd, | ||
cdouble * | x, | ||
int | Wid, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | B | ||
) |
function IPMulti: least square estimation of multi-sinusoids with GIVEN frequencies. This version operates in groups at least B bins from each other, rather than LSE all frequencies together.
In: x[Wid]: spectrum f[I]: frequencies, must be ordered low to high. B: number of bins beyond which sinusoids are treated as non-interfering M, c[], iH2: cosine-family window specification parameters Out: lmd[I]: amplitude-phase factors
Returns 0.
cdouble* IPMulti | ( | int | I, |
int | J, | ||
double * | f, | ||
double * | ph, | ||
double * | a, | ||
cdouble * | x, | ||
int | Wid, | ||
int | M, | ||
double * | c, | ||
cdouble ** | wt, | ||
cdouble ** | Q, | ||
double ** | L, | ||
MList * | RetList | ||
) |
function IPMulti: LSE estimation of I sinusoids given frequency and phase and J sinusoids given frequency only
In: x[Wid]: spectrum f[I+J], ph[I]: frequencies and phase angles M, c[], iH2: cosine-family window specification parameters Out: a[I+J]: amplitudes ph[I:I+J-1]: phase angles not given on start wt[I+2J][hWid], Q[I+2J][hWid], L[I+2J][I+2J]: internal w matrix and its LQ factorization, optional
Returns the residue vector, newly created and registered to RetList, if specified. On start a[] should have valid storage no less than I+2J.
double IPMulti_Direct | ( | int | I, |
double * | f, | ||
double * | ph, | ||
double * | a, | ||
cdouble * | x, | ||
int | Wid, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | B | ||
) |
function IPMulti_Direct: LSE estimation of multiple sinusoids given frequencies AND PHASES (direct method)
In: x[Wid]: spectrum f[I], ph[I]: frequencies and phase angles. B: spectral truncation half width, in bins; sinusoids over 3B bins apart are regarded non-interfering M, c[], iH2: cosine-family window specification parameters Out: a[I]: amplitudes
Returns square norm of the residue.
double IPMulti_GS | ( | int | I, |
double * | f, | ||
double * | ph, | ||
double * | a, | ||
cdouble * | x, | ||
int | Wid, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | B, | ||
double ** | L, | ||
double ** | Q | ||
) |
function IPMulti_GS: LSE estimation of multiple sinusoids given frequencies AND PHASES (Gram-Schmidt method)
In: x[Wid]: spectrum f[I], ph[I]: frequencies and phase angles. B: spectral truncation, in bins; sinusoids over 3B bins apart are regarded non-interfering M, c[], iH2: cosine-family window specification parameters Out: a[I]: amplitudes
Returns square norm of the residue.
void IPMultiSens | ( | int | I, |
double * | f, | ||
int | Wid, | ||
int | K1, | ||
int | K2, | ||
int | M, | ||
double * | c, | ||
double * | sens, | ||
double | eps | ||
) |
function IPMultiSens: computes the sensitivity of the least square estimation of multiple sinusoids given their frequencies .
In: f[I]: frequencies M, c[]: cosine-family window specification parameters K1, K2: spectral truncation range, i.e. bins outside [K1, K2] are ignored eps: energy suppression factor Out: sens[I]: sensitivity indicators
No return value. Sensibility is computed AFTER applying eps
double IPWindow | ( | double | f, |
cdouble * | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
bool | returnamplitude | ||
) |
function IPWindow: computes the truncated inner product of a windowed spectrum with that of a sinusoid at reference frequency f.
In: x[0:N-1]: input spectrum f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive returnamplitude: specifies return value, true for amplitude, false for angle
Returns the amplitude or phase of the inner product, as specified by $returnamplitude. The return value is interpreted as the actual amplitude/phase of a sinusoid being estimated at f.
function IPWindowC: computes the truncated inner product of a windowed spectrum with that of a sinusoid at reference frequency f.
In: x[0:N-1]: input spectrum f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive
Returns the inner product. The return value is interpreted as the actual amplitude-phase factor of a sinusoid being estimated at f.
int LSEDuo | ( | double & | f2, |
double | fmin, | ||
double | fmax, | ||
double | f1, | ||
cdouble * | x, | ||
int | N, | ||
double | B, | ||
double * | c, | ||
double * | d, | ||
int | M, | ||
double | iH2, | ||
cdouble & | r1, | ||
cdouble & | r2, | ||
double | epf | ||
) |
function LSEDuo: least-square estimation of two sinusoids of which one has a fixed frequency
In: x[N]: the windowed spectrum f1: the fixed frequency f2: initial value of the flexible frequency fmin, fmax: search range for f2, the flexible frequency B: spectral truncation half width M, c[], d[], iH2: epf: frequency error tolerance Out: f2: frequency estimate lmd1, lmd2: amplitude-phase factor estimates Returns 1 if managed to find a good f2, 0 if not, upon which the initial f2 is used for estimating
amplitudes and phase angles.
double LSESinusoid | ( | cdouble * | x, |
int | N, | ||
double | B, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
double & | a, | ||
double & | pp, | ||
double | epf | ||
) |
function LSESinusoid: LSE estimation of the predominant stationary sinusoid.
In: x[N]: windowed spectrum B: spectral truncation half width, in bins. M, c[], iH2: cosine-family window specification parameters epf: frequency error tolerance, in bins Out: a and pp: amplitude and phase estimates
Returns the frequency estimate, in bins.
double LSESinusoid | ( | int | f1, |
int | f2, | ||
cdouble * | x, | ||
int | N, | ||
double | B, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
double & | a, | ||
double & | pp, | ||
double | epf | ||
) |
function LSESinusoid: LSE estimation of stationary sinusoid predominant within [f1, f2].
In: x[N]: windowed spectrum [f1, f2]: frequency range B: spectral truncation half width, in bins. M, c[], iH2: cosine-family window specification parameters epf: frequency error tolerance, in bins Out: a and pp: amplitude and phase estimates
Returns the frequency estimate, in bins.
int LSESinusoid | ( | double & | f, |
double | f1, | ||
double | f2, | ||
cdouble * | x, | ||
int | N, | ||
double | B, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
double & | a, | ||
double & | pp, | ||
double | epf | ||
) |
function LSESinusoid: LSE estimation of stationary sinusoid near a given initial frequency within [f1, f2].
In: x[N]: windowed spectrum f: initial frequency, in bins [f1, f2]: frequency range B: spectral truncation half width, in bins. M, c[], iH2: cosine-family window specification parameters epf: frequency error tolerance, in bins Out: f, a and pp: frequency, amplitude and phase estimates
Returns 1 if managed to find a sinusoid, 0 if not, upon which $a and $pp are estimated at the initial f.
double LSESinusoidMP | ( | double & | f, |
double | f1, | ||
double | f2, | ||
cdouble ** | x, | ||
int | Fr, | ||
int | N, | ||
double | B, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
double * | a, | ||
double * | ph, | ||
double | epf | ||
) |
function LSESinusoidMP: LSE estimation of a stationary sinusoid from multi-frames spectrogram without considering phase-frequency consistency across frames.
In: x[Fr][N]: spectrogram f: initial frequency, in bins [f1, f2]: frequency range B: spectral truncation half width, in bins. M, c[], iH2: cosine-family window specification parameters epf: frequency error tolerance, in bins Out: f, a[Fr] and ph[Fr]: frequency, amplitudes and phase angles estimates
Returns an error bound of the frequency estimate.
void MultiplicativeAnalyzer | ( | double * | fs, |
double * | as, | ||
double * | phs, | ||
double * | das, | ||
cdouble * | x, | ||
int | Count, | ||
int | Wid, | ||
int | Offst, | ||
__int16 * | ref, | ||
TBasicAnalyzer | BasicAnalyzer, | ||
int | reserved, | ||
bool | LogA | ||
) |
function MultiplicativeAnalyzer: sinusoid analyzer with one multiplicative update
In: x[Count]: waveform data Wid, Offst: frame size and hop size BasicAnalyzer: pointer to a sinusoid analyzer ref[Count]: reference frequencies, in bins, used by BasicAnalyzer BasicAnalyzer: pointer to a sinusoid analyzer LogA: indicates if amplitudes are interpolated at cubic spline or exponential cubic spline Out: fs[Count], as[Count], phs[Count]: sinusoid parameter estimates das[Count]: estimate of amplitude derivative
No return value.
void MultiplicativeUpdate | ( | double * | fs, |
double * | as, | ||
double * | phs, | ||
double * | das, | ||
cdouble * | x, | ||
int | Count, | ||
int | Wid, | ||
int | Offst, | ||
TBasicAnalyzer | BasicAnalyzer, | ||
int | reserved, | ||
bool | LogA | ||
) |
function MultiplicativeUpdate: multiplicative reestimation of time-varying sinusoid
In: x[Count]: waveform data Wid, Offst: frame size and hop fs[Count], as[Count], phs[Count]: initial estimate of sinusoid parameters das[Count]: initial estimate of amplitude derivative BasicAnalyzer: pointer to a sinusoid analyzer LogA: indicates if amplitudes are interpolated at cubic spline or exponential cubic spline Out: fs[Count], as[Count], phs[Count], das[Count]: estimates after additive update
No return value.
void ReEstFreq | ( | int | FrCount, |
int | Wid, | ||
int | Offst, | ||
double * | x, | ||
double * | fbuf, | ||
double * | abuf, | ||
double * | pbuf, | ||
double * | win, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
cdouble * | w, | ||
cdouble * | xc, | ||
cdouble * | xs, | ||
double * | ps, | ||
double * | fa, | ||
double * | fb, | ||
double * | fc, | ||
double * | fd, | ||
double * | ns, | ||
int * | Wids | ||
) |
function ReEstFreq: sinusoid reestimation by demodulating frequency.
In: x[Wid+Offst*(FrCount-1)]: waveform data FrCount, Wid, Offst: frame count, frame size and hop size fbuf[FrCount], ns[FrCount]: initial frequency estiamtes and their timing win[Wid]: window function for estimating demodulated sinusoid M, c[], iH2: cosine-family window specification parameters, must be consistent with win[] Wids[FrCount]: specifies frame sizes for estimating individual frames of demodulated sinusoid, optional w[Wid/2], ps[Wid], xs[Wid], xc[Wid], fa[FrCount-1], fb[FrCount-1], fc[FrCount-1], fd[FrCount-1]: buffers Out: fbuf[FrCount], abuf[FrCount], pbuf[FrCount]: reestimated frequencies, amplitudes and phase angles
No return value.
void ReEstFreq_2 | ( | int | FrCount, |
int | Wid, | ||
int | Offst, | ||
double * | x, | ||
double * | fbuf, | ||
double * | abuf, | ||
double * | pbuf, | ||
double * | win, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
cdouble * | w, | ||
cdouble * | xc, | ||
cdouble * | xs, | ||
double * | f3, | ||
double * | f2, | ||
double * | f1, | ||
double * | f0, | ||
double * | ns | ||
) |
function ReEstFreq_2: sinusoid reestimation by demodulating frequency. This is that same as ReEstFreq(...) except that it calls Sinusoid(...) to synthesize the phase track used for demodulation and that it does not allow variable window sizes for estimating demodulated sinusoid.
In: x[Wid+Offst*(FrCount-1)]: waveform data FrCount, Wid, Offst: frame count, frame size and hop size fbuf[FrCount], ns[FrCount]: initial frequency estiamtes and their timing win[Wid]: window function for LSE sinusoid estimation M, c[], iH2: cosine-family window specification parameters, must be consistent with M, c, iH2 w[Wid/2], xs[Wid], xc[Wid], f3[FrCount-1], f2[FrCount-1], f1[FrCount-1], f0[FrCount-1]: buffers Out: fbuf[FrCount], abuf[FrCount], pbuf[FrCount]: reestimated frequencies, amplitudes and phase angles
No return value.
void ReEstFreqAmp | ( | int | FrCount, |
int | Wid, | ||
int | Offst, | ||
double * | x, | ||
double * | fbuf, | ||
double * | abuf, | ||
double * | pbuf, | ||
double * | win, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
cdouble * | w, | ||
cdouble * | xc, | ||
cdouble * | xs, | ||
double * | ps, | ||
double * | as, | ||
double * | fa, | ||
double * | fb, | ||
double * | fc, | ||
double * | fd, | ||
double * | aa, | ||
double * | ab, | ||
double * | ac, | ||
double * | ad, | ||
double * | ns, | ||
int * | Wids | ||
) |
function ReEstFreqAmp: sinusoid reestimation by demodulating frequency and amplitude.
In: x[Wid+Offst*(FrCount-1)]: waveform data FrCount, Wid, Offst: frame count, frame size and hop size fbuf[FrCount], abuf[FrCount], ns[FrCount]: initial frequency and amplitude estiamtes and their timing win[Wid]: window function for estimating demodulated sinusoid M, c[], iH2: cosine-family window specification parameters, must be consistent with win[] Wids[FrCount]: specifies frame sizes for estimating individual frames of demodulated sinusoid, optional w[Wid/2], ps[Wid], xs[Wid], xc[Wid]: buffers fa[FrCount-1], fb[FrCount-1], fc[FrCount-1], fd[FrCount-1]: buffers aa[FrCount-1], ab[FrCount-1], ac[FrCount-1], ad[FrCount-1]: buffers Out: fbuf[FrCount], abuf[FrCount], pbuf[FrCount]: reestimated frequencies, amplitudes and phase angles
No return value.
int Reestimate2 | ( | int | FrCount, |
int | Wid, | ||
int | Offst, | ||
double * | win, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
double * | x, | ||
double * | ae, | ||
double * | fe, | ||
double * | pe, | ||
double * | aret, | ||
double * | fret, | ||
double * | pret, | ||
int | maxiter, | ||
int * | Wids | ||
) |
function Reestimate2: iterative demodulation method for sinusoid parameter reestimation.
In: x[(FrCount-1)*Offst+Wid]: waveform data FrCount, Wid, Offst: frame count, frame size and hop size win[Wid]: window function M, c[], iH2: cosine-family window specification parameters, must be consistent with win[] Wids[FrCount]: specifies frame sizes for estimating individual frames of demodulated sinusoid, optional maxiter: maximal number of iterates ae[FrCount], fe[FrCount], pe[FrCount]: initial amplitude, frequency and phase estimates Out: aret[FrCount], fret[FrCount], pret[FrCount]: reestimated amplitudes, frequencies and phase angles
Returns the number of unused iterates left of the total of maxiter.
void setdh | ( | int | M, |
int | T, | ||
double **& | dh, | ||
MList * | mlist | ||
) |
function setdh: set dh[M] to the derivative of a series of power functions.
In: M, T. Out: dh[M][T], where dh[m] is derivative of the power function of order m.
No return value. dh is allocated anew and must be freed by caller.
void setdih | ( | int | M, |
int | T, | ||
double **& | dih, | ||
MList * | mlist | ||
) |
function setdih: set dih[M] to the difference of the integral of a series of power functions.
In: M, I Out: dih[M][I], where the accumulation of dih[m] is the integral of the power function of order m.
No return value. dih is allocated anew and must be freed by caller.
void seth | ( | int | M, |
int | T, | ||
double **& | h, | ||
MList * | mlist | ||
) |
function seth: set h[M] to a series of power functions.
In: M, T. Out: h[M][T], where h[m] is power function of order m.
No return value. h is allocated anew and must be freed by caller.
function setu: sets u[I+1] as base-band windowed Fourier atoms, whose frequencies come in the order of 0, 1, -1, 2, -2, 3, -3, 4, etc, in bins.
In: I, Wid: number and size of atoms to generate. WinOrder: order (=vanishing moment) of window function to use (2=Hann, 4=Hann^2, etc.) Out: u[I+1][Wid], du[I+1]{Wid]: the I+1 atoms and their derivatives.
No return value. u and du are created anew and must be freed by caller.
double sIPWindow | ( | double | f, |
int | L, | ||
cdouble ** | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
cdouble * | lmd | ||
) |
function sIPWindow: computes the total energy of truncated inner products between multiple windowed spectra and that of a sinusoid at a reference frequency f. This does not consider phase alignment between the spectra, supposedly measured at a sequence of known instants.
In: x[L][N]: input spectra f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: lmd[L]: the actual individual inner products representing actual ampltiude-phase factors (optional)
Returns the energy of the vector of inner products.
double sIPWindowC | ( | double | f, |
int | L, | ||
double | offst_rel, | ||
cdouble ** | x, | ||
int | N, | ||
int | M, | ||
double * | c, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
cdouble * | lmd | ||
) |
function sIPWindowC: computes the total energy of truncated inner products between multiple frames of a spectrogram and multiple frames of a spectrogram of a sinusoid at a reference frequency f.
In: x[L][N]: the spectrogram offst_rel: frame offset, relative to frame size f: reference frequency, in bins M, c[], iH2: cosine-family window specification parameters K1, K2: spectrum truncation bounds, in bins, inclusive Out: lmd[L]: the actual individual inner products representing actual ampltiude-phase factors (optional)
Returns the energy of the vector of inner products.
double sIPWindowDuo | ( | double | f1, |
double | f2, | ||
cdouble * | x, | ||
int | N, | ||
double * | c, | ||
double * | d, | ||
int | M, | ||
double | iH2, | ||
int | K1, | ||
int | K2, | ||
cdouble & | lmd1, | ||
cdouble & | lmd2 | ||
) |
function sIPWindowDuo: calculates the square norm of the orthogonal projection of a windowed spectrum onto the linear span of the windowed spectra of two sinusoids at reference frequencies f1 and f2.
In: x[N]: spectrum f1, f2: reference frequencies. M, c[], d[], iH2: cosine-family window specification parameters. K1, K2: spectrum truncation range, i.e. bins outside [K1, K2] are ignored. Out: lmd1, lmd2: projection coefficients, interpreted as actual amplitude-phase factors
Returns the square norm of the orthogonal projection.
void ssACubicHermite | ( | int | L, |
int | T, | ||
int | M, | ||
int & | N, | ||
double ***& | A, | ||
MList * | mlist, | ||
int | mode | ||
) |
function ssACubicHermite: sets N and A[L] for cubic Hermite spline model
In: L, M, T Out: N=2(L+1), A[L][M][N] filled out for the cubic Hermite spline
No return value. A is created anew and must be freed by caller.
void ssACubicSpline | ( | int | L, |
int | T, | ||
int | M, | ||
int & | N, | ||
double ***& | A, | ||
MList * | mlist, | ||
int | mode | ||
) |
function ssACubicSpline: sets N and A[L] for cubic spline model
In: L, M, T mode: boundary mode of cubic spline, 0=natural, 1=quadratic run-out, 2=cubic run-out Out: N=2(L+1), A[L][M][N] filled out for the cubic spline
No return value. A is created anew and must be freed by caller.
void ssALinearSpline | ( | int | L, |
int | T, | ||
int | M, | ||
int & | N, | ||
double ***& | A, | ||
MList * | mlist, | ||
int | mode | ||
) |
function ssALinearSpline: sets N and A[L] for the linear spline model
In: L, M, T Out: N=L+1, A[L][M][N] filled out for the linear spline model
No return value. A is created anew and bust be freed by caller.
void ssCubicHermite | ( | int | L, |
int | T, | ||
int | M, | ||
int & | N, | ||
double **& | h, | ||
double ***& | A, | ||
MList * | mlist, | ||
int | mode | ||
) |
function ssLinearSpline: sets M, N, h and A for the cubic Hermite spline model
In: L, M, T Out: N and h[][] and A[][][] filled out for the cubic Hermite spline model
No reutrn value. A and h are created anew and bust be freed by caller.
void ssCubicSpline | ( | int | L, |
int | T, | ||
int | M, | ||
int & | N, | ||
double **& | h, | ||
double ***& | A, | ||
MList * | mlist, | ||
int | mode | ||
) |
function ssLinearSpline: sets M, N, h and A for the cubic spline model
In: L, M, T Out: N and h[][] and A[][][] filled out for the cubic spline model
No reutrn value. A and h are created anew and bust be freed by caller.
void ssLinearSpline | ( | int | L, |
int | T, | ||
int | M, | ||
int & | N, | ||
double **& | h, | ||
double ***& | A, | ||
MList * | mlist, | ||
int | mode | ||
) |
function ssLinearSpline: sets M, N, h and A for the linear spline model
In: L, M, T Out: N and h[][] and A[][][] filled out for the linear spline model
No reutrn value. A and h are created anew and bust be freed by caller.
void TFAS05 | ( | double & | f, |
double & | t, | ||
double & | a, | ||
double & | ph, | ||
double & | aesp, | ||
double & | fslope, | ||
int | Wid, | ||
double * | data, | ||
double * | w, | ||
double | res | ||
) |
function TFAS05: the Abe-Smith method 2005
In: data[Wid]: waveform data w[Wid]: window function res: resolution of frequency for QIFFT Out: f, a, ph: frequency, amplitude and phase angle estimates aesp, fslope: estimates of log amplitude and frequency derivatives
No return value.
void TFAS05_enh | ( | double & | f, |
double & | t, | ||
double & | a, | ||
double & | ph, | ||
double & | aesp, | ||
double & | fslope, | ||
int | Wid, | ||
double * | data, | ||
double * | w, | ||
double | res | ||
) |
function TFAS05_enh: the Abe-Smith method 2005 enhanced by LSE amplitude and phase estimation
In: data[Wid]: waveform data w[Wid]: window function res: resolution of frequency for QIFFT Out: f, a, ph: frequency, amplitude and phase angle estimates aesp, fslope: estimates of log amplitude and frequency derivatives
No return value.
void TFReas | ( | double & | f, |
double & | t, | ||
double & | fslope, | ||
int | Wid, | ||
cdouble * | data, | ||
double * | win, | ||
double * | dwin, | ||
double * | ddwin, | ||
double * | plogaslope | ||
) |
function TFReas: time-frequency reassignment
In: data[Wid]: waveform data win[Wid+1], dwin[Wid+1], ddwin[Wid+1]: window function and its derivatives f, t: initial digital frequency and time Out: f, t: reassigned digital frequency and time fslope: estimate of frequency derivative plogaslope[0]: estimate of the derivative of logarithmic amplitude, optional
No return value.
void TFReas | ( | double & | f, |
double | t, | ||
double & | a, | ||
double & | ph, | ||
double & | fslope, | ||
int | Wid, | ||
cdouble * | data, | ||
double * | w, | ||
double * | dw, | ||
double * | ddw, | ||
double * | win | ||
) |
function TFReas: sinusoid estimation using reassignment method
In: data[Wid]: waveform data w[Wid+1], dw[Wid+1], ddw[Wid+1]: window function and its derivatives win[Wid]: window function used for estimating amplitude and phase by projection onto a chirp t: time for which the parameters are estimated f: initial frequency at t Out: f, a, ph: digital frequency, amplitude and phase angle estimated at t fslope: frequency derivative estimate
No return value.
function Window: calculates the cosine-family-windowed spectrum of a complex sinusoid on [0:N-1] at frequency f bins with zero central phase.
In: f: frequency, in bins N: window size M, c[]: cosine-family window decomposition coefficients Out: x[0...K2-K1] containing the spectrum at bins K1, ..., K2.
Returns pointer to x. x is created anew if x=0 is specified on start.
double WindowDuo | ( | double | df, |
int | N, | ||
double * | d, | ||
int | M, | ||
cdouble * | w | ||
) |
function WindowDuo: calcualtes the square norm of the inner product between windowed spectra of two sinusoids at frequencies f1 and f2, df=f1-f2.
In: df: frequency difference, in bins N: DFT size M, d[]: cosine-family window specification parameters (see "further reading"). Out: w[0], the inner product, optional
Returns square norm of the inner product.
Generated on Fri Dec 27 2024 07:09:12 for x by 1.8.11