comparison src/init.c @ 176:f94410db4014

Initialise ooura struct with right amount of memory for ooura FFT. Fixes #11
author Jamie Bullock <jamie@jamiebullock.com>
date Wed, 19 Jun 2013 15:30:04 -0700
parents 1a0907add40c
children 5176462e2797
comparison
equal deleted inserted replaced
175:41c02a0e7433 176:f94410db4014
41 41
42 42
43 #ifdef USE_OOURA 43 #ifdef USE_OOURA
44 void xtract_init_ooura_data(xtract_ooura_data *ooura_data, unsigned int N) 44 void xtract_init_ooura_data(xtract_ooura_data *ooura_data, unsigned int N)
45 { 45 {
46 ooura_data->ooura_ip = (int *)calloc((2 + sqrt(N)), sizeof(int)); 46 ooura_data->ooura_ip = (int *)calloc(2 + sqrt(N), sizeof(int));
47 ooura_data->ooura_w = (double *)calloc((N - 1), sizeof(double)); 47 ooura_data->ooura_w = (double *)calloc(N * 5 / 4, sizeof(double));
48 ooura_data->initialised = true; 48 ooura_data->initialised = true;
49 } 49 }
50 50
51 void xtract_free_ooura_data(xtract_ooura_data *ooura_data) 51 void xtract_free_ooura_data(xtract_ooura_data *ooura_data)
52 { 52 {