Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Resampling Hi-Res Audio (Read 15263 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Resampling Hi-Res Audio

Hello Forum!

I have read some threads and am trying to understand how to down-sample FLAC files and would welcome any advice.

My music collection is played mostly through my ipod classic 160GB. I also listen through itunes on my PC.

Currently its in .mp4 format and I am in the process of converting the library to to ALAC

I now have some Hi-Res stuff ranging from 24-44 to 24-192

If I understand correctly my ipod classic can play files up to 24-48?

I figure I'd down-sample the Hi-Res stuff to 24-44 or 24-48 depending on the source (96/2=48, 48 divides into 192, 44.1 into 88 etc).

QUESTION:

After converting the FLAC to WAV, and then using Foobar2000 with foo dsp resampler,

For a 192Hz file should I first bring it down to 96Hz then do it once again to 48?

QUESTION:

I only need the one plugin?

QUESTION?

Its as simple as I've described? No extra steps needed to avoid audible errors?



Thank-you for reading!










Re: Resampling Hi-Res Audio

Reply #1
Quote
I figure I'd down-sample the Hi-Res stuff to 24-44 or 24-48 depending on the source (96/2=48, 48 divides into 192, 44.1 into 88 etc).


Pick one and use it for everything.  I'd lean towards 44.1k because it tends to be more commonly used for music.

Quote
After converting the FLAC to WAV, and then using Foobar2000 with foo dsp resampler,


Don't convert to wav, you'll lose your tags.  Just load the files in foobar, and transcode to the new format with the resampler set to whatever sampling rate you decide on.

Quote
For a 192Hz file should I first bring it down to 96Hz then do it once again to 48?


No.  Don't try to outsmart foobar.


Re: Resampling Hi-Res Audio

Reply #2
Gracias saratoga

Another question I have is that the author of the guide Im using suggests using "channel mixer", "Advanced Limiter" and "Dither".

If Im not changing the bit depth are these things necessary?

Re: Resampling Hi-Res Audio

Reply #3
Quote
Im using suggests using "channel mixer", "Advanced Limiter" and "Dither".
I'd say less processing is better...  unless you want to change the sound in some way.

I assume the channel mixer is for mixing-down from 5.1 or 7.1 to 2-channel stereo.

You don't need a limiter unless you are boosting the volume to the point of clipping and you want to "round over" the peaks instead of ending-up with hard-clipped peaks.

Dither is supposed to help when you downsample the bit depth.  At 16-bits (or better) the dither is somewhere around -90dB down and you can't hear the dither (or the effects of dither).  If you downsample to 8-bits, dither will probably make an improvement (But I don't use 8-bit files and I've never tried it). "Everybody does it" and it doesn't hurt, but IMO if you can't hear the difference it doesn't matter.

Re: Resampling Hi-Res Audio

Reply #4
Hi-rez is just as often peak-normalized as everything else is?  It isn't so that the signal peaks at negative xx decibels?

Re: Resampling Hi-Res Audio

Reply #5
If Im not changing the bit depth are these things necessary?

Resampling usually needs to be followed by peak limiting, as it may introduce overs.
Brickwalling your peaks at -1 db doesn't hurt. Just make sure apply all processing before any dithering.

Re: Resampling Hi-Res Audio

Reply #6
If Im not changing the bit depth are these things necessary?

Resampling usually needs to be followed by peak limiting, as it may introduce overs.
Brickwalling your peaks at -1 db doesn't hurt. Just make sure apply all processing before any dithering.

Peak limiting itself may cause more problems as it solves. Normaly you won't hear slightly clipped samples from resampling. If you want to prevent it just lower the overall level, like with normalizing.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: Resampling Hi-Res Audio

Reply #7
I have found that .mp3 and .mp4 are louder than ALAC on my ipod classic.

I don't wish to lower the overall level because of this.

I can really crank up my itunes on my PC though with good quality headphones, though it would suck if I could hear clicks or distortions etc. (i.e. clipping?).

I was intending on deleting the bloated Hi-Res files once resampled and then converted to ALAC so I hope I get it right the first time. I could return to the store worst case...

Is it time consuming to analyze a resampled album for clipping and overs?

Re: Resampling Hi-Res Audio

Reply #8
Quote
Normaly you won't hear slightly clipped samples from resampling


True. It is however an option if you are being pedantic, which of course leads to being even more pedantic with respect to limiter choice/settings.

Re: Resampling Hi-Res Audio

Reply #9
Is it time consuming to analyze a resampled album for clipping and overs?


In foobar2000, select the files you want to analyze > right click > replaygain > scan per-file track gain

Files with Track peak 1.000000 are possibly clipped, but doesn't automatically mean they have audible distortion. You still need to listen to the files to check them, doing so can be very time consuming.

At last, click Cancel to close the result window.

Re: Resampling Hi-Res Audio

Reply #10
Quote
Is it time consuming to analyze a resampled album for clipping and overs?
You can't analyze after conversion.  You'd have to re-sample to floating-point, then analyze before converting back to 24-bits.  Integer files are limited to 0dBFS so there are no "overs" in the digital data and there's no way of knowing if a 0dB sample should have gone over 0dB.  (Several 0dB samples in a row usually indicates clipping, but several 0dB samples in a row are probably not from inter-sample overs.)

And, many commercial recordings already have some clipping so it's hard to know if clipping was caused by the resampling. 

Quote
I can really crank up my itunes on my PC though with good quality headphones, though it would suck if I could hear clicks or distortions etc. (i.e. clipping?).
I'd be amazed if you can hear the slight (and short duration) clipping due to inter-sample overs. 

In theory limiting should be less audible, but with limiting you are still altering (distorting) the waveform and if you can't hear the clipping you can't get audibly better than that!

If you are paranoid you could re-sample to floating point, normalize, and then convert to integer.  That would, of course, reduce the volume of any files with overs.  (I'm not that paranoid and I don't worry about inter-sample overs.)

Re: Resampling Hi-Res Audio

Reply #11
Right. Convert into float is the most reliable (and more time consuming) method and replaygain scans can show Track peaks larger than 1. Lossy formats like mp3/aac can be decoded into float therefore their scanning results are often larger than 1.

Re: Resampling Hi-Res Audio

Reply #12
In the end any format is always converted to integer as that is the format of DA conversion. How does a MP3 conversion code producing integer PCM samples for playback differ from the code producing integer PCM samples for FLAC compression? IMO the very same clipping will occur in both cases.

Re: Resampling Hi-Res Audio

Reply #13
Quote
In the end any format is always converted to integer as that is the format of DA conversion.
True!

Quote
How does a MP3 conversion code producing integer PCM samples for playback differ from the code producing integer PCM samples for FLAC compression? IMO the very same clipping will occur in both cases.
Sometimes there is a digital volume control, so the full-scale integer data isn't always sent to the DAC.    If the MP3 decoder generates floating-point and the DSP volume control works in floating-point, you can avoid clipping.

But, I've NEVER heard of this slight-clipping causing audible artifacts....  I've never heard of a case where MP3 encoding was non-transparent, but then became transparent when the volume was reduced (before encoding) to keep the peaks below 0dB.

You can also boost the volume in an audio editor above 0dB (most audio editors use floating-point) and as long as you're not listening at full-volume you may not clip your DAC.  So, sometimes people don't know there's a problem 'till they render to (integer) WAV.

Re: Resampling Hi-Res Audio

Reply #14
Resampling usually needs to be followed by peak limiting, as it may introduce overs.
Brickwalling your peaks at -1 db doesn't hurt.

That's a bad idea.

I wouldn't worry about any of this. Just resample it to 44/16 or 44/24 and leave it alone.

However, any "high res" purchase that hits 0dB FS or generates inter-sample overs should be returned for a refund and shamed on these forums.

Cheers,
David.

Re: Resampling Hi-Res Audio

Reply #15
However, any "high res" purchase that hits 0dB FS or generates inter-sample overs should be returned for a refund and shamed on these forums.

Unfortunately the market has already noticed that we so called Audacity Cowboys look fo clipping. Recent HiBit releases often have maximum peaks exactly constant on all tracks like as last step simply a lowering of volume is done. The DR loudnes database is full with that info.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Re: Resampling Hi-Res Audio

Reply #16
Quote
However, any "high res" purchase that hits 0dB FS or generates inter-sample overs should be returned for a refund and shamed on these forums.


I agree, but the source doesn't generate overs. If inter-sample overs occur during playback (of the original "high res" source), it is mostly due to the re-sampling algorithm present in the device.
But yes, overs don't occur all the time (during re-sampled playback). It's a combo of prone source material and crappy conversion algorithms.

Re: Resampling Hi-Res Audio

Reply #17
Quote
However, any "high res" purchase that hits 0dB FS or generates inter-sample overs should be returned for a refund and shamed on these forums.


I agree, but the source doesn't generate overs. If inter-sample overs occur during playback (of the original "high res" source), it is mostly due to the re-sampling algorithm present in the device.
Well, if ideal Nyquist sinc resampling yields inter-sample overs, then the source implicitly contains inter-sample overs IMO.

"high res" sources shouldn't be getting anywhere near this. I know some do, but it's a bad joke if they do. It implies a level of quality control and an attitude to recording that can't even get the best out of a 128kbps mp3, never mind a CD or something that claims to be "better".

Cheers,
David.

Re: Resampling Hi-Res Audio

Reply #18
However, any "high res" purchase that hits 0dB FS or generates inter-sample overs should be returned for a refund and shamed on these forums.
Why not insist on having the original 32 bit fp data that is the master format in most digital audio workstations? It allows almost lossless level reduction if your DAC can't handle the peaks.

Re: Resampling Hi-Res Audio

Reply #19
I have tried to find music where intersample clipping produces audible issues but haven't found any. From synthetic tests on numerous sound cards I know integrated and normal consumer cards all have problems handling intersample overs but in music the distortion seems to get hidden. A synthetic test file that has peak 4 dB above full scale requires 3-4 dB volume reduction on the sound cards and DACs I tested to not glitch. Highest intersample peak I found in my music files peaks 4.7 dB above digital full scale, yet it sounds fine to my ears. I didn't try careful ABXing though.

In case anyone cares to find problematic intersamples in their files, here's a foobar2000 component I made for the purpose. It uses resampling routines from the player and I recommend installing lvqcl's excellent SoX resampler for highest quality results and improved scanning speed.[attachment=8084:foo_true...truepeak.fb2k-component]

Re: Resampling Hi-Res Audio

Reply #20
If the MP3 decoder generates floating-point and the DSP volume control works in floating-point, you can avoid clipping.


Yes, in this specific case. In other cases the OS volume control is applied to integer. If using volume control facility provided by the soundcard, it is always integer-based. Too late for any clipping protection.

IMO it is a nonissue.

Re: Resampling Hi-Res Audio

Reply #21
In case anyone cares to find problematic intersamples in their files, here's a foobar2000 component I made for the purpose. It uses resampling routines from the player and I recommend installing lvqcl's excellent SoX resampler for highest quality results and improved scanning speed.[attachment=8084:foo_true...truepeak.fb2k-component]


I've just installed this component, but how do I now scan the files?

Re: Resampling Hi-Res Audio

Reply #22
However, any "high res" purchase that hits 0dB FS or generates inter-sample overs should be returned for a refund and shamed on these forums.
The same should apply to Redbook Audio CD releases, but that would probably exceed the storage capacity of the webspace this forum is hosted on.
It's only audiophile if it's inconvenient.

Re: Resampling Hi-Res Audio

Reply #23
I've just installed this component, but how do I now scan the files?

Select the files then right click them and use one of the Scan true-peaks options from the ReplayGain menu.

Re: Resampling Hi-Res Audio

Reply #24
I have tried to find music where intersample clipping produces audible issues but haven't found any. From synthetic tests on numerous sound cards I know integrated and normal consumer cards all have problems handling intersample overs but in music the distortion seems to get hidden. A synthetic test file that has peak 4 dB above full scale requires 3-4 dB volume reduction on the sound cards and DACs I tested to not glitch. Highest intersample peak I found in my music files peaks 4.7 dB above digital full scale, yet it sounds fine to my ears. I didn't try careful ABXing though.

In case anyone cares to find problematic intersamples in their files, here's a foobar2000 component I made for the purpose. It uses resampling routines from the player and I recommend installing lvqcl's excellent SoX resampler for highest quality results and improved scanning speed.[attachment=8084:foo_true...truepeak.fb2k-component]



You are describing a 2-part problem:

(1) Music that creates inter-sample overages.

(2) Inter-sample overages that are audible.

Creating files with inter-sample overages is IME something that "just happens"  during normal audio production of new recordings if you are trying to keep peak levels near FS.

When I was producing stereo tracks from multitrack recordings they just seemed to happen from time to time.  When I noticed them I sample edited the file to smooth them out of existence.  They were rare enough for that to be feasible, but they showed up in every so many minutes of recording. This was 5 or more years ago so I can't remember many details.

I've never studied whether inter-sample overages are audible.  The concern is of course that they are a kind of clipping, and clipping can be audible, that they might be audible.

There is an existing ABX test that studies the audibility of relatively infrequent clipping here:  Link to highly diagnostic file for clipping with very rare clipping added

I think that the above test shows that under certain ideal conditions, very sparse clipping can be highly audible.  However, while it is based on a natural sound recorded acoustically, the spectral contents of my test files  are miles away from being like typical music.

(1) I conclude that creating inter-sample overages is a natural consequence of many common audio production operations if the file(s) involved have peak values that are within a few dB of FS.

(2) It seems to me but I have not proven to my own satisfaction that under certain ideal conditions, inter-sample overages may be highly audible.