diff --git a/Examples/FFT_01/FFT_01.ino b/Examples/FFT_01/FFT_01.ino index 8c7c76f..caefe80 100644 --- a/Examples/FFT_01/FFT_01.ino +++ b/Examples/FFT_01/FFT_01.ino @@ -106,7 +106,8 @@ void PrintVector(double *vData, uint16_t bufferSize, uint8_t scaleType) } Serial.print(abscissa, 6); if(scaleType==SCL_FREQUENCY) - Serial.print(" Hz"); + Serial.print("Hz"); + Serial.print(" "); Serial.println(vData[i], 4); } Serial.println(); diff --git a/Examples/FFT_02/FFT_02.ino b/Examples/FFT_02/FFT_02.ino index 3ff7274..cb97e29 100644 --- a/Examples/FFT_02/FFT_02.ino +++ b/Examples/FFT_02/FFT_02.ino @@ -108,15 +108,16 @@ void PrintVector(double *vData, uint16_t bufferSize, uint8_t scaleType) abscissa = (i * 1.0); break; case SCL_TIME: - abscissa = ((i * 1.0) / samplingFrequency); + abscissa = ((i * 1.0) / sampling); break; case SCL_FREQUENCY: - abscissa = ((i * 1.0 * samplingFrequency) / samples); + abscissa = ((i * 1.0 * sampling) / samples); break; } Serial.print(abscissa, 6); if(scaleType==SCL_FREQUENCY) - Serial.print(" Hz"); + Serial.print("Hz"); + Serial.print(" "); Serial.println(vData[i], 4); } Serial.println(); diff --git a/Examples/FFT_03/FFT_03.ino b/Examples/FFT_03/FFT_03.ino index eab6bd4..868c8be 100644 --- a/Examples/FFT_03/FFT_03.ino +++ b/Examples/FFT_03/FFT_03.ino @@ -25,7 +25,7 @@ arduinoFFT FFT = arduinoFFT(); /* Create FFT object */ These values can be changed in order to evaluate the functions */ #define CHANNEL A0 -const uint16_t SAMPLES = 64; //This value MUST ALWAYS be a power of 2 +const uint16_t samples = 64; //This value MUST ALWAYS be a power of 2 const double samplingFrequency = 100; //Hz, must be less than 10000 due to ADC unsigned int sampling_period_us; @@ -45,7 +45,7 @@ double vImag[samples]; void setup() { - sampling_period_us = round(1000000*(1.0/SAMPLING_FREQUENCY)); + sampling_period_us = round(1000000*(1.0/samplingFrequency)); Serial.begin(115200); Serial.println("Ready"); } @@ -53,7 +53,7 @@ void setup() void loop() { /*SAMPLING*/ - for(int i=0; i