mirror of
https://github.com/aicodix/dsp.git
synced 2026-04-27 14:30:36 +00:00
make it work for negative n too
This commit is contained in:
parent
692bfa4d31
commit
cf54a8e431
2 changed files with 9 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ template <typename TYPE, typename PRECISE>
|
|||
void test(int MAX)
|
||||
{
|
||||
for (int N = 1; N <= MAX; ++N) {
|
||||
for (int n = 0; n < N; ++n) {
|
||||
for (int n = -N; n <= N; ++n) {
|
||||
PRECISE x = DSP::Const<PRECISE>::TwoPi() * PRECISE(n) / PRECISE(N);
|
||||
PRECISE cos_err = std::abs(DSP::UnitCircle<TYPE>::cos(n, N) - std::cos(x));
|
||||
assert(cos_err < std::numeric_limits<TYPE>::epsilon());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue