The task is to get such wave:
I can get square wave from sin wave, but I have no idea how to make it half-frequency. Have some advices?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
The frequency of your square wave is the same as your sine, it's not half.
The following solution focuses on getting the 45° phase difference between sine and pulse.
Differentiate the sine to get a cosine. (Note that a simple RC differentiator won't give you the required 90° phase shift. The opamp differentiator will.)
Pass both sine and cosine though a comparator, where you compare with 0V. This will get you two 50% square waves 90° phase shifted. AND these and you're there.
This will get you the 45° phase shift between sine and pulse as shown. If phase is not important then Russell's idea of the flip-flop is also good. AND flip-flop input and output to get a 25% duty cycle.
The shown output signal would be hard to get with any reliability in most cases as it is triggered by the peak of the sine wave. this is doable but unusual.
As Steven says, this is a 1F signal still but with asymmetric mark-space ( = high low) ratio.
A common way of getting F/2 is to use a fli-flop in toggle mode with a square wave derived from the sine wave as a clocking signal. On the first sine wave rising edge (or falling edge) the flip flop is toggled to output = high. On the next rising edge it is again toggled so that output = low.
You would usually convert the sine wave to a square wave to make a clock signal. Something like shown below. This uses a digital inverter as a comparator. A formal comparator IC could be used. The output is shown AC coupled with a capacitor - not needed in this application if flip-flop and comparator share the same supply.
And then divide that by two. One means:
From here which provides a good discussion.
are you using any Micro controller to perform this function...because a freind of mine did just that with an arduino..
what yiu have to do is to interface your analog volatge with an arduino through a zero crossing detector (ZCD) when you pass this through a zero crossing detector you would have the points where the voltage passes the x-axis or 0v. then all you have to do is to Start a Square wave at the first input from ZCD, ignore the other two and then on the fourth input from the ZCD complement the Square wave output, again ignore the next two inputs and at the third input , complement the output.