• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Question re: digital clipping on streaming

StevenEleven

Addicted to Fun and Learning
Forum Donor
Joined
Dec 1, 2018
Messages
581
Likes
1,190
I have a home-made Raspberry Pi digital streamer, which uses the Airplay protocol. It streams from wifi to the Raspberry Pi and out over optical via a HiFiBerry hat. There is no analog conversion going on until the signal moves beyond the Raspberry Pi and the hat.

I also have a Berhinger DEQ2496 (Swiss army knife EQ, DAC, ADC, or digital only processor). Yesterday I decided to put my DEQ2496 in between my Raspberry Pi and my receiver, so that I could do Stupid Audio Tricks with it. In the past I have only used the DEQ2496 for headphone EQ and crossfeed—this was the first time I’ve used it with my stereo system. I’ve had it for about 15 years.

The first question is: The DEQ2496 says I am getting digital clipping based on the input signal when I stream at max volume over AirPlay via wifi from my iPad to my Raspberry Pi to the DEQ2496. When I back off one volume step from max on the iPad all the clipping is gone—we are at -2 or -3 dB from clipping at peaks. I am having a hard time even conceptualizing what this indicated digital clipping means or what I should do about it or if it’s real, etc. Could someone please help me understand this? I suppose I could always back off one notch down from streaming at max volume using airplay over WiFi from the iPad to the Raspberry Pi, if that’s what the Behringer is trying to tell me I should do.

The second question is (for those of you with experience with the DEQ2496): Can I use my DEQ2496 (which can generate pink noise) and a nice microphone for last-stage bass managememt, i.e., smoothing out the bass FR? I have two subwoofers crossed over via an A/V receiver. If so, how would I use the DEQ2496 for this type of bass managememt? By ear I’m quite happy with my bass response but of course I wonder if I can do better, as part of the hobby.

To anyone who generously expends the time and effort to help, thanks!!! :):):)
 
Last edited:

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
The easiest way to understand this phenomenon is downloading Audacity, open some audio files and fiddle with Audacity's various EQ/filter settings, and see how the waveform reacts. Just try it. Much easier than explaining in words and graphs.

And yes, one should turn down digital volume to avoid digital clipping, and turn up analog volume to compensate the loss of loudness due to the use of EQ.
 

captain paranoia

Active Member
Joined
Feb 9, 2018
Messages
293
Likes
218
I am getting digital clipping based on the input signal when I stream at max volume over AirPlay via wifi from my iPad

What playback tool are you using on the iPad?
Is it doing replay gain adjustment?
If so, what parameters did you set when you did the volume analysis?
If the parameters were incorrect, replay gain adjustment could be applying too much gain, causing clipping.

Have you done volume levelling on the tracks?

If a playback tool, without replay gain adjustment, sets a gain more than 1.0 for 100% volume, then there's something very wrong with the playback tool...

Volume analysis looks at peak levels in a file, and adds a replay gain tag that will bring the peak level up to some specified value.
Volume levelling does volume analysis, and then applies a permanent gain adjustment to the file, changing every stored sample.
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
↑ Looks like I did not read OP's post carefully and thought that the clipping is post EQ. DEQ2496 manual says:
input.PNG

So please check the settings. A Product like this may have input SRC which may induce clipping as well, but it should not happen if it has built-in digital headroom. Maybe @pkane can explain.
 

Crazy_Nate

Member
Joined
Dec 21, 2019
Messages
52
Likes
68
Is there any oversampling involved? I had to brush up on what happens with intersample overs when researching Benchmark DACs (which have ~3.5 dB of headroom).

For my digital collection, I have my replaygain scanning set to do 8x oversampling for checking the songs / albums for peak levels. I was surprised at how much of my collection would clip once oversampled at 4x or 8x (I left it at 8x to be conservative, I can always turn the analog volume up). With no oversampling everything (entire collection) was at a peak level of 0.999 or 1.000, and that seems to jump almost up to 1.4 or higher with 8x oversampling. Maybe peak levels of 1.1-1.2 for most CDs that I have.
 
OP
S

StevenEleven

Addicted to Fun and Learning
Forum Donor
Joined
Dec 1, 2018
Messages
581
Likes
1,190
Thanks everyone for your thoughtful replies. As I was reading them it occurred to me that I can turn down the digital volume in my Raspberry Pi one smidgen and avoid the problem more permanently.

The iPad is just streaming WiFi to the Raspberry Pi, which is feeding the Airplay stream by optical input to the Behringer. Yes, it is clipping (or limiting) on input to the Behringer. Back off the volume by the smallest possible increment from the app or the iPad and the clipping is gone. You can check either input or output with the Behringer—I am checking for digital input clipping.

I am generally using lossless streaming services. I’ll have to check to see if volume normalization is turned on or off, and if I get different results with different streaming apps. These are variables I hadn’t thought about and need to experiment with.

The idea of digital clipping—that somehow the binary stream represents too high a value at times-it really puzzles me. It’s quite abstract. I’m trying to get my arms around it. I can easily conceptualize an analog input overloading a circuit and clipping. The idea of digital clipping is going to take some study time.

Obviously, some of your discussion is a little over my head, but I appreciate the challenging discussion. :)
 
Last edited:
OP
S

StevenEleven

Addicted to Fun and Learning
Forum Donor
Joined
Dec 1, 2018
Messages
581
Likes
1,190
Is there any oversampling involved? I had to brush up on what happens with intersample overs when researching Benchmark DACs (which have ~3.5 dB of headroom).

For my digital collection, I have my replaygain scanning set to do 8x oversampling for checking the songs / albums for peak levels. I was surprised at how much of my collection would clip once oversampled at 4x or 8x (I left it at 8x to be conservative, I can always turn the analog volume up). With no oversampling everything (entire collection) was at a peak level of 0.999 or 1.000, and that seems to jump almost up to 1.4 or higher with 8x oversampling. Maybe peak levels of 1.1-1.2 for most CDs that I have.

Awesome—that might be it. I want 44.1 in and 44.1 out—I’ll have to check for that. :)
 

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
Awesome—that might be it. I want 44.1 in and 44.1 out—I’ll have to check for that. :)
See the illustrations here:
https://www.audiosciencereview.com/...l-audio-measurements.10523/page-3#post-292532

Keep it mind that when input SRC is mandatory (by design), even when input and output sample rates remain the same, the signal will still be altered, it is done to reclock external signal. In some cases, intentionally mismatch the sample rates (e.g 44 -> 96) in a signal chain can actually reduce jitter. Read this for some examples:
https://www.audiosciencereview.com/forum/index.php?threads/digital-distortion.2059/#post-55543
 

RayDunzl

Grand Contributor
Central Scrutinizer
Joined
Mar 9, 2016
Messages
13,246
Likes
17,159
Location
Riverview FL
My DEQ2496, fed from REW, illuminates the Red light on a full scale sample, as near as I can tell.

If the REW test signal indicates clipping (or a full scale sample using noise), so does the DEQ24996.

If REW does not indicate clipping on noise, neither does the DEC2496,

0dBfs sine does illuminate the red, though REW does not report clipping, -0.01dBfs sine does not.

Pink and White noise, differing attenuations required to avoid a 0dBfs at REW (and the Red light on the DEQ2496 meter). About -9dBfs for pink, and -2dBfs for white.

1Hz 0dBfs sine illuminates the Red once per second. I expected twice per second.

---

Setup:

REW -> ASIO Topping D10 via USB -> conversion to Optical -> audio Authority 1177A switch -> Optical Out -> DEQ2496, all 44.1kHz.
 
Last edited:

RayDunzl

Grand Contributor
Central Scrutinizer
Joined
Mar 9, 2016
Messages
13,246
Likes
17,159
Location
Riverview FL
Strange. I suppose it should be -2 for pink and -9 for white?

Random Pink. Small number indicates how much "over" it is. You have to attenuate until that is a negative to not clip, though it still clips registers a clip every few seconds.

1582102488008.png
1582102652542.png


Pink Periodic is closer to -2, though.

1582102829967.png


Same as above for White Random and Periodic.

Hmm...

-9 for Random and -2.24 for Periodic noise generation, Pink or White.

---

https://www.roomeqwizard.com/help/help_en-GB/html/siggen.html#top

(Scroll down)
 

captain paranoia

Active Member
Joined
Feb 9, 2018
Messages
293
Likes
218
1Hz 0dBfs sine illuminates the Red once per second. I expected twice per second.

+/- 32767 would be symmetric FSD. Only one of those is clipping; the negative-going clip limit being -32768. That's my guess; a consequence of the 2s complement number range.

Pink noise peak to mean is higher than white noise peak to mean, yes?
 

RayDunzl

Grand Contributor
Central Scrutinizer
Joined
Mar 9, 2016
Messages
13,246
Likes
17,159
Location
Riverview FL

captain paranoia

Active Member
Joined
Feb 9, 2018
Messages
293
Likes
218
Well, it's a bit tricky, as the peak value in true white noise is potentially infinite, admittedly, with a very low probability...

I can't say that I've ever looked into the stats of noise too much (or if I did, it was a long time ago, and I've forgotten it), but my intuition says that, for a given signal power, if you roll off the amplitude with 1/f (pink), you must concentrate the power at the lower frequencies. And I suspect that means that you don't get quite so much 'averaging' of the lower frequencies with higher frequency components as you do in white noise. Thus, the signal excursion tends to be larger, as there is more coherence between the noise spectrum. All very hand-wavy thinking...

I shall try to remember to ask our signal processing specialists tomorrow. I suspect we might have to start with the premise that our original white noise is limited to some multiple of sigma.
 

JohnPM

Senior Member
Technical Expert
Joined
Apr 9, 2018
Messages
344
Likes
919
Location
UK
The crest factor figures for random noise are an approximation, since it is, well, random, but pink tends to be lumpier due to the LF heavy balance. The periodic noise sequences show the exact crest factor for the generated sequence, the sequences are adjusted to get it below 6 dB, but those figures will not be accurate once the sequence has passed through anything that alters the phase of the signal (so anything other than a straight digital link). Crest factors on the other side of a DAC will be higher.
 

JohnPM

Senior Member
Technical Expert
Joined
Apr 9, 2018
Messages
344
Likes
919
Location
UK
Meaning varying more over longer time periods as the random low frequency content pushes the signal about. Pink is the lumpy one below :)

pink.jpg


white.jpg
 
Top Bottom