Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Test your soundcard for clipping (Read 258285 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Test your soundcard for clipping

Reply #75
Quote
Sorry for your speakers, man ... if I were you, I would mount the two remaining tweeters into the front main system or re-arrange your speakers (if front & rear are the same types) as a start ... that way you can still enjoy two-channel music ...

I made that already, it's a 5.1 speaker system, the 5 satellites are the same type, only 2 was damaged (smooking). I'm looking for new tweeters for reemplacement them, with a bit if lucky the next week I will can get it.
MPC: --quality 10 --xlevel (v. 1.15s) (archive/transcoding)
MP3:  LAME 3.96.1 --preset standard (daily listening/portable)

Test your soundcard for clipping

Reply #76
FYI. All of my test were done under WinXP Pro SP1, using latest Audigy 2 Platinum eX drivers (5.12.1.383), with Hardware acceleration set to full & Sample rate conversion quality set to best (both in Sounds and Audio Devices Control panel), all Creative crap (EAX, CMSS, equalizer, etc) disabled and using fairly high resolution playback equipment (Meier Audio Prehead amplifier + shielded low capacitance interconnects + Ultrasone HFI-650 / AKG K270s / Sennheiser HD600+Cardas cables) in a room with very low volume background hiss during night time.

I'd be glad if I could get rid of the remaining artifacts, but I haven't been able to do so. Not that it's a great loss with another working sound card in the machine, but if anybody finds a really working solution to this, I'd be really delighted to hear about it.

regards,
Halcyon

Test your soundcard for clipping

Reply #77
Quote
Hmmmm....  now Fubar .60 is wierd..   I get heavy "laser blast" sound effects on every one I tried,  (using DS and resampler, and no other DSP) except 32Khz!!   Even Audigy native 48Khz rate had bad noise.  What's going on here?

Guess I'll be irritating and say, "Hey, I'm sticking with Winamp,  for better sound!!"  };-)    Though it is Peter's earlier SSRC code.

You just haven't set up Foobar2000 adequately to cope with this sample (i.e. you've set it up to permit clipping) - and an imperfect setup is one thing this sample helps identify.

As mentioned above, you need to turn on Foobar's clipping prevention (Preferences/Playback/ReplayGain box) because the Replaygain is trying to boost this above full scale, seeing as the dial-tones are very quiet and the full scale ultrasound is inaudible. Replaygain causing clipping is very rare (esp in Album Gain mode). You can turn it off again after the test if you're want to let it clip.

The other (less likely explanation) is that you have soft clipping limiter turned on, and that's causing distortion (as it is supposed to) or you're running some other compressor/limiter DSP (except for Advanced Limiter which only distorts the signal when clipping will occur - it knows this by reading ahead by a number of samples) or are running a pre-amp or equalizer with positive gain values.

From what you say about Winamp, it sounds like you then simply need to set FB2K's resampler active in the DSP list (usu. at the top of the list of DSPs) and set it to 48000 S/s for your Audigy 2.

Then FB2K will sound fine.

Using the SSRC, you also have a good Winamp setup if you don't use the dodgy Winamp EQ, and probably couldn't tell the difference from FB2K in a blind listening test, unless you had very good equipment and environment or have tracks for which Winamp doesn't support Replaygain.

Test your soundcard for clipping

Reply #78
Pio,

Since there may be issues with the OS for Creative cards:  I run Win XP Home SP1 with my SB Live card.  Hardware acceleration set on Full, Sample rate conversion quality set on Best. (These are the defaults.)  My driver version is 3509.0.0.0.

Just about everything is set on default, except that I turn off any software options that look like they are trying to function as an equalizer or DSP, and I adjust the volume sliders from time to time when an aggressive player or other piece of audio software plays with them.

Test your soundcard for clipping

Reply #79
Quote
lucpes, do my speakers have any fuses too? How come they don't put a safety fuse to any speaker more expensive than $300?

image

Here's how the fuse that blew looks like in my case (1.25A). A good idea would be not using HF test tones to check for damage in tweeters... I once blow a tweeter on other speakers using a 19kHz sine so be careful!


Edit: Please don't post large pictures. Thanks.

Test your soundcard for clipping

Reply #80
Well, having tested more thoroughly at different sampling rates with my SB Live 5.1 (Kx 3533 rc2), I have discovered the following...

48 khz ASIO: High freq. distortion (the dog-exciting kind). With volume pumped up, lower freq. hum is present - no more of this or i reckon my speakers 'll fry.

96 khz Dsound: High freq. again. Similar to 48
88 khz Dsound: Same.
64 khz Dsound: Very clear laser-effects.
48 khz Dsound: Almost the same.
44 khz Dsound: Less high freq. with fairly quiet laser-effects
32 khz Dsound: No problems at all.
24 khz Dsound: Same
22 khz Dsound: Same
16 khz Dsound: Same
11 khz Dsound: Same
8 khz Dsound: Same

Used foobar2000. Dithering was turned off, resampler at 64 bit precision, no replaygain calculated so no adjustment made. ...Just incase anyone is interested 

Test your soundcard for clipping

Reply #81
Below 44.1 kHz, if the resampling is done with antialias, the 20 kHz sine is simply removed (max bandwidth 16 kHz) and the sample doesn't clip anymore.

Test your soundcard for clipping

Reply #82
I extracted the sample to a wav file.  I looked at it with Sound Forge to make sure it didn't have something like already-recorded clipping in it.  I set my SBLive wave device and master volumes to 100% since I know these are the unity volume settings (lower settings will raise the quantization noise floor).  Using a full-scale 1kHz test tone at 48kHz, I set listening volume properly to comfortable levels.  Then I played the sample and all I heard was soft touch-tone sounds.  My 19-year-old daughter, who should have hearing less-affected by aging, reported the same, despite the fact my soundcard is a poster child for the anti-resampling bigotry camp.

I think this sample is a trap for the unwary.  Since it contains soft audible sounds mixed with loud sounds beyond the normal range of hearing, it tempts you to turn the volume of your amp way up so you can hear what's going on, but that means you are going to be hearing stuff near or at the quantization noise level which is in practice inaudible.  In addition, you are feeding a lot of energy into the amp and amplying the hell out of it, which the amp's circuitry is not designed for.  Furthermore, if the software used to play the sample has software volume control, you could easily, in trying to set volume to hear the soft tones, badly clip the sample before it even reaches the soundcard, and this might happen on some of the software's settings and not others.

There are better ways to experience digital clipping (wav files with clipping in them), and I think stress-testing amps and speakers with high-energy sound at frequencies that don't tell you what's really going on is a very dubious thing to do.

-Dave
dwh@cfcl.com

Test your soundcard for clipping

Reply #83
The spectrum of the clipped sample has subharmonics of the 20 kHz tone, while the resampled one has also some reflected versions, that are upside down.

Thus it should be possible to generate a sample like a sweep, that would tell if there is digital resampling or not (inversion of the sweep), regardless of clipping.

Test your soundcard for clipping

Reply #84
Quote
The spectrum of the clipped sample has subharmonics of the 20 kHz tone, while the resampled one has also some reflected versions, that are upside down.

Thus it should be possible to generate a sample like a sweep, that would tell if there is digital resampling or not (inversion of the sweep), regardless of clipping.

What exactly are you referring to by the resampled one?  Any resampling algorithm?

-Dave
dwh@cfcl.com

Test your soundcard for clipping

Reply #85
Here are the results of two bad processes performed in SoundForge :

Resampling to 48 kHz, quality 1, no antialias. The result is similar with antialias. Switching to quality 2 (on a 1-4 scale) removes nearly all aliases.

Clipping, applying a +3 db volume process.

The extra tones created look different. There are strong reversed images of the treble tone in the resampled version, but very weak, and low frequency ones in the clipped version. The frequency modulation is also constant in the resampling process, and not in the clipping process.

Test your soundcard for clipping

Reply #86
Quote
Switching to quality 2 (on a 1-4 scale) removes nearly all aliases.


I tried the same on Soundforge (WaveLab produce utterly horrible results), using different quality ranges.

Actually what I found out was that none of the resampling algorithms remove the problems.

With my crappy multimedia speakers I can hear a significant amount of hum/noise when the 19.5 kicks in.

With Ultrasone HFI-650 (which are painfully analytical headphones at times, imho) I can hear not only the increased noise, but ALSO a faint trace of the ambulance/chirping sound at the level or slightly below the noise floor. It's there, it's masked, but still clearly audible.

With AKG K271S I have to listen really attentively to hear the noise. I can't hear the chirping/ambulance at all. Increasing the playback volume I can hear the noise, but still not hear the chirping. If I pump up the Volume to 100/100, I get a new clipping sound that modulates in synch with the chirping sound (the chirping is not audible, only the clipping part of it is).

With Grado SR60 I can only hear the slightly elevated noise at similar playback level. If I increase the volume, I start to hear the original 19.5 kHz sound, the muted chirping/ambulance and the noise becomes more apparent. The chirping/ambulance is still clearly fainter than with Ultrasone, but then again the 19.5 kHz is clearly more audible. Clearly.

With Sennheiser HD600 I can hear the 19.5 kHz sound even at the same volume (very faintly), I cannot get the ambulance/chirping sound even at extremely high volume and the noise is very subdued, although audible at a higher volume.

I think this sample has much more use than just as a tool to:

1) estimate proper volume levels to avoid clipping
2) estimate the sample rate conversion quality of your software / hardware

Please note that the two above can be separated from each other. I can make the SRC almost ok, but destroy the results by pumping up the volume and causing clipping.

So we actually have two different artifacts working here at the same time. Aliasing intermodulation distortion due to sample rate conversion and clipping distortion.

In addition to the above, I think the sample is very useful in gauging differences between your sound reproduction gear. The high frequency analysis capabilities of my various heardphones become very apparent through the use of this sample.

I'm just afraid of destroying what's left of my very diminished HF hearing, by playing back this sample all over again too many times

I really recommend this sample (with precautions regarding hardware and your own hearing!) for testing 1) clipping, 2) sample rate conversion quality,  3) playback gear HF and dynamic reproduction capability.

regards,
Halcyon

Test your soundcard for clipping

Reply #87
Using Foobar through a Prodigy 7.1 soundcard.

Just some slight static with no DSP plugins. If I use the SSRC resampler (which I always do), it sounds perfect.

Yea for me

Edit: The Crossfeed DSP makes it sound like aliens attacking from space.
flac > schiit modi > schiit magni > hd650

Test your soundcard for clipping

Reply #88
Quote
Here are the results of two bad processes performed in SoundForge :

Resampling to 48 kHz, quality 1, no antialias. The result is similar with antialias. Switching to quality 2 (on a 1-4 scale) removes nearly all aliases.

Clipping, applying a +3 db volume process.

The extra tones created look different. There are strong reversed images of the treble tone in the resampled version, but very weak, and low frequency ones in the clipped version. The frequency modulation is also constant in the resampling process, and not in the clipping process.

I see.  If you want to make a graph of the Creative upsampling, isolated, you can download: http://pages.sbcglobal.net/udialsb.wav (for awhile).

-Dave
dwh@cfcl.com

Test your soundcard for clipping

Reply #89
Quote
Quote
Hmmmm....  now Fubar .60 is wierd..  I get heavy "laser blast" sound effects on every one I tried,  (using DS and resampler, and no other DSP) except 32Khz!!  Even Audigy native 48Khz rate had bad noise.  What's going on here?

Guess I'll be irritating and say, "Hey, I'm sticking with Winamp,  for better sound!!"  };-)    Though it is Peter's earlier SSRC code.

You just haven't set up Foobar2000 adequately to cope with this sample (i.e. you've set it up to permit clipping) - and an imperfect setup is one thing this sample helps identify.

As mentioned above, you need to turn on Foobar's clipping prevention (Preferences/Playback/ReplayGain box) because the Replaygain is trying to boost this above full scale, seeing as the dial-tones are very quiet and the full scale ultrasound is inaudible. Replaygain causing clipping is very rare (esp in Album Gain mode). You can turn it off again after the test if you're want to let it clip.

The other (less likely explanation) is that you have soft clipping limiter turned on, and that's causing distortion (as it is supposed to) or you're running some other compressor/limiter DSP (except for Advanced Limiter which only distorts the signal when clipping will occur - it knows this by reading ahead by a number of samples) or are running a pre-amp or equalizer with positive gain values.

From what you say about Winamp, it sounds like you then simply need to set FB2K's resampler active in the DSP list (usu. at the top of the list of DSPs) and set it to 48000 S/s for your Audigy 2.

Then FB2K will sound fine.

Using the SSRC, you also have a good Winamp setup if you don't use the dodgy Winamp EQ, and probably couldn't tell the difference from FB2K in a blind listening test, unless you had very good equipment and environment or have tracks for which Winamp doesn't support Replaygain.

OK...  turning off Replaygain killed the laser noises.  Is this what you mean by "turning on Foobar's clipping prevention"?

I never changed it before,  it was set to "use album gain"  and "use peak info..." checkbox was checked.  Isn't the checkbox feature supposed to detect the highest peak and then use that as a maximum?  It can't detect a 19Khz (or whatever that high tone is) tone?

I had no other kind of limiter or other DSP,  just the Attenuator (don't know what this is, if not the volume control) and the Resampler, which I did have set to 48Khz for most of my tests,  since I have a Audigy 1.

So,  I guess Foobar's problem was completely caused by Replaygain scaling the track wrong..

Hmmm... thought I'd check this out by running no resampling and no replay gain to see the different effect of clipping and bad resampling, and Foobar just locked up..  Ok, no resampling is similar,  laser sound but quieter and raspier,  then with the replaygain changing it.

Only question I'm left with, is Replaygain supposed to catch a file like this and  use the peak info to rescale when the first pass at it still causes clipping,  like the checkbox mentions?

Maybe a second question,  did Peter ever make a resampling version past 2.2.2.3 for winamp2?  Not that I apparently have any problems with that one... 

I do noitce that Foobar now puts up the playing file when you're listening to a Shoutcast station,  but I'm still a sucker for the quick link to the homepage, and etc that you get with Winamp..

Test your soundcard for clipping

Reply #90
"foobar2000 player v0.666 released

Changes:
- removed replaygain-scan-while-playing"

Hmmm... might this be why the "rescale-it-to-peaks-if-it-still-clips" feature isn't apparently working? 

Assuming that that feature is supposed to do that in a case like this..  (I can't say I really know what's going on there)

Test your soundcard for clipping

Reply #91
Ack. My laptop made that sound quite painful. 

Test your soundcard for clipping

Reply #92
Quote
Using Foobar through a Prodigy 7.1 soundcard.

Just some slight static with no DSP plugins. If I use the SSRC resampler (which I always do), it sounds perfect.

Yea for me

Edit: The Crossfeed DSP makes it sound like aliens attacking from space.

Really?  Should have gone with the Revolution!  No noise or anything with both resampling on and off.  Any volume setting, any output.

(Just kidding - I'm sure the Prodigy is also a nice soundcard).

Test your soundcard for clipping

Reply #93
Quote
Quote
Using Foobar through a Prodigy 7.1 soundcard.

Just some slight static with no DSP plugins. If I use the SSRC resampler (which I always do), it sounds perfect.

Yea for me

Edit: The Crossfeed DSP makes it sound like aliens attacking from space.

Really?  Should have gone with the Revolution!  No noise or anything with both resampling on and off.  Any volume setting, any output.

(Just kidding - I'm sure the Prodigy is also a nice soundcard).

I think the artifacts this sample produces with various settings on various sound cards using various playback gear are hard to compare.

I have demonstrated above (with my less than perfect hearing) that the ability to hear the artifacts from a sound card with this sample are very volume and playback gear dependent.

Hence, if you don't hear any artifacts and don't want to, then don't upgrade your playback gear

Then again, if you hear artifacts on your sound card and another person with the exact same sound card doesn't hear them, don't feel bad about it. If the settings are all equal, then either you have better hearing or more accurate playback gear (for this particular sample).

Please understand that I'm not saying that Revo (or any other card mentioned in this thread) is not faultless. It's just that testing the faultlessness is not necessarily easy. Even high quality equipment can mask some of the artifacts in this test.

I'm just trying to underline the point that whether you hear artifacts or not, is not only a function of your sound card, but also your hearing, playback volume and playback gear.

best regards,
  Halcyon

Test your soundcard for clipping

Reply #94
Quote
OK...  turning off Replaygain killed the laser noises.  Is this what you mean by "turning on Foobar's clipping prevention"?


No, I meant the "use peak info" checkbox being checked.

Quote
I never changed it before,  it was set to "use album gain"  and "use peak info..." checkbox was checked.  Isn't the checkbox feature supposed to detect the highest peak and then use that as a maximum?  It can't detect a 19Khz (or whatever that high tone is) tone?

I had no other kind of limiter or other DSP,  just the Attenuator (don't know what this is, if not the volume control) and the Resampler, which I did have set to 48Khz for most of my tests,  since I have a Audigy 1.


The latest FB2K (v0.666) does need you to scan the track for ReplayGain (which includes peak info) to apply any changes. The peak info is read directly from the sample values in the file, so it doesn't matter what frequency it is. It should measure the peak values accurately and therefore apply almost no gain (because the file is about to clip). I wonder if your peak value information was corrupted? If you right-click the file and erase the ReplayGain info, then right-click it and scan Track Gain, it ought to be OK.

Resampler could cause clipping and still be working properly, though I'd imagine it would be a very subtle amount of clipping, if any, given that.

Yes, Attenuator is the Volume Control.

Your clipping might be elsewhere - not in software, for example in the soundcard electronics or your amplifier, though the fact it didn't clip when you turned off RG seems to indicate a problem there instead.

Hardware clipping is likely to stop if you turn down the volume far enough.

Quote
So,  I guess Foobar's problem was completely caused by Replaygain scaling the track wrong..

Hmmm... thought I'd check this out by running no resampling and no replay gain to see the different effect of clipping and bad resampling, and Foobar just locked up..  Ok, no resampling is similar,  laser sound but quieter and raspier,  then with the replaygain changing it.

Only question I'm left with, is Replaygain supposed to catch a file like this and  use the peak info to rescale when the first pass at it still causes clipping,  like the checkbox mentions?


Yes, except that the first pass no longer scans for RG - you have to scan it manually from Foobar v0.666.

Quote
Maybe a second question,  did Peter ever make a resampling version past 2.2.2.3 for winamp2?  Not that I apparently have any problems with that one... 

I do noitce that Foobar now puts up the playing file when you're listening to a Shoutcast station,  but I'm still a sucker for the quick link to the homepage, and etc that you get with Winamp..


Yup, Winamp sounds very good, and rarely different from Foobar (unless you use the EQ!), so there's no imperative for many users to make the switch, and if you prefer some features, sure, stick with it.

P.S. Someone mentioned Crossfeed causing sirens. For me, Crossfeed DSP hasn't caused a problem with this sample (at 44.1 kHz).

P.P.S. I tried using FB2K to write out a 24-bit dithered 48000 Hz WAV (slow, 64 bit resampling) from this file (no noise shaping) and noted that the suggested track gain of the new file was 1 dB higher (19.2 dB). The peak value was now 1.000000, much as expected. Should the RG estimate change this much with good resampling?

Test your soundcard for clipping

Reply #95
Quote
The latest FB2K (v0.666) does need you to scan the track for ReplayGain (which includes peak info) to apply any changes. The peak info is read directly from the sample values in the file, so it doesn't matter what frequency it is. It should measure the peak values accurately and therefore apply almost no gain (because the file is about to clip). I wonder if your peak value information was corrupted? If you right-click the file and erase the ReplayGain info, then right-click it and scan Track Gain, it ought to be OK.


Ok, I'll try that.  BTW, what looks to be on the file now is:
track gain: +18,200000 dB
track peak: 0,997131

OK, now I'm back from erasing that and redetecting it.  Wierd..  First off, when I erase and rescan,  I get exactly the same value.
Second, with that value, or when it has no value,  there is no problem now,  even with replay gain enabled! ?!? 

Now I'm confused.  Maybe I changed something that didn't reset till Foobar got restarted?  Problem has gone away.

Another note,  even though I can't hear any thing,  I do get a "WARNING (CORE) : Clipping detected"  message in the console.  AND, I don't get it when I turn off Replaygain altogether.

Things that make ya go Hmmmm...

Still sounds great....


Quote
Resampler could cause clipping and still be working properly, though I'd imagine it would be a very subtle amount of clipping, if any, given that.

Yes, Attenuator is the Volume Control.

Your clipping might be elsewhere - not in software, for example in the soundcard electronics or your amplifier, though the fact it didn't clip when you turned off RG seems to indicate a problem there instead.

Hardware clipping is likely to stop if you turn down the volume far enough.


I have to have resampler on to avoid any sounds.
I can turn up my wave and main sliders all the way and have no added clipping.

Quote
Only question I'm left with, is Replaygain supposed to catch a file like this and  use the peak info to rescale when the first pass at it still causes clipping,  like the checkbox mentions?

Yes, except that the first pass no longer scans for RG - you have to scan it manually from Foobar v0.666.


Did it do it in .600? (my former version, I upgraded during testing this to see if there were any differences)

Arrgh..  locked up on me again, playing stream and poking around in Preferences..

Jon

 

Test your soundcard for clipping

Reply #96
[EDIT]This post has some factual assumptions that were incorrect, as pointed out by Garf in the next post. I think I found the root cause in the post after his[/EDIT]

The FB2K database (if enabled) may have needed refreshing, I guess.

When I started typing this post, I suspected the console message is referring to clipping detected from the Resampler output. The tiniest amount of attenuation (volume control -0.5 dB) would be enough to stop this.

The 20 kHz +/- 1 kHz frequency-modulated sine wave in the original is almost full scale (probably a bit less so it can add to the extreme values of the dialling tones and reach full scale but no higher). The sampling points at 44.1 kHz are below full scale (hence the track peak of 0.997...) because they don't happen to coincide with the peaks.

Assuming I'm correct about the target amplitude of the sine waves, a perfect (infinitely long) reconstruction filter when upsampling should generate a track peak of 1.000000 at most on every peak where the sampling point lines up perfectly with the peak of the sinusoid. I'd imagine the Resampler (SSRC) DSP plugin, even in Slow mode (long reconstruction filter window) and 64-bit precision, will still show some very subtle (inaudibly subtle) variation in loudness at frequencies so near to the Nyquist limit (22.049... kHz is the highest frequency that can be accurately represented by 44100 Sa/s sampling). This could cause tiny amounts of clipping, such as 1.00001, which would generate inaudible clipping distortion, even on this sample, yet would be just high enough to trigger the console warning.

(I actually tried resampling to 48000, WAV 64-bit floating point to test this, and found that FB2K's resampler doesn't cause clipping on this sample).

Using Resampler: Slow mode, 64 bit:
Track Gain = +18.210000 dB
Track peak = 0.997059

Fast mode, 64 bit (same for 32 bit):
Track peak = 0.997217

So (without using Preamp or Equalizer) these shouldn't clip on their own.

What about adding dither? Could that cause clipping?

EDIT: No, it can't, as Garf points out below, the ditherer won't add dither if the added noise would push the sample value beyond +1.000 or -1.000.

Assuming you use 16-bit playback (which I'm not sure of), setting dither to "strong ATH noise shaping (recommended)" the stronger high frequency content than "no noise shaping" can add about 31 (out of 32767) to a sample value at the peak - just now and again. That's 0.000946, which still isn't enough to exceed 1.000000 if you apply no replaygain.

However, you're using ReplayGain, so it would like to add 18.21 dB, then realises it can't from the peak value of 0.997131, so it's scaling
to get a peak of 1.000000 instead (a gain of about +0.024955 dB). You then add dither, which can take the peak to 1.000946 at most).

Edit: This is not true. Dither is not added if the sample would exceed 1.000000, so it must already exceed 1.000000. The culprit is identified in my next message.

That is just enough to clip, but it's so incredibly subtle (and probably incredibly infrequent) that it clips, that it no audible clipping distortion is heard. However, you do get the warning from FB2K.

I guess it would be a finishing touch for FB2K's clipping prevention (Replaygain) to have an option to take account of the dither type and bit depth by scaling the peak to just below 1.000000 so that dither can't cause it to exceed 1.000000. We could either enter the margin by hand, or FB2K could have a look-up table for dither type versus peak dither amplitude for each bit depth and sampling rate. This is overkill at normal bit depths, where it's inaudible, but for low bit depths like 8-bit, it would be useful if people used strong ATH noise shaping.

Also, Replaygain on real music (this udial sample is NOT real music!) rarely causes clipping if the target volume is 89.0 dB - it hardly ever has positive Album Gain values, and only occasionally has positive Track Gain values.

EDIT: Please see my next post for the real explanation.

Test your soundcard for clipping

Reply #97
FB2K ditherer and noiseshaper should never cause clipping in any circumstance, the code protects against this. If it does anyway in latest version, please report it as a bug.

Edit: Peter just reported that the warning cannot be caused by ditherer/noiseshaper.

Scaling down to get dithering headroom at 8 bits audibly lowers volume, it was in the ditherer before but I'm not sure it's a good idea. I'd rather have the ditherer prevent clipping itself, even if that means it is not as effective. The user can still introduce additional headroom via the attenuator, which would allow ditherer to work with full effectiveness. Getting good quality output at 8 bit takes some tweaking anyway.

For practical use, it makes no difference because circumstances where this is an issue should be extremely rare. (Assuming ReplayGain or some kind of clipping prevention is in use)

Test your soundcard for clipping

Reply #98
Thanks for the informative reply, Garf. I'll go back and edit my previous post to mention your detailed knowledge. It's comforting to know you thought of such extreme possibilities as dither causing clipping and designed to avoid them.

I haven't been able to test this myself because the machine I'm on right now doesn't support 48000 Hz. I have actually tested it using Microsoft Sound Mapper, which generates sirens, and didn't get a pop-up warning (I never have been warned of clipping because I use Advanced Limiter as well as RG).

I guess JonPike may have something else causing the warning. The only things that spring to mind are other DSPs. I know that the new Equalizer can have positive values, and the defunct PreAmp could too.

Ah, using diskwriter, 64-bit floating point, resampled to 48000 S/s with DSP enabled (Resampler 48000 S/s, fast, 32bit) AND with ReplayGain enabled (with clipping prevention), the WAV created, when scanned for RG, has:

Track Gain = +18.190000 dB  (correctly reflecting 0.02 dB gain applied with clipping prevention)
Track Peak = 1.000086

That is clipping, but only just, and inaudibly so. The 64-bit floating point WAV output is the same as the internal chain contains just before it dithers down to the playback format.

JonPike's clipping prevention followed by resampler presumably also generated this value. This is the sort of behaviour one might expect from a Resampler because it incorporates a filter. Any filter can cause differing peak values, as can a change of sampling rate.

The same method but with Slow resampling (but still only 32 bit precision), does not clip.

Resampler: 48000 S/s, Slow Mode, 32 bit precision:
Track Gain: +18.190000 dB
Track Peak: 0.999928

So, it's the precision of the long resampling filter window in Slow mode that makes it work more precisely in terms of peak amplitude. There's no audible difference in Fast mode, however.

So it's the combination of Fast mode resampling and ReplayGain going to the clip-prevention limit that generated the clipping warning.

So, JonPike, if you have the processor speed to spare, you could use slow resampling mode, but for sound quality, it's negligibly different, and Fast mode will sound just great. In real music, with Album Gain turned on and 89.0 dB RG target volume, you'll probably never see that warning message again.

There's no need to change your usual settings for real music because the minuscule clipping that did occur was inaudible to you, even on such an extremely sensitive test sample as this, but Slow mode resampling will give that final assurance of the utmost possible quality (albeit that it's inaudible). In real music with Album Gain, the warning message is extremely unlikely to ever be generated.

The only thing one could plausibly wish to add to the ReplayGain interface in FB2k is the facility to specify that RG's 'use peak values' feature could have a margining facility to enable the most pernickety users to ensure that full dither is applied and their resampler will not clip ever. An option of normalising the Album/Track to 0.999000 instead of 1.000000 if the respective album peak or track peak value would cause clipping ought to be sufficient for anyone using 16-bit audio or above, and would leave sufficient headroom for both 16-bit strong ATH noise shaping dither and fast resampling to 48000 S/s to hit their worst peaks simultaneously.

I do appreciate that it's almost certainly inaudible, except when the peak value is ultrasonic and the dither is required for audible sound sinking into the noise floor, so the lack of dither and lack of audible masking frequencies might cause truncation distortion to become audible. But surely nobody would be cruel enough to domestic pets to make a track like that!  Hmm, on second thoughts I wouldn't put it past Aphex Twin! 

Regards,

DickD

Test your soundcard for clipping

Reply #99
I need help.

I have tried everything that I can think of in Foobar v.0.667 to fix the clipping/sample rate conversion problems with udial.ape on Audigy 2 Platinum eX (latest drivers).

I cannot make the aliasing artifacts go away whatever I try. Yes, it becomes lower in amplitude and slightly harder to spot, but it is always there. Clipping goes away with proper setting of volume/replaygain though (which is good). But it is disheartening to notice that it happens at all to the extent that it is audible on Audigy 2.

I have tried:

- Replaygain disabled/track/album
- Peak info to scale on/off
- Output data format16-bit/24-bit/32-bit
- Output data format dither: off/Strong ATH
- DSP Resampling: 48kz/96kHz
- Precision 32/64bit
- slow mode On/Off
- Attenuator: off/on (-9 dB)
- Directsound/WaveOut/KernelStream/Asio output

I either get the aliased sound going on like an ambulance and no clipping (WaveOut/KernelStream) or I get clipped noise bursts that modulate into the noise floor in synch with the aliased ambulance noise, without actually hearing the ambulance noise as such (DirectSound, much less nasty than Wave/Kernel). This all with Audigy 2 Platinum eX.

With RME DIGI 96/8 PAD I get no aliasing modulated ambulance sounds nor do I get any clipping.

Regardless of what settings I use (resampled/replaygained/dithered or not), I always get problems with Audigy 2.

I also tried resampling to 96kHz (no requantization, still at 16 bits) in SoundForge at quality level 4 (using anti-aliasing filter during resampling). This sample is much better, but still has sound that sound like a wailing ambulance siren clipping, when played back on Audigy 2 from SoundForge.

Playing back the same Soundforge sample rate converted sound on RME card produce a very faintly audible trace of something modulated into the noise floor.

What on earth is going on with the Audigy 2 card?

I thought that only the Audigy's SRC/volume control was problematic, but even if I do the resampling elsewhere I still get the nasty ambulance sound, but only on Audigy 2 not on RME 96/8 card.

OffTopic:

On a related note, I tried the various Output device options and recorded the lowest/highest peak cpu utilization with each output option (on RME). Each device was tested ten times in a row (player wasn't restarted in between, no other processes sans system ones were running in the background, no network activity, no dsp/replaygain/dither active = straight 44.1kHz/16-bit playback):

DirectSound        24-35% (bad quality, I mean really horribly bad)
WaveOut            10-15%
Kernel Streaming  (not testable as it was not available for RME)
Asio (Buf:0, Time Critical) 8-13%

I know, it's not scientifict at all, but perhaps other people could chime in on their findings on the issue. What is the best output method to use in F2K regarding cpu usage (now assuming that there was no difference in sound quality)?

My own personal testing (I have spent a lot of time with this sample) leaves me to conlude for now that in WinAmp/Foobar with Audigy, one should use DirectSound with resampling for maximum quality (at least for this sample) and in Foobar with RME I can use Asio or WaveOut (no resampling needed for excellent quality), but ASIO seems to offer the lowest CPU usage levels.

regards,
Halcyon

PS This is not the most important thing in the world for me as I have A2 for games and not for critical listening. As such, this problem is more of academic interest to me, but perhaps more interesting to those using Creative cards for serious work.