Sound analyizing

I've never used the FFT or FHT library so I'm not sure what's wrong...

FFT (and FHT) is "imperfect".

Do you have a 1kHz sine wave? A square wave has harmonics (although the 2kHz harmonic is less than the 1kHz fundamental).

Did you bias the input (so you don't clip the negative half of the waveform)? A rectified wave will also contain harmonics although again, the harmonics should be less than the fundamental.

I want to make analyzer for sound messurement for health hearing i need analyze sound in octavband and determin dB in per band but first i should analize sound in octaband

I'm not sure how that's going to work... Typically with a hearing test a single tone is played at a known frequency and known amplitude and the patient/subject presses a button or raises his/her hand when they hear a tone.

Since the frequency and amplitude are known, there is no need to "analyze" the sound.

It's straightforward, except the headphones/speakers have to be calibrated (for SPL level and frequency response) and you need a soundproof environment so that quiet tones are not drowned-out by background noise. And, neither of those are trivial.

Your mean ardunio can not analize sound at least to 8000 hz?

There are two things that affect the maximum frequency -

  1. Nyquist theory says your sample rate has to be at least twice the signal frequency. The easy way to think about it is that you need to sample the positive-half of the wave at least once per cycle and the negative-half at least once per cycle.

If the signal is greater than half the sample rate you'll get aliasing (false frequencies).

The signal has to be filtered before it's digitized because the aliasing occurs when it's digitized and then it's too late to know. Every soundcard has a low-pass anti-aliasing filter.

You can build a Arduino spectrum-analyzer display/effect without a filter, and you can get-away with it because the highest frequencies in normal voice/music are low level so the alias is low-level and it's only a visual effect so it doesn't have to be perfect.

  1. The Arduino ADC looses accuracy above a sample rate of 15kHz which limits you to 7500Hz for the full 10-bit accuracy.