-/* On top of this basic LPC infrastructure we introduce two modifications:
-
- 1) Filter generation is limited in the resolution of features it
- can represent (this is more obvious when the filter is looked at as
- a set of LSP coefficients). Human perception of the audio spectrum
- is logarithmic not only in amplitude, but also frequency. Because
- the high frequency features we'll need to encode will be broader
- than the low frequency features, filter generation will be
- dominated by higher frequencies (when most of the energy is in the
- lowest frequencies, and greatest perceived resolution is in the
- midrange). To avoid this effect, Vorbis encodes the frequency
- spectrum with a biased log frequency scale. The intent is to
- roughly equalize the sizes of the octaves (see xlogmap.h)
-
- 2) When we change the frequency scale, we also change the
- (apparent) relative energies of the bands; that is, on a log scale
- covering 5 octaves, the highest octave goes from being represented
- in half the bins, to only 1/32 of the bins. If the amplitudes
- remain the same, we have divided the energy represented by the
- highest octave by 16 (as far as Levinson-Durbin is concerned).
- This will seriously skew filter generation, which bases calculation
- on the mean square error with respect to energy. Thus, Vorbis
- normalizes the amplitudes of the log spectrum frequencies to keep
- the relative octave energies correct. */
-
-/* n == size of vector to be used for filter, m == order of filter,
- oct == octaves in normalized scale, encode_p == encode (1) or
- decode (0) */
-
-void lpc_init(lpc_lookup *l,int n, int mapped, int m, int oct, int encode_p){
- double bias=LOG_BIAS(n,oct);
- double scale=(float)mapped/(float)oct; /* where n==mapped */
- int i;
-
- memset(l,0,sizeof(lpc_lookup));
-
- l->n=n;
- l->ln=mapped;
- l->m=m;
- l->dscale=malloc(n*sizeof(double));
- l->norm=malloc(n*sizeof(double));