cancel
Showing results for 
Search instead for 
Did you mean: 

AcousticBF (Beamforming) generates only noise.

KBéla.1
Associate III
I am trying to run AcousticBF (Beamforming library v3.1.0 from XCUBE_SMARTMIC_V2.4.0 pack) on STM32H747 development board, but on the output I get only a tone signal, and no audio hearable from Mics.
 
- The inputs are two PDM mics, and the PDM signal is converted to 16kHz, 16bit PCM audio by PDMFilter library. Audio quality for both audio channels are good, when Beamformer is switched off.
 
- When I enable Beamformer I get only a signal tone in the output stream. (Signal tone means a 3kHz sinusoid signal, with a side lobes on 1.5kHz and 4kHz).
- Reference output signal is also filled with the same signal tone.
- I tryed to work with a precompiled library, and with own compilation of sources, too. Own compilation of sources, generates many warnings, e.g. 

warning: 'libBeamforming_setConfig' defined but not used [-Wunused-function]

But I think it is not a problem, and a linker can found the function. The problem is static declaration of function, and this function is called from another file.
- I have already used an older version of beamforming library, with same setup on an STM32F769 cpu, and it was OK.
 
Beamformer setup is:
 

 

uint32_t BF_Init(uint8_t algoType)
{
  uint32_t error_value = 0;

  BF_DeInit ();

  ProcessBF_Flag = 0;

  libBeamforming_Handler_Instance.algorithm_type_init=ACOUSTIC_BF_TYPE_STRONG;
  libBeamforming_Handler_Instance.ref_mic_enable=ACOUSTIC_BF_REF_ENABLE;//ACOUSTIC_BF_REF_DISABLE;
  libBeamforming_Handler_Instance.ptr_out_channels=2;
  libBeamforming_Handler_Instance.data_format=ACOUSTIC_BF_DATA_FORMAT_PCM;
  libBeamforming_Handler_Instance.sampling_frequency=ACOUSTIC_BF_FS_16;
  libBeamforming_Handler_Instance.ptr_M1_channels=1;
  libBeamforming_Handler_Instance.ptr_M2_channels=1;
  libBeamforming_Handler_Instance.delay_enable = 1; //if disabled than not works correctly, external delay needed or something like this
  error_value = AcousticBF_getMemorySize(&libBeamforming_Handler_Instance);

  if (error_value != 0)
  {
  return error_value;
  }
#if STMDSP_DYNAMIC_MEMORY_ALLOCATION
  libBeamforming_Handler_Instance.pInternalMemory =(uint32_t *)malloc(libBeamforming_Handler_Instance.internal_memory_size);

  if(libBeamforming_Handler_Instance.pInternalMemory == NULL)
  {
    return MEMORY_ALLOCATION_ERRROR;//while(1); /*Error Management*/ /// memory problem
  }
#else
  if (sizeof(libBeamforming_IntBuffer) >= libBeamforming_Handler_Instance.internal_memory_size)
  {
    libBeamforming_Handler_Instance.pInternalMemory = &libBeamforming_IntBuffer[0];
  }
  else
  {
return MEMORY_ALLOCATION_ERRROR;//while(1); /*Error Management*/ /// memory problem
  }
#endif

    error_value = AcousticBF_Init(&libBeamforming_Handler_Instance);

  /*Error Management*/
  if(error_value != 0)
  {
    return error_value; //while(1); /*Error Management*/
  }

  /*Setup Beamforming dynamic parameters*/
  libBeamforming_Config_Instance.algorithm_type = algoType;
  libBeamforming_Config_Instance.M2_gain = 0;
  libBeamforming_Config_Instance.mic_distance = BF_PCM_ONLY_ALLOWED_DIST;
  libBeamforming_Config_Instance.volume = BEAMFORMER_DEFAULT_VOLUME;//24;//70;//24; // [dB] used only when PDM input is used

  error_value = AcousticBF_setConfig(&libBeamforming_Handler_Instance, &libBeamforming_Config_Instance);

//  if(error_value != 0){
//    while(1);    /*Error Management*/
//  }

  if (error_value == 0)
  {
  EnBeamForm = 1;
  }

  return error_value;
}

 

 
 
 
 
 
1 REPLY 1
KBéla.1
Associate III

Update:

Now I can precompile the beamforming sources without any warnings, but the output is still only a signal tone.