COMMON: Fix regression in SineTable creation.

This is a regression from f4ba8a6485. The
commit replaced the static cosine and sine tables with dynamically created
ones. In the process of that a copy&paste error happened which made the sine
table use the layout of the cosine table. This commit now changes the
dynamically created sine tables to conform to the layout of the previous
static tables.
This commit is contained in:
Johannes Schickel 2013-06-08 21:25:18 +02:00
parent 190ec9c2b6
commit 21f87070af

View file

@ -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() {