The Software System Implementation of Speech Command Recognizer Under Intensive Background Nosie

A device for speech command recognition is designed and implemented in this paper. The adaptive filtering technique is adopted for speech enhancement by using two microphones for sampling the background noise and noisy speech signal correspondently. The connected-word speech recognition algorithm based on HMM is employed for speech command recognition. The experiment shows that the equipment can work well under the background noise of 90dB.


Introduction
Speech command recognition technology for limited vocabulary based on conjunction recognition technology has good robustness and high recognition rate and it is widely used in many fields of information query and voice control.However, speech recognition technology is sensitive to environmental noise when it is applied, especially in strong noise environment, which has a significant impact on speech endpoint detection and feature extraction.Therefore, in a speech recognition system, speech enhancement technology is usually used to reduce the effect of noise on speech signal.The purpose of speech enhancement technology is to try to recover clean speech signals from noisy speech.Traditional speech enhancement methods mainly include parameter estimation methods such as comb filter (estimation of pitch period parameters), wiener filter, kalman filter (estimation of signalto-noise ratio parameters) and parameter estimation-based speech enhancement methods such as spectral subtraction and adaptive filtering noise cancellation.In addition, there are voice enhancement methods based on microphone arrays and methods based on statistics and in-depth learning.Considering the size limitation of microphone array in application, the noise of application scene may be non-stationary, and the type and statistical characteristics of noise are unknown.In practical applications, we consider using non-parametric speech enhancement methods.
In non-parametric methods, spectral subtraction will produce serious spectral distortion under the condition of low signal-to-noise ratio, which will affect the performance of speech recognition. Therefore, we choose the adaptive filtering noise cancellation method of dual microphones as our speech enhancement method.In speech recognition model, we adopt HMM model based on segment length distribution, which has good adaptability and can achieve high recognition rate of command words under the condition of accurate speech endpoint detection. Finally, we transplant the speech enhancement algorithm and speech recognition algorithm to ADSP-21469 platform, and realize the speech recognition task in strong noise environment.  Figure 1 is the block diagram for the realization of speech recognition algorithm.In the front of the speech recognition system, a speech enhancement scheme based on adaptive noise cancellation with dual microphones is used. The microphone labeled Mic_S in the system is close to the mouth to collect voice command signals containing environmental noise. Another microphone labeled Mic_N is set up to collect environmental noise.Under the condition of 90 dB ambient noise, the output signal-tonoise ratio of the microphone used to collect voice is about 0 dB under the condition of short talk.These two microphones acquire signals through adaptive filters to achieve noise cancellation function. The signal-to-noise ratio can be increased by more than 20 dB, which meets the requirement of speech signal-to-noise ratio of follow-up command word speech engine.The speech recognition module of command words used in the system includes endpoint detection, speech feature extraction and template search matching. The final recognition result is sent to the controller system through the data communication interface. Here we introduce the functions and implementation algorithms of the main modules of the system in detail.

( )
Nn  noise path difference and adaptive filter delay in microphone output.The purpose of this method is to make the adaptive filtering noise cancellation algorithm better adapt to various noise environments.
The output of speech enhancement  Figure 2, the adaptive filter is in transverse form.Its input signal is ( ) In this system, the Mic_S microphone for voice acquisition is close to the speaker's mouth, and the Mic_N for background noise acquisition is relatively far from the speaker's mouth.Because of the near-field effect of speech, the signal-to-noise ratio of speech collected by Mic_S microphone is much larger than that collected by Mic_N microphone. That is to say , the signal collected by Mic_N microphone in strong noise environment can be approximately considered as environmental noise.In this case, the condition of formula (3) is approximately satisfied.
According to formula (3), when estimating the minimum mean square value, the following is derived.
In formula (5), ( ) n  is the step-size coefficient of the algorithm, and gradient operator  is concerned with finding partial derivatives of W . Its vector form is expressed as follows.
Notice that  When the value of M is small, for example 01 M.  , the misalignment coefficient has the following approximate relationship.

 
It can be seen from formula (8) that the larger the step size coefficient  , the larger the misalignment coefficient, which will eventually lead to greater output error of the filter, leading to instability.The analysis of filter [1] shows that if signal ( ) is set as a constant, it will affect the stability and convergence speed of LMS algorithm in practical application.To solve this problem, many improved algorithms have been proposed. We use the improved normalized LMS algorithm (NLMS).The NLMS algorithm takes into account the change of input signal amplitude and normalizes the calculation of iteration step coefficients.Its iteration formula is as follows.
W n e n X n T n X n X NLMS algorithm can be seen as optimizing u again on the basis of formula (7), so that the posterior error of filter coefficients calculated from formula (7) is minimized when applied to transverse filters [1] .
Experiments show that the NLMS algorithm takes into account the stability and convergence speed of adaptive filtering, and the algorithm is relatively simple and the computational complexity is small.

