Software to detect +0dBFS waveforms and overload times

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Does anyone know free software that detect +0dBFS overloads?

I have written about +0dBFS in two posts recently, and it seems to still be a problem today in ASRCs, DACs, DSPs and bitrate reducing encoders with corresponding decoders.

The waveforms in question has had dynamic compression so that the oversampled waveform gets over 0dBFS.

The article pointing to the problem is TC electronics
http://www.tcelectronic.com/media/1013907/lund_2006_stop_counting_samples_aes121.pdf from 2006.

I find a lot of programs that detect 0dBFS but they don't estimate the overload in dB (or linear). So I don't know if the signal just hits 0dBFS, the waveform is nonclipped +0dBFS or the waveform is clipped.
By clipped I mean that the original waveform can't be recreated in a perfect DAC according to Nyquist.

I have made some examples of sine +0dBFS signals for evaluation.

THE ANALOG VOLUME AT SPEAKER SHOULD BE -40 dB DOWN
to not burn your tweeter!

*44.1 fs, 5512.5 Hz sin stereo wav file that has 22.5 degree phase change and 1.08 (linear) amplitude in left channel.
Right channel -3dB with left as reference, or 1.08 / sqr(2) = about 0.76 linear.
1.08 linear is about +0.67dBFS so the rigth is about -2.33dBFS.
Assumes that +/-1 top linear corresponds to 0dBFS

* The second one is:
Freq = 22050
SF = 44100
Phase = 22.5
Ampl = 2.6 , 8.3dBFS
Left channel:
Freq = 11025
SF = 44100
Phase = 45
Ampl = 1.41, 3.0 dBFS

Again mind the volume so that no tweeters are harmed!!!

* Last a more real life like signal that is a HF sine modulated on a bass sine that is again modulated on a sub 1 HZ sine.
I made the "same" signal in two samplerates, 44.1 samplefrequency and 48.0 samplefrequency.
The 48.0 sf wav file is
sine at 6k phase 22.5degrees ampl 1.08 +
sine at 60 phase 22.5degrees ampl 1.00 +
sine at 0.6 phase 22.5degrees ampl 1.00

That means no samples over +/-1.00000
Top values at +0.67dbFS

This is more like overcompressed music that is not clipped.
The signal will produce artifacts and distortion that is easily heard if the chain don't treat +0dBFS signals with grace.

Again: BE CAREFUL WITH THE VOLUME AND YOUR EARS!!!!! Attunate 40dB or more before speakers.

The other file is 44.1kHz samplerate, signal scaled to 5k5125. The same artifacts should be heard or the chain is OK regarding +0dBFS signals.
I think the cain should also be able to handle these signals played with no digital attunation at the source.

Enough digital attunation at the source should make the distortion go away.
(The wavefiles are also posted in:
http://www.diyaudio.com/forums/digi...amp-crossover-dac-project-40.html#post4476464
and
http://www.diyaudio.com/forums/digital-line-level/280626-worlds-best-dacs-32.html#post4496832
Regards Torgeir
 

Attachments

  • sinoverload.JPG
    sinoverload.JPG
    47.5 KB · Views: 426
  • 48sf6kdiv100s1p08lin.zip
    788 KB · Views: 49
  • 44p1sf5k5div100s1p08.zip
    950.6 KB · Views: 50
  • 11kand22kplussdbFS.zip
    580.1 KB · Views: 56
  • 5k51251p08ampl22p5phaseandmin3dB.zip
    609.3 KB · Views: 48
  • 48sf6kand60and0p6hzfine2.JPG
    48sf6kand60and0p6hzfine2.JPG
    38.5 KB · Views: 66
  • 48sf6kand60and0p6hzfine1.JPG
    48sf6kand60and0p6hzfine1.JPG
    68.4 KB · Views: 414
  • 48sf6kand60and0p6hzmid.JPG
    48sf6kand60and0p6hzmid.JPG
    84 KB · Views: 419
  • 48sf6kand60and0p6hzbroad.JPG
    48sf6kand60and0p6hzbroad.JPG
    65.3 KB · Views: 423
  • sinoverload2.JPG
    sinoverload2.JPG
    59.8 KB · Views: 420
Last edited:
I was made aware that a more common expression of this phenomena is : intersample peaks.
I still is interested in links to good programs to find this or clipping (and separation of the two) in wav files.
(I am not looking for a real time meter as i have a RME soundcard)

By the way: The last files is a nice tool to hear if your chain resamples. Often clicks are heard when the chain is resampling without attunation.
 
Last edited:
Keep in mind: by definition a pure 0.0 dB DC will give you a +3.010 dBFS RMS

Hp

Could you explain?
My calculations gives 0dBFS for DC , -3 dBFS for sine RMS, but sine top value 0dBFS if 0 phase shift.
https://en.wikipedia.org/wiki/Root_mean_square

But the RMS value is not the problem it is the peak value. Only one sample over 1 (0dbFS) can give an artifact thet is heard for much longer than 1 sample time.
 
I'm planning on adding support for this to PyMasVis. Just have to find some time to implement it correctly.

That is great news. I really like your program!
Found this:
https://ccrma.stanford.edu/~jos/resample/resample.pdf

Maybe an algorithm could be:
Shift bits in samples 2 bits left
Make frame 2^n long
FFT frame , store FFTd result in array a.
Upsample frame at least 4 times with very god resampler.
FFT upsampled frame, store FFTd result in array b.
Compare result a and result b.
Discreppancies means clipping.

Check new frame for samples over +/- 0.25.
Peak over +/-0.25, but no clipping means +0dBFS but not clipped signal.

I sure there are more intelligent solutions out there also....

Torgeir
 
Last edited:
OK.
RMS is root mean square and the "square" is the value squared. So DC has same RMS value as square wave when:
* Symetric(around 0, linear value)
* Same magnitude of the peak values as the DC value.

I think the HpW analyser will support this claim:)

Another matter is that an bandlimited squarewave is not actually square....
 
Last edited:
Note that the 22050 @ 44100 example fails to satisfy the sampling theorem (assuming the response extends to DC), that is not a valid set of samples.

Intersample peaks are a known thing and come down to the fact that while you can digitise any signal that fits and reproduce it, not all sets of samples are reproducible.

Consider a sample sequence that is just +- full scale depending on the sign of the impulse response of the reconstruction filter, this is the pathological case and pretty much nothing will reproduce that.

There are at least two views on the subject of intersample peaks, you can take the view that the correct response is "So don't do that then", or you can attenuate by some arbitrary amount going into the DAC or lossy codec, 6dB is usually sufficient and is easy to contrive with a small amount of programmable logic if the DAC lacks the ability to do it internally.

Regards, Dan.
 
Yeah there should be a DC alias since 22050 is not < 44100/2

But i guess 22049.999999999999 could go on for a while before samples goes over 1.

The whole point of the seach of intersample peaks over 0dBFS is to not blame the loudspeaker, amplifier or maybe even DAC when hearing artifacts that can be attributed to program material with such overload.
(I am speaking as a consumer (not producer) of program material)

The problem is also that the phenomena is not that widely known and even ASRCs are made now that don't do the -6dB preattunation.

"Bitperfect", meaning no digital attunation, is also a goal for many even if that can lead to +0dBFS artifacts.
 
Last edited:
Consider a sample sequence that is just +- full scale depending on the sign of the impulse response of the reconstruction filter, this is the pathological case and pretty much nothing will reproduce that.

Do you have a formula of the signal?

Would be fun to make such a signal.

There are a second approach to the "impossible to handle signals"
Some systems handle them with grace and they are barely detectable or muted, other systems destroys your tweeters and damage your ears.
(Okay a little overexaggggerating:)
 
Intersample peaks are a known thing and come down to the fact that while you can digitise any signal that fits and reproduce it, not all sets of samples are reproducible.

This is a very interesting point and some of the center of the problem.
At least since 2006 it has been published resuts of reproduction of such signals in hifi equipment. I guess methematichans has known for 100 years.

The problem is that a lot of compressors the last 20 years make waveforms that is not reproducable by user quipment.
Hence the thread. It is interesting to se when in programmaterial such waveforms occur. Both intersample peaks and plain brickwall compression.

Do you know a way to detect brickwall compression and waveforms that are unreproduceable?
 
Got an idea (or maybe i have read it somewhere) how to, in a crude way, detect digitaly clipped signal.

A sampled signal is bandlimited to half Nyquist.
If no digital clipping or compression has occured there are no added frequencies over half Nyquist.
If oversampleing reveals frequencies over original half Nyquist there has been compression or clipping.

The enclosed pictures shows a 1kHz, 44100 SR, phase 0, peak -6dB, sine that has 1.1 linear peak, but are clipped at 1. (All sine values over 1 or less than -1 is set to 1 or -1) See first picture.
Second picture is FFT of the signal.
Third picture is the signal oversampled 4x linear.
Fourth picture is FFT of oversampled signal.
We can see that the clipping distortion is easily seen over 22050Hz.

Editor is Wavosaur free audio editor with VST and ASIO support

It is crude, but it it is easy to implement and we dont need to know more of the original signal than that it is properly bandlimited to <SR/2.

It will not detect subtle compression that is LP filtered or has no residue outside original SR/2
 

Attachments

  • 1k1p1clipped.JPG
    1k1p1clipped.JPG
    128.4 KB · Views: 125
  • 1k1p1clippedFFT.JPG
    1k1p1clippedFFT.JPG
    97.7 KB · Views: 127
  • 1k1p1clipped4xupsample.JPG
    1k1p1clipped4xupsample.JPG
    128.9 KB · Views: 122
  • 1k1p1clipped4xupsampleFFT.JPG
    1k1p1clipped4xupsampleFFT.JPG
    120.8 KB · Views: 130
...a known issue that can produce "higher than expected" peaks in a amplitude, bandwidth limited digital waveform is illustrated by the "over 0 dB fs problem"

illustration from: Over The Top?
shows what you can get by deliberate construction, applying the realistic limit that real DAC hardware will amplitude limit so the "run up" to the "over" has to be both amplitude and bandwidth limited

by "eyeball" that isn't an "infinite" slew rate - 2x maybe?

I believe I heard Bob Adams claim better oversampling audio DACs do use saturation arithmetic in the digital filters and include 3 dB over range for the more common hard clipping of simpler music signals

and some DAW sw is "aware" of the problem and provide tools to view reconstructed signal to avoid the problem in the mastering

Mastering audio: the art and the science - Google Books

235586d1313458216-john-curls-blowtorch-preamplifier-part-ii-fig6.gif
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.