diff options
Diffstat (limited to 'controller/fw/src/freq_meas.c')
-rw-r--r-- | controller/fw/src/freq_meas.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/controller/fw/src/freq_meas.c b/controller/fw/src/freq_meas.c index ba7801e..83a330c 100644 --- a/controller/fw/src/freq_meas.c +++ b/controller/fw/src/freq_meas.c @@ -30,7 +30,7 @@ extern arm_status arm_rfft_4096_fast_init_f32(arm_rfft_fast_instance_f32 * S); void func_gauss_grad(float *out, float *params, int x, void *userdata); float func_gauss(float *params, int x, void *userdata); -int adc_buf_measure_freq(int16_t adc_buf[FMEAS_FFT_LEN], float *out) { +int adc_buf_measure_freq(uint16_t adc_buf[FMEAS_FFT_LEN], float *out) { int rc; float in_buf[FMEAS_FFT_LEN]; float out_buf[FMEAS_FFT_LEN]; @@ -42,7 +42,7 @@ int adc_buf_measure_freq(int16_t adc_buf[FMEAS_FFT_LEN], float *out) { */ //DEBUG_PRINT("Applying window function"); for (size_t i=0; i<FMEAS_FFT_LEN; i++) - in_buf[i] = (float)adc_buf[i] / (float)FMEAS_ADC_MAX * fmeas_fft_window_table[i]; + in_buf[i] = ((float)adc_buf[i] / (float)FMEAS_ADC_MAX - 0.5) * fmeas_fft_window_table[i]; //DEBUG_PRINT("Running FFT"); arm_rfft_fast_instance_f32 fft_inst; |