Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: g.orlandini on September 14, 2017, 09:32:06 AM

Title: Resampling of low frequency audio podcast
Post by: g.orlandini on September 14, 2017, 09:32:06 AM
Hi all,

I'm listening a lot to audio podcast with sample rate lower than classic 44100 Hz (it's 11025, 12000, 16000 or 22050). In the Sansa Clip Plus manual I read:
 "7.18. Frequency
This is the sampling frequency used for the rockbox playback engine. Audio at a different sampling rate will be converted to this sampling rate prior to mixing using a cubic Hermite polynomial resampler. Note: For best quality and battery life, select the sampling rate used by your audio.
This is typically 44.1kHz."
So this means a 11025 Hz audio is resampled to 44100 Hz while I listen to it? In case there is a resample, how bad is it for battery consumption and audio quality?
Thanks for sharing your opinions/knowledge
Title: Re: Resampling of low frequency audio podcast
Post by: saratoga on September 14, 2017, 10:20:26 AM
You have to resample with such low rates. The CPU time required is relatively blow, and quality doesn't matter given such low sampling rates.
Title: Re: Resampling of low frequency audio podcast
Post by: gevaerts on September 14, 2017, 10:38:33 AM
One thing to note is that the higher the sample rate of the mp3 (or whatever) file, the more work the CPU will have to *decode* it. This means that while an 11.025kHz file will need a bit of CPU to convert to 44.1 or 48 kHz, that will be swamped out by the actual decoding needing a lot less.

What *may* make a difference in quality is setting the sample rate to a multiple of your podcasts (if possible), e.g. set it to 44.1kHz if you listen to 11.025kHz or 22.05kHz stuff, and set it to 48kHz if you listen to 12kHz or 16kHz files. As saratoga noted though, you're starting with fairly low quality, so I suspect you probably wouldn't hear the difference anyway.
Title: Re: Resampling of low frequency audio podcast
Post by: g.orlandini on September 14, 2017, 12:07:25 PM
Thanks for your answers. If I understand well when I listen to a podcast with sample rate 11025 or 22025 I should set playback frequency to 44100, instead if 12000 or 16000 I should set it to 48000. If playback frequency is a multiple of audio frequency CPU time and quality loss is low. Sometimes I do resample/recode audio podcast to save space in my sansa clip (usually from mp3 2 ch 44100 128 Kbit to mp3 vbr9 1 ch 11025 @ 22-24 Kbit with no big audio quality loss) and I wonder if I the bigger CPU time used to resample from 11025 to 44100 is compensated with the smaller file size and less disk read time.

Thanks again
Title: Re: Resampling of low frequency audio podcast
Post by: saratoga on September 14, 2017, 01:11:32 PM
If I understand well when I listen to a podcast with sample rate 11025 or 22025 I should set playback frequency to 44100, instead if 12000 or 16000 I should set it to 48000.

There is no reason to do that.

If playback frequency is a multiple of audio frequency CPU time and quality loss is low.

I have no idea why people think this, but it is not true. 
Title: Re: Resampling of low frequency audio podcast
Post by: g.orlandini on September 14, 2017, 02:01:36 PM
If I understand well when I listen to a podcast with sample rate 11025 or 22025 I should set playback frequency to 44100, instead if 12000 or 16000 I should set it to 48000.

There is no reason to do that.

Do you mean, as gevaerts wrote, that there's no audible difference listening low quality audio if I set playback frequency at 44100 or 48000?

If playback frequency is a multiple of audio frequency CPU time and quality loss is low.

I have no idea why people think this, but it is not true.

I'm no expert I believe you.

What about battery consumption using low sample rate audio vs original audio @ 44100 128 Kbit?

Sometimes I do resample/recode audio podcast to save space in my sansa clip (usually from mp3 2 ch 44100 128 Kbit to mp3 vbr9 1 ch 11025 @ 22-24 Kbit with no big audio quality loss) and I wonder if I the bigger CPU time used to resample from 11025 to 44100 is compensated with the smaller file size and less disk read time.

Thanks again

Thanks




Title: Re: Resampling of low frequency audio podcast
Post by: saratoga on September 14, 2017, 04:21:08 PM
If you're transcoding to save space, you can just use ogg and leave the sample rate alone.

I don't think there will be much difference in battery life either way, but you can test using the battery bench plugin to measure how long the battery lasts for any file type you have.