Hi
According to the ESP32 datasheet
"The ESP32 I2S module integrates an A-law compression/decompression module to enable compression/decompression of the received audio data."
Does anyone know there's anything in the SDK (or any plans) to enable compression/decompression on incoming I2S PCM data. I have a MEMS microphone that imports 32-bit samples at quite high sample rates so some kind of hardware A-law compression would be great.
Thanks
Simon
ADPCM Compression
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: ADPCM Compression
ADPCM is a simple predictive codec. A-law and µ-law are non-linear quantization curves to get better dynamic or s/n ratio for when your ADC resolution is limited, which seems to be the opposite of what you have to deal with.
What do plan to accomplish?
What do plan to accomplish?
Re: ADPCM Compression
Hi
Sorry, wasn't very clear. I would actually like to compress the raw PCM that is coming through from the microphone as I'm transmitting it over UDP using Wifi. 32bit PCM is taking too much bandwidth, so I'm investigating how I can get the ESP32 to perform some compression. I was looking into ADPCM/A-law, saw there was hardware support for it and wondered whether it would help, especially as it's only voice quality I'm interested in. I admit to not using A-law before, so I could be wrong on this.
Thanks
Sorry, wasn't very clear. I would actually like to compress the raw PCM that is coming through from the microphone as I'm transmitting it over UDP using Wifi. 32bit PCM is taking too much bandwidth, so I'm investigating how I can get the ESP32 to perform some compression. I was looking into ADPCM/A-law, saw there was hardware support for it and wondered whether it would help, especially as it's only voice quality I'm interested in. I admit to not using A-law before, so I could be wrong on this.
Thanks
-
- Posts: 263
- Joined: Sun Jun 19, 2016 12:00 am
Re: ADPCM Compression
I see. I'm not sure the ESP32 has ADPCM hardware, where did you read that?
Someone recently ported the LAME MP3 encoder, you can try to use that one if latency is not important. Also, there is a software SBC encoder in the bluetooth module you could try
I am streaming 16bit, 16khz mono audio via wifi just fine, which microphone are you using? Even the Knowles SPH0645LM4H supports 16khz in practise, though the datasheet says otherwise.
Someone recently ported the LAME MP3 encoder, you can try to use that one if latency is not important. Also, there is a software SBC encoder in the bluetooth module you could try
I am streaming 16bit, 16khz mono audio via wifi just fine, which microphone are you using? Even the Knowles SPH0645LM4H supports 16khz in practise, though the datasheet says otherwise.
Re: ADPCM Compression
I took the quote I posted above from the hardware reference manual https://espressif.com/sites/default/fil ... ual_en.pdf. I didn't realise the Knowles SPH0645LM4H did 16khz rates, as I was just going by the datasheet but as you say, that should be fine.
I'll take a look at the SBC encoder as well.
Thanks for your help
I'll take a look at the SBC encoder as well.
Thanks for your help
Re: ADPCM Compression
The manual also mentiones "The RX_PCM_BYPASS bit and the TX_PCM_BYPASS bit of register I2S_CONF1_REG should be cleared when using the A-law compression/decompression module." which could be interpreted as "should be cleared to use". Have you tried clearing them and looked if the data being written by the DMA has been compressed on the way?
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot] and 112 guests