I found this library usable after I moved from the direct avr programming and changing it to the arduino language. Try using something like this:
#define LOG_OUT 1 // use the log output function
#define FHT_N 128 // set to 128 point fht
#include <FHT.h> // include the library
void setup() {
Serial.begin(9600); // use the serial port
}
void loop() {
for (int i = 0 ; i < FHT_N ; i++) { // save 128 samples
fht_input[i] = analogRead(adcPin); // 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
for (byte i = 0 ; i < FHT_N/2 ; i++) {
Serial.print(fht_log_out[i]);
Serial.print(" ");
}
Serial.println();
}