mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
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:
parent
55f0beddc6
commit
fc7a3bea72
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user