1 /********************************************************************
3 * THIS FILE IS PART OF THE OggGhost SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggGhost SOURCE CODE IS (C) COPYRIGHT 2007-2011 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
11 ********************************************************************
13 function: research-grade chirp extraction code
16 ********************************************************************/
19 float A
; /* center amplitude (linear) */
20 float W
; /* frequency (radians per sample, not cycles per block) */
21 float P
; /* phase (radians) */
22 float dA
; /* amplitude modulation (linear change per sample) */
23 float dW
; /* frequency modulation (radians per sample^2) */
24 float ddA
; /* amplitude modulation (linear change per sample^2) */
25 int label
; /* used for tracking by outside code */
29 estimate_chirps(const float *x
, /* unwindowed input to fit */
30 const float *window
, /* window to apply to input/bases */
31 int len
, /* block length */
32 chirp
*c
, /* list of chirp estimates/outputs */
33 int n
, /* number of chirps */
34 float fit_limit
,/* minimum basis movement to continue iteration */
35 int iter_limit
, /* maximum number of iterations */
36 int fit_gs
, /* Use Gauss-Seidel partial updates */
38 int fitW
, /* fit the W parameter */
39 int fitdA
, /* fit the dA parameter */
40 int fitdW
, /* fit the dW parameter */
41 int fitddA
, /* fit the ddA parameter */
42 int nonlinear
, /* perform a linear fit (0),
43 nonlinear fit recentering W only (1)
44 nonlinear fit recentering W and dW (2) */
45 float fit_W_alpha
, /* W alpha multiplier for nonlinear fit */
46 float fit_dW_alpha
,/* dW alpha multiplier for nonlinear fit */
47 int symm_norm
, /* Use symmetric normalization optimization */
48 int bound_zero
); /* prevent W or dW from fitting to negative or
49 greater-then-Nyquist frequencies */
51 extern void advance_chirps(chirp
*c
, int n
, int len
);