Saturate sinewave to square wave  - Page 1
Forum section: electronics / projects

author: alexscep
author_rank: Contributor
timestamp: April 22, 2015, 04:15:01 pm
content: Dear forum-members,i am currently searching for a circuit that can saturate a given sine wave to a square wave with constant amplitude. I already tried achieving this with an opamp, configured as comparator. But this introduced a phase-difference, which is highly annoying. The sinewave could have an amplitude as low as 10mV and the frequency-range is within 10Hz to 2MHz. Does anyone have a tip or alternative solution to this problem.Any help would be greatly appreciated,Thx in advance,Alex

author: krivx
author_rank: Frequent Contributor
timestamp: April 22, 2015, 04:32:51 pm
content: It sounds like you want a high-speed comparator. You can achieve delays of nanoseconds, which should only give a small phase shift if you only need 2MHz.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 22, 2015, 05:06:38 pm
content: What is your application?

author: alexscep
author_rank: Contributor
timestamp: April 22, 2015, 07:44:06 pm
content: I want to be able to measure the phase-difference between two sine-waves with the same frequency. But first i want to convert these sinewaves to square-waves. It is very important that during this conversion no phase-shift is introduced.

author: dom0
author_rank: Super Contributor
timestamp: April 22, 2015, 07:48:51 pm
content: You can just add a DC offset to the sine wave to adjust the square wave phase.

author: m98
author_rank: Frequent Contributor
timestamp: April 22, 2015, 07:56:01 pm
content: Am I missing something or why does it matter when both Sinewaves you want to compare get phase-shifted by each the same amount?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: April 22, 2015, 08:01:47 pm
content: Actually, it's important that no phasedifferencebe introduced...That makes things much easier.More widely, what are you doing? Instrumentation? That's quite a range to afford phase detection of (and will incur quite some delay in determining what the phase shift is -- at least a cycle for digital methods). It may well be effective to use a more involved process, such as acquisition followed by Fourier transform and peak tracking.Consider this: an existing DSO would be able to perform the following macro:"Auto" -- sets vertical and horizontal scale suitable for the waveform (hopefully) -- this accounts for orders of magnitude range in both time and voltage;Measure - Phase shift - Ch1-Ch2 (or whatever)Or instead of "Auto", monitor frequency and voltage and adjust the settings with a feedback loop.Hopefully your intent is something not as expensive as a DSO, but that would be the ceiling as far as complexity and cost.Tim

author: tonyarkles
author_rank: Regular Contributor
timestamp: April 22, 2015, 08:07:54 pm
content: Quote from: alexscep on April 22, 2015, 04:15:01 pmCould you use an actual comparator? Regular opamps do sometimes behave funny when their outputs are being driven to the rails hard. Your phase shift could be due to the recovery time due to that happening.Edit: E.g.http://www.digikey.ca/product-detail/en/MCP6561T-E%2FOT/MCP6561T-E%2FOTCT-ND/2060179has a max 80ns propagation delay.

author: kjs
author_rank: Regular Contributor
timestamp: April 22, 2015, 09:00:44 pm
content: you didn't say what frequency your sinewaves have.... Usually converting them into a square wave isn't the way to go as the trigger level may change which introduces an error.http://www.minicircuits.com/products/PhaseDetectors.shtmlor a simple Schotty Mixer is usually the better way to do it.

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 22, 2015, 09:05:52 pm
content: The obvious solution would appear to be a pair of comparators as zero-crossing (or edge-trigger) configuration.It doesn't really matter how much latency there is as long as thedeltais within the desired tolerance.

author: bson
author_rank: Unknown
timestamp: April 22, 2015, 11:08:19 pm
content: You could also just normalize them to a suitable logic level, hook them up to a logic-level phase detector and see how that works. Maybe this is good enough for your application?

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: April 22, 2015, 11:31:35 pm
content: http://www.minicircuits.com/products/PhaseDetectors.shtml

author: moffy
author_rank: Super Contributor
timestamp: April 23, 2015, 12:25:03 am
content: I have had a similar problem. Because of the low 10mv you need to amplify first, just use a differential pair with a resistor connected to one of the collectors. You get amplification and flattening at the same time. Use a dual matched pair such as BCM847, if you want excessively fast use BFM520. Properly designed it will do all you need. You can follow the diff pair amp with a comparator like the LT1720 with a little hysteresis.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: April 23, 2015, 12:51:05 am
content: For some reason I saw 10-20 MHz. Oh well. The basic idea of the diode ring is still good.http://www.radio-electronics.com/info/rf-technology-design/pll-synthesizers/phase-locked-loop-detector.php

author: SL4P
author_rank: Super Contributor
timestamp: April 23, 2015, 02:43:57 am
content: Put a pair of diodes back to back across the signal.Clipped square at 0.6V

author: Zero999
author_rank: Super Contributor
timestamp: April 23, 2015, 08:35:46 am
content: What about a jellybean PLL? The 74HC4046, 74HC7046 and 74HC297 all have phase comparators.http://www.onsemi.com/pub_link/Collateral/MC74HC4046A-D.PDFhttp://www.ti.com/lit/ds/symlink/cd74hc7046a.pdfhttp://www.ti.com/lit/ds/symlink/cd74hct297.pdf

author: schopi68
author_rank: Regular Contributor
timestamp: April 23, 2015, 09:34:41 am
content: What about using two transistors in a standard differential amplifier configuration as a replacement for the opamp?http://sub.allaboutcircuits.com/images/quiz/03921x01.png