Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kosme/arduinoFFT into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrique Condes committed Oct 6, 2020
2 parents ee0459d + 4011ca2 commit 89defc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/arduinoFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ void arduinoFFT::DCRemoval()
{
// calculate the mean of vData
double mean = 0;
for (uint16_t i = 1; i < ((this->_samples >> 1) + 1); i++)
for (uint16_t i = 0; i < this->_samples; i++)
{
mean += this->_vReal[i];
}
mean /= this->_samples;
// Subtract the mean from vData
for (uint16_t i = 1; i < ((this->_samples >> 1) + 1); i++)
for (uint16_t i = 0; i < this->_samples; i++)
{
this->_vReal[i] -= mean;
}
Expand All @@ -216,13 +216,13 @@ void arduinoFFT::DCRemoval(double *vData, uint16_t samples)
// calculate the mean of vData
#warning("This method is deprecated and may be removed on future revisions.")
double mean = 0;
for (uint16_t i = 1; i < ((samples >> 1) + 1); i++)
for (uint16_t i = 0; i < samples; i++)
{
mean += vData[i];
}
mean /= samples;
// Subtract the mean from vData
for (uint16_t i = 1; i < ((samples >> 1) + 1); i++)
for (uint16_t i = 0; i < samples; i++)
{
vData[i] -= mean;
}
Expand Down

0 comments on commit 89defc7

Please sign in to comment.