HydrogenAudio

Hydrogenaudio Forum => General Audio => Topic started by: Kalnoc on 2014-03-15 18:19:54

Title: Best method to downsample 96kHz/24bit FLAC
Post by: Kalnoc on 2014-03-15 18:19:54
Hello, I have a purchased 96kHz/24bit FLAC file I'd like to resample/downsample to 44.1/16 for mobile use. What is the recommended way to accomplish this? I have the latest version of Foobar and Audacity if that helps. Thanks
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-15 18:21:40
The built in foobar resampler is more than adequate for this.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: ZinCh on 2014-03-15 18:57:12
Better results will be with with 48/16 settings (not 44.1/16), because 96=2*48, and mobile devices can play 48 kHz too
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-15 19:46:26
Better results will be with with 48/16 settings (not 44.1/16), because 96=2*48,


This is not true.  Pick whichever destination sampling rate you need.  Most likely this is 44.1k for portable devices.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: Octocontrabass on 2014-03-15 19:46:31
Better results will be with with 48/16 settings (not 44.1/16), because 96=2*48,
No. Good resamplers do not work like that.

If you're resampling from an unnecessarily high sample rate, choose the sample rate that makes the most sense for your situation.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-15 19:54:15
No. Good resamplers do not work like that.


For what its worth, I don't even think bad ones work like that.  At least their is no advantage for polynomial based resamplers, which are what most high speed, lower accuracy resamplers use. 
Title: Best method to downsample 96kHz/24bit FLAC
Post by: testyou on 2014-03-15 21:00:49
OP can use Audacity, foobar2000, SoX mod for foobar2000, SoX commandline, john33's drag and drop programs...

