ffmpeg vs. SoX for resampling |
ffmpeg vs. SoX for resampling |
Feb 5 2013, 11:00
Post
#1
|
|
![]() Group: Members (Donating) Posts: 102 Joined: 1-October 01 From: Doylestown, PA Member No.: 145 |
I just found out that TAudioConverter, although it has SoX support, uses ffmpeg for bitdepth changes, resampling, and dither. I don't use those functions very much, but I'm curious if anyone has done a quality comparison between the two.
|
|
|
|
![]() |
Feb 6 2013, 23:36
Post
#2
|
|
|
Group: Members Posts: 1568 Joined: 24-June 02 From: Catalunya(Spain) Member No.: 2383 |
As always, there is tradeoff between speed and accuracy, and in this field, there's even different techniques in play.
There are two good ways to resample: - Using SINC ( sin(x)/x ) interpolation. - Using a decimator/interpolator combination. In both cases, a filter is needed to reconstruct the signal, and the quality of that filter reflects how fast and how clean it is in removing frequency imaging, without adding other unwanted distortions. Both are relatively slow (They migh be "fast" for downsampling a single stereo sample from 96Khz to 44.1Khz, but now think about a realtime sampler like BASSMIDI, FluidSynth, or any other Soundfont player, where you not only play several streams, but also change their speed while playing). So there have always existed other "resamplers" (not in the academic sense, but approximations) like: - ZO (Zero order, or sample Hold). The fastest and worst of them all (See the graph of Secret Rabbit Code, ZOH). - Linear interpolation. Quite an improvement over ZO, and still fast (This was being used in 16 and 32 channel trackers back in 1992-1996 with 386 and 486 PC's! See Secret Rabbit Code, Linear. One can apply a filter with this type of interpolation, like in Wavosaur Linear, but it sort of defeats the purpose) - Cubic interpolation. Cubic interpolation, and other polynomial interpolators are an advancement over linear interpolation, approximating the signal using polinomials. This generally lowers aliasing notably, but they still miss a filter. (See Renoise cubic, or OpenMPT polyphase, which are, again, realtime multichannel trackers with realtime virtual effects). Any SINC interpolator should give a clean signal, but it is at least 4 times slower than cubic interpolation. It can filter by itself, but to be of good quality, it gets slower (because it needs more taps). So, while a product that is specific to change the sample rate of a signal should have a good resampler, one should not think that it is the only reasonable way to resample. This post has been edited by [JAZ]: Feb 6 2013, 23:41 |
|
|
|
Feb 12 2013, 18:30
Post
#3
|
|
|
Group: Members Posts: 2297 Joined: 9-October 05 From: Dormagen, Germany Member No.: 25015 |
... Any SINC interpolator should give a clean signal ... Can you tell me please which software uses SINC? -------------------- lame3100k -V0 --cvbr 9
|
|
|
|
Feb 14 2013, 08:04
Post
#4
|
|
![]() Group: Members Posts: 267 Joined: 3-August 08 From: UK Member No.: 56644 |
Can you tell me please which software uses SINC? First, go to http://src.infinitewave.ca/ For the top graph, select Test Result = Impulse, then press the > button to look at each resampler in turn:
|
|
|
|
jkauff ffmpeg vs. SoX for resampling Feb 5 2013, 11:00
db1989 I’m no authority, but there’s always good old http... Feb 5 2013, 11:28
bandpass QUOTE (db1989 @ Feb 5 2013, 10:28) Let’s,... Feb 5 2013, 12:33
jkauff QUOTE (db1989 @ Feb 5 2013, 05:28) I’m no... Feb 5 2013, 12:36

bandpass QUOTE (jkauff @ Feb 5 2013, 11:36) Well, ... Feb 5 2013, 13:05

phofman QUOTE (bandpass @ Feb 5 2013, 14:05) ... ... Feb 5 2013, 16:32

bandpass QUOTE (phofman @ Feb 5 2013, 15:32) I am ... Feb 5 2013, 17:23

phofman QUOTE (bandpass @ Feb 5 2013, 18:23) The ... Feb 12 2013, 15:01

bandpass Audacity are using libsoxr directly (native API). ... Feb 12 2013, 16:13

2012 QUOTE (phofman @ Feb 12 2013, 16:01) QUOT... Feb 13 2013, 15:49

phofman QUOTE (2012 @ Feb 13 2013, 16:49) I alrea... Feb 13 2013, 20:29
[JAZ] QUOTE (db1989 @ Feb 5 2013, 11:28) Let’s... Feb 5 2013, 20:36
db1989 I did notice the large disparity in version number... Feb 5 2013, 12:40
lvqcl Downloaded TAC(0.7.5.938)(portable).7z. It contain... Feb 5 2013, 15:56
db1989 Regardless of different options and builds, someth... Feb 5 2013, 17:50
ozok I've posted a request for a ffmpeg build with ... Feb 5 2013, 18:09
db1989 QUOTE QUOTE
Seems to me that those reflections of... Feb 5 2013, 20:51
lvqcl QUOTE (Alexey Lukin @ Jul 31 2008, 04:10)... Feb 5 2013, 21:55
bandpass QUOTE (lvqcl @ Feb 5 2013, 20:55) + a thr... Feb 5 2013, 22:39
bandpass FFmpeg native is even worse going the other way (i... Feb 5 2013, 22:29
mavere QUOTE (db1989 @ Feb 5 2013, 02:28) I... Feb 6 2013, 02:58
nu774 QUOTE (mavere @ Feb 6 2013, 10:58) Apple ... Feb 6 2013, 05:06
IgorC http://src.infinitewave.ca/images/Tone/ffmpeg.png
... Feb 6 2013, 03:43
bandpass QUOTE (IgorC @ Feb 6 2013, 02:43) ffmpeg... Feb 6 2013, 07:48
Alexey Lukin These spectral peaks are not bad only for a 1 kHz ... Feb 6 2013, 04:33
LithosZA QUOTE ve posted a request for a ffmpeg build with ... Feb 6 2013, 08:17
ozok zeranoe kindly supplied it after my request. Feb 6 2013, 13:01
soulsearchingsun So, where is TOS#8 when everyone agrees on looking... Feb 6 2013, 14:34
pdq QUOTE (soulsearchingsun @ Feb 6 2013, 08... Feb 6 2013, 14:46
db1989 QUOTE (soulsearchingsun @ Feb 6 2013, 13... Feb 6 2013, 15:27
bandpass QUOTE (soulsearchingsun @ Feb 6 2013, 13... Feb 7 2013, 08:57
saratoga QUOTE ([JAZ] @ Feb 6 2013, 17:36)... Feb 12 2013, 16:50
[JAZ] @ halb27: I haven't checked other software, b... Feb 12 2013, 20:25
lvqcl QUOTE ([JAZ] @ Feb 12 2013, 23:25... Feb 12 2013, 20:39
knutinh QUOTE ([JAZ] @ Feb 12 2013, 20:25... Feb 13 2013, 16:04
saratoga QUOTE ([JAZ] @ Feb 12 2013, 14:25... Feb 13 2013, 18:32
[JAZ] @ saratoga:
As I said, my knowledge of this is av... Feb 13 2013, 22:11
Rotareneg QUOTE ([JAZ] @ Feb 13 2013, 15:11... Feb 14 2013, 05:39
saratoga QUOTE ([JAZ] @ Feb 13 2013, 16:11... Feb 14 2013, 07:01
halb27 So SSRC high precision is a good approximation to ... Feb 14 2013, 09:07
bandpass SSRC uses kaiser-windowed sinc. Feb 14 2013, 13:48
halb27 Sorry, I don't know what this means in terms o... Feb 14 2013, 19:03
saratoga QUOTE (halb27 @ Feb 14 2013, 13:03) Sorry... Feb 14 2013, 19:12
bandpass It has some problems upsampling though: Feb 14 2013, 22:28
saratoga QUOTE (bandpass @ Feb 14 2013, 16:28) It ... Feb 15 2013, 01:53
bandpass QUOTE (saratoga @ Feb 15 2013, 00:53) Are... Feb 15 2013, 07:00
halb27 No problem for me, I'm only interested in down... Feb 14 2013, 23:05
Wombat QUOTE (bandpass @ Feb 14 2013, 23:28) It ... Feb 15 2013, 03:42![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 09:05 |