Posted to tcl by mjanssen at Fri Aug 29 22:13:53 GMT 2008view raw

  1. /* dpform.c */
  2.  
  3. /* a formant tracker based on LPC polynomial roots and dynamic programming */
  4. /***/
  5. /* At each frame, the LPC poles are ordered by increasing frequency. All
  6. "reasonable" mappings of the poles to F1, F2, ... are performed.
  7. The cost of "connecting" each of these mappings with each of the mappings
  8. in the previous frame is computed. The lowest cost connection is then
  9. chosen as the optimum one. At each frame, each mapping has associated
  10. with it a cost based on the formant bandwidths and frequencies. This
  11. "local" cost is finally added to the cost of the best "connection." At
  12. end of utterance (or after a reasonable delay like .5sec) the best
  13. mappings for the entire utterance may be found by retracing back through
  14. best candidate mappings, starting at end of utterance (or current frame).
  15. */
  16.  
  17. /* Here are the major fudge factors for tweaking the formant tracker. */
  18. #define MAXCAN 300 /* maximum number of candidate mappings allowed */
  19. static double MISSING = 1, /* equivalent delta-Hz cost for missing formant */
  20. NOBAND = 1000, /* equivalent bandwidth cost of a missing formant */
  21. DF_FACT = 20.0, /* cost for proportional frequency changes */
  22. /* with good "stationarity" function:*/
  23. /* DF_FACT = 80.0, *//* cost for proportional frequency changes */
  24. DFN_FACT = 0.3, /* cost for proportional dev. from nominal freqs. */
  25. BAND_FACT = .002, /* cost per Hz of bandwidth in the poles */
  26. /* F_BIAS = 0.0004, bias toward selecting low-freq. poles */
  27. F_BIAS = 0.000, /* bias toward selecting low-freq. poles */
  28. F_MERGE = 2000.0; /* cost of mapping f1 and f2 to same frequency */