Fix to issues #6 and #7. Cleaning imaginary to avoid OVF.

pull/8/head v1.2.1
Enrique Condes 2017-08-28 13:48:02 -05:00
rodzic 8952252888
commit 690c071206
3 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -63,6 +63,7 @@ void loop()
{
vReal[i] = int8_t((amplitude * (sin((i * (twoPi * cycles)) / samples))) / 2.0);/* Build data with positive and negative values*/
//vReal[i] = uint8_t((amplitude * (sin((i * (twoPi * cycles)) / samples) + 1.0)) / 2.0);/* Build data displaced on the Y axis to include only positive values*/
vImag[i] = 0.0; //Imaginary part must be zeroed in case of looping to avoid wrong calculations and overflows
}
/* Print the results of the simulated sampling according to time */
Serial.println("Data:");

Wyświetl plik

@ -56,6 +56,7 @@ void loop()
for(uint16_t i =0;i<samples;i++)
{
vReal[i] = double(analogRead(CHANNEL));
vImag[i] = 0.0; //Imaginary part must be zeroed in case of looping to avoid wrong calculations and overflows
if(samplingFrequency<=1000)
delay(delayTime);
else

Wyświetl plik

@ -1,5 +1,5 @@
name=arduinoFFT
version=1.2
version=1.2.1
author=kosme <enrique@shapeoko.com>
maintainer=Enrique Condes <enrique@shapeoko.com>
sentence=A library for implementing Fast Fourier Transform on Arduino.