piclist 1998\11\05\174919a >
Thread: sin function
picon face BY : Peter L. Peres email (remove spam text)

On Fri, 6 Nov 1998, Dennis Plunkett wrote:

> As this is all to do with DTMF detection I would say that while well and

NO, generation. The great debate was, whether it would be possible to do
it and have some room left over for something else in the PIC, and not use
an output analog filter.

In theory it is possible to do lookup table magic and use a PIC at 4MHz to
output an (almost) arbitrary waveform using 8kHz (125 usec) sampling at 8
bits parallel (into a R2R D/A or DAC08 or whatever) and have lots of time
left over for other things. This works well, as I have written some FM
code to interface a serial stream to radio in real time at 38400
(simplex) and had room to spare.


> Also note the number of samples that would be required, as undersampling
> could not be used successfuly (due to the short period of the tone).
> Sampling would need to be performed at x times the max frequency (1620Hz?)

Re: decoding:

Sampling needs to be done at phone digitizer frequency, 8kHz, to get the
most out of the signal. Also, I think that base clipping will yield a very
'loud' two-tone interference pattern in a ring buffer when receiving DTMF,
and that something or other could be done about this. It would be far from
perfect but it could be usable for projects etc. In theory, it should be
enough to have two full periods of the slower signal in the buffer at any
one time to make sense of it. That would be 700Hz -> ~= 1.4msec -> * 2 =
2.8 msec of samples, @ 125 usec ea. ~= 23 samples. Then you'd have 125
usec to make sense of this. Assuming that a decision and an action is to
be made on each item in the buffer while it is run through in 1 pass,
you'd have 3 T cycles per decision + action * 23 = 69 T cycles to make
sense of the buffer contents, leaving 56 T cycles to wait for the next
sample. This is a PIC at 4 MHz ! My hunch is, that this could work as a
crude DTMF decoder on a PIC. The buffer size fits in the RAM of a 16F84 if
I'm not wrong ;)

I hope that I did not goof on the figures. It's late.



In reply to: <>
See also: www.piclist.com/techref/method/math.htm?key=sin
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) sin function

month overview.

new search...