home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / speech / 249 < prev    next >
Encoding:
Text File  |  1992-11-12  |  5.7 KB  |  133 lines

  1. Newsgroups: comp.speech
  2. Path: sparky!uunet!convex!darwin.sura.net!spool.mu.edu!agate!ames!riacs!danforth
  3. From: danforth@riacs.edu (Douglas G. Danforth)
  4. Subject: Re: Very simple speech recognition Alg. wanted.
  5. Message-ID: <1992Nov12.180625.13886@riacs.edu>
  6. Sender: news@riacs.edu
  7. Organization: RIACS, NASA Ames Research Center
  8. References: <MHALL.92Nov9152432@occs.cs.oberlin.edu>
  9. Distribution: comp.speech
  10. Date: Thu, 12 Nov 92 18:06:25 GMT
  11. Lines: 120
  12.  
  13. In <MHALL.92Nov9152432@occs.cs.oberlin.edu> mhall@occs.cs.oberlin.edu (Matthew Hall) writes:
  14.  
  15. >Hello-
  16. >    I asked this question before, and recieved no replies.
  17. >However I did recieve at least five requests to pass information on.
  18. >If you can help, please do.  Many people want to know.
  19.  
  20. >Simply the question is this - How does one implement a speaker
  21. >dependant, discrete recognition system?  For my purposes, the
  22. >vocabulary can be very small (<100 commands), but others have shown
  23. >interest in larger vocabularies.
  24.  
  25. >Specifically, what data should one store - what patterns are unique to
  26. >different words.  How does one search a "dictionary" for a specific
  27. >word, and how does one quickly and somewhat accurately match a word
  28. >spoken to it's saved (pattern?)  The sound, at least in my case, is
  29. >stored in a raw waveform.  I am using pascal on a Macintosh, but I am
  30. >pretty flexible.
  31.  
  32. >If you can help me and the other querents out, either by source code
  33. >or pointers to information, please do. There seems to be a great
  34. >interest in this.
  35.  
  36. >Thank you,
  37. >-matt hall
  38. >--
  39. >-------------------------------------------------------------------------------
  40. >Matt Hall.    mhall@occs.oberlin.edu  OR  SMH9666@OBERLIN.BITNET
  41. >              (216)-775-6613 (That's a Cleveland Area code. Lucky Me)
  42.  
  43. >"Life's good, but not fair at all"  -Lou Reed
  44.  
  45. QUICKY RECOGNIZER sketch:
  46.  
  47. Here is a simple recognizer that should give you 85%+ recognition
  48. accuracy.  The accuracy is a function of WHAT words you have in
  49. your vocabulary.  Long distinct words are easy.  Short similar
  50. words are hard.  You can get 98+% on the digits with this recognizer.
  51.  
  52. Overview:
  53. (1) Find the begining and end of the utterance.
  54. (2) Filter the raw signal into frequency bands.
  55. (3) Cut the utterance into a fixed number of segments.
  56. (4) Average data for each band in each segment.
  57. (5) Store this pattern with its name.
  58. (6) Collect training set of about 3 repetitions of each pattern (word).
  59. (7) Recognize unknown by comparing its pattern against all patterns
  60.     in the training set and returning the name of the pattern closest
  61.     to the unknown.
  62.  
  63. This type of recognizer has been used by several companies such as
  64. Interstate Electronics.  There are many variations on this theme:
  65. Use Mel-Ceptral rather than frequency bands, dynamic time warping
  66. rather than linear segment rule, Hidden Markov Models with no
  67. specific end point determination, etc.
  68.  
  69. If you use filter bands then you need to know how to construct a
  70. filter which has a center frequency and band width.  There are many
  71. signal processing books that describe how to do this but can get
  72. quite technical very fast.  I have found that a simple "second
  73. order state space" filter works very well.  By this I mean that
  74. each filter is represented by a 2x2 matrix which specifies its
  75. center frequency and bandwidth along with a 2x1 vector, its state.
  76. The state is modified from sample to sample by first adding the
  77. input signal from whatever hardware board you have to one of the
  78. components of the state and then multiplying that state by the
  79. 2x2 matrix:  add and rotate.  The output of the filter is just
  80. one of the components of the state (it doesn't really matter which,
  81. the phase is just shifted slightly).
  82.  
  83. The 2x2 matrix is contructed as following:
  84.  
  85.               |a  -b|
  86.     R = r |     |
  87.               |b   a|
  88.  
  89. where 0 < r < 1,  a=cos(t), b=sin(t).
  90.  
  91. The parameter r determines the width of the filter.  If r is close to 1
  92. then the width is very narrow and the output can grow very large for
  93. inputs with frequency in resonance with the filter.  For r small the
  94. width is broad and the amplitude grows less strongly.
  95.  
  96. The parameter t is the frequency of the filter, small t low frequency,
  97. large (near pi) t high frequency.  You should spread your filters
  98. over the range 200Hz to 4000Hz.  The spread should be heavy near the
  99. low frequency with fewer filters near the high (critical bands).
  100.  
  101. The output of a filter will look choppy and irregular just like the
  102. input but will be large for resonance input signals.  One needs to
  103. smooth the output of each band filter by "lowpass" filtering the 
  104. rectified fullwave (absolute value of)(make all negative values positive).
  105. This entails using a second stage with a single 1x1 state scalar that
  106. adds a fraction of the rectified bandpass filter output to a fraction
  107. of its value:  Lowpass := (1-u)*Lowpass + u*|Bandpass|,  where  0 < u < 1.
  108.  
  109. Resample the Lowpass at about 200 times a second to use for the other
  110. parts of the pattern generation.
  111.  
  112. How many filters?  How many segments?  Well 16 for both works quite
  113. nicely.  This gives a pattern of 256 numbers.  That's what you store.
  114.  
  115. How do you find the begining and end of an utterance?  Use a threshold
  116. for the total energy (square of the input signal) and remember that
  117. just because the signal drops below the threshold does not mean that
  118. the word is finished.  It may come up again!  Consider the word "it".
  119. There is a long pause between the "i" and the release of the "t" so
  120. you need allow for this.  Again, other more sophisticated techniques
  121. can avoid having to make these "end point" decisions in this way but
  122. take more work to implement.
  123.  
  124. I think I have provided enough information for you to begin building
  125. your first speech recognition system.  Oh yes, just use a Euclidean
  126. distance between the 256 elements of two patterns (other metrics
  127. also work).
  128.  
  129. Good luck,
  130.  
  131. Doug Danforth
  132.  
  133.