aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/sinetables.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/sinetables.cpp b/common/sinetables.cpp
index a6ec99469d..2198dbfd1a 100644
--- a/common/sinetables.cpp
+++ b/common/sinetables.cpp
@@ -36,13 +36,13 @@ SineTable::SineTable(int bitPrecision) {
double freq = 2 * M_PI / m;
_table = new float[m];
- // Table contains sin(2*pi*x/n) for 0<=x<=n/4,
- // followed by its reverse
- for (int i = 0; i <= m / 4; i++)
+ // Table contains sin(2*pi*i/m) for 0<=i<m/4,
+ // followed by m/2<=i<3m/4
+ for (int i = 0; i < m / 4; i++)
_table[i] = sin(i * freq);
- for (int i = 1; i < m / 4; i++)
- _table[m / 2 - i] = _table[i];
+ for (int i = 0; i < m / 4; i++)
+ _table[m / 4 + i] = -_table[i];
}
SineTable::~SineTable() {