Author Topic: Saturate sinewave to square wave  (Read 4757 times)

0 Members and 1 Guest are viewing this topic.

Offline alexscepTopic starter

  • Contributor
  • Posts: 31
Saturate sinewave to square wave
« on: April 22, 2015, 04:15:01 pm »
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
 

Offline krivx

  • Frequent Contributor
  • **
  • Posts: 765
  • Country: ie
Re: Saturate sinewave to square wave
« Reply #1 on: April 22, 2015, 04:32:51 pm »
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.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22433
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Saturate sinewave to square wave
« Reply #2 on: April 22, 2015, 05:06:38 pm »
What is your application?
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline alexscepTopic starter

  • Contributor
  • Posts: 31
Re: Saturate sinewave to square wave
« Reply #3 on: April 22, 2015, 07:44:06 pm »
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.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
Re: Saturate sinewave to square wave
« Reply #4 on: April 22, 2015, 07:48:51 pm »
You can just add a DC offset to the sine wave to adjust the square wave phase.
,
 

Offline m98

  • Frequent Contributor
  • **
  • Posts: 630
  • Country: de
Re: Saturate sinewave to square wave
« Reply #5 on: April 22, 2015, 07:56:01 pm »
Am I missing something or why does it matter when both Sinewaves you want to compare get phase-shifted by each the same amount?
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22433
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Saturate sinewave to square wave
« Reply #6 on: April 22, 2015, 08:01:47 pm »
Actually, it's important that no phase difference be 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline tonyarkles

  • Regular Contributor
  • *
  • Posts: 118
Re: Saturate sinewave to square wave
« Reply #7 on: April 22, 2015, 08:07:54 pm »
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.

Could 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/2060179 has a max 80ns propagation delay.
« Last Edit: April 22, 2015, 08:14:19 pm by tonyarkles »
 

Offline kjs

  • Regular Contributor
  • *
  • Posts: 97
  • Country: de
Re: Saturate sinewave to square wave
« Reply #8 on: April 22, 2015, 09:00:44 pm »
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.shtml or a simple Schotty Mixer is usually the better way to do it.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4319
  • Country: us
  • KJ7YLK
Re: Saturate sinewave to square wave
« Reply #9 on: April 22, 2015, 09:05:52 pm »
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 the delta is within the desired tolerance.
 

Offline bson

  • Supporter
  • ****
  • Posts: 2457
  • Country: us
Re: Saturate sinewave to square wave
« Reply #10 on: April 22, 2015, 11:08:19 pm »
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?

 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3486
  • Country: ca
  • Place text here.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: Saturate sinewave to square wave
« Reply #12 on: April 23, 2015, 12:25:03 am »
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.
 

Online Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3486
  • Country: ca
  • Place text here.
Re: Saturate sinewave to square wave
« Reply #13 on: April 23, 2015, 12:51:05 am »
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
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: Saturate sinewave to square wave
« Reply #14 on: April 23, 2015, 02:43:57 am »
Put a pair of diodes back to back across the signal.
Clipped square at 0.6V
Don't ask a question if you aren't willing to listen to the answer.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Saturate sinewave to square wave
« Reply #15 on: April 23, 2015, 08:35:46 am »
 

Offline schopi68

  • Regular Contributor
  • *
  • Posts: 123
  • Country: de
    • My stuff page
Re: Saturate sinewave to square wave
« Reply #16 on: April 23, 2015, 09:34:41 am »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf