On Thu, 14 Jul 2016 10:32:37 +0900 James Wages wrote: > I had a look at it, but it is implementing a SIN wave and there is nothin= g in that code dealing specifically with a SWEEP across a start and end fre= quency within a given time window. I did an image generator for SSTV (Slow Scan TV) a long time ago. It used DDS techniques to generate a sine wave at the output. It used a pic16c54 (!) to do that, so any more modern processor should be able to do it faster and this produce a better quality sound. Though I don't have the code at hand here, here's the idea: - It uses a fixed frequency interrupt. Each interrupt, a fixed number is added to what is called a 'phase accumulator'. This phase accumulator points to a table of, say, 16 or 32 values of a sine table (2 pi corresponds to 16 or 32 values).=20 - But wait - this technique doesn't give enough frequency resolution (though the 16 levels - or 32) approximate the sine enough, the=20 frequency step is too coarse. This is where a second accumulator comes in. A delta is summed to this accumulator which effectively corresponds to a value from 0 (0x00) to 0.996093 (255). Each time there's a carry, you increment the first accumulator an extra 1. This effectively gives you a decimal part to the fixed number from the previous point, which gives you extremely good frequency resolution. So effective you are dividing your clock by (fixed) to (fixed+1) in steps of 0.004! - And if you don't want a D/A converter (you only need 4 or 5 bits for a 16 or 32 bit table), you can use the trick with Walsh coefficients (using coefficients and a special lookup table). There's an Application Note from Motorola about using Walsh transform to generate sine waves. John --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .