Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

AGC Amplifier Circuit

  1. Jul 1, 2009 #1
    Hello All,

    I'm working on designing a simple circuit that takes a square wave clock input and converts it to a sine wave using a Johnson Counter, an R2R ladder and an output filter capacitor (see the below link for reference):

    http://books.google.com/books?id=rZ... sine wave generator johnson counter&pg=PA360

    I want to be able to use this circuit in a pretty dynamic range 1Hz to 1MHz and this circuit appears to be the simplest way to go about it (aside from programming a microcontroller and using a DDS IC with it). This circuit gives me the ability to simply clock it with a function generator to set the output frequency.

    However, there is one problem; the output filter circuit as pictured in the schematic is only designed to work in one narrow frequency range. I would like to make it work through the whole input range of 1Hz to 1Mhz without needing to manually switch in and out RC values to keep the filter in the right range. So I was thinking that if I could just design the filter for somewhere in the low range, and then add an AGC amplifier to the circuit, that the amp could keep the output amplitude constant as the frequency is increased (and the resulting output sine wave decreases).

    I know that AGC amplifiers are used all the time in audio equipment and I'm currently trying to do some research to see what kinds of ICs are available out there. Has anyone here ever worked with these types of amplifiers? If so, I would appreciate any suggestions people may have :-)

    Jason O
  2. jcsd
  3. Jul 1, 2009 #2


    User Avatar

    Staff: Mentor

    Jason, Your link has a bzillion circuits in it. Which one are your trying to point us at?

    What is your final application? Is it comm? Or some other app?

    My initial inclination would be to use an oversampled system, with zero crossing information feeding a uC generating sine waves per zero crossings, but that really depends on the final application and specs.
  4. Jul 1, 2009 #3
    Hi Berkeman,

    The circuit I am referring to is on page 361 of the book on that link. It shows a means of producing a three-phase digitally generated sine wave using a clock input signal.

    In my case, I want to generate a three-phase sine wave output to feed into some coils that I am playing with. I'm exploring the physics of high-speed rotating magnetic fields and wanted to make a circuit that didn't require me to program a microcontroller. The output of the circuit would be fed to a high power OP-amp or amplifier (TBD) which I would use to drive the load. So at this level, I am just looking to get a signal level output (0-5V or less, I could feed it into an op-amp to get the voltage up later).

    - Jason O
  5. Jul 1, 2009 #4


    User Avatar

    Staff: Mentor

    Why no uC and oversampling? You skeerd?

  6. Jul 1, 2009 #5
    Haha no, lol. I just thought it would be nifty to try this approch. Plus with no need of a micro, you can just clock it with a function generator, or 555 etc :smile:.
  7. Jul 2, 2009 #6
    How much voltage and current do you need in your sine wave.

    How pure does your sine wave have to be?
  8. Jul 2, 2009 #7
    Think a little bit about what you're asking for. One hertz to one megahertz is six decades. At 20 dB per decade for a single pole butterworth, you'll need a range of 120 dB for your AGC amp!
  9. Jul 2, 2009 #8


    User Avatar
    Science Advisor
    Gold Member

    I've found http://en.wikipedia.org/wiki/Voltage-controlled_oscillator" [Broken] to be neat. Your frequency range may be a little much for these VCOs but they are still fun to play with.
    Last edited by a moderator: May 4, 2017
  10. Jul 2, 2009 #9
    The first approach I'd try isn't simple and it won't get you down to 1 Hz. I'd build a crystal oscillator somewhere between 20 MHz and 50 MHz depending on how much range I could get out of a varactor. Then I'd build a VCO and tune it so at the lower limit it would be just above the crystal oscillator.

    By mixing the two, I may be able to get a difference product of about 100 Hz which I would phase lock with your control frequency. The control voltage controls the VCO frequency by raising the voltage across the varactor. If the crystal oscillator is 20 MHz, the VCO only has to go from 20 MHz to 21 MHz.
  11. Jul 3, 2009 #10


    User Avatar
    Science Advisor

    If you get 8 bit output, you will not need filtering. This gives you 256 levels and you can get quite a good sinewave from that.

    We had a similar discussion about using 8 bit Eproms preprogrammed with phase data about a week ago. I think you were the poster in that case as well.

    What are you actually trying to do?
  12. Jul 5, 2009 #11
    Hey Everyone,

    Thanks for all the replies and the great input!

    In my case, the output sine wave will be going into an amplifier IC (either high-power op-amp or something else), so at this stage, I'm not too concerned about the power output. I just want to get the signal-level part working. I would like the sine wave to be as undistorted as possible without getting too crazy, though since I will be ultimately using it to drive coils, it doesn't have to be super clean as the coils would somewhat filter it if it's not perfect. But the wave shape is very important though.

    Sorry, you'll have to forgive my ignorance as I have a very minimal understanding of filter circuits (and have a hard time understanding things in terms of dB). But thanks for pointing that out for me. I'm guessing that an AGC is out of the question then?

    Actually, i have had a chance to play with VCOs before (specifically a CD74HC4046) which worked fine but the issue here is that I would like to use a clock input signal to control the sine wave frequency and phase shift (I have an existing pulse generator I built that I can control via a computer). Also, I need the wide output range for the experiments I am doing.

    Hmmm this sounds very interesting, though I am a bit confused by your description. How would you control the input frequency? I need to be able to use a clock signal in my case.

    Actually, this is my first post here in quite some time (though I may have had a similar discussion before in a different thread). Again, I know that I could do the EEPROMs and micros but I'm trying to look for a solution that doesn't require any programming of anything. That's why I decided to go with the present circuit i have now. The only problem Is the filtering issue.

    One other idea I have is to use some kind of filter that I can vary with a voltage input. Then I could use a frequency to voltage detector (or something similar) to set the filter cutoff point. But even better would be to use some kind of op-amp circuit that would only integrate enough of the sine wave to keep it smoothed out. Still searching for a solution.

    - Jason O
    Last edited by a moderator: May 4, 2017
  13. Jul 5, 2009 #12
    Interesting choice of a vco CD74HC4046. It not only has a vco but also a phase comparator. If you go to pages 13 & 14 of this sheet and look at the frequency change versus control voltage, you'll see about the best you can get is an 8.5:1 ratio. You want a 1,000,000:1 ratio.

    You may want to Google "RF Mixers" and find out a little more about them. They both add and subtract one frequency from another. Usually one or the other is filtered out. So if you have two oscillators, a 20 MHz crystal oscillator and a 20-21 MHz vco and mix them together, you could theoretically get what you want. If both of your oscillators produce sine waves then your difference frequency should also be a sine wave.

    To use the phase comparator you would connect the signal generator to the signal input (pin 14) and the output of the mixer to the comp input (pin 3) to get a control voltage proportional to the phase difference on any of pins 1, 2, or 13. That control voltage should go to the frequency control pin of the vco. As you adjust the frequency of your signal generator, the vco should track it, only 20 MHz higher in frequency. Note that if the vco ever goes below the frequency of the crystal oscillator, the phase comparator will try to drive the frequency lower not higher. That's why it's not practical to take this circuit down to 1 Hz.

    To generate a three phase signal you will need to generate 3 phases from your signal generator. One way to do that would be to use a three stage shift register on the signal generator. You will need 3 74HC4046's, 3 vco's, 3 mixers but only 1 crystal oscillator.

    With this method instead of needing a frequency range of 1 MHz:1 or even 8.5:1, you only need a ratio of only 1.05:1 (21 MHz : 20 MHz).

    By the way, I think the EPROM method is also a very good solution and much easier to implement than mine. Even though it could provide 255 discrete steps, I don't think you'd need to run it 255 times you function generator frequency. The more harmonics you can tolerate, the lower the ratio of the frequencies you can use. For instance if you can tolerate using only 32 steps, then you'd only have to program it at every 360/32 degrees with the sine value and run its clock at 32 times the signal generator frequency with the phase comparator and a divide by 32 counter.

    Your last comment about a variable filter, often called tracking filters, would be very difficult to implement.
  14. Jul 5, 2009 #13


    User Avatar
    Science Advisor

    Actually, this is my first post here in quite some time (though I may have had a similar discussion before in a different thread). Again, I know that I could do the EEPROMs and micros but I'm trying to look for a solution that doesn't require any programming of anything. That's why I decided to go with the present circuit i have now. The only problem Is the filtering issue.

    See the following thread which is still on this page. June 27th 2009 !!! :)


    Eproms are often a fast easy way to get a result. You do need a programmer, but compared with making tracking filters over a million to one range, they are pretty simple.
    The old Eproms needed special power supplies, but modern ones can just be programmed at 5 volts. Have a look at the 28 and 28C devices like the 28C16A. 8 bit parallel output.

  15. Jul 6, 2009 #14
    Haha ok you got me there. I forgot about your EEPROM comment in that last thread (brain fart for the date :biggrin: ). At this point, I must admit that I am leaning back towards the EEPROM/Micro & DDS approach since my parts count seems to be growing exponentially.... I'll keep working on it. Thanks for the suggestions.

    - Jason O
  16. Jan 4, 2010 #15


    User Avatar

    Sorry, just joined the forum and found this thread. Have you considered using a switched capacitor filter clocked with the same clock you use to drive the Johnson counter? This might provide a tracking filter that moves with the sinewave frequency. Most SCF's require a clock of about 100 times the filter break point (if memory serves.) So some prescaling might be required. But this would provide an optimal filter at whatever frequency you are running at.
  17. Jan 4, 2010 #16


    User Avatar

    Oops, forgot you need to get up to 1 MHz. Probably won't find a switched capacitor filter anywhere near that frequency. Still, you might be able to supplement a traditional higher frequency filter with an SCF to provide filtering at lower frequencies.
  18. Jan 4, 2010 #17
    Hi JFA,

    Thanks for the suggestion. I did actually look into that in detail but like you said, I found it very impractical to go with that approach since the idea was to create a broadband square wave to sine wave generator. Adding a frequency multiplier to get teh 100x clock frequency would have been way more complicated than it's worth in that case.

    Jason O
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook