Summary of the invention the objective of the invention is for overcoming the weak point of prior art, a kind of unspecified person speech recognition, phonetic prompt method based on the speech recognition special chip proposed, can realize the speech recognition of high precision unspecified person at cheap 8 monolithics or 16 MCU microcontrollers, it is low to have the method complexity, the high and good characteristics of robustness of accuracy of identification.Particularly the Chinese digital speech recognition performance is reached even surpass current international most advanced level.
The present invention proposes a kind of unspecified person speech recognition, phonetic prompt method based on the speech recognition special chip, comprise the A/D sampling, frequency spectrum shaping windowing pre-emphasis is handled, characteristic parameter extraction, end-point detection, the speech recognition template training, the speech recognition template matches, recognition result output, and phonetic synthesis, it is characterized in that, specifically may further comprise the steps:
The training in advance of A, unspecified person speech recognition:
Training process requires that a large amount of sound banks is arranged, and training process is finished on PC, and the template after the training is deposited in the chip, and its training method comprises: adopt based on polynomial sorting technique; The parameter of model of cognition is represented with polynomial coefficient; Approach posterior probability by polynomial expression; Model parameter is tried to achieve by the optimized calculation method of system of linear equations;
B, speech recognition parameter extract:
(1) voice signal input back adopts A/D to sample, and becomes original digital speech, adopts electric-level gain control, with the high precision of guaranteeing to sample;
(2) said original figure voice signal is carried out frequency spectrum shaping and divides the frame windowing process, to guarantee to divide the accurate stationarity of frame voice;
(3) feature of said minute frame voice is carried out phonetic feature and extract, the principal character parameter adopts linear prediction cepstral coefficients (LPCC), and storage is used for back dynamic segmentation and template extraction;
(4) use the zero-crossing rate and the short-time energy feature of voice signal to carry out end-point detection, remove the speech frame of no sound area, to guarantee the validity of each frame phonetic feature;
The identification of C, unspecified person voice command:
Identifying adopts the two-stage recognition structure, is divided into thick identification and smart identification.Just can obtain a result to the thick identification of the order that is not easy to obscure, the order that is easy to obscure is discerned by meticulousr model;
The speaker adaptation study of D, unspecified person speech recognition:
The speaker is had accent or speaks when lack of standardization, and recognition system can cause erroneous judgement, adopts the speaker adaptation method that recognition template is adjusted; Said self-adapting regulation method adopts the maximum a posteriori probability method, progressively revises the recognition template parameter by alternative manner;
E. voice suggestion:
Phonetic synthesis and encoding and decoding speech technology are used in voice suggestion, but consider the restriction of system resource, should reduce the expense of system as far as possible; The phonetic synthesis model parameter is analyzed leaching process and is finished on computers, be stored in the chip then, therefore the speech analysis parameter extracting method can be very complicated, thereby guarantee to have high-quality synthetic speech, but the phonetic synthesis model parameter that needs to store should be the least possible, and phoneme synthesizing method is also simple as far as possible; Phonetic synthesis model of the present invention uses multiple-pulse phonetic synthesis model.
Electric-level gain control during said phonetic feature extracts can comprise: the input speech signal sampling precision is judged, if the input speech signal sampling precision is not high enough, by self-adaptive level control, adjusted the amplification quantity of voice, improve the speech sample precision; Said end-point detecting method is according to the end points thresholding of setting, and search for quiet section, determine voice, the top point; Said cepstrum parameter is that the linear prediction model (LPC) according to voice calculates.
Model of cognition training process in the training in advance method of said speech recognition can be: set up the database of wanting voice command recognition, extract the characteristic parameter of voice then, the process of characteristic parameter extraction is identical with the front.By the learning process of iteration, extract identification parameter based on polynomial disaggregated model.Learning process adopts second best measure, adjusts parameter in the polynomial disaggregated model at every turn, all calculates up to desired model parameter; Whole training process is finished on computers, and the model parameter that will draw after will training at last deposits in the speech recognition special chip, as model of cognition; This is and the different place of specific people's speech recognition;
The middle identifying of said voice command recognition methods can be: calculate the output result of each polynomial disaggregated model, the model of getting the output probability maximum is a recognition result; Identifying adopts thick identification and the identification of smart identification two-stage; Its difference is that the model parameter of thick identification is less, and recognition speed is fast, and smart model of cognition parameter is more.Can improve discrimination to the order that is easy to obscure by smart identification.
Self-adaptation in the recognition methods of said voice command adopts the model adaptation adjustment technology, and to the voice command of identification error, behind adaptive learning, discrimination can obviously improve.Adaptive process can be: input requires adaptive speech data, adopts the adaptive approach based on maximum a posteriori probability, respectively speech recognition parameter is adjusted by iteration, makes to differentiate between the model to estimate and keep maximum distinctive.
Employing phoneme synthesizing method in the said voice suggestion specifically can may further comprise the steps:
(1) uses multiple-pulse phonetic synthesis model, on PC, extract the LPC parameter and the excitation parameters of phonetic synthesis model by optimization method.
(2) quantification of LPC parameter is carried out vector quantization with 10 bits; The number of the driving pulse of LPC model is 25, adopts single order pitch period loop, and these parameters use 189 bits to carry out scalar quantization.
(3) for guaranteeing the level and smooth of synthetic speech, carry out linear interpolation in interframe.
The present invention has following characteristics:
(1) the present invention is the medium and small vocabulary non specific human speech sound distinguishing method based on the speech recognition special chip.These methods have characteristics such as complicacy is low, accuracy of identification is high, robustness is good.
(2) adopt the shared way of identification parameter and coding parameter, thereby significantly reduced requirement, guarantee to have very high coding quality simultaneously system resource.
(3) because to adopt 8 MCU or 16 bit DSPs be core, adopt 10 bit linear A/D, D/A, so outstanding feature such as this chip has that volume is little, in light weight, power consumptive province, cost are low.In fields such as communication, Industry Control, intelligent home electrical appliance, intelligent toy, automotive electronics great using value is arranged.
(4) voice recognition commands bar number of the present invention is in 10 on 8 cores, is 30 on 16 chips.To 8 chip identification rates is more than 95%, is more than 98% to 16 chip identification rates.
A kind of unspecified person speech recognition based on the speech recognition special chip, phonetic prompt method embodiment that embodiment the present invention proposes are described in detail as follows in conjunction with each figure:
The embodiments of the invention entire method constitutes as shown in Figure 3, whole process can be divided into (1) A/D sampling and sampling back voice with increase the weight of, improve the energy of high-frequency signal, windowing divides frame to handle; (2) extraction of speech characteristic parameter (comprising end-point detection parameter, model of cognition parameter), (3) end-point detection are determined effective speech parameter; (4) effective speech characteristic parameter is carried out dynamic segmentation, to reduce the template stores space of parameter; (5) speech recognition is carried out template relatively by method for mode matching, and voice identification result is exported.The specification specified of each step is as follows.
1, speech recognition parameter feature extraction:
(1) voice signal at first carries out low-pass filter, samples by 10-bit linear A/D then, becomes original digital speech, and adopting the purpose of 10 A/D is in order to reduce the cost of chip.Because the precision of A/D is low, therefore to control and the energy and the overload situations of input signal are judged gain-controlled amplifier on the method, so that guarantee to have made full use of the dynamic range of 10 A/D, obtain high as far as possible sampling precision.
(2) the original figure voice signal is carried out frequency spectrum shaping and divides the frame windowing process, the accurate stationarity that guarantees to divide the frame voice.Preemphasis filter is taken as 1-0.95z
-1, zero-crossing rate lifts level and is taken as 4 in calculating.
(3) minute feature of frame voice is carried out phonetic feature and extract, phonetic feature comprises LPCC cepstrum coefficient, energy, zero-crossing rate etc., and storage is used for the back dynamic segmentation.The calculating of a wherein very important step correlation function value need be finished in real time, owing to based on 8 single-chip microcomputer 8 no sign multiplication is only arranged, the process of therefore calculating correlation function value is as follows:
In the following formula, s (n) is converted into unsigned number a (n) for 8 signed numbers are arranged.Obviously product is preserved with three bytes and can not be overflowed (frame length is not more than 256).
2, end-point detection:
(1) guarantees the validity of each frame phonetic feature, eliminate irrelevant noise, must carry out the end-point detection and the judgement of voice.End-point detecting method of the present invention was divided into for two steps, at first end points is carried out preliminary ruling, after energy is greater than a certain determined value, be defined as preliminary starting point according to speech signal energy, continue to seek the bigger unvoiced frame of speech signal energy backward from this starting point then, carry out the voiced segments location.Be in the main true if unvoiced frame exists this end points of explanation to judge, begin to search for forward, backward the start frame of quiet frame as voice from unvoiced frame.Result's output with search.The end-point detection block diagram as shown in Figure 4.Its basic skills is: ZERO_RATE_TH is a threshold value of zero-crossing rate, and ACTIVE_LEVEL, INACTIVE_LEVEL and ON_LEVEL are the threshold values of energy.
(2) initial value of system is decided to be silent state.Under silent state, when zero-crossing rate surpasses threshold value ZERO_RATE_TH or energy and surpasses threshold value A CTIVE_LEVEL, change state of activation over to, if energy surpasses threshold value ON_LEVEL, then directly change sonance over to.Remember that this frame is the forward terminal of voice.
(3) under state of activation,, then change sonance over to if energy surpasses threshold value ON_LEVEL; If continuous some frames (being set by constant C ONST_DURATION) energy all surpasses only threshold value ON_LEVEL, change no voice and spirit over to.
(4),, then change unactivated state over to if energy is lower than threshold value INACTIVE_LEVEL at sonance.This frame of mark is the aft terminal of voice.
(5) in unactivated state, if continuous some frames (being set by constant C ONST_DURATION) energy all surpasses only threshold value INACTIVE_LEVEL, then voice finish; Otherwise change sonance over to.
The actual value of parameter is as follows: ZERO_RATE_TH is taken as 0.4, and ACTIVE_LEVEL is more according to the background noise setting, and INACTIVE_LEVEL is taken as 4 times of ACTIVE_LEVEL, and ON_LEVEL is taken as 8 times of ACTIVE_LEVEL, and CONST_DURATION is made as 20 frames.
3, phonetic feature dynamic segmentation, weighted mean:
(1) the input phonetic feature is carried out dynamic segmentation and weighted mean, improve the proportion of voiceless consonant characteristic parameter in identification, extract most important template parameter in the phonetic feature.The phonetic feature segmentation is one of core of this system voice recognition methods.
(2) the normalization Euclidean distance of calculating the speech characteristic parameter between different frame is adopted in dynamic segmentation.Surpass certain thresholding when changing, assert that this point is the important separation of phonetic feature.Phonetic feature in the different sections is weighted on average, and they are preserved as new speech characteristic parameter, and remove previous phonetic feature.By model parameter is reduced widely, not only save storage space, and reduced the complexity of computing and improved system's arithmetic speed.
4, the training of unspecified person speech recognition template:
The training of unspecified person speech recognition template parameter is finished on computers, at first carries out the extraction of speech characteristic parameter, uses based on the polynomial expression disaggregated model, approaches posterior probability by polynomial expression.The exponent number of multinomial model is relevant with model accuracy, adopts the quadratic polynomial disaggregated model just can reach very high accuracy of identification.Entire method is as follows:
Make F (V)=(f
1) (V) f
2(V) ... f
10(V))
T=A
TX (V) is f wherein
i(V) be the polynomial expression approximating function, X (V) is polynomial eigenvector, and it is made up of the phase cross between the different components of speech characteristic vector.Based on least mean-square error (MSE) criterion optimization method, estimate posterior probability with D (V):
Wherein P is a probability vector.Y=(0,0,0 ..., 0,1,0 ..., 0) and be the approximate vector of P, only the value with the corresponding class of V is 1, other value is 0.Satisfy equation (1) separate for:
E{XX
T}A
*=E{XY
T} (2)
The training process flow diagram of unspecified person speech recognition system is described in detail as follows as shown in Figure 5:
(1) by the eigenvector X (V) of speech characteristic vector evaluator of input.
ν wherein
IkBe V
iK dimension component.
(2) divide K class with the polynomial expression eigenvector, K is identification speech number.Ω is sorter training set.C
iRepresent the i class, i=1 ..., K.{ X
CiRepresent all polynomial expression features of the voice that all belong to the i class.
(3) in order to improve training effectiveness, in advance relevant first-order statistics amount E (X) and second-order statistic E (XX
T) calculate and finish.
(4) based on the minimum mean square error criterion optimization method, adopt the optimization method of suboptimum, adjust a highest model parameter of distinctive in the polynomial disaggregated model, up to the accuracy requirement of satisfying model at every turn.And from the polynomial expression eigenvector X of higher-dimension, calculate the characteristic component of actual use, composition and classification device training characteristics vector X
*,
(5) adopt formula (2) to optimize whole polynomial expression disaggregated model parameter again, systematic training is finished.
5, unspecified person speech recognition:
Unspecified person speech recognition process flow diagram as shown in Figure 6.Detailed steps is as follows:
(1) input speech signal extracts speech recognition features, and method is identical with the front.
(2) the eigenvector X (V) of evaluator.
(3) calculate the output probability value of each multinomial model.
A wherein
iBe the i component of polynomial expression disaggregated model parameter A: A=[a
1a
2A
K]
T
(4) adjudicate the recognition result that is of finding out the output probability maximum by (4) formula.For improving recognition speed and accuracy of identification, the identification judging process also is divided into thick identification and two processes of smart identification.Detail flow chart as shown in Figure 7.The model parameter of thick identification is less, and model parameter is 300, and thick recognition speed is fast.Estimate poor voice and must carry out essence and discern some voice that easily mix and thick identification are credible, the parameter of smart model of cognition is more, Duos about 100 than thick identification.The training method of smart model of cognition is identical with thick recognition methods.At first slightly discern, to slightly discern 3 selects recognition result to send into the credible computing module of estimating, when the with a low credibility of recognition result or the easily mixed voice of existence, then thick recognition result is sent into smart identification module, first three selects the result to carry out further smart identification to thick identification, then smart recognition result is sent into crediblely to estimate module and further judge the credible judgement of estimating.If the only still discontented requirement of can letter estimating of Shi Bie result, system refuses to know, and voice are re-entered in prompting.
(5) crediblely estimate the computing method more complicated, for selecting identification probability and first three to select the likelihood ratio of the average probability formation of recognition result with first, and first the likelihood ratio of selecting identification probability and second to select probability to constitute be combined into the comprehensive credible valuation of estimating, (this value is about 3 if this likelihood ratio is less than certain thresholding, can set different value according to the varying environment noise), then think credible estimate low.
6, the self-adaptation of unspecified person speech recognition modeling:
(1) adaptive process is: the speaker carries out supervised learning to the voice of identification error, and the parameter by real-time adjustment identification multinomial model increases the degree of discrimination between the model.If after the self-adaptation, can not reach the result, can carry out repeatedly adaptive learning, till obtaining satisfied recognition result.
(2) adaptive approach adopts alternative manner, recognition template is revised, and this method is the method with identification feature, also can adjust other relevant template in the template that corrects mistakes simultaneously, the value of adjusting step-length α is less than 0.01, otherwise causes adjustment easily.Self-adapting regulation method is as follows:
A wherein
K+1For upgrading back model parameter, A
kFor upgrading preceding model parameter.α is for adjusting step-length, and value is about 10
-3, X is polynomial eigenvector.The TI-digit database is trained the english digit model of cognition in English, and to the english digit discrimination very low (78%) of some Chinese's pronunciation, but by after the self-adaptation adjustment, discrimination is significantly improved, and reaches more than 99%.
7, voice suggestion is handled:
(1) adopts multi-pulse excitation LPC phonetic synthesis model; Model parameter is handled on computers in advance, editor, and compression deposits among the ROM of special chip then; The lpc analysis frame length is 20 milliseconds; The quantification of LPC parameter is carried out vector quantization with 10 bits; Pitch period 5 bit quantizations, pitch predictor coefficient 3 bit quantizations, the number of driving pulse are 25, each pulse position 4 bit quantizations, the pulse of amplitude peak at log-domain with 6 bit quantizations, the amplitude of its after pulse at log-domain with 3 bit quantizations.
(2), the estimation method of multiple-pulse parameter is improved for reducing the bit number that the multiple-pulse location parameter is quantized; The minimum spacing of this method paired pulses limits, and the position number of pulse only can appear on the point with 3 multiples; Maximum spacing between the pulse does not allow to surpass 48; The restrictive condition of maximum impulse spacing, can not be in the optimizing process of DISCHARGE PULSES EXTRACTION complete fulfillment; After the optimization of each DISCHARGE PULSES EXTRACTION is finished, sign indicating number is removed towards 5 pulses of amplitude minimum, be inserted into pulse distance greater than between two pulses of 48; This process repeats till the condition that satisfies the pulse distance requirement.
(3) decode procedure of parameter adopts look-up method; For guaranteeing the level and smooth of synthetic speech, carry out the interframe linear interpolation at decode procedure; 1/3 of every frame voice are carried out the interframe linear interpolation to the LPC parameter respectively with back 1/3.
(4) be the subjective quality that further improves phonetic synthesis, the use feeling weighting filter carries out the back Filtering Processing.
Present embodiment has been developed the medium and small vocabulary non specific human speech sound distinguishing method of a kind of language based on sound identification special chip based on said method.Usually comprise in the speech recognition special chip: audio frequency prime amplifier, automatic gain control (AGC), D/A (A/D) converter, mould/number (D/A) converter, MCU nuclear (8051), pulse width modulator (PWM), random access memory (RAM), ROM (read-only memory) (ROM), flash memory (FLASH).Store phoneme synthesizing method, voice coding method, speech recognition training method and audio recognition method among the ROM, and suggestion voice.The template and the suggestion voice of speech recognition are stored among the FLASH.