Discussion:
Idea to increase "Headroom" with lossless volume change
Wombat
2013-05-02 17:32:11 UTC
Permalink
Not that i am interested in this to much but reading about this
"headroom" it must be something en vogue since the DAC2 arrived.

My brainfart makes only sense if you donŽt already use your player with
digital volume control or you are afraid about normal digital volume
control.

My idea is to pad 16bit files wit zeroes to 24bit and shift the music
content from the upper bits '1->16' to bits '2->17'
This gives you full 6dB headroom and leaves all audio content intact
(only for 16bit stuff)

There you go, 16bit to 24bit, 1 bit softer:

sox input.wav -b 24 output.wav gain -6.020599913


Of course you can reverse everything with a positive value and make it
exactly 1 bit louder.

Me knows no math but 1 bit in dB equals:

20 x log10(2) = 6.020599913
From -6.0205999 on SoX starts to shift the music around bit by bit! One
digit less and it calculates new values with no chance to reverse it
back to original.

For 24bit files you will loose the lowest bit, but this shouldnŽt matter
at all.

You freaks may implement it over config.conf


I wonder about the SoX Team meanwhile. This becomes really impressive!!

I also wonder if that is old news or my reasoning is completely wrong
but donŽt tell me playing with such silly things is not healthy. I know
that...
Any double-check or correction is welcome


P.S. If you have a silent recording that doesnŽt need all bits, means
its peak level is at least 6.03 below maximum, this may be a nice way to
make it louder.


------------------------------------------------------------------------
Wombat's Profile: http://forums.slimdevices.com/member.php?userid=4113
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-02 18:05:04 UTC
Permalink
Post by Wombat
Not that i am interested in this to much but reading about this
"headroom" it must be something en vogue since the DAC2 arrived.
And why would the headroom be an issue?


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Wombat
2013-05-02 19:08:50 UTC
Permalink
Post by Julf
And why would the headroom be an issue?
For example
http://www.hydrogenaudio.org/forums/index.php?showtopic=98753&hl=benchmark
Look closely in the sig of the member John_Siau.

Most likely they created a problem we didnŽt had before we knew it :) I
donŽt worry about it to much but my idea here costs nothing and may give
piece of mind.


------------------------------------------------------------------------
Wombat's Profile: http://forums.slimdevices.com/member.php?userid=4113
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-02 19:22:07 UTC
Permalink
Post by Wombat
For example
http://www.hydrogenaudio.org/forums/index.php?showtopic=98753&hl=benchmark
Look closely in the sig of the member John_Siau.
Most likely they created a problem we didnŽt had before we knew it :) I
donŽt worry about it to much but my idea here costs nothing and may give
piece of mind.
Intersample peaks are not a problem as long as you are in the digital
domain. They only become an issue if the analog stages after (or in)
your DAC have no headroom. It is very, very unusual for analog stages to
have no headroom - usually distortion just increases ever so slightly
when you exceed the nominal maximum signal. In any case, any problems
with headroom are a sign of bad design.


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Wombat
2013-05-02 19:28:47 UTC
Permalink
Post by Julf
Intersample peaks are not a problem as long as you are in the digital
domain. They only become an issue if the analog stages after (or in)
your DAC have no headroom. It is very, very unusual for analog stages to
have no headroom - usually distortion just increases ever so slightly
when you exceed the nominal maximum signal. In any case, any problems
with headroom are a sign of bad design.
May be or may not be. This thread is about creating headroom.


------------------------------------------------------------------------
Wombat's Profile: http://forums.slimdevices.com/member.php?userid=4113
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-02 19:33:00 UTC
Permalink
Post by Wombat
May be or may not be.
Which part don't you agree with?
Post by Wombat
This thread is about creating headroom.
Sure. Is a discussion about the possible need for that headroom
inappropriate?


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
darrenyeats
2013-05-02 20:45:06 UTC
Permalink
Post by Julf
Intersample peaks are not a problem as long as you are in the digital
domain. They only become an issue if the analog stages after (or in)
your DAC have no headroom. It is very, very unusual for analog stages to
have no headroom - usually distortion just increases ever so slightly
when you exceed the nominal maximum signal. In any case, any problems
with headroom are a sign of bad design.
The problem is the oversampling that happens in the DAC. If you have say
a 44kHz input it gets converted to a higher rate internally (still
digital) and some of the new data points can be over 0db.

