<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks, Roman.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><div class="gmail_quote">On 2 February 2018 at 21:28, Roman Haefeli <span dir="ltr"><<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fre, 2018-02-02 at 18:31 +0000, Dario Sanfilippo wrote:<br>
> There's an implementation of a peak holder in this blog post: http://<br>
> <a href="http://dariosanfilippo.tumblr.com/post/162523174771/lookahead-limiting-in-" rel="noreferrer" target="_blank">dariosanfilippo.tumblr.com/<wbr>post/162523174771/lookahead-<wbr>limiting-in-</a><br>
> pure-data. I remember testing it but please let me know if you find a<br>
> bug.<br>
<br>
</span>Very nice write up. Thanks for sharing.<br>
<span class=""><br>
> The current peak is replaced to whatever the input is after a desired<br>
> time, and the counter is reset whenever a new peak is found. It<br>
> should be easy to change it so that the peak is reset periodically.<br>
<br>
</span>It's not exactly equivalent with what I've asked, since your<br>
implementation only takes new peaks into account after the hold period<br>
has ended. </blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​Perhaps my wording ​in the previous email was confusing: what happens is that every new peak will update the output immediately, and whenever that happens the countdown starts so that, should no other peak be detected after that time, the output will be set to whatever the input is in that moment.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Assume an input signal consisting of a series of 1-sample<br>
impulses with a period that is slightly lower than the hold period. The<br>
output signal has a gap before each second impulse. For the use case in<br>
your article (which is also the use case I'm interested in), that<br>
doesn't matter much, because the peak holder signal is fed to a peak<br>
enveloper which somewhat masks those gaps.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​In that case, we should expect a full-amp DC​ out of the peak holder for the impulses are faster than the hold time, and that's what we actually get:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><img src="cid:ii_161598dfdaa80246" alt="Inline images 2" width="562" height="538"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">So the peak envelope is only used to transition from the peak to the non-peak value exponentially.</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I'm going to use your implementation for peak holding. Thanks!<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman<br></font></span></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​Sure, you're welcome. I hope that this makes more sense.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dario​</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
<br>
</font></span><br>______________________________<wbr>_________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/<wbr>listinfo/pd-list</a><br>
<br></blockquote></div><br></div></div>