Speech endpoint detection algorithm
After noise cancellation, the signal-to-noise ratio (SNR) of speech signal is enhanced, which can satisfy the basic requirement of endpoint detection for SNR, so that the position of speech signal can be detected more accurately from background noise.
Experiments show that the speech recognizer is sensitive to the initial position error of speech. The software of the recognizer uses a double threshold detection method based on short-term average energy to determine the starting point of speech more accurately.Since voice always has a high energy voiced sound after the beginning of speech, a higher threshold T h is set to judge the location of voice 0 N . In order to avoid the loss of data with less energy at the beginning of voice segment, a threshold T i lower than T h is set to detect the real voice starting position 1 N .As shown in Figure 3, the double threshold detection method is based on the correct estimation of background noise energy. In endpoint detection algorithm, cyclic buffer is used to cache voice data.In order to estimate the background noise of speech signal after speech enhancement, the algorithm calculates the energy of input signal of one frame (frame length is 20ms) every 10ms interval, and caches the speech data in a circular queue of 500 frames (5 seconds). In speech detection, the minimum energy of all data frames in the cyclic queue is searched as the background noise energy T noise of the current speech. Setting two thresholds 20dB TT h noise .When detecting the location 0 N where the frame energy of speech is higher than the threshold value of T h , it is considered that a speech event is detected, and the frame energy value of speech is traced back from that time until the location where the frame energy is less than the threshold of T i is found, which is the real starting time of speech 1 N .In addition, in order to prevent misjudgement in retrospective speech starting point, it is agreed that the maximum number of retrospective frames should not exceed 20 frames. When the 0 N position is detected, the voice pronunciation begins. The frame energy of the voice lasts more than 0.5 seconds and falls again below the threshold value T i . This is the end of the voice pronunciation, that is the 2 N position in Figure 3.The method of speech detection based on energy threshold alone works well in quiet environment. However, when there is background noise, this method is prone to interference, resulting in speech error judgment. For this reason, the analysis of pitch features is added in this system. Its principle is that there are voiced components in the pronunciation of Chinese syllables.A remarkable feature of voiced tone is that there is a relatively stable fundamental frequency, so we add a pitch search algorithm to the algorithm.We search for pitches in the range of 3-13 ms pitch period. If more than five pitch frames are found in succession, the voice will be recognized as voice, otherwise it will be considered as interference signal. Using pitch features to detect speech greatly improves the stability of the endpoint detection algorithm.

Command word recognition algorithms and implementation scheme
In the recognition system, the sampling frequency of speech signal is 16 KHz, the adaptive filter uses 320-point FIR transverse filter, and the speech microphone channel inserts 160-point delay to automatically adapt to the change of the two-channel noise delay path environment. After speech enhancement, the speech endpoint is judged, and then the speech recognition features are extracted.Speech signal is pre-emphasized with a high-pass filter ( ) . The speech signal is analyzed by using Hamming window. The frame length is 20 ms and the frame is shifted to 10 ms. The speech feature vector is a 45-dimensional feature vector composed of normalized energy and 14-dimensional MFCC coefficients, together with their first-order and second-order difference coefficients. The system uses DDBHMM [2] model as the basic recognition framework, and uses two Gauss functions of total covariance matrix to form GMM model to describe the distribution of observation vectors.Considering the flexibility and stability, the system uses half-syllable (each Chinese syllable can be divided into Initial and Final parts) as the modeling primitive for word stitching. The system uses 100 Initial models and 164 Final models. Each Initial model is described by two states, and each Final model is described by four states. There are 856 states in the whole model. The training of the HMM model used the soliton full syllable database (1254 syllables) of 100 people (50 male voices + 50 female voices) and the connection word database (699 words) of 100 people (50 male voices + 50 female voices). The two databases covered all the connections between the commonly used syllables and syllables in Chinese.HMM model training is carried out on PC in advance, and the trained model is stored in Flash chip through the simulator development interface. When recognizing DDBHMM model, the frame synchronization search algorithm based on Viterbi decoding can be used directly to recognize the DDBHMM [2] model without considering the correlation of segment length between states, the correlation between observation vectors and the uniform distribution of segment length. If the recognition algorithm is searched directly according to the MLSS recognition algorithm of DDBHMM model, the calculation of the Gauss probability model of the total covariance matrix is very large. Therefore, a two-stage search strategy is adopted.
The first stage is the fast search stage.The state codebook of HMM uses a single Gauss diagonal matrix to find the top N candidate entries with the highest matching degree.The second stage is precise search stage, using GMM model of total covariance matrix.The likelihood distance is calculated