ERIS CORE

◆ analyze()

void erisAudioAnalyzeFFT1024::analyze ( void  )

Definition at line 143 of file eris_analyze_fft1024.cpp.

144 {
145  float p;
146 
147  if (is_analyzed) return;
148  //(NVIC_DISABLE_IRQ(IRQ_SOFTWARE));
149 
150  apply_window_to_fft_buffer_f32((float32_t*)tmp_buffer, window_f32);
151  arm_fill_f32(0,(float32_t*)&tmp_buffer[1024],1024);
152  arm_cfft_radix4_f32(&fft_inst, (float32_t*)tmp_buffer);
153  //extract the polar phase from the interleaved real and imag
154 
155  for(int16_t i=0;i < 1024;i+=2){
156  p = normalized_atan2(tmp_buffer[i],tmp_buffer[i+1]);
157  if (!std::isfinite(p)) p = 0;
158  phase[i/2] = (phase[i/2] + (360.0 * (p/4.0)))/2.0;
159  }
160 
161  // Process the data through the Complex Magnitude Module for calculating the magnitude at each bin
162  arm_cmplx_mag_f32((float32_t*)tmp_buffer, (float32_t*)tmp_buffer, 1024);
163  for(int16_t i=0;i < 1024;i+=2){
164  //arm_cmplx_mag_f32((float32_t*)tmp_buffer, (float32_t*)output, 1024);
165  output[i] = (output[i] + tmp_buffer[i]) / 2.0;
166  }
167 
168 
169  //(NVIC_ENABLE_IRQ(IRQ_SOFTWARE));
170 
171  //spectralFilter();
172 
173  outputflag = false; //current frame is analyzed and ready to use
174  is_analyzed = true;
175  return;
176 }
const char PROGMEM p[][16]
Definition: Eris.h:247
arm_cfft_radix4_instance_f32 fft_inst
static void apply_window_to_fft_buffer_f32(float32_t *buffer, const float32_t *window)
float normalized_atan2(float y, float x)
float phase

References apply_window_to_fft_buffer_f32(), fft_inst, is_analyzed, normalized_atan2(), outputflag, p, phase, and window_f32.

Referenced by AppCQT::update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: