Speaker-dependent Voice Command Recognition
In this application showcase, we shall use DTW (dynamic time warping) for speaker-dependent voice command recognition. This is the simplest voice command recognition system, in which the user's utterance is compared with those pre-recorded utterances (by the same user) using DTW. The utterance with the shortest DTW distance is identified, and the corresponding action will be triggered as the result of the voice command system.
Contents
Basics
There are two stages involved in building such a system:
- Registration (or Enrollment): Each user is required to record several utterances (or spoken keywords) as the database
- Recognition: During application, the user should say a keyword to a microphone, and the system can identify the closest commands in the database.
When comparing the user's input to the recordings in the database, we use DTW for elastic comparison since it tolerates variations in speech rate. Each recording should go through endpoint detection to remove leading and trailing silence. The utterance is then chopped into frames, and each frame is converted into a 39-dim feature vector call MFCC (Mel-scale frequency cepstral coefficient). DTW is then employed to compute the distance betweens two sets of MFCCs extracted from two utterances.
The demo is available within the toolbox folder "demo/sdVoiceCommand". There are two major commands:
- goRegister.m: Run this script to do registration. In particular, you need to say "one", "two", "three", "four", "five" sequentially to build the database. If you need to change these commands, modify the value of the variable "sentence". Each utterance will go through endpoint detection and feature extraction. The features together with the recording specs are saved at mfcc4dtwDemo.mat.
- goRecognize.m: Run this script to start testing the system. You can simply speak to the microphone to see the recognition result. Each utterance will go through the same processes of endpoint detection and feature extraction. Then the identified utterance is the one with the shortest DTW distance.
Note that in order to have the best performance, you are advised to use a uni-directional microphone instead of omni-directional one (such as the built-in microphone in a notebook).
Reference
- H. Sakoe and S. Chiba, "Dynamic Programming Algorithm Optimization for Spoken Word Recognition", IEEE Transactions on Acoustics, Speech and Signal Processing, Vol. 26, No. 1, pp. 43{49, 1978.
Copyright 2011-2016 Jyh-Shing Roger Jang.