Rectifying high frequency square wave - Page 1
Forum section: electronics / beginners

author: jadew
author_rank: Frequent Contributor
timestamp: November 23, 2012, 12:47:51 pm
content: Hello guys,I'm amplifying a sine wave (up to about 20Mhz), into a square wave using a fast opamp, however, since the opamp is powered from +- 6, I'm getting a square wave that swings from -5 to +5 and I only need it from 0 to +5.I tried:diode - too slow response700Mhz rated mosfet - still slow response, after 1Mhz it's like it's not even there - what am I doing wrong?BJT - same thing as the fast mosfetFast comparator instead of the fast opamp - too slow** the comparator I used had only a 80ns response time, while the opamp has a 7ns response time, so definitely faster, but I still tried it.I don't want to buy a really fast comparator, because they're getting ridiculously expensive after a certain bandwidth, so I'm looking for a cheap solution.Please advise,Thanks

author: ptricks
author_rank: Frequent Contributor
timestamp: November 23, 2012, 01:15:29 pm
content: Have you tried using a 1N914 switching diode ? Switching time is 4ns.

author: Psi
author_rank: Super Contributor
timestamp: November 23, 2012, 01:16:51 pm
content: You should be able to do that using a high speed diode and opamp to make a precision rectifier

author: jadew
author_rank: Frequent Contributor
timestamp: November 23, 2012, 01:21:58 pm
content: Thanks for the reply,I don't think I have any fast diodes around, but the one ptricks suggested is cheap enough, so I'll add it to my next order.I will also look into how precision rectifiers work.Thank you

author: jadew
author_rank: Frequent Contributor
timestamp: November 23, 2012, 01:35:00 pm
content: Found some 5ns schottky diodes in my inventory.They seem to work fine, but it looks like the falling edge is highly dependent on the resistor I'm using in series with the diode, I'm sure I'll figure out the right value tho.Thanks guys

author: lewis
author_rank: Frequent Contributor
timestamp: November 24, 2012, 10:16:07 pm
content: Try powering the opamp from +6V supply only, connect the V- to ground

author: ejeffrey
author_rank: Super Contributor
timestamp: November 26, 2012, 08:36:15 am
content: A couple of things:The problem with your FET/BJT solutions is probably that you are using them in a single-ended configuration. When they are conducting, they provide a nice low impedance drive, but when they are not conducting they go high impedance and you have some external RC time that dominates your response. The brute force way to solve this is to use a low impedance pull-down. The better solution is to use two drive transistors in a push-pull configuration. The same problem can happen with the diode, although my guess is that in the likely configuration you would have a faster RC time here.It is generally better to avoid using opamps in saturated mode. RF opamps are better behaved in this respect than their audio frequency friends, but even fast opamps can have problems where they are much slower coming out of saturation than their small-signal behavior would suggest. Comparators are designed to operate this way, and will generally perform better.Finally, since you signal is a sine wave, if your amplitude is predictable the best comparator is a logic gate. Just amplify your signal to ~5 V pk-pk and capacitively couple it to a 74AC series inverter or buffer. You will get a nice, clean, fast square wave out, with very fast edges. If the signal amplitude varies widely, but your opamp 'comparator' works OK to get a +/- 5 V signal, you can attenuate and capacitively couple that signal to a logic gate to clean up the edges and set the voltages.

author: Psi
author_rank: Super Contributor
timestamp: November 26, 2012, 10:24:15 am
content: His signal is a square wave.

author: vk6zgo
author_rank: Super Contributor
timestamp: November 26, 2012, 12:01:14 pm
content: Quote from: Psi on November 26, 2012, 10:24:15 amNo,he is starting out with a sine wave then turning it into a square wave with an op amp.

author: Psi
author_rank: Super Contributor
timestamp: November 26, 2012, 12:10:04 pm
content: oh, my bad.

author: lewis
author_rank: Frequent Contributor
timestamp: November 26, 2012, 12:43:11 pm
content: Quote from: ejeffrey on November 26, 2012, 08:36:15 am+1. Make sure it's a schmitt trigger, 74AC14 or something.