2023-02-19 09:19 PM
Hi,
I'm using STM32WB5MM-DK board interfaced with SPH0645LM4H I2S mic for capturing audio. I also connected a playback speaker with the setup I have mentioned. I also configured UART for transmitting the PCM data from STM32WB5MM-DK to PC. When I transfer and convert it to audio file in PC I hear some crackling sound but on the playback speaker I'm not hearing any crackling or noise.
Sample rate: 16KHz; Channel: Stereo; UART baudrate: 460800.
Help me out with this issue.
Thanks in advance.
2023-02-19 10:03 PM
> convert it to audio file in PC
How?
JW
2023-02-19 10:26 PM
Hi JW,
Using python script I'm converting the data to .wav file.
2023-02-19 11:16 PM
>Sample rate: 16Hz ? really? as wav for subsonic recording?
at 460k you can transmit it in ascii , with some comments.
2023-02-19 11:21 PM
Sorry It's 16KHz.
2023-02-19 11:32 PM
aaa, new game. now you have max. 14 bit/sample (460800/16000/2 = 14,4 ).
so you could use 8 bit resolution without problem. or use compression, something like MP3 .
or go to 1Mb transmission, then 16b would be possible.
2023-02-20 01:38 AM
Instead of sound from microphone, try to transmit and playback constant data, something easily recognizable, such as sawtooth - that's also easily generated at the mcu side, simply by incrementing a variable.
JW
2023-02-20 01:57 AM
... and later a tone generator like phyphox on your smartphone.
... and a tool like Audacity on the PC that can import raw data in various formats.
Despite of using the UART you may use Semihosting and directly open and write to a file on the host from MCU code. See AN4989 Application note "STM32 microcontroller debug toolbox" for details.
Bandwith is limited, so if you use compression, start with something easy like G.711 or ADPCM.
hth
KnarfB