el_supremo:
What do you mean "floating"?
What about the ground?
Pete
Floating meaning literally floating around. The jumper cable was attached to an analog pin but the other end was touching nothing (or a piece of paper every now and then
)
I tried with the ground as well (the jack's ground). Nothing distinguishable either. The physical ground (GND on arduino, or my metal radiator) resulted in a constant value, so I thought that works. Even touching the end of the cable resulted in a change of waveform, but connecting it to the audio out just doesn't do anything.
DVDdoug:
I've never done this stuff, but the FFT/FHT library should output some variables and then it's up to you and your application to decide what to do with those values. You can find examples of people making Arduino based spectrum analyzers (where the output is usually an array of LEDs).
Did you [u]bias[/u] the Arduino's input? Without bias, your audio signal is negative half the time and negative voltages can damage the Arduino, distort the audio, and since the Arduino can't read negative voltages, your FFT calculations will be messed-up.
A floating-input probably isn't that helpful because it can pick up noise, but you could try grounding the input because you know that's "silence". And then for testing, I recommend some test-tones. You can generate sine waves at known frequencies with [u]Audacity[/u] and play them back on your computer.
To test your hardware and to make sure you're getting a good signal, run the [u]Analog Read Serial Example[/u]. With the biased input, silence should read about 512. Quiet sounds should jump around a little, and louder sounds should jump-around much-higher than 512 and much lower. Note that even a constant tone will jump around because you are reading at random places along the waveform, and the wave passes-through zero (512) twice per cycle.
I haven't biased the signal. I though that absolutely any change in voltage should do something (be it negative).
I checked with a ground attached and it resulted in a constant value (I think it's okay). As for test tones, I tried a constant 50Hz sinewave and also a sweeping sinewave from 20Hz-ish to 18kHz-ish. Still looked like random values to me.
I think my hardware is (still XD) good. I have tried outputting raw analogRead values to the plotter and it resulted in a pretty neat sinewave while the cable was floating (I think it was the mains influencing it, no idea). After connecting it to the same audio "sources" (my 3 devices) the sinewave was a bit "cracky" (screenshots attached), so it means that something is actually happening.