2024-10-31 01:30 AM - edited 2024-10-31 01:39 AM
Hy,
I have tried to resample a 16bit/8kHz audio signal to 16kHz and 48kHz.
Conversion works, but the audio is noisy. I am tested it on development board STM32H747 CM7 core.
I have tried libraries: SRC236_CM7_GCC.a and SRC236HQ_CM7_GCC.a without quality improvement.
I am working with 10ms blocks.
Initialization parameters are:
// conversion from 8kHz to 16kHz
src236_static_param_t src236_static_param.src_mode = SRC236_RATIO_2;
// library initialization
src_error = src236_reset(PSrc236PersistentMem_ToCodecOut, PSrcScratchMem_ToCodecOut);
if (src_error != SRC236_ERROR_NONE)
{
return (-1); //error AUDIO_ERROR_SRC
}
/* SRC236 effect static parameters setting */
src_error = src236_setParam(&src236_static_param, PSrc236PersistentMem_ToCodecOut);
if (src_error != SRC236_ERROR_NONE)
{
return (-1); //error AUDIO_ERROR_SRC
}
// 8kHz, 16 bit audio input // 10ms block
LowRateConversionBuff_ToCodecOut.nb_channels = 1;
LowRateConversionBuff_ToCodecOut.nb_bytes_per_Sample = 2;
LowRateConversionBuff_ToCodecOut.mode = NOT_INTERLEAVED;
// LowRateConversionBuff_ToCodecOut.data_ptr = //set data pointer before usage
LowRateConversionBuff_ToCodecOut.buffer_size = 80;
// 16kHz, 16bit audio output
HighRateConversionBuff_ToCodecOut.nb_channels = 1;
HighRateConversionBuff_ToCodecOut.nb_bytes_per_Sample = 2;
HighRateConversionBuff_ToCodecOut.mode = NOT_INTERLEAVED;
// HighRateConversionBuff_ToCodecOut.data_ptr = //set data pointer before usage
HighRateConversionBuff_ToCodecOut.buffer_size = 160;
Processing part:
LowRateConversionBuff_ToCodecOut.data_ptr = pInData;
HighRateConversionBuff_ToCodecOut.data_ptr = pOutData;
src_error = src236_process(&LowRateConversionBuff_ToCodecOut, &HighRateConversionBuff_ToCodecOut, PSrc236PersistentMem_ToCodecOut);
if (src_error == SRC236_ERROR_NONE)
{
return 0;
}
2024-10-31 01:34 AM
Please see the posting tips for how to properly post source code: