192kHz/24bit FLAC to ALAC
Sep 6, 2012 at 11:46 PM Thread Starter Post #1 of 18

Angels and Air

100+ Head-Fier
Joined
Feb 9, 2012
Posts
174
Likes
12
So I'm thinking of buying Green Day's "American Idiot" off of HDTracks in 192kHz/24bit FLAC Format...
 
I know I don't have the proper equipment (DAC, Audiophile Headphones) to take full advantage of the sound quality, but I'm set on buying it anyway since I was pretty unimpressed by the amount of dynamic range in the CD Version...
 
Hopefully when I upgrade my equipment (eventually), I'll be amazed by the sound quality! 
beyersmile.png

 
Few Questions:
1. If I convert the 192kHz/24bit FLAC File to ALAC, will it be downsampled?
2. Does ALAC even support 192kHz/24bit...?
3. If I able to convert FLAC to ALAC without a reduce in sound quality, will I be able to play the 192kHz/24bit ALAC File on my iPhone/iPod or will it be downsampled?
4. What's the average bit rate for 192kHz/24bit? Guessing it'll be HUGE, probably won't be able to fit it on my iPhone... 
tongue.gif

 
Thanks!
 
Sep 7, 2012 at 12:32 AM Post #2 of 18
1) Not that I've found.
2) It sure seems to when I convert it. Reads the proper rate through my DAC.
3) No. Unless you're doing fancy stuff on the software and hardware end.
4) Roughly 6-7k Bit Rate wise.
 
Also...I can't imagine anything by Green Day would sound any less worse no matter how high the bit rate is. :D
 
I've got quite a few things from HD Track and converted them to ALAC. The rates read correctly in Audirvana Plus and on my DACs read out. 
 
Sep 7, 2012 at 3:51 AM Post #3 of 18
x2 on everything MorbidToaster said.  I have observed the same, both with 192 and 96.
 
Now here's the thing - the iPod family only supports ALAC thru 48.  But don't despair -- 96 and 192 are exact multiples of 48 (not the case with redbook 44.1), so the down conversion is merely a decimation, not a messy interpolation.  I use xrecode II on the PC (this is NOT free, but well worth the small fee IMHO) and it nails the job.
 
The 48 ALACs sound fantastic on my iMods with Wolfson DACs.  Really.  I basically buy 96 off the web, or rip DVD-A's at 96.  Then downcovert to 48 ALAC.
 
At meets people drop their jaws when they hear these tracks -- I get comments like "what recording is that?  I've never head Metallica sound so good" etc.
 
More: I love this so much that when I rip redbook CDs at 44.1, I upsample with careful antialiasing control to 96, then decimate to 48 ALAC.  I think it sounds better on the iMod than the 44.1 original.  This is controvesial, people tell me I'm crazy.  But think this way: a lot of DACs internally upsample as a first step in their elaborate algorithm to produce an analog interpolate.  I'm just doing it first, doing it for them, off-line with a superior algorithm, much more computing power, and no hard real-time constraint on the computation.
 
YMMV
 
Sep 7, 2012 at 10:09 AM Post #4 of 18
Quote:
Now here's the thing - the iPod family only supports ALAC thru 48.  But don't despair -- 96 and 192 are exact multiples of 48 (not the case with redbook 44.1), so the down conversion is merely a decimation, not a messy interpolation.

Interpolation is just as "messy" as decimation. In both cases the conversion includes a low pass filter. Every single sample that appears on the output is being processed.
 
Quote:
More: I love this so much that when I rip redbook CDs at 44.1, I upsample with careful antialiasing control to 96, then decimate to 48 ALAC.  I think it sounds better on the iMod than the 44.1 original.

So you resample (interpolation+decimation) from 44.1 to 96 and then again (decimation) down to 48? What's the point of that other than degrading the signal twice?
 
 
Quote:
This is controvesial, people tell me I'm crazy.  But think this way: a lot of DACs internally upsample as a first step in their elaborate algorithm to produce an analog interpolate.  I'm just doing it first, doing it for them, off-line with a superior algorithm, much more computing power, and no hard real-time constraint on the computation.

Oversampling DACs don't just upsample, they interpolate and increase the sampling rate e.g. by a factor of 128 to a couple of MHz.
 
Sep 8, 2012 at 2:06 PM Post #5 of 18
Well I can't speak to what is done in actual firmware in specific gear, nor in third-party commercial or free software packages (I guess I could read the code for those packages in the public domain; I haven't) but I do know my math.  Exact decimation is much easier than interpolation, since you know the exact readings at the to-be-converted-to-sample points.  Zero error.  No filter at all.  Again, this is on paper.  I don't know what is actually done, but I know what I can do.  With time-aligned signals.
 
You may be right in common practice, indeed, but that doesn't stop me from doing my own exact sub-sample.
 
When I go from 96 to 48 I am degrading the signal exactly as much as I have to, no more.  And --- again the math is simple -- to go from 44.1 to 48 you have a choice, and my way -- 44.1 to 96 then decimate -- may in fact be better than someone else's direct interpolation from 44.1 to 48.  Indeed there must be one filter involved.  This is a kind of oversampling, really it is -- I didn't mean to imply it is like Wadia's or others that go way way up.  You have a good point though -- I should really go from 44.1 to some HUGE multiple of 48, then decimate.  That's better on paper.
 
I assume the Wolfson DACs are best at 48.  I don't know this.  All guess work.  But I do know that lots of people react (yes, I realize this is not rigorous DBT, but still sample-size-one biased experiments when replicated do tell us something, contrary to popular opinion in the Sound Science forum, and I really do know what I am talking about when it comesto statistics, trust me, I won the Journal of American Statistical Assoication's Theory and Methods award ... alas, a long time ago, but I haven't lost much ... the memory is the second thing to go .. I hope) quite remarkably to these tracks on my iMod + iCube. 
 
Having said that, I really should do a blind test.  The same track, from a redbook CD, also available on a DVD-A version, where the liner notes indicate it really is hi res.  Then give people 4 tracks:
 
  • 44.1 ALAC (redbook)
  • 48 ALAC via 44.1 to 96 to 48 (redbook)
  • 48 ALAC via 96 tp 48 (DVD-A) -- the two-track version (when there is one on the DVD-A)
  • 48 ALAC via 96 to 48 (DVD-A) -- the 5.1 version from the DVD-A  mixed down by me to two-track
 
In my non-rigorous tests I observe that people order these 4 > 2 > 3 > 1.
 
I would have thought 4 > 3 > 2 > 1 ... but it seems a lot of the 2-track mixdowns on DVD-A's were rush jobs.  Honestly the 2, 3 order probablyy varies a lot.  I know a lot of people say that even 96 is a joke, and would expect all 4 of these to be the same ... maybe the mastering is better on the DVD-A's who knows. 
 
All I know is that with Wolfson and 5.5 Gen iPods converted to iMods by Vinnie, and a good amp, I am happiest with the DVD-A 96 5.1 downmixed and downsampled by me, then next happiest with 44.1 converted my way to 48, not directly.  Over and over.  I'm not hurting anyone, I am not denying global warming, so I plan to continue.
 
Sep 8, 2012 at 3:05 PM Post #6 of 18
Quote:
Originally Posted by wavoman /img/forum/go_quote.gif
 
When I go from 96 to 48 I am degrading the signal exactly as much as I have to, no more.  And --- again the math is simple -- to go from 44.1 to 48 you have a choice, and my way -- 44.1 to 96 then decimate -- may in fact be better than someone else's direct interpolation from 44.1 to 48.

 
For the downsampling from 96 to 48 kHz, you do need a lowpass filter to avoid aliasing, you cannot just throw away every other sample, because that mirrors back the 24 to 48 kHz range to 24 to 0 kHz. That is, unless the 96 kHz signal already contains nothing above 24 kHz. However, if your interpolation for 44.1->96 conversion is already so good that there is negligible imaging to >24 kHz, then you might just as well interpolate from 44.1 to 48 kHz in the first place, and get the same quality with less processing. The one case in which the 44.1->96->48 conversion makes sense is if the total CPU time needed for a cheap interpolation and a FIR filter is less than that of a high quality interpolation from 44.1 to 48 kHz (the cost of interpolation is a linear function of the window size, while it is logarithmic for FFT convolution).
In any case, a good converter will use whatever solution that gives the best results in the least amount of time. It is definitely possible to write (and I already did so) a 44.1->48 kHz interpolation that is audibly transparent, and runs much faster than real time on current CPUs.
 
Sep 8, 2012 at 3:30 PM Post #7 of 18
Yes the high-pass filter is first. 
 
On to the second point -- My idea was to remove any interpolation from the firmware, do it all on my PC in advance.  My direct 44.1 to 48 did not seem to work as well ... but your code does it better it seems (I heard problems with mine).
 
Do you make your code 44.1 to 48 code available?  What does it run on?  I would pay for this.  PM me if interested.
 
Again, I am just guessing what goes on inside the Wolfson.  Someone who works there might know and tell me this is all hogwash.
 
Sep 8, 2012 at 3:44 PM Post #8 of 18
Quote:
Well I can't speak to what is done in actual firmware in specific gear, nor in third-party commercial or free software packages (I guess I could read the code for those packages in the public domain; I haven't) but I do know my math.  Exact decimation is much easier than interpolation, since you know the exact readings at the to-be-converted-to-sample points.  Zero error.  No filter at all.  Again, this is on paper.  I don't know what is actually done, but I know what I can do.  With time-aligned signals.

But I can tell you what happens in the software. I've developed resamplers myself. Decimation is as easy as interpolation. In one case you low pass filter the signal and drop samples, in the other you add zero-valued samples and low pass filter the signal.
 
Quote:
You may be right in common practice, indeed, but that doesn't stop me from doing my own exact sub-sample.
 
When I go from 96 to 48 I am degrading the signal exactly as much as I have to, no more.  And --- again the math is simple -- to go from 44.1 to 48 you have a choice, and my way -- 44.1 to 96 then decimate -- may in fact be better than someone else's direct interpolation from 44.1 to 48.  Indeed there must be one filter involved.  This is a kind of oversampling, really it is -- I didn't mean to imply it is like Wadia's or others that go way way up.  You have a good point though -- I should really go from 44.1 to some HUGE multiple of 48, then decimate.  That's better on paper.

Going from 44.1 to 48 the math is just as simple, the implementation less so. The only choice I see to resample 44.1 to 48 kHz is using a resampling factor of 160/147 instead of going from 44.1 to 96 (factor 320/147) and then again to 48 (factor 1/2).
Unless the resampler is broken you don't need to go to some huge multiple at all..
 
Anyway, you're using xrecode II right? I just tested it, it's not looking good at all:
 
First you convert from 44.1 to 96 kHz, which involves a low pass filter. As you can see xrecode fails pretty badly suppressing images above 22.05 kHz (marked as red dashed line). There's also quite some droop in the passband.

 
Then you go from 96 kHz to 48. There's definitely another low pass filter involved. Also, this shows how bad the filters really are (everything above the red dashed line will be aliased, i.e. mirrored back like stv014 wrote):

 
 
 
As a comparison, here's how resampling is done properly (sox, 44.1 to 48 kHz):

 
and the same but with "allow aliasing" option:

 
 
Quote:
I assume the Wolfson DACs are best at 48.  I don't know this.  All guess work.  But I do know that lots of people react (yes, I realize this is not rigorous DBT, but still sample-size-one biased experiments when replicated do tell us something, contrary to popular opinion in the Sound Science forum, and I really do know what I am talking about when it comesto statistics, trust me, I won the Journal of American Statistical Assoication's Theory and Methods award ... alas, a long time ago, but I haven't lost much ... the memory is the second thing to go .. I hope) quite remarkably to these tracks on my iMod + iCube.

With the filters used above it doesn't matter at all how well the DAC works at 48 kHz. No DAC can undo the "damage".
 
Btw, the iCube has treble roll-off (about -4.5 dB at 20 kHz at any sample rate).
 
 
Quote:
 Having said that, I really should do a blind test.  The same track, from a redbook CD, also available on a DVD-A version, where the liner notes indicate it really is hi res.  Then give people 4 tracks:  
  • 44.1 ALAC (redbook)
  • 48 ALAC via 44.1 to 96 to 48 (redbook)
  • 48 ALAC via 96 tp 48 (DVD-A) -- the two-track version (when there is one on the DVD-A)
  • 48 ALAC via 96 to 48 (DVD-A) -- the 5.1 version from the DVD-A  mixed down by me to two-track
 
In my non-rigorous tests I observe that people order these 4 > 2 > 3 > 1.
 
I would have thought 4 > 3 > 2 > 1 ... but it seems a lot of the 2-track mixdowns on DVD-A's were rush jobs.  Honestly the 2, 3 order probablyy varies a lot.  I know a lot of people say that even 96 is a joke, and would expect all 4 of these to be the same ... maybe the mastering is better on the DVD-A's who knows. 
 
All I know is that with Wolfson and 5.5 Gen iPods converted to iMods by Vinnie, and a good amp, I am happiest with the DVD-A 96 5.1 downmixed and downsampled by me, then next happiest with 44.1 converted my way to 48, not directly.  Over and over.  I'm not hurting anyone, I am not denying global warming, so I plan to continue.

4 being the first doesn't seem to have much to do with how you resampled the file. I guess it's the 5.1 to stereo mixdown and yes the mastering may very well be better too.
 
I'm not saying you are hurting anyone, you're just hurting sound quality.
 
edit: removed a confusing sentence about smart resampling
 
Sep 8, 2012 at 6:33 PM Post #9 of 18
Thanks for taking so much time on this!  I really appreciate the critique.
 
I experimented with both SOX and xrecode to do the original 44.1 to 96, and chose xrecode, not SOX, after looking at selected frequencies, all below 22.05. the obvious cut-off.  I reached the opposite conclusion.  Even with "allow aliasing" on in SOX.
 
But you present spot-on evidence the other way.  I will look at my results again (this was a few years ago).  I saw no drop at all below my selected passband frequency.  You show that is wrong.  So I must be wrong, but I can't figure out what I did incorrecty.  I accept your conclusion!
 
Now, having nothing at all at 24 kHz, I did the half-sample myself.  It was very easy ... no low pass filter.
 
You say this is wrong, and I believe you.  So what did I do?  The result sounds great ... I am sure the roll off in the iQube has something to do with it, matching my old-age hearing roll-off.
 
Once more, I am blown away at how much effort you put in on this to help me!!  Thanks again.
 
Sep 8, 2012 at 7:52 PM Post #10 of 18
You're welcome. Sox is almost flat up to ~21 kHz, even more so with the aliasing option.
 
Some time ago I even made a video that shows what happens with aliasing: https://www.youtube.com/watch?v=Z_G6n2DO_2U (sox without vs. with aliasing). The same sweep is used for both runs, but with aliasing the images are mirrored back.
With 44.1 kHz and the filter sox uses this is no problem since, as you can see, the level drops quickly and is long "gone" before reaching audible frequencies.
 
 
To see how bad just dropping every other sample is generate a sweep, e.g. from 1 kHz to 22.05 kHz using 44.1 kHz sample rate. Use your technique of converting to 96 kHz, then drop every other sample without any filtering (=> 48 kHz). Look at the resulting file using a spectrum analyzer, there won't be a clean sine but two sine waves. (!)
 
Sep 8, 2012 at 9:36 PM Post #11 of 18
That's very clear.  I certainly learned something tonight.
 
I should be able to prove your result on paper, computing the DFT of the half sample.  I thought I proved the opposite a few years ago, I thought it was trivial, but obviously I was wrong.
 
A new day dawns in my filtering life thanks to both of you, xnor and stev014.
 
I will switch back to SOX immediately.  I will allow aliasing. 
 
For redbook tracks, I will go directly from 44.1 to 48 on my desktop before making ALACs for the 5.5 Gen iMod, to optimize (I hope) the performance of the Wolfson DAC.  I will also use SOX to make 96 FLACS for my desktop playlists, which are all uniformly 96 FLACs (some of my downstream equipment does not do well with changing bit rates on the fly -- audible noise).
 
From DVD-A's I will continue to extract only the 5.1 at 96, then mix down to two-track 96.  Now I'm done for the desktop.  The I will use SOX, not my half-sample, to make the 48 ALAC.
 
Done and dusted. 
 
Thanks!!!
 
BTW, diminshed high-frequency hearing (covers up a lot of sins) is the one, single advantage of growing old.   Besides the advantage of not suffering the alternative to not growing old, that is.
 
Sep 15, 2012 at 4:12 AM Post #12 of 18
Yikes... I don't understand what any of you guys are saying! 
tongue.gif

 
Anyway, is there a (free) program I can use to resample 192kHz files to 48kHz (so it's playable on my iPhone)?
 
Does dBpoweramp let you do that?
 
Sep 16, 2012 at 2:07 PM Post #13 of 18
xnor has convinced me that SOX is the program to use.  It is available inside Foobar 2000 (FB2K) as a module.  FB2K and SOX are free. I belive you can call it from dBpoweramp too.
 
You'll want to go from 192x24 FLAC to 48x16 ALAC.
 

Users who are viewing this thread

Back
Top