<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I see what you mean, Roman. So you'd need the N-size block to be processed beforehand, which would imply an N-size delay in the output, is that right? I haven't thought of it, no idea whether that could be achieved by changing the feedback period in the peak holder and/or adding a delay in the input. Maybe I'll try something later.</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">Cheers,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Dario</div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 3 February 2018 at 09:33, 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"><div class="HOEnZb"><div class="h5">On Sam, 2018-02-03 at 02:47 +0000, Dario Sanfilippo wrote:<br>
> Thanks, Roman.<br>
><br>
> On 2 February 2018 at 21:28, Roman Haefeli <<a href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>><br>
> wrote:<br>
> > On Fre, 2018-02-02 at 18:31 +0000, Dario Sanfilippo wrote:<br>
> > > There's an implementation of a peak holder in this blog<br>
> > post: http://<br>
> > > <a href="http://dariosanfilippo.tumblr.com/post/162523174771/lookahead-limiting-" rel="noreferrer" target="_blank">dariosanfilippo.tumblr.com/<wbr>post/162523174771/lookahead-<wbr>limiting-</a><br>
> > in-<br>
> > > pure-data. I remember testing it but please let me know if you<br>
> > find a<br>
> > > bug.<br>
> ><br>
> > Very nice write up. Thanks for sharing.<br>
> ><br>
> > > The current peak is replaced to whatever the input is after a<br>
> > 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<br>
> > periodically.<br>
> ><br>
> > It's not exactly equivalent with what I've asked, since your<br>
> > implementation only takes new peaks into account after the hold<br>
> > period<br>
> > has ended. <br>
> Perhaps my wording in the previous email was confusing: what happens<br>
> is that every new peak will update the output immediately, and<br>
> whenever that happens the countdown starts so that, should no other<br>
> peak be detected after that time, the output will be set to whatever<br>
> the input is in that moment.<br>
>  <br>
> > Assume an input signal consisting of a series of 1-sample<br>
> > impulses with a period that is slightly lower than the hold period.<br>
> > The<br>
> > output signal has a gap before each second impulse. For the use<br>
> > 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<br>
> > peak<br>
> > enveloper which somewhat masks those gaps.<br>
> In that case, we should expect a full-amp DC out of the peak holder<br>
> for the impulses are faster than the hold time, and that's what we<br>
> actually get:<br>
<br>
<br>
</div></div>Yes, correct. If the peaks  reach the same level or are higher than the<br>
ones before, then the hold period is prolonged. But when they have less<br>
amplitude than the ones before, gaps appear. See:<br>
<br>
<a href="https://netpd.org/~roman/tmp/peakholder_gaps.png" rel="noreferrer" target="_blank">https://netpd.org/~roman/tmp/<wbr>peakholder_gaps.png</a><br>
<br>
With a true max(x[0-(-N)], a downward stairway would appear and there<br>
wouldn't be any gaps. <br>
<br>
As I said, that is only small difference and for the purpose of a look-<br>
ahead limiter it probably doesn't matter that much.<br>
<span class="HOEnZb"><font color="#888888"><br>
Roman<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>