[Bug 14717] resampled sound is horrible

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Nov 4 07:34:04 CDT 2011


http://bugs.winehq.org/show_bug.cgi?id=14717

--- Comment #197 from Alexander E. Patrakov <patrakov at gmail.com> 2011-11-04 07:34:04 CDT ---
The FIRs in the patch use significantly less points than those from
libsamplerate. Since values in between the stored FIR points are obtained via
linear interpolation (both in the proposed patch and in libsamplerate), this
means that the patch adds more noise to the resampled signal and does not
achieve the stated noise figures.

For example, let's consider the best FIR. It has the following four samples
near the top (I am just quoting the beginning of the table in the patch):

0.0151608889127230161,
0.015155099431551319,
0.0151377390515672269,
0.0151088319498221702,

Let's suppose that the resampler needs to access the non-existing point in the
middle between the 2nd and the 3rd sample. Since it uses linear interpolation,
it would get (0.015155099431551319 + 0.0151377390515672269) / 2 =
0.015146419241559274. I am too lazy to rebuild the FIR with more points, so I
will just use cubic interpolation to estimate a more precise value. So here we
go, according to http://paulbourke.net/miscellaneous/interpolation/ I need to
set mu = 0.5 in their CubicInterpolate() function. Result:
0.015149308944130944.

So, two different interpolation methods give values that differ by 0.02%. So
this is the estimation of the error given by the less precise one (linear
interpolation). Such errors propagate to the audio signal, as noise. 0.02 % =
-74 dB of noise. This is obviously not balanced with the -120 dB of stopband
attenuation provided by the same FIR, and just not good enough for working even
with 16-bit audio signals. The "fastest" FIR from libsamplerate has, according
to the same type of calculations, -89 dB of noise.

This is even worse for the "fast" fir in the patch: with linear interpolation,
it has -54 dB of noise (and -65 dB of stopband attenuation).

So either use more points (this doesn't increase compulational complexity,
BTW), or use cubic interpolation near lines 271-275 of mixer.c.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list