Re: [ecasound] 24/96 upsampling problem

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] 24/96 upsampling problem
From: Kai Vehmanen (k_AT_eca.cx)
Date: Fri Nov 28 2003 - 01:53:06 EET


On Wed, 5 Nov 2003, Kamil Wencel wrote:

> I am having trouble upsampling a 16 bit 44.1 kHz wave file to
> 24bit 96kHz. Sorry, if my that question may seem lame, but
> I have no idea what Im doing wrong.

This is a good question. Earlier Ecasound releases supported
implicit resampling (i.e. resampling when needed), but this approach had
its problems, so with current Ecasound releases you have to
explicitly ask for resampling. Here's an example:

ecasound -f:16,2,96000 -i resample,44100,foo.wav -f:24,2,96000 -o bar.wav

The syntax is somewhat verbose as Ecasound requires all audio
input and output objects (in one chainsetup) to have the same
samplerate. To do resampling, we use the special 'resample' input
type to resample foo.wav from 44100 to 96000. Additionally we specifiy
the sample format (16bit for foo.wav and 24bit for bar.wav). Both
files are stereo/2ch.

For good quality, I recommend installing Erik de Castro
Lopo's libsamplerate [1] package. To optimize conversion quality,
use 'resample-hq' instead of 'resample' (although this consumes
a _lot_ of cpu power). You have to re-configure and compile Ecasound after
installing libsamplerate.

If you notice any audible errors in the conversion, makek sure you have
the latest libsamplerate (0.0.15 or newer). Also, there are few minor bugs
in Ecasound's side. I'm currently tracing these, and will add a few
bugfixes to the upcoming Ecasound-2.3.2.

> Once Ive upsampled the file, its content becomes *instable*
> especially in more dynamic parts of music. Then you hear a lot
> of scratching and fine clicks.

Resampling is tricky business. Good conversions takes a lot of CPU and
requires complex algorithms, while a simpler converted can be very light,
but quality suboptimal. Also, error in converter code can show up with
only certain src-rate<->dst-rate pairs, and this further complicates
testing.

[1] http://www.mega-nerd.com/SRC/

-- 
 http://www.eca.cx
 Audio software for Linux!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Nov 28 2003 - 01:49:57 EET