message: GenericFreqDomain: improve examples of mag-phase operations
diff: @@ -52,11 +52,23 @@ void AudioEffectLowpass_FD_F32::processAudioFD(float32_t *complex_2N_buffer, con
  int N_2 = NFFT / 2 + 1;
  float Hz_per_bin = sample_rate_Hz /((float)NFFT); //sample_rate_Hz is from the base class AudioFreqDomainBase_FD_F32
  +
  /*
  - //In some other example, this might be a useful operation...getting the magnitude of the bin.
  - //here's a computationally efficient way to do it...call an optimized library
  - float orig_mag[N_2];
  + //In some other example, this might be a useful operation...getting the magnitude and phase of the bins.
  + //here's a computationally efficient way to do it...call an optimized library for the mangitude
  + float32_t orig_mag[N_2];
  arm_cmplx_mag_f32(complex_2N_buffer, orig_mag, N_2); //get the magnitude for each FFT bin and store somewhere safes
  +
  + //here's a way to compute the phase
  + float32_t phase_rad[N_2];
  + for (ind=0; ind<N_2; ind++ ) phase_rad[ind] = atan2f(complex_2N_buffer[2*ind+1),complex_2N_buffer[2*ind]);
  +
  + //here's a way to compute the complex number back from the magnitude and phase
  + float32_t new_complex_2N_buffer[2*NFFT];
  + for (ind=0; ind<N_2; ind++) {
  + new_complex_2N_buffer[ind*2] = orig_mag[ind] * cosf(phase_rad[ind]); //real
  + new_complex_2N_buffer[ind*2+1] = orig_mag[ind] * sinf(phase_rad[ind]); //imaginary
  + }
  */
  //Loop over each bin and attenuate those above the cutoff
  