IPB

Welcome Guest ( Log In | Register )

Pathological example of a intersample peak, 11dB, discussion.
Rescator
post Jan 10 2013, 04:36
Post #1





Group: Members
Posts: 73
Joined: 13-January 09
From: Trondheim
Member No.: 65515



Pathological example of a intersample peak that was artificially created:

~0dB peak, ~20dBFS RMS (squarewave), +10.87dB intersample peak, 44.1KHz, 32bit float.

http://www.hydrogenaudio.org/forums/index....showtopic=98752

Please keep any discussion of the test sample in this tread, rather than where it's simply "stored".


The problem:
If oversampled the true peak is reveal to be almost +11dB.
A DAC would need 11dB headroom (or alternatively ~12dB which equals 2 bits) to handle this wav correctly.

The solution?:
A "quick fix" for a 24bit (or float) audio chain, would be to reduce the volume by 12dB somewhere.
Volume loss can be later compensated by simply increasing the analog volume (the user turning the knob a little higher).

*** The rest is somewhat opinionated. ***


Thoughts:
As such the "bottom 3 bits" of audio could be considered waste-able, 2 bits to handle pathological intersample peaks, + 1 bit due to quantization/noisefloor/dither.
A "24bit" DAC would have no issues, 21bits to use is a lot. Likewise a "20bit" DAC would still have 17bits to use.
Ideally the 11 (or 12) dB volume reduction would be done by the DAC just before the reconstruction stage.

Issues?:
For a 12dB headroom DAC one would need to crank up the playback volume, so such a DAC would sound more quiet than most other DACs.
Noisefloor of the amplifier and other parts of the equipment/audio chain is also an issue.
But even "cheap" gear has around -80dBFS to -100dBFS noisefloor.
Also considering that a normal living room can easily have a +50dB noisefloor, so loosing out on the 12dB or so of the quietest audio is not an issue.

So if taking CD audio as an example, a 12dB adjustment would cause the content in the -96dBFS to -84dBFS range to be lost.
The loss can be avoided by simply passing the 16bit audio as 24bit or 32bit float instead.
Under Windows Vista and Windows 7 and Windows 8 all audio is changed to 32bit so this is a non-issue.

How to avoid intersample peaks on gear without the needed headroom?:
On Windows you can simply make sure that you never raise the volume (in Windows) above -12dBFS (~45% volume),
and instead use the analog volume knob (if there is one on your system or gear) instead.

11dB really?
Yep! Then again this is a pathological example.
"Normally" the intersample peak is within 1dB of the digital peak, and in some rare cases up to 2 to 3dB higher.
If you make/master music, then the final mix/pressing master/encoding/exporting should have 2 or 3dB headroom.
So as long as no peaks go above 3dB you should be pretty darn safe from causing any clicks or distortion for the end user.

The example here is a pure spike, and humans tend not to like to listen to pops, clicks, static, test tones, or similar.
So encountering anything like this "in the wild" is very rare.

Is it really that bad?:
Please remember that intersample peaks do not damage equipment, at least I've never heard or read about such happening, and the CD was invented like ages ago.
So if this was a practical issue we'd have heard about it along time ago as equipment got fried etc. And we'd have had a solution years ago as well.

The only thing it does is damage the audio quality, that is if you actually can hear/notice it at all. You are more likely to hear crackling/distortion from overly compressed music.
And ironically it is that type of overly compressed music that has the most intersample peaks that go above 0dBFS.
Solution? Stop compressing the hell out of music. Use 20dB or more headroom and intersample peaks will most likely never be an issue.



--------------------
"Normality exist in the minds of others, not mine!" - Rescator
Go to the top of the page
+Quote Post
 
Start new topic
Replies
2Bdecided
post Jan 14 2013, 17:20
Post #2


ReplayGain developer


Group: Developer
Posts: 5141
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



Yep, that's exactly it.

(I just used Excel).

That upper "series" (Y=X+8dB) must be wrong, and is contaminating your results for the number of intersample overs above 0dB FS.


I'm coming at this from the other direction - I suspect that, in the context of EBU R128, consideration of intersample peak is irrelevant for content that reaches the consumer. Any consumer-targeted audio track that is loudness matched to -23LUFS is very unlikely to have any content near clipping, and as long as the actual samples sit below 0dB FS I bet the intersample peaks are safe too (except on a track intentionally created to disprove this statement!).

For pop CDs, which are often 10-15dB louder than EBU R128 requires, and often smashed/clipressed to be as loud as possible, then of course intersample overs are a real issue.

Cheers,
David.

