2024-03-18 02:25 AM
warning: 'libBeamforming_setConfig' defined but not used [-Wunused-function]
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;
}
Solved! Go to Solution.
2024-09-19 06:52 AM
It was my mistake. I fill wrong audio data to the input, from a wrong memory address.
Beamforming in PCM mode now works, but noise reduction feature seems to be so unusable. White noisy is removed, but instead of that a digital noise is included. Digital noise level is less than a white noise level, but it is much more annoying.
Noise reduction level is not controllable.
I have much more better results with a noise filtering from STM32 Echo canceller library.
I am actually try to run Beamforming in PDM mode. I am hoping for a better quality.
2024-03-18 06:31 AM
Update:
Now I can precompile the beamforming sources without any warnings, but the output is still only a signal tone.
2024-09-19 06:52 AM
It was my mistake. I fill wrong audio data to the input, from a wrong memory address.
Beamforming in PCM mode now works, but noise reduction feature seems to be so unusable. White noisy is removed, but instead of that a digital noise is included. Digital noise level is less than a white noise level, but it is much more annoying.
Noise reduction level is not controllable.
I have much more better results with a noise filtering from STM32 Echo canceller library.
I am actually try to run Beamforming in PDM mode. I am hoping for a better quality.