Low resource audio encoder and decoder - Page 1
Forum section: electronics / general

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 27, 2018, 04:23:32 pm
content: Hi, I have used helix mp3 decoder before, for my new project I have this limitation that I have a 200Kbits total bandwidth for my network, I have a cortex M4 with a 100MHz clock, so I want to know if there are some open source C library’s that would decode and encode the audio, so it can be done both the decode and encode the audio with 16bit’s data and at least 20K samples per second Realtime with the M4. So, the audio would be small enough to pass the network bandwidth, the MP3 decoder source is available, the problem with it is the encoder is not available as open source also it uses lots of CPU cycles to encode and decode at the same time, and it’s an over compression for this project. Any ideas are welcome!

author: mark03
author_rank: Frequent Contributor
timestamp: November 27, 2018, 04:51:31 pm
content: You might look into Ogg Vorbis rather than MP3. As ogg is a much more open spec, you'll probably have a greater chance of finding a ready-to-go MCU implementation.If good performance at lower data rates is important, I believe Opus is the current reigning champion. Also an open design, likely with an open-source MCU implementation already in existence. IIRC it really shines at rates < 100 kbps.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 27, 2018, 05:23:30 pm
content: You should specify what your goal is in terms of acceptable loss.There are many lossy data compression schemes for audio that lead to high compression ratios (higher than MP3) and take little processing power, if you don't care too much about sound quality.You may be interested in Opus:https://opus-codec.org/

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 27, 2018, 06:42:50 pm
content: QuoteThanks do you know any encode and decode library? can it be done with a M4 @ 100Mhz?QuoteThe audio quality is not my main concern, as it 's used mainly for speech, but the better quality always sound better

author: mark03
author_rank: Frequent Contributor
timestamp: November 27, 2018, 06:56:35 pm
content: Actually, both Opus and Vorbis result in better quality than MP3, at moderate bit rates. MP3 is only still around because of inertia and ubiquity. (There is a reason none of the recent video codecs use MP3 for audio. Although they're not using Opus or Vorbis either for the most part, which is a different story having more to do with vested patent interests and $$ than technical merit.)I would use a targeted google search of github, and also look at each codec project's own source distribution. I'm almost certain one of them comes with a Cortex M branch... probably Opus.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 27, 2018, 07:17:21 pm
content: Quote from: ali_asadzadeh on November 27, 2018, 06:42:50 pmFor speech, you can take a look at the Speex codec:https://www.speex.org/Or implement any ADPCM codec, I'm sure there's plenty of source code out there.

author: mark03
author_rank: Frequent Contributor
timestamp: November 27, 2018, 08:35:54 pm
content: TI app note "Implementing Opus voice code for TM4C129x device":https://www.ti.com/lit/an/spma076/spma076.pdf(This is a Cortex-M4-based device.)

author: David Hess
author_rank: Super Contributor
timestamp: November 28, 2018, 03:43:14 am
content: Quote from: ali_asadzadeh on November 27, 2018, 06:42:50 pmIn the past MP3 encoding and decoding could be done in real time on a Pentium 90 so it should be possible on an M4 which has single cycle DSP.

author: ali_asadzadeh
author_rank: Super Contributor
timestamp: November 28, 2018, 06:03:24 am
content: Thanks to all.Quotethanks for the link