<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><span>My mistake<br><br>> Ah.</span><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div id="yiv1898664165"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;"><div><span>> As often happens, as soon as I have pressed "send" and posted the question, the answer pops out.</span></div><div><span>> xb4 = xb4 - xb4 * xb4 * xb4 * 0.166667f;</span></div><div>><br><span></span></div><div><span>> is replaced by...</span></div><div>> <br><span></span></div><div><span>> xb4 = xb4 - xb4 * xb4 * xb4 * 0.01f;</span></div>
<div>> <br></div><div>> ...and it works.</div><div><br>and then breaks again<br></div><div> </div><div>Gemnotes-0.1alpha: Live music notation for Pure Data<br>http://sharktracks.co.uk/<br></div> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight: bold;">From:</span></b> Ed Kelly <morph_2016@yahoo.co.uk><br> <b><span style="font-weight: bold;">To:</span></b> Mathieu Bouchard <matju@artengine.ca> <br><b><span style="font-weight: bold;">Cc:</span></b> PD List <pd-list@iem.at>; Joe White <joe@rjdj.me>; pddev <pd-dev@iem.at> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, 24 March 2012, 8:47<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [PD-dev] [PD] Filter design for iPhone<br>
</font> </div> <br><div id="yiv1898664165"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;">>> I'm anxious to know what limit is reached in the coefficients of the filter that causes the undefined result (NaN).<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">><br>>I haven't seen the code, but I just want to make you notice that adding together -Infinity and +Infinity results in a NaN ; so does subtracting <br>>two infinities of the same sign.<br>><br>>So, the NaN might happen when two expressions that are supposed to partially cancel each other, happen to both overflow, in different directions.<br>><br>>There are various possible causes for NaN, but with formulas that only involve +, - and *, the possibilities
are a lot more limited.<br><br>Hmmm.<br>I think that's why it
puzzles me so. Can you see a / anywhere here?<br><br> while (n--) {<br> i1=(*in++);<br> fc1 = (*fc++);<br> res1 = (*res++);<br> q = 1.0f - fc1;<br> p = fc1 + 0.8f * fc1 * q;<br> fcoeff = p + p - 1.0f;<br> q = res1 * (1.0f + 0.5f * q * (1.0f - q + 5.6f * q * q));<br> i1 -= q * xb4;<br> t1 = xb1;<br> xb1 = (i1 + xb0) * p - xb1 * fcoeff;<br> t2 = xb2;<br> xb2 = (xb1 + t1) * p - xb2 * fcoeff;<br> t1 = xb3;<br> xb3 = (xb2 + t2) * p - xb3 * fcoeff;<br> xb4 = (xb3 + t1) * p - xb4 * fcoeff;<br> xb4 = xb4 - xb4 * xb4 * xb4 * 0.166667f;<br> xb0 = i1;<br> *out++ = xb4; <br> }<br><br>No reciprocals, no divisions, just +,-,*.<br>I cannot
help thinking I must be reaching a "limit" in the calculus sense...<br><br>Ed<br><br><br><br><br> ______________________________________________________________________<br>| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC<br><br> </div> </div> </div></div></div><br>_______________________________________________<br>Pd-dev mailing list<br><a rel="nofollow" ymailto="mailto:Pd-dev@iem.at" target="_blank" href="mailto:Pd-dev@iem.at">Pd-dev@iem.at</a><br><a rel="nofollow" target="_blank" href="http://lists.puredata.info/listinfo/pd-dev">http://lists.puredata.info/listinfo/pd-dev</a><br><br><br> </div> </div> </div></div></div><br><br> </div> </div> </div></body></html>