Author Topic: Low resource audio encoder and decoder  (Read 701 times)

0 Members and 1 Guest are viewing this topic.

Offline ali_asadzadeh

  • Frequent Contributor
  • **
  • Posts: 896
  • Country: ir
    • ASiD Designer
Low resource audio encoder and decoder
« on: November 27, 2018, 04:23:32 pm »
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!
You can order parts from www.ASiDesigner.com
we are a wire-based company
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 562
  • Country: us
Re: Low resource audio encoder and decoder
« Reply #1 on: November 27, 2018, 04:51:31 pm »
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.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 3537
  • Country: fr
Re: Low resource audio encoder and decoder
« Reply #2 on: November 27, 2018, 05:23:30 pm »
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/
 

Offline ali_asadzadeh

  • Frequent Contributor
  • **
  • Posts: 896
  • Country: ir
    • ASiD Designer
Re: Low resource audio encoder and decoder
« Reply #3 on: November 27, 2018, 06:42:50 pm »
Quote
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.
Thanks do you know any encode and decode library? can it be done with a M4 @ 100Mhz?

Quote
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/
The audio quality is not my main concern, as it 's used mainly for speech, but the better quality always sound better ;)
You can order parts from www.ASiDesigner.com
we are a wire-based company
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 562
  • Country: us
Re: Low resource audio encoder and decoder
« Reply #4 on: November 27, 2018, 06:56:35 pm »
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.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 3537
  • Country: fr
Re: Low resource audio encoder and decoder
« Reply #5 on: November 27, 2018, 07:17:21 pm »
The audio quality is not my main concern, as it 's used mainly for speech, but the better quality always sound better ;)

For 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.
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 562
  • Country: us
Re: Low resource audio encoder and decoder
« Reply #6 on: November 27, 2018, 08:35:54 pm »
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.)
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 9933
  • Country: us
  • DavidH
Re: Low resource audio encoder and decoder
« Reply #7 on: November 28, 2018, 03:43:14 am »
Thanks do you know any encode and decode library? can it be done with a M4 @ 100Mhz?

In 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.
 

Offline ali_asadzadeh

  • Frequent Contributor
  • **
  • Posts: 896
  • Country: ir
    • ASiD Designer
Re: Low resource audio encoder and decoder
« Reply #8 on: November 28, 2018, 06:03:24 am »
Thanks to all.
Quote
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.)
thanks for the link :) ;)
You can order parts from www.ASiDesigner.com
we are a wire-based company
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf