<div dir="ltr"><div>&gt; <span style="font-family:arial,sans-serif;font-size:12.800000190734863px">change the [fexpr~] to something like </span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">&gt; [fexpr~ $x[0] + ($f2 * $y[-1]) + ($f3 * $y[-2])]</span></div>
<div><br></div>f*ck, I&#39;ll be damned, now my patch that implements [bp~] with [fexpr~] seems to work, it&#39;s attached. Thanks! <div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">&gt; it&#39;s pretty easy to see that from the code you quoted</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">I can&#39;t really see it from the code itself. And, well, remember I mentioned about the biquad code? </span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><div>    {</div><div>        t_sample output =  *in++ + fb1 * last + fb2 * prev;</div>
<div>        if (PD_BIGORSMALL(output))</div><div>            output = 0; </div><div>        *out++ = ff1 * output + ff2 * last + ff3 * prev;</div><div>        prev = last;</div><div>        last = output;</div><div>    }</div>
<div><br></div><div>Well, I made a silly confusion mistake and thought the first line was feedforward  (and then equivalent to the bp~). But still, it could be it for all I can tell. How can you actually see wether is feedback or not?</div>
<div><br></div></span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><div>Anyway, the patch works and I can also make it on biquad, it&#39;s all attached.</div><div><br></div><div>&gt; after all it&#39;s a resonating filter and therefore needs a feedback path.</div>
</span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><div><br></div><div>I wouldn&#39;t know about that, but that&#39;s how you convinced me you knew what you were talking about :) </div><div><br>
</div><div>Thanks again</div></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-11 16:46 GMT-03:00 volker böhm <span dir="ltr">&lt;<a href="mailto:vboehm@gmx.ch" target="_blank">vboehm@gmx.ch</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On 11.04.2014, at 16:48, Alexandre Torres Porres wrote:<br>
<br>
&gt; &quot;&quot;last&quot; and &quot;prev&quot; are the last two _output_ samples.<br>
&gt; i don&#39;t know fexpr~ very well, but it looks like you try to access the last _input_ samples.&quot;<br>
&gt;<br>
&gt; In [fexpr~] you can access input samples with $x variables and output samples with $y. So you&#39;re correct. I&#39;m going for the input samples.<br>
&gt;<br>
&gt; But I did it because I believe &quot;last&quot; and &quot;prev&quot; in this formula are in fact about input samples.<br>
<br>
<br>
</div>no, and it&#39;s pretty easy to see that from the code you quoted:<br>
<div class=""><br>
&gt; &gt; t_sample output = *in++ + coef1 * last + coef2 * prev;<br>
&gt; &gt;<br>
&gt; &gt;         *out++ = gain * output;<br>
&gt; &gt;<br>
&gt; &gt;         prev = last;<br>
&gt; &gt;<br>
&gt; &gt;         last = output;<br>
<br>
<br>
</div>after all it&#39;s a resonating filter and therefore needs a feedback path.<br>
so it somehow has to take outgoing samples back in.<br>
<div class=""><br>
<br>
&gt; So I feel pretty strong about getting this [fexpr~] right. Is there anything I did not take into consideration?<br>
<br>
</div>yes, calculate coef1, coef2 and gain by using the formulas from the code,<br>
change the [fexpr~] to something like [ fexpr~ $x[0] + ($f2 * $y[-1]) + ($f3 * $y[-2]) ],<br>
(where $f2 and $f3 would be coef1 and coef2 resp.)<br>
apply the gain factor afterwards,<br>
and you are done.<br>
<span class="HOEnZb"><font color="#888888"><br>
vb<br>
<br>
<br>
<br>
</font></span></blockquote></div><br></div>