modified API for fft
This commit is contained in:
parent
8b30087ce4
commit
7722a73abf
3 changed files with 23 additions and 16 deletions
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: fft-test.c,v 1.1 2008/04/25 16:34:31 joxe Exp $
|
||||
* $Id: fft-test.c,v 1.2 2008/04/25 22:12:25 joxe Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
* fft-test - a test program that use the sound sensor for sampling
|
||||
|
@ -35,8 +35,8 @@
|
|||
*
|
||||
* Author : Joakim Eriksson
|
||||
* Created : 2008-04-04
|
||||
* Updated : $Date: 2008/04/25 16:34:31 $
|
||||
* $Revision: 1.1 $
|
||||
* Updated : $Date: 2008/04/25 22:12:25 $
|
||||
* $Revision: 1.2 $
|
||||
*/
|
||||
|
||||
#include "contiki-esb.h"
|
||||
|
@ -57,6 +57,7 @@ PROCESS_THREAD(fft_process, ev, data)
|
|||
static int i = 0;
|
||||
static int mode = 0;
|
||||
static int16_t fftBuf[FFT_TEST_SIZE];
|
||||
static int16_t tmpBuf[FFT_TEST_SIZE];
|
||||
static int max_value = 0;
|
||||
static int max_pos = 0;
|
||||
|
||||
|
@ -92,7 +93,7 @@ PROCESS_THREAD(fft_process, ev, data)
|
|||
if (mode) {
|
||||
/* Calculate fft, print result, and find index of
|
||||
highest energy level */
|
||||
ifft(fftBuf, FFT_TEST_SIZE);
|
||||
ifft(fftBuf, tmpBuf, FFT_TEST_SIZE);
|
||||
max_value = 0;
|
||||
max_pos = 0;
|
||||
for (i = 0; i < FFT_TEST_SIZE/2; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue