Arduino and Matlab for Voice Analysis

In this tutorial you will learn how you can use Arduino and Matlab for Voice Analysis. The Arduino and extra circuitry will be used for instrumentation and Matlab will be used as the software for plotting the voice input in real time. Because of Arduino it is now easy sense signal by using its ADC(Analog Digital Converter) and send over USB to computer or software running in the computer like Matlab.

 In this Arduino and Matlab for Voice Analysis tutorial you will learn how to use Arduino as instrumentation device to acquire analog signal and use Matlab Simulink to plot the voice signal. You will learn how to use Arduino ADC and learn how to use Matlab Simulink to plot real time voice signal.
This is extended tutorial where voice signal is captured. For basic analog signal capture see Real Time Oscilloscope using Simulink and Arduino where simple analog signal voltage is captured using potentiometer variation.

Block diagram for Arduino and Matlab for Voice Analysis

A microphone is used to capture the voice signal and convert to electrical signal. But this electrical signal is not strong enough to be detected properly. Hence the solution is to create an external circuit which comprises of microphone and amplifier. The amplifier increases the amplitude level of the electrical signal from the microphone. The output from the amplifier is then connected to the Arduino ADC. When you speak on the microphone, the sound energy is converted to electrical signal. This electrical signal is amplified by an amplifier(LM386 IC). The output is then fed to Arduino ADC. This ADC takes in the amplified analog signal and converts its to digital signal ranging from 0 to 1023. Afterwards, this digital signal is send to Matlab using the USB.

So what we are doing essentially is depicted in the figure below.

speech analysis with arduino and Matlab

Circuit Diagram for Arduino and Matlab for Voice Analysis

The first task is how to acquire the analog speech signal or voice signal using Arduino. The following circuit schematic shows how to acquire the voice signal using external microphone and amplifier circuit and connect with Arduino ADC pin.

speech analysis circuit

Matlab Simulink Setup for Speech analysis

The next task is to setup the Matlab software. The matlab simulink is used to read digital voice signal sent by arduino and plot it in real time. The following picture shows how to make simulink model to work with Arduino UNO.

arduino speech simulink

Note if you used Arduino Due instead follow the tutorial Reading analog signal with Arduino Due and Simulink.

Running simulation and Viewing the Voice in real time

Afterwards we run the simulink simulation and view the time scope we will see the following voice signal plotted in the graph.

The higher peaks shows voice signal when spoken into the microphone.

If we increase change the value of 10kOhm potentiometer, we will see increase(decrease) in gain of the amplifier. We effectively are changing the sensitivity of the amplifier of input voice signal from the microphone.

For example by increasing resistance in the potentiometer we get the following real time signal graph.

Further increase in potentiometer value to maximum possible resulted in the following speech signal real time graph.

Thus for hobbyist we showed you simple Arduino and Matlab for voice analysis setup that can be build and experimented readily.

What do you think?

0 points
Upvote Downvote

Total votes: 0

Upvotes: 0

Upvotes percentage: 0.000000%

Downvotes: 0

Downvotes percentage: 0.000000%

Leave a Reply

Your email address will not be published. Required fields are marked *

What is PLA and PAL and what is the difference between them in FPGA?

What is PLA and PAL and what is the difference between them in FPGA?

usb interfacing with mcu

PIC32 Harmony USB tutorial