I
I
IliaBrz2017-09-04 01:34:33
Arduino
IliaBrz, 2017-09-04 01:34:33

How to recognize sounds at different frequencies in Arduino?

How to determine the frequency of sound using the Arduino microcontroller, and output a certain character to the console for each frequency?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Skobkin, 2017-09-04
@skobkin

Remember what sound is. This is a wave. Electronically, it fluctuates either from -X to X (perfect sine) or, in the case of the Arduino analog inputs, from 0 to 1023. You can decide what is the maximum frequency you want to determine, understand what interval in microseconds it corresponds and do during this period (and in general it is believed that this period should correspond to a frequency twice as large) measuring the number of value changes from ~0 to a certain threshold value. Based on this, you can make an assumption about the frequency of the signal.
https://www.youtube.com/watch?v=SQFl9YpkZX0 ( source code ). This is in terms of rational thinking without any theory.
You can also read about the Fourier transform .

O
Ocelot, 2017-09-04
@Ocelot

You need Goertzel's algorithm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question