# Sine wave to square spikes

#### shackle000

Joined Mar 25, 2010
5
Hi everyone,

I want to design a circuit which takes positive sine wave-shape input and outputs square wave of very less width equivalent to a spike. In other words, i want to count the peaks. The output spike should be of same voltage as input. Thanks and waiting for reply.

#### beenthere

Joined Apr 20, 2004
15,819
Can you give us more information? What is the frequency and magnitude of the sine wave? Is it AC - do the excursions go above and below 0 volts? What is the magnitude of the spikes? Do you want a response for the negative and positive peaks?

#### russ_hensel

Joined Jan 11, 2009
825
You do not have to do that wave shaping to count the peaks, is this really your requirement?

#### shackle000

Joined Mar 25, 2010
5
I have attached a picture in which I am referrring the lower wave as my input and the above trail as my ideal output. Actually I want to count the number of events happening, considering each positive shape sine wave as one event. The frequency of events is quite high (in MHz). The magnitude of output may preferably be equal to input's peak voltage.

#### Attachments

• 61.6 KB Views: 44

#### atferrari

Joined Jan 6, 2004
4,730
Maybe I am being picky, but you mentioned a sine wave.

Dou you mean that given a sine wave at the input, you want to generate a short pulse after every negative to positive zero crossing?

#### shackle000

Joined Mar 25, 2010
5
The input signal stays between 0 to positive and doesn't go in negative. My sole purpose is to distinctively count the events that is train of pulses. Please see the attached picture, the below train of pulses is my input. Thanks.

#### shackle000

Joined Mar 25, 2010
5
The picture is attached in my previous post.

#### beenthere

Joined Apr 20, 2004
15,819
The magnitude of output may preferably be equal to input's peak voltage. ]/QUOTE]The pictured waveform is not at all a sine wave. Have you tried to use those pulses to run your counter?

From the stated importance of maintaining an equivalent pulse height, do you need something more like a pulse height analyzer?

There seems to be a lot of information we do not have. What kind of counter, outside of a PHA, is sensitive to the pulse height?

#### shackle000

Joined Mar 25, 2010
5
I do not actually need a pulse height analyser, but if I able to manage it it would be a bonus.

The height of input humps (I don't know what to call this kind of wave shape) is variable so I can not use just a threshold value and give it to comparator. I just need a spike at the ouput equivalent to one input hump and later on I would count those spikes.

May be I was not very clear, but in the picture i tried to show my inputs and outputs. I want to design a ciruit which could give me such output. Thanks for your patience.

#### shortbus

Joined Sep 30, 2009
10,039
I do not actually need a pulse height analyser, but if I able to manage it it would be a bonus.

The height of input humps (I don't know what to call this kind of wave shape) is variable so I can not use just a threshold value and give it to comparator. I just need a spike at the output equivalent to one input hump and later on I would count those spikes.

May be I was not very clear, but in the picture i tried to show my inputs and outputs. I want to design a circuit which could give me such output. Thanks for your patience.
You can if you make the input threshold to the comparator adjustable with a potentiometer. But your out put "square wave voltage" would not be variable with the input. But that shouldn't matter if your just counting.