Best way to make a sine wave a square wave?
|
|
IamSmooth
|
Sun Feb 14 2010, 02:20AM
|
|
|
Registered Member #190
Joined: Fri Feb 17 2006, 12:00AM
Location:
Posts: 1567
|
I will submit this thread as this is really what I want and the other may be distracting. I have a floating capacitor voltage. I clipped the signal with a resistor and some diode clamps, but I would like it to be a near-perfect square-wave at any voltage. My first thought is a comparator. Any suggestions?
|
Back to top
|
|
Russell Haley
|
|
Registered Member #2478
Joined: Mon Nov 23 2009, 03:24AM
Location: Texas A&M University
Posts: 47
|
Try a schmitt trigger CMOS gate. That's effectively a comparator with a threshold of 2.5V +/- some hysteresis. The 74HC14 is a good choice.
The hysteresis will cause some phase shift. If you don't like that, use a phase-locked loop with the type II phase detector or the type I and an integrator.
|
Back to top
|
|
cjk2
|
|
Registered Member #51
Joined: Thu Feb 09 2006, 04:17AM
Location:
Posts: 263
|
I always build circuits like this to take "whatever" and clean it up to a nice square wave. The RC filter provides a stable comparison voltage that changes with the average level of the signal over time so the circuit always triggers correctly. The positive feedback arrangement provides hysteresis to avoid false triggers. Add an RC filter to the input if you like to further clean up the input. Remove the first op amp if your source is low impedance enough.
|
Back to top
|
|
Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob
|
|
Powered by e107 Forum System
|