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.
That is an extreme waveform:)
Hope it isn't an dirac delta that exeeds the bandwith of FS/2! https://en.wikipedia.org/wiki/Dirac_delta_function

I have made two enclosed files.
Compound of 0.5 Hz, 50Hz and 1kHz.

First has all with same amplitude 1 then all total devided by 3. Peak 1 linear
Second has 1K with amplitude 1.3 then all total devided by 3. Peaks over +/1 is clipped to +/-1

Distortion that comes and goes are easily heard in the last file. (Nothing wrong with the DAC, the signal is clipped)

If waveosaur is used to upsample files 4 times one can easily see how distortion (also over FS/2) comes and goes as one steps the FFT through the file. FFT size 16384 is OK. Then both clipped and unclipped signals are transformed as you step through the file.
 

Attachments

  • 0p5Hz50Hz1kHz1p0clip.zip
    852.1 KB · Views: 57
  • 0p5Hz50Hz1kHz1p3clip (2).zip
    846.8 KB · Views: 56
  • sampleratechange.JPG
    sampleratechange.JPG
    133.6 KB · Views: 150
  • sampleratechangeFFT.JPG
    sampleratechangeFFT.JPG
    120.7 KB · Views: 150
The enclosed picture of real pop waveforms shows that the waveforms are relevant, but I can't get the oversample and HF distortion suggested method to give any good indication of distortion other than aliasing.
Maybe the compressor is smarter than me....
 

Attachments

  • pop1.JPG
    pop1.JPG
    237.1 KB · Views: 142
  • pop2.JPG
    pop2.JPG
    154.2 KB · Views: 147
  • pop3.JPG
    pop3.JPG
    204 KB · Views: 146
Just as a heads up; I've got a beta test of PyMasVis as a service up at PyMasVis now. It calculates, among other things, true peak using 4x oversampling and a FIR lowpass filter. Perhaps not 100% accurate but close enough to know if there is data above 0 dBFS.

That's great! Really useful for analysing a problematic track.

+1.74 dB TP on the track. No wonder it sounds a little distorted on some equipment.

Thanks a lot.

Regards Torgeir
 

Attachments

  • 1-02-Touch-My-Body.mp3-pymasvis.png
    1-02-Touch-My-Body.mp3-pymasvis.png
    46.3 KB · Views: 75
Perhaps not 100% accurate
Hmm, has the algorithm's accuracy been tested against signals of known clipping? There's two main error sources I'm seeing:

1) If I'm understanding your brief description, the approach is an attempt to estimate the unclipped waveform by shifting aliased energy out of band and rejecting it. Upsampling and lowpassing doesn't accomplish this. Upsample replicates the energy into the images and lowpass then rejects those same images. At a basic level that puts one back to the start. But I looked at the code only quickly, so perhaps I missed some multiband cleverness.
2) For 100% accuracy you'd need an antialiasing filter with an ideal impulse response. Those are hard to get. ;) If fir_coeffs() is analyze.py is the right place I'd guess from a glance at the taps you've selected an intermediate phase filter where the resulting time domain smearing might build to something like -3dB, meaning worst case interaction with the signal could overestimate clipping by also around 3dB.

I'm unsure reports of 1-2dB clipping would necessarily be significant due to the latter. The former's harder to quantify.
 
From the first post the signal:
* 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
And the sum devided by three.
That means no samples over +/-1.00000
Top values at +0.67dbFS

has been run through. Shows less, not more overload.
Guess the 4 times oversampling don't qite hit the top:)

For oversampling and peak detection. Have a look at chapter 10.3 in:
http://www.dspconcepts.com/sites/default/files/documentation/Audio Weaver Module User's Guide.pdf
 

Attachments

  • 48sf6kdiv100s1p08.wav-pymasvis.png
    48sf6kdiv100s1p08.wav-pymasvis.png
    34.5 KB · Views: 66
Last edited:
No samples beyond unity and top values of 0.67dB are inconsistent. And, as the sines are wavelength aligned, the expected maximum looks like 0.23dB. Consider testing across some frequency and level sweeps.

DSP Concepts stated purpose in 10.3 avoids some of the difficulties mentioned in my first point. Not sure how much it helps in figuring out, say, 20dB got taken off the top of a hi-hat. But considerations of amplitude increase on resampling other reconstructive corrections are fairly well known and I would hope most (A)SRC software, hardware, and DACs designed to accommodate them. Not something I've ever seen specifically called out in a spec but it's plausibly another source of false positives for this algorithm.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.