├── Audio files ├── allow.wav ├── denied.wav ├── five.wav ├── four.wav ├── one.wav ├── test.wav ├── test2.wav ├── test3.wav ├── test5.wav ├── three.wav └── two.wav ├── README.md └── Voice_Rec.m /Audio files/allow.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/allow.wav -------------------------------------------------------------------------------- /Audio files/denied.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/denied.wav -------------------------------------------------------------------------------- /Audio files/five.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/five.wav -------------------------------------------------------------------------------- /Audio files/four.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/four.wav -------------------------------------------------------------------------------- /Audio files/one.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/one.wav -------------------------------------------------------------------------------- /Audio files/test.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/test.wav -------------------------------------------------------------------------------- /Audio files/test2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/test2.wav -------------------------------------------------------------------------------- /Audio files/test3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/test3.wav -------------------------------------------------------------------------------- /Audio files/test5.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/test5.wav -------------------------------------------------------------------------------- /Audio files/three.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/three.wav -------------------------------------------------------------------------------- /Audio files/two.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/minkushjain/Speech-Recognition-using-MATLAB/d265b4096a1eb852c8d52bce44c08d8e8364256f/Audio files/two.wav -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Speech-Recognition-using-MATLAB 2 | This is a MATLAB project for speech recognition using Co-variance technique 3 | 4 | ## Getting Started 5 | Run the Voice_rec.m file with MATLAB software 6 | 7 | You can add your own audio files for voice recognition. 8 | 9 | ## Introduction 10 | 11 | Speech Recognition is the way of capturing the talked words using a gadget and converting them into a digitally stored set of words. 12 | In the current world, there is a continually expanding need to confirm and recognize the voice of individuals automatically. 13 | Speech recognition is basically and widely used concept for providing the security to the applications. 14 | 15 | ## Co Variation Technique 16 | 17 | Co-variance is the measure of the deviation between two sets of random variables. It compares the two signals, by considering the provided samples and compares it with the test sample to provide the result. 18 | 19 | Syntax for Co-variance in MATLAB is derived as r = cov(x) 20 | 21 | r = cov(x) returns a specific covariance value to the program which can be compared with the 22 | other signals for speech recognition. 23 | 24 | Covariance method measures the difference between the covariance value of the sample voice 25 | to that of the value of predefined voice and then gives the result whether accepted or not. 26 | 27 | If the voice is recognized, it returns a electric sound, otherwise returns "Access Denied" sound if the given sample does not match. 28 | -------------------------------------------------------------------------------- /Voice_Rec.m: -------------------------------------------------------------------------------- 1 | function Voice_Rec(~) 2 | Fs = 70000; % Sample Frequency 3 | x=audioread('denied.wav'); 4 | % 5 | % tag wave information 6 | % 7 | voice=cov(x); 8 | % 9 | 10 | y0=audioread('denied.wav'); %'denied.wav' was used here as reference 11 | y1=audioread('one.wav'); 12 | y2=audioread('two.wav'); 13 | y3=audioread('three.wav'); 14 | y4=audioread('four.wav'); 15 | y5=audioread('five.wav'); 16 | 17 | h=audioread('allow.wav'); 18 | 19 | 20 | ref=cov(y0); 21 | delta0 = abs(ref - voice); 22 | sel = ref; 23 | dif = abs(delta0); 24 | 25 | % all allowed wave files must be loaded and compared 26 | % to the input, one at a time 27 | % 28 | one=cov(y1); 29 | delta1 = abs(one - voice); 30 | if (delta1 <= dif) 31 | sel = one; 32 | dif = abs(delta1); 33 | end 34 | 35 | two = cov(y2); 36 | delta2 = abs(two - voice); 37 | if (delta2 <= dif) 38 | sel = two; 39 | dif = abs(delta2); 40 | end 41 | 42 | three = cov(y3); 43 | delta3 = abs(three - voice); 44 | if (abs(delta3) <= dif) 45 | sel = three; 46 | dif = abs(delta3); 47 | end 48 | 49 | four = cov(y4); 50 | delta4 = abs(four - voice); 51 | if (delta4 <= dif) 52 | sel = four; 53 | dif = abs(delta4); 54 | end 55 | 56 | five = cov(y5); 57 | delta5 = abs(five - voice); 58 | if (delta5 <= dif) 59 | sel = five; 60 | dif = abs(delta5); 61 | end 62 | 63 | 64 | if sel == one 65 | soundsc(y1,Fs) 66 | soundsc(h,Fs) 67 | elseif sel == two 68 | soundsc(y2,Fs) 69 | soundsc(h,Fs) 70 | elseif sel == three 71 | soundsc(y3,Fs) 72 | soundsc(h,Fs) 73 | elseif sel == four 74 | soundsc(y4,Fs) 75 | soundsc(h,Fs) 76 | elseif sel == five 77 | soundsc(y5,Fs) 78 | soundsc(h,Fs) 79 | else soundsc(audioread('denied.wav'),Fs) 80 | 81 | end 82 | --------------------------------------------------------------------------------