See
http://forums.slimdevices.com/showthread.php?98661-Some-observations-about-the-Benchmark-DAC1

Regards, Darren


------------------------------------------------------------------------
darrenyeats's Profile: http://forums.slimdevices.com/member.php?userid=10799
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
darrenyeats
2013-05-02 20:59:49 UTC
Permalink
Wow, it seems the HA guy managed to get a 11db intersample peak!
Darren


------------------------------------------------------------------------
darrenyeats's Profile: http://forums.slimdevices.com/member.php?userid=10799
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-02 22:09:23 UTC
Permalink
Post by darrenyeats
The problem is the oversampling that happens in the DAC. If you have say
a 44kHz input it gets converted to a higher rate internally (still
digital) and some of the new data points can be over 0db. Benchmark
refer to this as "DSP headroom" in their DAC2 marketing materials;
except they say 3.5db of digital headroom is required.
Yes, but any DSP operation can result in overflow, and that has to be
accounted for. I would call performing DSP operations without checking
for overflow a design error. Sounds a bit funny to promote lack of that
particular design error as a special feature.


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Archimago
2013-05-03 02:46:33 UTC
Permalink
Post by Julf
Yes, but any DSP operation can result in overflow, and that has to be
accounted for. I would call performing DSP operations without checking
for overflow a design error. Sounds a bit funny to promote lack of that
particular design error as a special feature.
That's what I was thinking as well...

Odd that the Benchmark DAC1 didn't account for the headroom doing ASRC
upsampling - I presume that is the implication. You always have to do
this.

Do we have conclusive evidence that this is a problem with the DAC1. As
per my discussion with Darren in the DAC1 thread; I haven't seen proof.
Maybe the 3.5dB headroom they speak of is just hype and they already did
this in the DAC1 to some extent ;-)


------------------------------------------------------------------------
Archimago's Profile: http://forums.slimdevices.com/member.php?userid=2207
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Mnyb
2013-05-03 05:53:18 UTC
Permalink
Won't this only really be a problem with loudness war recordings that
sound so good anyway :)

Would a more " natural " signal that just touches 0dB for one sample be
a problem to ?

Is this really limited to asrc ? could not any digital filter used have
this problem .


------------------------------------------------------------------------
Mnyb's Profile: http://forums.slimdevices.com/member.php?userid=4143
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-03 07:30:00 UTC
Permalink
Post by Mnyb
Would a more " natural " signal that just touches 0dB for one sample be
a problem to?
Yes.
Post by Mnyb
Is this really limited to asrc ? could not any digital filter used have
this problem .
It is a problem in any situation where you have to interpolate between
two samples, so most DSP operations are susceptible.

It's just easier to explain in the context of sample rate conversion
(especially upsampling). Imagine you have an original signal that has
two consecutive samples at 0dB. If you are upsampling to double the
sample rate, you will insert a sample between the two "old" samples and
interpolate - and it is pretty clear that the interpolated value is
higher than 0 dB.