This post has been edited by 2Bdecided: Jan 14 2013, 17:21
Go to the top of the page
+Quote Post
Rescator
post Jan 14 2013, 20:29
Post #3





Group: Members
Posts: 73
Joined: 13-January 09
From: Trondheim
Member No.: 65515



(@bandpass Darn you, stop teaching me new tricks. PS! Libre crashed 3 times trying to plot this stuff. Heh! and thanks, had no idea Libre or OO could do that...)

QUOTE (2Bdecided @ Jan 14 2013, 17:20) *
I'm coming at this from the other direction - I suspect that, in the context of EBU R128, consideration of intersample peak is irrelevant for content that reaches the consumer. Any consumer-targeted audio track that is loudness matched to -23LUFS is very unlikely to have any content near clipping, and as long as the actual samples sit below 0dB FS I bet the intersample peaks are safe too (except on a track intentionally created to disprove this statement!).

For pop CDs, which are often 10-15dB louder than EBU R128 requires, and often smashed/clipressed to be as loud as possible, then of course intersample overs are a real issue.

*nod* My last 3 albums released has an RMS of around -23 dBFS, future projects of mine will "target" around RMS -26 dBFS as that seems to be close to EBU R128's -23 LUFS pretty close.

QUOTE (2Bdecided @ Jan 14 2013, 17:20) *
That upper "series" (Y=X+8dB) must be wrong, and is contaminating your results for the number of intersample overs above 0dB FS.


Yeah! *sigh* Looks like I have to revisit this later as this is really irking me now.
Check this out: http://imageshack.us/photo/my-images/688/scanuy.jpg/
Sorted by peak from lowest to highest.

Top left are peaks, bottom left is RMS, and the right/big one is the intersample peaks.
Both the Peak and RMS seem to correlate as expected, and even as the peaks max out (at 0.0 dBFS) the RMS shows the continued squashing going on.
And the ISP seems to match (if we ignore that "shadow" hanging over it there for a moment), and it's not until the very last ~0.70% of tracks that the ISP's go above 3.5 dBFS.

But back to that shadow (or cloud is perhaps more appropriate) hanging there, if one assumes they are 8dB "off" and adjust them "down" then they seem to match with the rest of the curve. Which is most likely correct.

Then again something else may be going on, I'll defiantly get back to this again later (with a updated/corrected csv for you guys) I just do not know when, I'f I'm going to waste a day on this again I might as well make sure it's correct, and that any sox errors/failures or foobar2000 issues can be handled, I'll also grab more data (like channels, codec (mp3 flac, wav, ogg, m4a, etc), bitdepth, frequency, and anything else I can think of/grab at the same time.
And if that anomaly rears it's head again, I'll make sure I track the filepaths so I can check the offenders if it's either damaged files/bad encodings or something else. (my guess is it was weird output from sox that my tool wasn't programmed to parse).

For those curious, it looked for "Pk lev dB" and "RMS lev dB" from the first stat and just "Pk lev dB" from the second stat. And only the first number was grabbed (for multichannel 2 or more numbers would be presented and intentionally ignored), any sox output that did not contain this info would get ignored.
Also if any Pk or RMS was NOT grabbed properly but still went into the csv then those will show up as either -999 or +999 values, and I see no such values, so it was either the wav passed to sox or sox itself that provided dodgy data.

But I will revisit this, I can not promise when though, I need to set aside a day, and if possible use a different tool than Sox (using foobar2000 as the "decoder" is very practical), peak, rms and some way to get ISP's or upsample and gather the peaks is all I need. Heck, even a upsampler with support for piping is all I need, I can code a peak scanner that do 32bit or even 64bit float peak scanner myself fairly quickly.

I could probably code something similar to sox's "upsample 4 sinc -a 40 -t 8k -24k" if I got some pointers/help though. (no idea how/where to start making a upsampler at all, any ANSI C code out there?).


--------------------
"Normality exist in the minds of others, not mine!" - Rescator
Go to the top of the page
+Quote Post

Posts in this topic
- Rescator   Pathological example of a intersample peak, 11dB, discussion.   Jan 10 2013, 04:36
- - Rescator   http://forums.digitalspy.co.uk/showthread....25#po...   Jan 10 2013, 07:51
- - Kees de Visser   At a first glance it seems that this test signal i...   Jan 10 2013, 07:57
- - lvqcl   http://www.hydrogenaudio.org/forums/index....st...   Jan 10 2013, 15:52
- - 2Bdecided   While we're quoting past debates, I remember o...   Jan 10 2013, 16:06
- - John_Siau   When designing Benchmark's new DAC2 HGC D/A co...   Jan 10 2013, 16:10
|- - saratoga   QUOTE (John_Siau @ Jan 10 2013, 10:10) I ...   Jan 10 2013, 17:07
|- - Rescator   QUOTE (John_Siau @ Jan 10 2013, 16:10) A ...   Jan 11 2013, 11:27
|- - Banned   QUOTE (Rescator @ Jan 11 2013, 11:27) it ...   Jan 12 2013, 12:24
|- - Rescator   QUOTE (Banned @ Jan 12 2013, 12:24) QUOTE...   Jan 12 2013, 13:14
|- - Banned   QUOTE (Rescator @ Jan 12 2013, 13:14) Nic...   Jan 12 2013, 15:54
|- - Rescator   QUOTE (Banned @ Jan 12 2013, 15:54) Examp...   Jan 12 2013, 18:14
|- - Banned   QUOTE (Rescator @ Jan 12 2013, 18:14) QUO...   Jan 12 2013, 20:52
|- - Rescator   QUOTE (Banned @ Jan 12 2013, 20:52) QUOTE...   Jan 12 2013, 22:53
|- - 2Bdecided   QUOTE (Rescator @ Jan 12 2013, 21:53) To ...   Jan 14 2013, 12:47
- - bennetng   I've seen +4.8dB intersample peak in a song, b...   Jan 10 2013, 18:19
- - 2Bdecided   I don't see how on-sample values above 0dB FS ...   Jan 10 2013, 19:56
- - bennetng   I just generated another synthetic example wavefor...   Jan 10 2013, 20:26
|- - Rescator   QUOTE (bennetng @ Jan 10 2013, 20:26) I j...   Jan 12 2013, 13:22
|- - bennetng   QUOTE (Rescator @ Jan 12 2013, 20:22) QUO...   Jan 12 2013, 16:36
- - bandpass   $ sox InterSamplePeak.wav -n gain -11.9 stats...   Jan 11 2013, 13:13
- - bandpass   Here's how to do the EBU upsampling/filtering ...   Jan 12 2013, 23:17
|- - Rescator   QUOTE (bandpass @ Jan 12 2013, 23:17) Her...   Jan 12 2013, 23:22
- - Rescator   bandpass, 2bdecided, saratoga and John Siau will h...   Jan 14 2013, 00:51
|- - 2Bdecided   QUOTE (Rescator @ Jan 13 2013, 23:51) ban...   Jan 14 2013, 13:00
||- - Rescator   QUOTE (2Bdecided @ Jan 14 2013, 13:00) Ar...   Jan 14 2013, 16:49
||- - bug80   QUOTE (Rescator @ Jan 14 2013, 16:49) QUO...   Feb 4 2013, 12:45
|- - John_Siau   QUOTE (Rescator @ Jan 13 2013, 18:51) ban...   Jan 14 2013, 18:22
- - bandpass   Using LibreOffice (free and available on Windows):   Jan 14 2013, 17:06
- - 2Bdecided   Yep, that's exactly it. (I just used Excel). ...   Jan 14 2013, 17:20
|- - Rescator   (@bandpass Darn you, stop teaching me new tricks. ...   Jan 14 2013, 20:29
|- - bandpass   QUOTE (Rescator @ Jan 14 2013, 19:29) if ...   Jan 15 2013, 09:57
- - John_Siau   The "+11 dB" test signal (that started t...   Jan 14 2013, 18:40
|- - Rescator   QUOTE (John_Siau @ Jan 14 2013, 18:40) Th...   Jan 14 2013, 19:37
- - Wombat   After reading about that topic a bit i found that ...   Jan 14 2013, 22:31
|- - Alexey Lukin   QUOTE (Wombat @ Jan 14 2013, 17:31) After...   Feb 4 2013, 19:49
- - knutinh   Since inter-sample overshoot is a problem for the ...   Feb 4 2013, 09:20
|- - 2Bdecided   QUOTE (knutinh @ Feb 4 2013, 08:20) Since...   Feb 4 2013, 13:08
|- - knutinh   QUOTE (2Bdecided @ Feb 4 2013, 13:08) QUO...   Mar 4 2013, 13:58
|- - John_Siau   QUOTE (knutinh @ Mar 4 2013, 07:58) I vag...   Mar 4 2013, 17:51
|- - 2Bdecided   QUOTE (knutinh @ Mar 4 2013, 12:58) I vag...   Mar 4 2013, 18:21
- - John_Siau   QUOTE (2Bdecided @ Feb 4 2013, 07:08) QUO...   Feb 4 2013, 18:08


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: 22nd September 2014 - 13:53