IPB

Welcome Guest ( Log In | Register )

ffmpeg vs. SoX for resampling
jkauff
post Feb 5 2013, 11:00
Post #1





Group: Members (Donating)
Posts: 162
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.
Go to the top of the page
+Quote Post
 
Start new topic
Replies
[JAZ]
post Feb 12 2013, 20:25
Post #2





Group: Members
Posts: 1783
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383



@ halb27: I haven't checked other software, but a sinc method is implemented in Psycle (And at least back to 2003 or so, there was a tracker name Aodix that had a 64point sinc interpolator, for non-realtime rendering). Here you can see the code of Psycle:

http://sourceforge.net/p/psycle/code/10455...rs/dsp.hpp#l544
search for: static float band_limited

The sinc table is calculated in this other file, and a blackman window is applied to make it finite.
http://sourceforge.net/p/psycle/code/10455...helpers/dsp.cpp

This implementation still lacks a filter (I am trying to find a good one that doesn't require too much lookahead, but I might end calling soxr variable rate if I can't find a good way to do it).
I have a file as old as 2001 (I had to doublecheck to be sure of the year), that shows a sinc interpolator and applies a filter modifying the sinc speed. But this way of filtering decays slowly and in what i've tested, alters the frequencies too.




@saratoga: I am not an expert in DSP or maths (I did study the fourier transform at the university, but was applied to signals in general, not specifically to sound).
But with my knowledge of resampling (i.e. what I've tried to know), the sinc interpolation is considered the ideal (which also means not possible in finite time/signals) resampling method because it is the response or an ideal brickwall lowpass filter. Real implementations have to window the sinc in order to make it finite, and in this way, limit the amount of samples needed to calculate the output. (See Psycle's implementation).

In contrast, decimating and interpolating is a two step method which firstly upsamples using the zero-stuffing method, applies a lowpass filter at the lowest of the two samplerates, and then downsamples by getting directly the samples from the lowpassed signal. The difficult part is getting the values to what upsample, wich is the common minimum multiple. (erm.. spelling?)
In some way, this is how a DAC works (except that then, the result is a continuous signal).


I have included the polynomial interpolators in the "other resamplers", since they are, in some way, approximations, or concepts applied to sound when sometimes they originated in graphics ( splines, for example, is more about visuals than samples).

This post has been edited by [JAZ]: Feb 12 2013, 20:29
Go to the top of the page
+Quote Post
saratoga
post Feb 13 2013, 18:32
Post #3





Group: Members
Posts: 4998
Joined: 2-September 02
Member No.: 3264



QUOTE ([JAZ] @ Feb 12 2013, 14:25) *

@saratoga: I am not an expert in DSP or maths (I did study the fourier transform at the university, but was applied to signals in general, not specifically to sound).
But with my knowledge of resampling (i.e. what I've tried to know), the sinc interpolation is considered the ideal (which also means not possible in finite time/signals) resampling method because it is the response or an ideal brickwall lowpass filter. Real implementations have to window the sinc in order to make it finite, and in this way, limit the amount of samples needed to calculate the output. (See Psycle's implementation).

In contrast, decimating and interpolating is a two step method which firstly upsamples using the zero-stuffing method, applies a lowpass filter at the lowest of the two samplerates, and then downsamples by getting directly the samples from the lowpassed signal.


A lowpass filter is a windowed sinc. So you propose two methods, one of which fits a windowed sinc to calculate values, and another which ... fits a windowed sinc to calculate values.

These are just two ways of implementing the same algorithm, which is preferred is just an implementation detail that depends on the exact needs of the resampler. Trying to draw some abstract distinction between them is silly.

QUOTE ([JAZ] @ Feb 12 2013, 14:25) *

I have included the polynomial interpolators in the "other resamplers", since they are, in some way, approximations, or concepts applied to sound when sometimes they originated in graphics


They didn't originate in graphics, they originated in 17th century boundary value problems. They're general numerical techniques, as such both polynomial and windowed sinc interpolation are widely used in audio and graphics.

QUOTE ([JAZ] @ Feb 12 2013, 14:25) *

( splines, for example, is more about visuals than samples).


What is it you think digital images are made of if not samples?
Go to the top of the page
+Quote Post

Posts in this topic
- 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
- - [JAZ]   As always, there is tradeoff between speed and acc...   Feb 6 2013, 23:36
|- - saratoga   QUOTE ([JAZ] @ Feb 6 2013, 17:36)...   Feb 12 2013, 16:50
|- - halb27   QUOTE ([JAZ] @ Feb 6 2013, 23:36)...   Feb 12 2013, 18:30
|- - bandpass   QUOTE (halb27 @ Feb 12 2013, 17:30) Can y...   Feb 14 2013, 08:04
- - [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


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th September 2014 - 23:50