Wish I had time to draw the picture....


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-03 15:43:59 UTC
Permalink
Post by Julf
Wish I had time to draw the picture....
Found a very good discussion on the topic: 'Gearsluz - Tips and
techniques: Intersample peaks'
(http://www.gearslutz.com/board/showwiki.php?title=Tips-and-Techniques:Intersample-peaks)

A relevant quote: "Ceilings of .3 or .1 etc dBFS are arbitrary. What
matters are the real/intersample/reconstructed peaks. Clean processing
only produces fractions of dB's overshot, aggressive loudness treatments
can make for several dB's, and worst case signals can in some situations
give two digit numbers of dB's overshot!"


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Archimago
2013-05-04 14:36:02 UTC
Permalink
Hi guys, I wanted to quickly see how much headroom is needed for
probably the loudest clipped/compressed/limited track I have in my
collection to examine the effect in real "music". From the Iggy & The
Stooges album "Raw Power".

--------------------------------------------------------------------------------
Analyzed: Iggy & The Stooges / Raw Power (1997 Iggy Remix, FLAC)
--------------------------------------------------------------------------------

DR Peak RMS Duration Track
--------------------------------------------------------------------------------
DR0 0.00 dB -2.08 dB 3:29 01-Search And Destroy
DR1 0.00 dB -2.27 dB 3:33 02-Gimme Danger
DR0 0.00 dB -0.79 dB 4:55 03-Your Pretty Face Is Going To
Hell
DR2 0.00 dB -3.17 dB 3:42 04-Penetration
DR2 0.00 dB -3.30 dB 4:16 05-Raw Power
DR2 0.00 dB -4.05 dB 4:53 06-I Need Somebody
DR1 0.00 dB -1.73 dB 3:05 07-Shake Appeal
DR1 0.00 dB -2.80 dB 6:07 08-Death Trip
--------------------------------------------------------------------------------

Number of tracks: 8
Official DR value: DR1

DR value of 1!!! The loudest track in there is "Your Pretty Face Is
Going To Hell" - DR0 with RMS dynamic range of 0.79dB!

Behold:
14777

Let's reduce the track by 6dB:
14778

Using dBPowerAmp ASRC to upsample to 192kHz:
14779

Peak volume from -6dB when upsampled has turned to -3.7 (Left), -3.76
(Right) for the intersample peaks. This means there was a need for 2.3dB
volume headroom using this ASRC algorithm. Benchmark's 3.5dB overhead
looks very reasonable...

I think it's important to note that tracks like these are really bad
sounding (no kidding)! In fact, I increasing the ASRC volume up to +6dB
(no headroom) and compared with the original nasty clipped copy off the
CD, I cannot ABX the difference even though I know it's clipping even
more.


+-------------------------------------------------------------------+
|Filename: ASRC_192.jpg |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=14779|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
Archimago's Profile: http://forums.slimdevices.com/member.php?userid=2207
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Wombat
2013-05-04 15:52:42 UTC
Permalink
Thanks, i pretty much think that is it. SoX for example does a gain drop
by 3dB when automaticaly guarding for clipping. Like Julf and others
already mentioned the DAC designer itself should already think about
such things when he has processing in mind.
Somehow Benchmark is now the first time i noticed this is sold as new
must have feature.

My attention here lied on "lossless" volume change. I didnŽt know before
it is possible and now that i found out i wondered what to do with it
;)
btw. For people changing volume lossless in 16 bit files with headroom
making it 1 bit louder SoX needs to disable dither with the -D switch.


------------------------------------------------------------------------
Wombat's Profile: http://forums.slimdevices.com/member.php?userid=4113
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
darrenyeats
2013-05-03 08:03:28 UTC
Permalink
Chaps,
Think about it, even the DAC2 does not accommodate arbitrarily large
peaks! The HA thread indicates some are up to 11db and a BM guy pops up
saying you can get more headroom by not maxing the volume.

That right there should tell us that we shouldn't assume a DAC just
deals with it.

I wonder whether what is trivial off-line is less easy in real-time? Or
would a sacrifice in SNR be required, which the marketing department
would hate? Not sure.
Darren

Sent from my HTC Sensation Z710e using Tapatalk 2


