ADPCM Compression

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

ADPCM Compression

Postby lil_spli » Wed May 31, 2017 9:59 am

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

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: ADPCM Compression

Postby BuddyCasino » Thu Jun 01, 2017 1:29 pm

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?

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: ADPCM Compression

Postby lil_spli » Fri Jun 02, 2017 11:40 am

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

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: ADPCM Compression

Postby BuddyCasino » Fri Jun 02, 2017 1:46 pm

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.

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: ADPCM Compression

Postby lil_spli » Fri Jun 02, 2017 2:36 pm

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

englund
Posts: 2
Joined: Wed Dec 06, 2017 8:30 am

Re: ADPCM Compression

Postby englund » Wed Dec 06, 2017 8:34 am

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: No registered users and 109 guests