tests/dft_cmp.c: Fix indexing error

Was incorrectly using `DFT_DATA_LENGTH` instead of `DFT_SPEC_LENGTH`
to index into `spectrum` array.
This commit is contained in:
Erik de Castro Lopo 2015-09-15 18:50:38 +10:00
parent 55f0beddc6
commit fc7a3bea72

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2002-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2002-2015 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@ -123,9 +123,9 @@ dft_magnitude (const double *data, double *spectrum)
spectrum [k] = sqrt (real_part * real_part + imag_part * imag_part) ;
} ;
spectrum [DFT_DATA_LENGTH - 1] = 0.0 ;
spectrum [DFT_SPEC_LENGTH - 1] = 0.0 ;
spectrum [0] = spectrum [1] = spectrum [2] = spectrum [3] = spectrum [4] = 0.0 ;
spectrum [0] = spectrum [1] = spectrum [2] = 0.0 ;
return ;
} /* dft_magnitude */