IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
replaygain, intersample overs, and reconstruction stages
SiriusB
post Nov 30 2007, 23:25
Post #1





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



My understanding of intersample overs is that they are waveform peaks occuring between samples, that aren't reconstructed to their 'true' amplitude by consumer gear because the samples on either side of the peak are too close to 0dBFS already. These intersample peaks can be as much as 6dB 'over' 0dBFS, or more commonly a few dB over. They 'happen' when a production is monitored using peak meters that only measure peak values of the samples, rather than the levels of the reconstructed waveforms. So if an engineer slams the sample peaks repeatedly up to near 0dB, as part of the loudness wars, the file will still show as 'legal' using the inadequate meter. It will be 'illegal' in terms of the level of the true waveform peak levels. Consumer gear and consumer software D/A stages don't 'know how' to reconstruct peaks that are >0dBFS, outputting distortion instead.

Assuming I've got this right (tell me if not), does lowering sample peak level a few dB in the digital domain -- e.g. by applying negative replaygain values -- prior to D/A reconstruction increase our chance of recovering the 'true' waveform at output? Or is that accurate peak shape lost forever?

Another way to phrase this is, how do consumer D/A stages normally reconstruct peaks that occur between samples, and why can't they do it when such peaks are over 0dBFS?

This post has been edited by SiriusB: Nov 30 2007, 23:38
Go to the top of the page
+Quote Post
greynol
post Nov 30 2007, 23:54
Post #2





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (SiriusB @ Nov 30 2007, 14:25) *
Assuming I've got this right (tell me if not), does lowering sample peak level a few dB in the digital domain -- e.g. by applying negative replaygain values -- prior to D/A reconstruction increase our chance of recovering the 'true' waveform at output?
Yes, absolutely.

Sorry I can't answer your last question with any true authority, but many others here certainly can. smile.gif


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
mixminus1
post Dec 1 2007, 00:39
Post #3





Group: Members
Posts: 688
Joined: 23-February 05
Member No.: 20097



TC Electronic has some very good papers on various aspects of +0 intersample peak metering and reproduction in their tech library (scroll down to the "Mastering and Formats" section).


--------------------
"Not sure what the question is, but the answer is probably no."
Go to the top of the page
+Quote Post
Kees de Visser
post Dec 1 2007, 08:25
Post #4





Group: Members
Posts: 685
Joined: 22-May 05
From: France
Member No.: 22220



QUOTE (SiriusB @ Dec 1 2007, 00:25) *
Another way to phrase this is, how do consumer D/A stages normally reconstruct peaks that occur between samples, and why can't they do it when such peaks are over 0dBFS?
Before the "discovery" of intersample overs DAC manufacturers didn't expect the signal peaks to exceed 0 dBFS and designed the (reconstruction) filter and the following analog stages to be able to handle just that level. This isn't as careless as it might seem nowadays: the output of an AD converter is very unlikely to contain iso's. Digital (post-)processing however enables signal manipulations that can easily create those overs, especially with dynamic (over)compression.
You're right that the consumer can easily solve the problem by reducing the signal level just before the DAC.
The biggest risk for iso's is during recording/mixing/mastering. The signal passes through many processes, each of which can introduce iso artifacts. Once a distorted signal passes an EQ or a reverb e.g., you might never be able to get rid of it afterwards. TC Electronic did an excellent job in making the audio professionals aware of the problem and suggesting solutions (use good peak-meters and keep the levels away from 0 dBFS).

Kees de Visser
Go to the top of the page
+Quote Post
SebastianG
post Dec 2 2007, 10:02
Post #5





Group: Developer
Posts: 1318
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (SiriusB @ Nov 30 2007, 23:25) *
These intersample peaks can be as much as 6dB 'over' 0dBFS

Oh really? I thought the maximum is 3dB.

Cheers!
SG
Go to the top of the page
+Quote Post
SiriusB
post Dec 3 2007, 06:53
Post #6





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



Check the papers by Aldrich and by Lund. 6dB is the cited maximum, though it's under extraordinary conditions.
Go to the top of the page
+Quote Post
SebastianG
post Dec 3 2007, 17:45
Post #7





Group: Developer
Posts: 1318
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



Oh, it's even worse! Theoretically, you can't guarantee such a limit unless the reconstruction filter's impulse response has a finite extent.

For example: Using sinc interpolation on the signal

[ ... 1 -1 1 -1 1 1 -1 1 -1 1 ... ] (Note: There's a pair of 1 in the middle next to each other)

results in the infinite sum
CODE
4/pi * \sum_{k=0}^{\infty} 1/(1+2k) == \infty

for the value right in the middle between the pair of +1s.

To be honest: That was unexpected.


However, using more practical reconstruction filters it'd be something like 2.5 (+8 dB) or less. Also, "normal music" isn't really a big problem due to the low energy in the above frequencies.


Cheers!
SG

This post has been edited by SebastianG: Dec 3 2007, 17:55
Go to the top of the page
+Quote Post
SiriusB
post Dec 5 2007, 19:20
Post #8





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



My questions are ultimately about reconstruction. How does pro gear accurately reconstruct the peaks above 0 dBFS? And do I achieve the same effect by bringing the level down with , say replaygain? Or is the peak forever 'lost'?

I don't recall seeing 'new' curved peaks when I use Audition to look at the waveforms of loud tracks I've replaygained. Flat-topped peaks still look flat-topped.
Go to the top of the page
+Quote Post
greynol
post Dec 5 2007, 19:43
Post #9





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (SiriusB @ Dec 5 2007, 10:20) *
And do I achieve the same effect by bringing the level down with , say replaygain? Or is the peak forever 'lost'?
Again, the answer to this part of your question is NO.


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
SiriusB
post Dec 5 2007, 21:44
Post #10





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



QUOTE (greynol @ Dec 5 2007, 13:43) *
QUOTE (SiriusB @ Dec 5 2007, 10:20) *
And do I achieve the same effect by bringing the level down with , say replaygain? Or is the peak forever 'lost'?
Again, the answer to this part of your question is NO.



There's two questions there.
Go to the top of the page
+Quote Post
greynol
post Dec 5 2007, 22:07
Post #11





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



If you reduce the level of the data before it hits the DAC then it should be able to reproduce what was previously an ISO without clipping. The peak is not "forever lost".


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
DVDdoug
post Dec 5 2007, 22:30
Post #12





Group: Members
Posts: 2632
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



I don't know what "pro gear" does to "reconstruct" the wave. However, I do know that the true intersample data is LOST! For all we know, there may have been an intersample dip rather than an intersample peak! (We do know that there is not a complex waveform between samples, because the signal has been low-pass filtered as required by Nyquist.)

A low-pass filter will often have a slight peak (1 to 3dB) just-before the cutoff frequency. The low-pass filter following the DAC could "reconstruct" a high-frequency peak greater than 0dBFS. However, the filter and following analog circuitry will generally have some headroom above 0dB, so this should not contrubute to clipping. (If the analog section is causing clipping, then digitally reducing the gain will help.)

QUOTE
I don't recall seeing 'new' curved peaks when I use Audition to look at the waveforms of loud tracks I've replaygained. Flat-topped peaks still look flat-topped.
When you "look" at the waveforms, you are looking at the digitized samples. So, there is no intersample data (or intersample reconstruction). You would have to observe the analog output with an oscilloscope to see these effects. And, ReplayGain does not change the shape of the wave. In fact, it doesn't change audio data at all! It simply changes the gain applied during playback.

This post has been edited by DVDdoug: Dec 5 2007, 23:03
Go to the top of the page
+Quote Post
greynol
post Dec 5 2007, 22:57
Post #13





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (DVDdoug @ Dec 5 2007, 13:30) *
I don't know what "pro gear" does to "reconstruct" the wave. However, I do know that the true intersample data is lost! For all we know, there may have been an intersample dip rather than an intersample peak! (We do know that there is not a complex waveform between samples, because the signal has been low-pass filtered as required by Nyquist.)
This is not a theoretical discussion about digitization; we're talking about the practical reconstruction of digital signals. Let's not quibble about the "true" nature of the original analog signal before it was sampled. Intersample overs are a real phenomenon and can be prevented by attenuating the signal before reconstruction.

QUOTE (DVDdoug @ Dec 5 2007, 13:30) *
A low-pass filter will often have a slight peak just-before the cutoff frequency. The low-pass filter following the DAC could "reconstruct" a high-frequency peak greater than 0dBFS. However, the filter and following analog circuitry will generally have some headroom above 0dB, so this should not contrubute to clipping.
I thought you said that you don't know what pro gear does to reconstruct analog signals.

QUOTE (DVDdoug @ Dec 5 2007, 13:30) *
QUOTE
I don't recall seeing 'new' curved peaks when I use Audition to look at the waveforms of loud tracks I've replaygained.
When you "look" at the waveforms, you are looking at the digitized samples. So, there is no intersample data (or intersample reconstruction).
Not so. Audition fills in inter-sample data based on ideal reconstruction.

QUOTE (DVDdoug @ Dec 5 2007, 13:30) *
And, ReplayGain does not change the shape of the wave.
It doesn't have to.

QUOTE (DVDdoug @ Dec 5 2007, 13:30) *
It simply changes the gain applied during playback.
Which changes the audio data before it's sent to the DAC! laugh.gif

QUOTE (SiriusB @ Nov 30 2007, 14:25) *
Assuming I've got this right (tell me if not), does lowering sample peak level a few dB in the digital domain -- e.g. by applying negative replaygain values -- prior to D/A reconstruction increase our chance of recovering the 'true' waveform at output?
Yes, it does.

This post has been edited by greynol: Dec 5 2007, 23:22


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
SiriusB
post Dec 5 2007, 23:03
Post #14





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



QUOTE (DVDdoug @ Dec 5 2007, 16:30) *
I don't know what "pro gear" does to "reconstruct" the wave. However, I do know that the true intersample data is lost! For all we know, there may have been an intersample dip rather than an intersample peak! (We do know that there is not a complex waveform between samples, because the signal has been low-pass filtered as required by Nyquist.)


'Reconstruct' is not bizarre terminology -- digital gear uses reconstruction filters. And my refefnce to 'pro gear' being able to reconstruct the correct intersample amplitude between two samples near or at 0dBFS, is straight from the papers of Lund or Aldrich.

QUOTE
A low-pass filter will often have a slight peak just-before the cutoff frequency. The low-pass filter following the DAC could "reconstruct" a high-frequency peak greater than 0dBFS. However, the filter and following analog circuitry will generally have some headroom above 0dB, so this should not contrubute to clipping.

QUOTE
I don't recall seeing 'new' curved peaks when I use Audition to look at the waveforms of loud tracks I've replaygained. Flat-topped peaks still look flat-topped.
When you "look" at the waveforms, you are looking at the digitized samples.


But in Audition at least, you aren't looking at a simple 'connect the samples with a straight line' representation. For example, a 44.1 kHz-sampled 15kHz sine wave in Audition definitely shows some peaks rising and falling between two samples. That's the software doing a visual representation of predicted output (a 'reconstruction' if you will). I was just curious how it knows to show that part of the curve a peak, rather than say, a flat line between the two samples, or even a dip.

My recollection was that flat intersample regions stayed flat when viewed after downward digital amplification (eg after applying replaygain values to the file to 'see' what it would look like). But no longer trusting my 'recollection', I just did this experiment myself in Audition -- first I normalized such a region of a 15 kHz sine wav (ripped from a home audio setup CD with test tones) so that peak sample value is 0dBFS. Now the above-mentioned intersample 'peak' is flat. Saved the file. Reopened it. Reduced level so samples peak at -3 dB instead. Et voila, the original rounded intersample peak is back. So I'm a believer that it can work.


QUOTE
So, there is no intersample data (or intersample reconstruction). You would have to observe the analog output with an oscilloscope to see these effects. And, ReplayGain does not change the shape of the wave. In fact, it doesn't change audio data at all! It simply changes the gain applied during playback.



I already knew what replaygain does and does not do in this regard, thanks. I know the software itself merely calculates a digital amplification value, and that playback software merely applies this to output, not altering the actual file itself -- unless you tell it to (e.g. an option for foobar2000 file saving) in order to create a 'permanently' re-levelled version.

This post has been edited by SiriusB: Dec 5 2007, 23:59
Go to the top of the page
+Quote Post
greynol
post Dec 5 2007, 23:35
Post #15





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (SiriusB @ Dec 5 2007, 14:03) *
I normalized such a region of a 15 kHz sine wav (ripped from a home audio setup CD with test tones) so that peak sample value is 0dBFS. Now the above-mentioned intersample 'peak' is flat. Saved the file. Reopened it. Reduced level so samples peak at -3 dB instead. Et voila, the original rounded intersample peak is back. So I'm a believer.
So we're good here.

Now what's left is your question about consumer gear. Did the documents at t.c. electronic linked by mixminus1 provide any information that you found helpful?


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
SiriusB
post Dec 5 2007, 23:57
Post #16





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



QUOTE (greynol @ Dec 5 2007, 17:35) *
QUOTE (SiriusB @ Dec 5 2007, 14:03) *
I normalized such a region of a 15 kHz sine wav (ripped from a home audio setup CD with test tones) so that peak sample value is 0dBFS. Now the above-mentioned intersample 'peak' is flat. Saved the file. Reopened it. Reduced level so samples peak at -3 dB instead. Et voila, the original rounded intersample peak is back. So I'm a believer.
So we're good here.


Well, I have minorly re-worded some of that since you replied. biggrin.gif

I wonder if my probe signal isn't quite the same as what I recall seeing in some hypercompressed CDs. There, Audition actually draws a LINE between two samples at 0dB. In my probe signal, when I normal two equal-value sample to 0dB, the intersample peak disappears, but Audition doesn't draw a line between them.
It's like the real peak is simply 'hiding offstage'. In commercial discs, it seems the data are gone, and bringing the peak level down doesn't 'bring them out of hiding'.

But I need to find some commercial CD examples to verify this. Lund et al do talk about multiple production stages at +0dBFS causing the peaks to be lost.


QUOTE
Now what's left is your question about consumer gear. Did the documents at t.c. electronic linked by mixminus1 provide any information that you found helpful?


No, they seem to assume an understanding of reconstruction filters than I lack. But I'm sure the info is out there. I just need to get off my lazy butt. I even have Pohlmann's book at home and bet he explains it all in there.

This post has been edited by SiriusB: Dec 6 2007, 00:00
Go to the top of the page
+Quote Post
greynol
post Dec 6 2007, 00:04
Post #17





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



I'd really have to see screenshots of what you're looking at.


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
Vitecs
post Dec 7 2007, 15:58
Post #18





Group: Members
Posts: 40
Joined: 6-November 07
Member No.: 48526



Interesting subject. My 2 cents:
QUOTE (SiriusB @ Dec 5 2007, 14:03) *
I normalized such a region of a 15 kHz sine wav (ripped from a home audio setup CD with test tones) so that peak sample value is 0dBFS. Now the above-mentioned intersample 'peak' is flat. Saved the file. Reopened it. Reduced level so samples peak at -3 dB instead. Et voila, the original rounded intersample peak is back. So I'm a believer.

Audio editor must be able to "reconstruct" a picture of the signal to show to us these good-looking waveforms. If we zoom-in to the level where the screen has pixels without "assigned" samples program should interpolate the "missing" values. What interpolation function is in use - I don't mind - cubic will be enough to see these "intersample" peaks appearing again.

QUOTE (SiriusB @ Dec 5 2007, 16:57) *
But I need to find some commercial CD examples to verify this. Lund et al do talk about multiple production stages at +0dBFS causing the peaks to be lost.

I don't believe that occasional one or two "maxed" samples will lead us to any audible effect. I think even analog filter will "reproduce" the signal in similar way to Audition (it will remove higher freqs).

What I'd like to see if it's possible to "reconstruct" a dozen concurrent clipped samples (hello Paul with Memories Almost Full! Great recording tongue.gif )
Go to the top of the page
+Quote Post
SiriusB
post Dec 7 2007, 17:54
Post #19





Group: Members
Posts: 26
Joined: 30-August 07
Member No.: 46625



That's the sort of commercial CD example I'm referring to.

I'll post some Audition screen caps this weekend or next week.
Go to the top of the page
+Quote Post
knutinh
post Dec 7 2007, 22:54
Post #20





Group: Members
Posts: 570
Joined: 1-November 06
Member No.: 37047



1. Nyquist was right. In theory, a waveform of bandwidth <B can be sampled at a samplingrate of 2B and perfectly recreated using a brickwall reconstruction filter. The fourier-transform of a brick is a sinc - lets pretend that this filter is all-analog and that there is no oversampling. In practice, there is no way of knowing the actual implemented reconstruction filter other than measuring it.

2. Nyquist did not (AFAIK) talk about quantisation and non-linear distortion - at least not in the famous theory bearing his name. The ideally reconstructed waveform may or may not exceed the limits presented by the max/min sample levels. If the reconstructed waveform exceeds the "reference" max/min levels, then the analog stage of the D/A-converter must have enough headroom to represent that level without clipping. I think this is primarily an "analog" problem, not a digital one.

3. Nothing fundamentally new has happened to the technology exposing this problem, but the use of compression/clipping/normalising in the mastering industry means that bad designs have a larger chance of giving users bad sound.

4. One simple solution is to digitally reduce the level prior to D/A.

5. Cool edit/Adobe Audition tries to hint at the reconstructed waveform by doing reconstruction filtering of the samples before a graphical representation is drawn. Take a look at the overshoots below:


-k
Go to the top of the page
+Quote Post
benski
post Dec 7 2007, 23:05
Post #21


Winamp Developer


Group: Developer
Posts: 670
Joined: 17-July 05
From: Brooklyn, NY
Member No.: 23375



QUOTE (knutinh @ Dec 7 2007, 16:54) *
5. Cool edit/Adobe Audition tries to hint at the reconstructed waveform by doing reconstruction filtering of the samples before a graphical representation is drawn. Take a look at the overshoots below:


Your screen highlights Gibbs Phenomenon, which is a separate issue from intersample overs. Overshoot will be seen at the ADC also and so it isn't much of a factor here.
Go to the top of the page
+Quote Post
greynol
post Dec 7 2007, 23:06
Post #22





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



It's quite easy to show a sync pulse in CEP/Audition as well. Thanks for posting the image. smile.gif


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post
knutinh
post Dec 7 2007, 23:12
Post #23





Group: Members
Posts: 570
Joined: 1-November 06
Member No.: 37047



QUOTE (SebastianG @ Dec 3 2007, 17:45) *
Oh, it's even worse! Theoretically, you can't guarantee such a limit unless the reconstruction filter's impulse response has a finite extent.

For example: Using sinc interpolation on the signal

[ ... 1 -1 1 -1 1 1 -1 1 -1 1 ... ] (Note: There's a pair of 1 in the middle next to each other)

results in the infinite sum
CODE
4/pi * \sum_{k=0}^{\infty} 1/(1+2k) == \infty

for the value right in the middle between the pair of +1s.

To be honest: That was unexpected.


However, using more practical reconstruction filters it'd be something like 2.5 (+8 dB) or less. Also, "normal music" isn't really a big problem due to the low energy in the above frequencies.


Cheers!
SG

I dont understand your formula. Is it mathematica or something? Do you speak matlab? :-)

A digital FIR filter should be scaled by the sum of the absolute value of every coefficient. I think that this assures that no digital overload occurs, even for a input vector of all 1s and -1s of the same polarity as the coefficients, being the worst case. Now, for a long filter this easily results in a large scaling-factor, and probably a smaller and smaller chance of the worst-case input ever occuring (especially in music as, as you say, 22049Hz 0dBFS sines arent that common in music).

Now, the analog side of the DAC should be able to cope with any instantaneous levels the reconstruction filter should ever try to produce. I am guessing that having a little guardband will decrease the chance of very high peaks "in-between samples"?

-k

QUOTE (benski @ Dec 7 2007, 23:05) *
QUOTE (knutinh @ Dec 7 2007, 16:54) *

5. Cool edit/Adobe Audition tries to hint at the reconstructed waveform by doing reconstruction filtering of the samples before a graphical representation is drawn. Take a look at the overshoots below:


Your screen highlights Gibbs Phenomenon, which is a separate issue from intersample overs. Overshoot will be seen at the ADC also and so it isn't much of a factor here.

Is it?

Gibbs phenomenon is simply the result of lowpassfiltering an "edge". This results in "in-between-levels" that may exceed the values of any samples. If the waveform is normalised digitally, then the problem may manifest itself in the DAC?

I thought that this was exactly the same as "intersample overs", where lowpassfiltering a sequence of samples could produce analog levels exceeding that of any sample?

-k

This post has been edited by knutinh: Dec 7 2007, 23:14
Go to the top of the page
+Quote Post
SebastianG
post Dec 8 2007, 09:42
Post #24





Group: Developer
Posts: 1318
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (knutinh @ Dec 7 2007, 23:12) *
QUOTE (SebastianG @ Dec 3 2007, 17:45) *

4/pi * \sum_{k=0}^{\infty} 1/(1+2k) == \infty

I dont understand your formula. Is it mathematica or something? Do you speak matlab? :-)

It's pseudo-LaTeX. It describes the sum:
4/pi * ( 1 + 1/3 + 1/5 + 1/7 + ... )

You'll get there via sinc(1/2 + k) = (-1)^k * 2/pi * 1/(1+2k) for k=0,1,2,3,...


Cheers!
SG
Go to the top of the page
+Quote Post
greynol
post Dec 8 2007, 22:33
Post #25





Group: Super Moderator
Posts: 10025
Joined: 1-April 04
From: San Francisco
Member No.: 13167



QUOTE (benski @ Dec 7 2007, 14:05) *
Your screen highlights Gibbs Phenomenon, which is a separate issue from intersample overs. Overshoot will be seen at the ADC also and so it isn't much of a factor here.

If Audition/Cool Edit 2000/CEP used anti-alias filtering when synthesizing waveforms you would see Gibbs Phenomenon and it would be reflected in the magnitude of the samples, but the program doesn't. Try creating a 8kHz square wave in a new file with a 44.1kHz sample rate and this will become readily apparent; if there was no aliasing, the program would return a sine wave.

What you're seeing here may look like Gibbs Phenomenon, but it really isn't.

This post has been edited by greynol: Dec 9 2007, 19:49


--------------------
Your eyes cannot hear.
Go to the top of the page
+Quote Post

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: 21st October 2014 - 07:19