Arduino Forum

Using Arduino => Audio => Topic started by: karansahni on Apr 15, 2018, 03:30 am

Title: Detect a particular frequency?
Post by: karansahni on Apr 15, 2018, 03:30 am
Hey i am using MAX4466 and using the following code to detect the the max frequency. But I'm getting the maximum magnitude in the bin for the frequency when the source is perpendicular to the mic not in front of it. Can you help me out. Its realllly important
Title: Re: Detect a particular frequency?
Post by: Grumpy_Mike on Apr 15, 2018, 09:26 am
Quote
using MAX4466 and using the following code to detect the the max frequency. But I'm getting the maximum magnitude in the bin for the frequency when the source is perpendicular to the mic not in front of it
So I assume that it is detecting the frequency correctly?

A microphone has a specific polar response so why would you expect any Microphone orientation to give no signal?
Title: Re: Detect a particular frequency?
Post by: karansahni on Apr 16, 2018, 07:03 am
Well, I have to point my robo car towards the direction of the chosen frequency and then go towards it. But I'm getting maximum magnitude for the particular frequency when the orientation of mic is perpendicular to the source of sound. Hence my car goes in the wrong direction
Title: Re: Detect a particular frequency?
Post by: slipstick on Apr 16, 2018, 10:18 am
So reposition the mic on the car so that it sees maximum in the direction you want it to go in.

It sounds like the polar pattern of the mic isn't what you think it is.

Steve
Title: Re: Detect a particular frequency?
Post by: Grumpy_Mike on Apr 16, 2018, 03:41 pm
Or put the mike in the bottom of a styrene drinking cup to act as a direction microphone.
Title: Re: Detect a particular frequency?
Post by: jremington on Apr 16, 2018, 05:23 pm
Quote
But I'm getting the maximum magnitude in the bin for the frequency when the source is perpendicular to the mic not in front of it.
When the microphone is pointed at the source, you are probably overloading the microphone amplifier, which leads to serious waveform distortion and totally incorrect frequency indications.

Post a clear circuit diagram (not a Fritzing mess) of your microphone input circuit.
Title: Re: Detect a particular frequency?
Post by: karansahni on Apr 16, 2018, 06:48 pm
I could try a styrene cup today.
Title: Re: Detect a particular frequency?
Post by: karansahni on Apr 16, 2018, 06:54 pm
When the microphone is pointed at the source, you are probably overloading the microphone amplifier, which leads to serious waveform distortion and totally incorrect frequency indications.

Post a clear circuit diagram (not a Fritzing mess) of your microphone input circuit.
I'm using MAX4466 with Adjustable Gain.
You can see the circuit diagram here: https://cdn-shop.adafruit.com/datasheets/MAX4465-MAX4469.pdf
Title: Re: Detect a particular frequency?
Post by: jremington on Apr 16, 2018, 08:59 pm
There are several circuit diagrams in that link, and none include an Arduino. If you want help, follow the instructions in the "How to use this forum" post.

Have you verified that the input signal to the Arduino is not distorted under any conditions?