Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpda!motcsd!mark From: mark@motcsd.UUCP (Mark Jeghers) Newsgroups: sci.electronics Subject: Re: Square to Sawtooth Message-ID: <288@greek.UUCP> Date: 29 Mar 89 21:30:16 GMT References: <7476@thorin.cs.unc.edu> Reply-To: mark@greek.UUCP (Mark Jeghers) Organization: Motorola Computer Systems, Cupertino, CA. Lines: 33 In article <7476@thorin.cs.unc.edu> rohlf@unc.cs.unc.edu (John Rohlf) writes: > > Given an externally generated square wave of varying > frequency(audio range) and varying amplitude, what is the best/ > easiest way of converting it to a sawtooth of the same frequency > and amplitude? A couple of methods of varying complexity/quality/cost: A. Simple capacitor discharge setup. Load the square wave output with a diode and a capacitor (and maybe a small resistor) such that the cap charges more or less instantaneously and discharges slowly. The problem is that the quality is low and it works over a small range of frequencies. B. A more complex version of "A", using a transistor to control the discharge rate of the cap. Use the transistor as a "throttle", varying the discharge rate in inverse proportion to the frequency. Complications: you must have a voltage or current available that varies with the frequency, also, I don't recall the exact wiring of the parts to achieve this effect. C. The D/A approach. Start with a square wave many octaves higher than what you want as your output. Feed it to a binary counter, 7 or 8 bits wide for instance. Feed that to an A/D converter and sawtooth will be output. It will contain staircases which can be filtered out. Using more bits will reduce the staircases in size, but also require a higher initial frequency. A square wave whose frequency matches the sawtooth can be taken directly off the lowest frequency bit of the binary counter. Corrections/expansions/comments upon this are welcome. Mark Jeghers Motorola Computer Systems