bennji_of_the_overflow
bennji_of_the_overflow

Reputation: 1133

Determining the best filter order for linear predictive coding

I am wondering if there is an established method for choosing the best filter order to use when performing linear predictive coding (such as that used in audio file formats like FLAC).

My current approach is:

  1. Take a chunk of signal
  2. Window the signal with a 0.5 tukey window
  3. Get the auto-correlation coefficients
  4. Calculate the LPC coefficients using the auto-correlation coefficients
  5. Generate the predicted signal using a standard FIR filter with the LPC coefficients
  6. Measure the error between the original and predicted signal
  7. Goto step 1 and continue repeating with different filter orders ...
  8. Choose best order based on lowest error

Is it possible to estimate the best filter order by looking at the error created from step 4 of the process? I would like to shortcut to step 8 from step 4 if possible.

Upvotes: 3

Views: 1294

Answers (1)

hcs
hcs

Reputation: 1534

Since you mentioned FLAC, I had a look at how they do it. It looks like in the process of calculating the LPC coefficients, they estimate the errors for all orders up to the max. The overall computation starts here, they use FLAC__lpc_compute_lp_coefficients to compute the coeffs and also estimate the error. This is then used in FLAC__lpc_compute_best_order to decide what coefficient to use (in the nonexhaustive case).

Another implementation to look at is libflake, which is choosing the highest order n with n-1's reflection coefficient > .10. This seems related to the approach described here (PDF) which chooses the lowest order n when n+1 and n+2's reflection coefficients are < .15. Both are looking for the point where the reflection coef blows up, but looking at figure 1 in the aforementioned PDF it looks like taking the search from above as Flake does makes more sense. Just another heuristic but might be interesting.

Upvotes: 1

Related Questions