Hello,
I'm trying to test the audio filter chip. According to the data sheet,
the capacitors should be 0.01nF (for the audio input pin) 0.1nF. I use Audacity
to generate tones of varying frequency (63Hz, etc).
0.01 and 0.1 capacitors don't seem to work at all. Elsewhere in various
tutorials I found 100nF and 10nF used instead. With them I do see better
results. But, the main problem now is that when I generate, say, a 63Hz
signal through Audacity the adjacent frequencies react as well. And...
the more I crank up the volume the more adjacent frequencies are
affected -- and the higher the readings are. I thought the loudness of
the signal would be irrelevant for this chip? I.e., I thought it would
react only to the frequency.
Do I need a function generator or something like Audacity should work for a test?
Below is the program I found in a tutorial. A variation of it seems to
be used by everybody. As you can see it prints a value for each of the
seven frequencies through the console.
Thanks!
Sergei
#include "Arduino.h"
#include "Servo.h"
void setup();
void loop();
int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values
void setup()
{
Serial.begin(9600);
pinMode(analogPin, INPUT);
pinMode(strobePin, OUTPUT);
pinMode(resetPin, OUTPUT);
analogReference(DEFAULT);
digitalWrite(resetPin, LOW);
digitalWrite(strobePin, HIGH);
Serial.println("MSGEQ7 test by J Skoba");
}
void loop()
{
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
for (int i = 0; i < 7; i++)
{
digitalWrite(strobePin, LOW);
delayMicroseconds(30); // to allow the output to settle
spectrumValue = analogRead(analogPin);
// comment out/remove the serial stuff to go faster
// - its just here for show
if (spectrumValue < 10)
{
Serial.print(" ");
Serial.print(spectrumValue);
}
else if (spectrumValue < 100 )
{
Serial.print(" ");
Serial.print(spectrumValue);
}
else
{
Serial.print(" ");
Serial.print(spectrumValue);
}
digitalWrite(strobePin, HIGH);
}
Serial.println();
}
I'm trying to test the audio filter chip. According to the data sheet,
the capacitors should be 0.01nF (for the audio input pin) 0.1nF. I use Audacity
to generate tones of varying frequency (63Hz, etc).
0.01 and 0.1 capacitors don't seem to work at all. Elsewhere in various
tutorials I found 100nF and 10nF used instead. With them I do see better
results. But, the main problem now is that when I generate, say, a 63Hz
signal through Audacity the adjacent frequencies react as well. And...
the more I crank up the volume the more adjacent frequencies are
affected -- and the higher the readings are. I thought the loudness of
the signal would be irrelevant for this chip? I.e., I thought it would
react only to the frequency.
Do I need a function generator or something like Audacity should work for a test?
Below is the program I found in a tutorial. A variation of it seems to
be used by everybody. As you can see it prints a value for each of the
seven frequencies through the console.
Thanks!
Sergei
#include "Arduino.h"
#include "Servo.h"
void setup();
void loop();
int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values
void setup()
{
Serial.begin(9600);
pinMode(analogPin, INPUT);
pinMode(strobePin, OUTPUT);
pinMode(resetPin, OUTPUT);
analogReference(DEFAULT);
digitalWrite(resetPin, LOW);
digitalWrite(strobePin, HIGH);
Serial.println("MSGEQ7 test by J Skoba");
}
void loop()
{
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
for (int i = 0; i < 7; i++)
{
digitalWrite(strobePin, LOW);
delayMicroseconds(30); // to allow the output to settle
spectrumValue = analogRead(analogPin);
// comment out/remove the serial stuff to go faster
// - its just here for show
if (spectrumValue < 10)
{
Serial.print(" ");
Serial.print(spectrumValue);
}
else if (spectrumValue < 100 )
{
Serial.print(" ");
Serial.print(spectrumValue);
}
else
{
Serial.print(" ");
Serial.print(spectrumValue);
}
digitalWrite(strobePin, HIGH);
}
Serial.println();
}