<div dir="ltr"><font color="#000000">&quot;<span style="font-family:arial,sans-serif;font-size:12.800000190734863px">&quot;last&quot; and &quot;prev&quot; are the last two _output_ samples.</span><br style="font-family:arial,sans-serif;font-size:12.800000190734863px">
<span style="font-family:arial,sans-serif;font-size:12.800000190734863px">i don&#39;t know fexpr~ very well, but it looks like you try to access the last _input_ samples.&quot;</span></font><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><font color="#000000"><br>
</font></span></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><font color="#000000">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.</font></span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><font color="#000000"><br></font></span></div><div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">But I did it because I believe </span><span style="font-size:12.800000190734863px;font-family:arial,sans-serif">&quot;last&quot; and &quot;prev&quot; in </span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">this formula are in fact about input samples. And I still do. The reason being that I checked the code of other objects like [biquad~], and </span><span style="font-size:12.800000190734863px;font-family:arial,sans-serif">&quot;last&quot; and &quot;prev&quot; where names used both for input and output operations, the difference being that the math for the output operation was something like </span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">*out++ + coef1 * last + coef2 * prev  instead of </span><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">*in++ + coef1 * last + coef2 * prev (like bp~) .</span></font></div>
<div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></font></div><div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">So I feel pretty strong about getting this [fexpr~] right. Is there anything I did not take into consideration? </span></font></div>
<div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></font></div><div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">One way or another, input or output samples, seems pretty clear to me you could achieve [bp~] with [biquad~] coefficients. I think the tricky part now is getting to the coefficients and gain values.</span></font></div>
<div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></span></font></div><div><font color="#000000"><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">Cheers</span></font></div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-11 3:23 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 03:07, Alexandre Torres Porres wrote:<br>
<br>
&gt; hey, the code I sent only calculates the coeficients, but I left out an important part which is<br>
&gt;<br>
&gt; t_sample output = *in++ + coef1 * last + coef2 * prev;<br>
&gt;<br>
&gt;         *out++ = gain * output;<br>
&gt;<br>
&gt;         prev = last;<br>
&gt;<br>
&gt;         last = output;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; This shows how the filter is done with those coefficients<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; It&#39;s easy to implement this with [fexpr~], it goes something like:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; [fexpr~ $x + (coef1 * $x1[-1]) + (coef2 * $x1[-2])]<br>
<br>
</div>&quot;last&quot; and &quot;prev&quot; are the last two _output_ samples.<br>
i don&#39;t know fexpr~ very well, but it looks like you try to access the last _input_ samples.<br>
<span class="HOEnZb"><font color="#888888">vb<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</div></div></blockquote></div><br></div>