Hi. everyone I need help with Audio Pattern Recognition

So for my uni project I have to make a device that recognize a audio pattern and gives an output pin like to turn on a Led or something, can anyone i have searched about i have searched a lot but still don't know how to put the pattern of audio into the microcontoller,
I'm using STM32F407VGT6
Thanks for taking the time to read my topic.

LEt's clear up one thing to begin with. What do you consider an audio pattern and can you supply an example?

2 Likes

This is not a free design service however there is a paid section where you can hire the work done. We will help but not do your design and software.

What hardware do you plan on connecting to the micro. Have you started a schematic yet? What tools do you have available such as a scope?

1 Like

I remember seeing a project somewhere that would detect a series of whistles. The first whistle would set a pitch, and subsequent whistles within a short time period would be 0s or 1s, depending on whether they were higher or lower in pitch than the "start bit" whistle.

That was a long time ago, and I don't recall where I saw it, but it seems like the sort of thing that could be implemented on an Arduino, if it's the sort of thing you had in mind.

1 Like

A bit simpler than speech recognition perhaps but not something I think an Arduino can handle.

RPi can do this maybe.

1 Like

Thanks alot or replying,
For example a horn sound, it's not really specified yet as my project is just to recognise such sounds, it could be anything like a horn sound
and actually we got some fft_data as output of audio using Matlab but the proffesor of our project relized all this steps could be done through the micro controller so he just said it all need to be done on the Microcontroller which is a STM32F407
and the data we got from Matlab is this one
float fft_data[] = {0.0028699542, 0.0012439878, 0.0002226337, 0.0002966630, 0.0001992569, 0.0006495360, 0.0004606968, 0.0003313039, 0.0001994489, 0.0002219513, 0.0004151769, 0.0005615211, 0.0002294426, 0.0001315715, 0.0001982487, 0.0004695023};
once again, Thank you for helping

Thanks alot or replying,
it's just a simple Shematic, a mirocontoller connected to Microphone and led which needs to be turned on when hearing the pattern
we can't really afford to pay as its a uni project. Thank you

They make touch tone "DTMF" (Duel Tone Multi Frequency) receiving chips that have been around a long time. Your phone uses a variant of them. Try searching for DTMF decoder, you will get a lot of hits and ideas.

1 Like

Ok, and what is the PATTERN you found in the data?

Thanks alot or replying,
yes its actually similar to what we want to do, just instead its only an audio that it detects, I will look for it, Thanks for letting me know.

Thanks alot or replying,
I'm actually using a STM32F407,
Thanks for letting me know.

I honestly don't know much aout it, all i got was the result of searching and searching but still there is a lot to learn,
and abut the pattern Those number i think are supposed to be the pattern which the microcontoller can read.

Sure! But how have you identified the pattern? How will you compare this data to a second or third set of data to detect identical or similar patterns? What quality in the data indicates a pattern that can be related to other sets of data?

Thank you for replying.
the thing is that we gotta use A STM32 to recognize a audio pattern

I'm not really sure about this, I'm trying to learn but I think it converts the audio magnitude and frequency to those numbers which i just sent and it compares it with the audio input audio input which is gonna be vReal.

Consider pattern recognition includes the order of values, which you obviously have and it includes the time between the values. So all pattern recognition MUST include at least one time variable. Now the question is, does the length of the time interval make a difference in your pattern? Can the time interval changes also make a pattern?

I'd also be interested to see how this project develops. I had thought of an application to integrate cheap smoke detectors, carbon monoxide detectors etc. in a system but non-invasively. Such a system would only detect the sound pattern emitted by the alarm and transmit the results to a central node. I would guess that, in this case, a Goertzel type frequency detection algorithm could work as used say in the detection of tone dialling telephones which I played with here: DTMF decoder library - #75 by 6v6gt

1 Like

Hi @peymma ,

Welcome to the forum..

Reminds me of..
Clap on..
Clap off..
it's the clapper!! :slight_smile:
catchy tv ad song caught on back in day..

it's been done more than a few times..
google "arduino clapper"
maybe start there..

good luck.. ~q

1 Like

yes that's completly right it should have the time variable as well, but the thing is I dont know how to get all those values, and then how to give those data to the microcontroller. and to answer your question, i'm sorry I'm not sure what you meant by that as I'm a begining to learn as well having to finsh this project in few months
but i can provide you more details about what to do, so i got a audio file, lets say for example a horn sound. I got the FFT of it using Matlab I provided the picture down below, so this audio is the same Audio that needs to be detected from the microcontroller which is a STM32,

Here is the output i got

That is only the frequency domain of the audio. Says NOTHING about amplitude and timing variations of the pattern. Pattern recognition is much more complex than just frequency measuring.