Skip to content

Humphery7/speech_recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

speech_recognition

Audio Command Recognition System

This project implements an Audio Command Recognition System using MATLAB and deep learning. The system records an audio command, processes it, and classifies it into predefined categories. It uses a trained neural network model to make predictions and displays the predicted class with its probability.

Features

  • Audio Command Recognition: Recognizes voice commands from recorded audio.
  • Real-time Recording: Records audio through the microphone.
  • Live Playback: Plays back the recorded audio after it is captured.
  • Prediction: Classifies the audio command using a deep learning model.
  • Display of Prediction: Shows the predicted command and the corresponding probability.

Prerequisites

Before running the project, ensure you have the following:

  • MATLAB (Version 2019 or later)
  • Deep Learning Toolbox (for training and using neural networks)
  • Audio Toolbox (for audio processing)
  • Pretrained Neural Network Model (Trained model file for classification)
  • Support Packages (for microphone access, sound playback, etc.)

Setup

  1. Clone this repository:

    git clone https://github.com/yourusername/audio-command-recognition.git
  2. Install required packages: Make sure you have the necessary MATLAB toolboxes installed (e.g., Deep Learning Toolbox, Audio Toolbox). You can install them using the MATLAB Add-On Explorer.

  3. Prepare the trained model:

    • The neural network model for classification should be trained using a dataset of audio commands.
    • Place the trained model file (trainedNet.mat or equivalent) in the project directory.
  4. Preprocessing audio data:

    • The audio data should be recorded with a consistent sample rate and duration.
    • Audio preprocessing (such as feature extraction, normalization, etc.) should be handled before passing the data into the trained network.

Usage

  1. Run the main script: The script audio_command_recognition.m handles the full process of recording, processing, and classifying the audio command.

    • The system will record a 2-second audio sample.
    • It will then preprocess the audio and pass it to the trained neural network for classification.
    • The predicted class with its probability will be displayed in the MATLAB console.
    • The recorded audio will also be played back.
  2. Testing the system: To test the system with your own audio commands, ensure that you have a trained model and modify the script as needed to match the input format.

Example Output

Recording...
Recording complete.
Playing back recorded audio...
Predicted Command: 'TOL3'
Probability: 85.62%
Prediction Scores for All Classes:
L1: 5.23%
TOL2: 0.74%
TOL3: 85.62%
TOL4: 3.21%
TOFL1: 1.11%
TOFL2: 0.92%
TOFL3: 1.05%
TOFL4: 2.12%

Model Training

To train your own model:

  1. Prepare a dataset of labeled audio commands.
  2. Extract features from the audio data (e.g., Mel-spectrogram, MFCCs).
  3. Train a neural network using trainNetwork with your data.

Acknowledgments

  • This project uses MATLAB's Deep Learning Toolbox and Audio Toolbox.
  • Thanks to the open-source community for the many resources and libraries available for audio processing and machine learning.

License

This project is open Sourced.

Explanation:

  • Introduction: Describes what the project does.
  • Features: Lists the main functionalities of the system.
  • Prerequisites: Specifies the necessary tools and libraries.
  • Setup: Instructions on how to clone the repository and set up the environment.
  • Usage: How to run the system and what the user can expect as output.
  • Model Training: Provides a brief on how to train the model if needed.
  • Acknowledgments: Credits to tools and resources used.
  • License: Licensing info (optional, you can adjust based on your needs).

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages