<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On March 18, 2013 07:04:52 PM Tim E. Real wrote:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On March 18, 2013 06:47:16 PM you wrote:<br /></p>
<p style=" margin-top:12px; margin-bottom:12px; margin-left:80px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:80px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Mon, Mar 18, 2013 at 5:50 PM, Tim E. Real <<a href="mailto:termtech@rogers.com"><span style=" text-decoration: underline; color:#0057ae;">termtech@rogers.com</span></a>> wrote:<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:84px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi again. Looking for any advice, tips, tricks, anecdotes etc.<br /><br />I want to eliminate or reduce 'zipper' noise on volume changes.<br />So I'm looking at two techniques:<br />Zero-crossing / zero-value signal detection, and slew-rate limiting.<br />Code is almost done, almost ready to start testing each technique.<br />Each technique has some advantages and disadvantages.<br /><br />If I use a slew-rate limiter, I figure for a sudden volume factor change<br /> from 0.0 to 1.0, if I limit the slew rate to say 0.01 per sample then after<br /> 100 samples the ramp will be done.<br />But even with a fine ramp, this still might introduce artifacts in the audio.<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:80px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />You cannot avoid artifacts in the audio. The only question is what is the nature of the artifacts.  <br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:80px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:84px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">If I use a zero-crossing/zero-value detector and apply volume changes<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:80px; margin-right:80px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />Zero crossing stuff is a completely bogus idea that needs to be eliminated from the lexicon of audio software. You will not be accomplishing anything trying to use such a technique, other than introduce even more artifacts (and rather horrendous ones at that). Even zero-valued samples are not particularly useful - keep in mind that what defines transducer (read: speaker) behaviour is power, not instantaneous volume.  <br /><br />Just use sensibly short ramped changes. For the record, Ardour uses 64 or a JACK period size, whichever is, hmm, larger or smaller, can't recall.<br /><br />--p<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Wow, surprising answer. </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Can you elaborate a wee bit on the bogus point? What worse artifacts?</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Popping noise will be heard if sudden volume change is applied while</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> the signal data value is currently non-zero.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Is it not better to apply (register) the changes during zero or near-zero</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> signal data values?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">After all, some electronic systems employ it: <br />http://en.wikipedia.org/wiki/Zero_crossing</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">http://electronicdesign.com/analog/digital-volume-control-eliminates-zipper-noise<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Thanks.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Tim.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br />Ah, I may have answered my own question when I said:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">"(One cannot simply wait for the current data value to be 'zero' because</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> for example with a perfect square wave signal the 'current' value will never </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> approach zero, hence the zero-crossing detection requirement.)"</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Yeah, I was worried about that bit: </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">That's not just an exception. With all kinds of waves not just square, many </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> times the current value may not approach zero even if it did 'cross' over.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">So having no choice but to apply the volume at this cross point the popping</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> noise might still be heard. I guess that's what Fons meant by 'reduced'...</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"> and what Paul meant by... bogus. Right?</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Thanks.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Tim.</p></body></html>