At the risk of boring everyone with our on-line dialog, > >Actually, the table is not biggg. That's the beauty > of > >linear interpolation. See below. > > > Sorry, I wasn't clear at this. I meant that > interpolation may be omitted if > the table is big enough to reduce jitter for DTMF > frequencies. The question > is how big. Again, Cauchy Remainder Theorem for interpolation may be used. In this instance however, it's zero order interpolation (i.e. NO interpolation). IIRC, the error will be proportional to the differences in consecutive entries in the table (I don't know if or what the proportionality constant is). I think intuitively this makes sense. If the index into the table is a fraction, you'll have to round to the nearest integer. Consequently, the ideal sample which lies somewhere between the two that are in the table will be off. And assuming you're satisfying Nyquist, the error will be bounded by the samples that are available. > You forget the integration. Could you perhaps drag up the details showing how this algorithm really works? > I dont have time right now to look at this routine, > have to go to school. It > seems that this small table will require additional > effort on calculation of > mid points to get more accurate frequency. Compared to Eric's table, you're right. His takes about 15 cycles; a savings of about 40 cycles. OTOH, it has 64 entries in the table. I'd probably choose Eric's sine over Scott's for DTMF (especially since Eric already wrote the damn DTMF dialer). 64 table entries is not that many. Further more since the sample output rate is potentially 3 or 4 times faster you could ease the filter requirements even more (again, this depends on how you actually go from a to d...) > > >Perhaps it's not obvious, but the triangle-to-sine > >algorithm may also be viewed as a kind of a digital > >filter, or more specifically the impulse response > of a > >digital filter. Consequently, you may wish to > consider > > > Yeah, this is a first order FIR filter with unitary > coefficients. > > >other simple algorithms. (e.g. a 4'th order FIR > filter > >with binary coefficients or perhaps a 3'rd order > IIR.) > > > Simple? :) Second order FIR may be. But 3'rd order > IIR - no, thanks. First > order IIR is enough to generate sine waveform. It > requires cumbersome > multiplication. The simplest 3'rd order IIR I know is Simpson's 3/8'ths rule. It's not quite as good as the 1/3 rule, but it's much better than the rectangular rule for numeric integration. The only caveat is that even though it is an integration formula, it's transfer function in fact amplifies high frequencies. .lo ===== __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com