K
K
Kop3t32014-01-22 15:00:10
Android
Kop3t3, 2014-01-22 15:00:10

How to determine the sound frequency on the fly from a microphone (Android)?

Good day to all.
There is an Arduino based device connected to an Android phone in the headset jack.
The device polls the sensors, and upon receiving a signal, it sends a 50 ms beep of a certain frequency to the phone. Tell me a way to find out the current frequency (or volume level for a given frequency) using the Android SDK, or (preferably) natively in c ++. If there are options for Linux, alsa is worth it.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
@
@ntkt, 2014-01-22
@Kop3t3

The task is actually formulated as follows: you need to get the power spectrum of the input signal (using the FFT from digitized samples), then select the fundamental frequency with its amplitude in it, and not confuse it with its harmonics with smaller amplitudes (and they will interfere). In general, you will come across a lot of code examples on demand android get input frequency, but in order to make them work, you must at least have a minimal knowledge of the mat used. apparatus.

G
GavriKos, 2014-01-22
@GavriKos

Maybe it's worth somehow organizing the communication of the adruinka with the phone in a different way? The Fourier transform is a very processor-intensive operation + all sorts of noise and so on are possible.
As an alternative - if you just need to transmit some kind of state - encode it either with a signal length, or even send it in binary: 0 - there is sound, 1 - there is no sound, and then decode it.

M
Moskus, 2014-02-10
@Moskus

netscale.cse.nd.edu/twiki/pub/Main/Projects/Analyz...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question