------------------------------------------------------------------------
darrenyeats's Profile: http://forums.slimdevices.com/member.php?userid=10799
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Archimago
2013-05-03 15:28:15 UTC
Permalink
Post by darrenyeats
Chaps,
Think about it, even the DAC2 does not accommodate -arbitrarily large-
peaks. The HA thread indicates some are up to 11db and a BM guy pops up
saying you can get more than 3.5db headroom by not maxing the volume.
That right there tells us not to assume anything.
I wonder whether what is trivial off-line is less easy (or requires a
sacrifice in SNR, which the marketing department would hate) in real
time? Not sure.
Darren
Sent from my HTC Sensation Z710e using Tapatalk 2
Maybe it's best then just to NOT do any upsampling if this is the case -
jitter be damned! Will have to look into this further this weekend...
The "Raw Power" CD with DR1 might be an interesting case in extreme
clipping if one were to upsample and see where these peaks lie.

I remain a bit disturbed that the DAC1 would perform upsampling without
*some* amplitude headroom... I really want to see evidence of this like
the Ken Rockwell square wave spectrum plot between max volume and maybe
-6 dB to look for harmonic changes. I might have a peek at this with my
Essence One with & without upsampling enabled to see if ASUS did it
right.


------------------------------------------------------------------------
Archimago's Profile: http://forums.slimdevices.com/member.php?userid=2207
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
darrenyeats
2013-05-04 18:28:53 UTC
Permalink
Archimago,
As mentioned on PFM, try the track I Can Talk by Two Door Cinema Club
from the album Tourist History. DR4 with one inter-sample peak of +1.4b
and a very large number of peaks at about plus half a decibel.
Darren

Sent from my Nexus 10 using Tapatalk HD


------------------------------------------------------------------------
darrenyeats's Profile: http://forums.slimdevices.com/member.php?userid=10799
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Archimago
2013-05-04 20:52:53 UTC
Permalink
Post by darrenyeats
Archimago,
As mentioned on PFM, try the track I Can Talk by Two Door Cinema Club
from the album Tourist History. DR4 with one inter-sample peak of +1.4b
and a very large number of peaks at about plus half a decibel.
Darren
Sent from my Nexus 10 using Tapatalk HD
DR4 eh? That's positively dynamic compared to Iggy and his DR0 :-).

Here's what I see with that Two Door Cinema Club track -

Original:
14780

-3dB cut for headroom (figure from your comments that was all that was
needed):
14781

ASRC upsample to 192kHz:
14782

Peaks now go from -3dB to -1.47dB. Headroom needed for this track:
1.53dB using the dBPowerAmp upsampler - pretty close to your +1.4dB.

I want to see a *real* piece of music (not some synthetic test tone)
that needs +5dB headroom (not to mention +11dB as in one of the other
threads). I'm thinking a 3dB headroom (1/2-bit) should be enough for
upsampling...


+-------------------------------------------------------------------+
|Filename: ASRC.jpg |
|Download: http://forums.slimdevices.com/attachment.php?attachmentid=14782|
+-------------------------------------------------------------------+

------------------------------------------------------------------------
Archimago's Profile: http://forums.slimdevices.com/member.php?userid=2207
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Julf
2013-05-05 09:57:11 UTC
Permalink
Post by Archimago
I want to see a *real* piece of music (not some synthetic test tone)
that needs +5dB headroom (not to mention +11dB as in one of the other
threads). I'm thinking a 3dB headroom (1/2-bit) should be enough for
upsampling...
And even if you hit that very special +11 dB beast, all that happens is
that you clip one sample period. How much clipping was there in that
Iggy recording again? :)


------------------------------------------------------------------------
Julf's Profile: http://forums.slimdevices.com/member.php?userid=42050
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Archimago
2013-05-06 06:40:44 UTC
Permalink
Post by Julf
And even if you hit that very special +11 dB beast, all that happens is
that you clip one sample period. How much clipping was there in that
Iggy recording again? :)
Yup. And since we're upsampling, the duration of that sample period is
even briefer.


------------------------------------------------------------------------
Archimago's Profile: http://forums.slimdevices.com/member.php?userid=2207
View this thread: http://forums.slimdevices.com/showthread.php?t=98706
Loading...