Post if you have any issues.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: Octocontrabass on 2014-03-15 21:06:51
For what its worth, I don't even think bad ones work like that.
There is nearest-neighbor resampling. I doubt anyone will be able to find a real resampler that works that way, but it is a valid choice and it probably will sound better with nice even multiples. (I'd like to hear those artifacts!)
Title: Best method to downsample 96kHz/24bit FLAC
Post by: ktf on 2014-03-15 21:27:17
No. Good resamplers do not work like that.

For what its worth, I don't even think bad ones work like that.

AFAIK most resamplers build into ADCs are 'decimators' and work like that. Probably other oversampling algorithms as well. However, these clearly aren't general purpose resamplers, so they aren't usable for this job anyway.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-15 21:47:39
No. Good resamplers do not work like that.

For what its worth, I don't even think bad ones work like that.

AFAIK most resamplers build into ADCs are 'decimators' and work like that.


By definition a decimator has to work like that.  But thats not done for quality reasons, its done because you generally run your ADC at an integer multiple of your actual sampling rate anyway.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-15 22:03:23
For what its worth, I don't even think bad ones work like that.
There is nearest-neighbor resampling. I doubt anyone will be able to find a real resampler that works that way, but it is a valid choice and it probably will sound better with nice even multiples. (I'd like to hear those artifacts!)


Thats a good point.  If its already band limited to 1/4th the sampling rate, nearest neighbor (or even linear) works great for integer ratios.  If its not though, its going to fail horribly.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: Nystagmus on 2014-03-16 21:19:29
Another consideration, maybe not best, but workable....

Convert to WAV first.  Then...

Use r8brain freeware for the downsampling of the WAV file versions.  It has an excellent pro reputation for lack of aliasing and artifacts amongst rate converters of WAV files. 

Then reconvert to FLAC using FLACdrop or whatnot. 
And put the tags and artwork back in using Foobar2000. 

Title: Best method to downsample 96kHz/24bit FLAC
Post by: mjb2006 on 2014-03-17 02:29:11
There are many excellent sample rate converters to choose from. Here's the obligatory pointer to the graphs at http://src.infinitewave.ca/ (http://src.infinitewave.ca/) ... AFAIK, you shouldn't get audible artifacts when using any converter that that has only red/magenta/violet/blue lines outside the sweep, in the bottom-left two-thirds of the graph. So as stated, nothing's wrong with foobar2000's converter. It is the ones showing orange/yellow/white (aside from the sweep itself) that you need to worry about.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: 16 Hz on 2014-03-17 04:08:54
Hello, I have a purchased 96kHz/24bit FLAC file I'd like to resample/downsample to 44.1/16 for mobile use. What is the recommended way to accomplish this?


I was just wondering the same thing, but in my case, I'm worried about the word lenght reduction.
Going from 24 bits to 16 bits, is it important to use dithering? Is it irrelevant?
Or should I take the default behavior from my converter and forget about it?

Thanks and best regards.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: knutinh on 2014-03-17 08:12:46
For what its worth, I don't even think bad ones work like that.  At least their is no advantage for polynomial based resamplers, which are what most high speed, lower accuracy resamplers use.

I am aware of polyphase based resamplers, but what is "polynomial based" resamplers?

I am sure that the clever people here can find interesting corner-cases, but that would only obfuscate the OP question: it probably will work fine. If you are sceptical, try for yourself, and if you find that it matters, report your findings back here.

-k
Title: Best method to downsample 96kHz/24bit FLAC
Post by: [JAZ] on 2014-03-17 19:54:48
Polynomial (http://en.wikipedia.org/wiki/Polynomial).

Polynomial resamplers are resamplers that are based on polynomials in order to determine the values between discrete points. So the real difference is how one obtains the formula, and that usually determines the way the algorithm works.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-17 20:56:35
For what its worth, I don't even think bad ones work like that.  At least their is no advantage for polynomial based resamplers, which are what most high speed, lower accuracy resamplers use.

I am aware of polyphase based resamplers, but what is "polynomial based" resamplers?


Techniques that fit a polynomial to perform interpolation. Outside of audio, these are the only techniques in widespread use, and outside of very high quality audio players and mastering applications, they are probably the most widely used family.  Virtually all embedded devices use them for instance, as do most audio drivers.

See:  http://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf (http://yehar.com/blog/wp-content/uploads/2009/08/deip.pdf)
Title: Best method to downsample 96kHz/24bit FLAC
Post by: DVDdoug on 2014-03-17 23:34:15
I've always used whatever was handy for re-samping.  I've NEVER heard any difference between the original and the re-sampled copy.  (I'm always working at 16-bits/44.1kHz or better, and I'm generally resampling between 16/44.1 and 16/48, going  one way or the other between CD and DVD.)



Quote
Going from 24 bits to 16 bits, is it important to use dithering? Is it irrelevant?
Or should I take the default behavior from my converter and forget about it?
It's "standard practice" to dither when downsampling. 

But the truth is, you are not going to hear 16-bit dither (or the effects of dither) under any normal listening conditions.    Nobody will listen to your recording and say, "It sounds like you forgot to dither."      If you downsample to 8-bits, I assume dithering WILL make an audible difference.

Title: Best method to downsample 96kHz/24bit FLAC
Post by: AliceWonder on 2014-03-23 04:43:58
Better results will be with with 48/16 settings (not 44.1/16), because 96=2*48,


This is not true.  Pick whichever destination sampling rate you need.  Most likely this is 44.1k for portable devices.


44.1 kHz as far as I know was never used until the CD format and now is only used for digital distribution because of legacy. They had to initially to make burning audio CDs easier, and now it is just habit.

Many mobile devices do video as well and video is generally 48 kHz. Every audio-only mobile player I have had has had no problem with my 48 kHz mp3s.

I really see no reason to go to 44.1 kHz if you aren't going to burn an audio CD from it.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-23 04:54:16
44.1 kHz as far as I know was never used until the CD format and now is only used for digital distribution because of legacy. They had to initially to make burning audio CDs easier, and now it is just habit.


CDs were around for a long time before burners existed, but ignoring that, what does this have to do with anything?

Many mobile devices do video as well and video is generally 48 kHz. Every audio-only mobile player I have had has had no problem with my 48 kHz mp3s.


No one is saying that devices have a "problem" with 48kHz mp3s.

I really see no reason to go to 44.1 kHz if you aren't going to burn an audio CD from it.


Then you haven't read this thread.  As I said above, you should use 44.1k with hardware devices that run at 44.1k. 
Title: Best method to downsample 96kHz/24bit FLAC
Post by: AliceWonder on 2014-03-23 17:53:12
Then you haven't read this thread.  As I said above, you should use 44.1k with hardware devices that run at 44.1k.


I don't know of any hardware devices, other than audio CD players, that run at 44.1k that can't also do 48k.

44.1k was for audio CDs. It was used for MP3s on digital audio stores because it made burning CDs easier.

It now is primarily used for legacy reasons. Note that opus does not do 44.1k but will resample to 48k upon encode, and plays perfectly fine on any rock-boxed DAP.

Because video is and will continue to be 48k - phasing 44.1k out will mean less resampling for sound cards set to 48k or switching of sample rates on sound cards set to do both.

Most can resample or switch flawlessly but I've seen at least one report here of an audible noise when the sounds card switches from one to the other, and while it has been awhile since it has happened to me, switching audio frequencies has crashed my sound server before requiring a reboot. Both are undoubtedly driver bugs but the less a sound card has to switch (or resample) the less often any bugs in that area will have an opportunity be be exposed.

If video was using 44.1 kHz (and I don't know why they opted for 48 kHz instead) I would be of the opposite opinion - but video is becoming more common and uses 48 khz.

I'll shut up about it now, though, I don't want to be a pedantic pain over what I concede is a very minor thing.
Title: Best method to downsample 96kHz/24bit FLAC
Post by: saratoga on 2014-03-23 18:44:14
Then you haven't read this thread.  As I said above, you should use 44.1k with hardware devices that run at 44.1k.


I don't know of any hardware devices, other than audio CD players, that run at 44.1k that can't also do 48k.


I suspect you are confusing devices that support resampling 48k to 44.1khz with devices that actually run at 48k.  Its relatively rare for a portable music player to run at anything but 44.1k since other sampling rates are very uncommon, but virtually all of them will resample to maintain compatibility with other sampling rates.