Now we'll proceed with last six Project three on August, scene recognition with microphone specifically
for theory and data collection.
Here we are.
Terminal and edge impulse will be used in this project to train and deploy an adjacent classifier.
We will learn how to do this object scene classification is actually a task in which a machine learning
model has to figure out what kind of sound a piece of a nodule is like a crying baby cough, a dog barking,
and so on.
Now, let's learn more about how computers processes sounds.
The sound is a vibration that moves through a transmission medium like a gas liquid or solid.
It moves through the medium as an acoustically.
Now there are molecules in the surrounding medium that are being pushed by the source of the sound.
They push the molecules that are next to them and so on and so forth.
When they touch another object, it also vibrates a little.
Now this is how microphones work.
The microphone membrane is pushed in more by the molecules in, then moves back to where it was before.
Theoretically, in the circuit voltage is related to a sound amplitude, so the louder the sound, the
more the membrane is pushed.
This causes alternating current in the circuit.
As a sampling rate, we take a measurement of a sound 8000 times a second, which is called as an analog
to digital converter.
We then read this voltage with this converter and recorded at the same time every time so that we get
the same amount of data each time we do this.
If we sampled too slowly, we might not get at all the important parts of the sound if we do it too
quickly.
The numbers we use to record sound digitally also play a role.
The more nuances we can keep from the original sound, the more range of a number we use.
Now that is called the audio bit that you might have heard terms like eight bit sound and 16 bit sound.
Now it refers to how many bits are in the sound for eight bits sound and an eight bit integer with a
range of zero to 255 issues, which is what it sees in the box.
It's negative.
327 six eight two three two seven six seven.
All right.
So at the end, we have a long string of numbers with bigger numbers indicating louder parts of the
sound, we can think of it like this this one second of gunshot sound recorded at an 8000 hertz frequency
with an eight bit depth of zero to 255.
And this is the example of bit.
Now we can cut and paste parts of it, but for studying sound, it's too low.
It's at this point that four year transform mail skills spectrograms and cepstral coefficients come
into play.
And part of this project will talk about the four year transform, which is a mathematical transformation
that lets us break down into each individual frequencies and its amplitude.
Or if you'd like to use a metaphor, given the smoothie it outputs the recipe.
That is how our sound looks like after applying the for you to transform.
So the higher dive bars correspond to larger amplitude frequencies.
Now, for an example, if we want to reduce the size of an audio file, we can get a low value of frequencies.
We can also remove noise or the sound of a voice.
For example, if we do a four year transform, we list all the information about the time of the signal,
which is not good for things like human speech that don't repeat.
They give signal sample and do a four year transform on it multiple times.
This is like cutting it up and then putting the data from the multiple for you transforms back together
to make a spectrogram.
No, here x axis is the time the y axis is the frequency and the amplitude of the frequency is expressed
through a color.
Brighter colors correspond to a larger amplitude.
Now, I believe you can now recognize this sound.
No, maybe yes, or maybe there is too much information in the normal spectrum.
If we only want to find sounds that the human ear can hear.
Studies have shown that humans don't see frequencies in a straight line.
As humans, we can better tell the difference in lower frequencies than we can tell the differences
in higher frequencies.
No, it's not very easy for us to tell the difference between 500 and 1000 hertz.
Even though the distance between them is the same.
In 1937, Stephen Volkmann, a new man, came up with a way to measure pitch so that equal distances
in beach sounded the same to the listener.
Now this scale is called the bell.
Now it says here a Mel Spectrum is a spectrogram where the frequencies are converted to the Mel scale,
there are more steps involved for recognizing speech.
For example, cepstral coefficients that we mentioned above and we will be discussing them further as
we go on with our lesson.
Now it is time to finally start with the practical implementation.
To start our preparation, install Anaconda Environment Manager if you didn't install it in the first
lesson, see lesson one Lesson one Introduction to tiny amounts with real terminals for information
on how to install anaconda and create a virtual environment.
Then, in a virtual environment, install your browser with PIP.
Install your browser and conduct install slash Secunda slash forge space SFM.
We need to take note the audio signal needs to be sampled at a very high sampling rate.
It will be best if it is eight thousand hertz or ideally sixteen thousand hertz.
Edge inputs data for cool is too slow to handle this sampling rate.
So we will need to use dedicated data collection framework to get the data for this project.
So make sure to download a new version of real terminology.
Must be married with microphone support and flash it to your device as described in Latin for.
After that date, a new project on edge impulsive not for lunch edge impulsive ingestion service.
For the next step, if you use Ajay Devgn before it, you will need to add clean the document above
to clean project down, then log in with your credentials and choose a project.
You have just pretty darn good data acquisition tab and you can start getting data samples.
We will have three classes of data.
We have the ground coffee trade now record 10 samples for each class 5000 milliseconds duration each.
You can record the data sounds split from the computer speakers, except for background glass.
But if you have the opportunity to record real sounds, that would be even better for background glass
record sounds that should not be classified as coughing or crying.
Example people talking.
No sounds.
Air conditioning or fun.
And so on.
And so forth.
Thirty samples is way too small, so we're also going to put up more data.
You can download the sounds from the internet, recycle them to 16000 hertz and to save them to this
type of format, the one format for the WHV 400.
But this converter strip, you can also use this converter script to change the format.
Now, copy the code and base it in the text document by using Notepad plus the ideal ID or other suitable
ID.
Do not use window default notepad.
Now save document as converter that thewhite and then from an account environment run python converter.
The thewhite name of the downloaded file class underscore name the number that W or the waveform.
And then right after dark, you can find examples, sound files already converted to write formatting
materials for this course, then split all the song samples to leave only the interesting pieces.
Now do that for every class, except for background.
After that collection is done, it is time to choose processing blocks and define our neural network
model.
Lastly, make sure to record in different environments such as outside, on the street, inside of the
classroom or anywhere you want.