Your ADC configuration is all wrong. You're sampling at the wrong rate, because you reset the ADC configuration after the first measurement. Try this:
#define LOG_OUT 1 // use the log output function
#define FHT_N 256 // set to 256 point fht
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#include <FHT.h> // include the library
void setup() {
Serial.begin(115200); // use the serial port
ADCSRB = 0; // Free running mode
ADMUX = (DEFAULT << 6) | 0; // A0
sbi(ADCSRA, ADEN); // Enable ADC
sbi(ADCSRA, ADATE); // Auto trigger
sbi(ADCSRA, ADSC); // Start conversion
// 19.231 kHz
sbi(ADCSRA, ADPS2);
sbi(ADCSRA, ADPS1);
cbi(ADCSRA, ADPS0);
}
void loop() {
do {
cli(); // UDRE interrupt slows this way down on arduino1.0
for (int i = 0 ; i < FHT_N ; i++) { // save 256 samples
while (!(ADCSRA & _BV(ADIF))); // wait for adc to be ready
sbi(ADCSRA, ADIF); // Clear interrupt flag
byte m = ADCL; // fetch adc data
byte j = ADCH;
int k = (j << 8) | m; // form into an int
k -= 0x0200; // form into a signed int
k <<= 6; // form into a 16b signed int
fht_input[i] = k; // put real data into bins
}
fht_window(); // window the data for better frequency response
fht_reorder(); // reorder the data before doing the fht
fht_run(); // process the data in the fht
fht_mag_log(); // take the output of the fht
sei();
for (uint8_t i = 0 ; i < FHT_N / 2 ; i++) {
Serial.print(i * 19231UL / FHT_N); Serial.print(" Hz:\t");
Serial.println(fht_log_out[i]); // send out the data
}
} while(0);
while(1);
}
By the way, you need a strong anti-aliasing filter, especially at these low sampling rates.