Creating a square wave pulse at the peak of a sin wave

In summary, the expert suggests using a comparator to trigger a square pulse that lasts for a relatively small amount of time, corresponding to the peak of a sin wave input. This can be done via a programmable device such as an arduino, and is the only way that they can think of doing it. Care must be taken to define the pulse width, level detection, and the problem of noise causing false triggers.
  • #1
jmjsilvester
4
0
Hi all,

I am trying to create a square wave pulse that lasts for a relatively small amnount of time which corresponds (as close as possible) to the peak of a sin wave input of period about 1 second.

The only way that I can think of doing this is via a programmable device such as an arduino to create the signal. I am sure that there would be a clever electronic way that this can be done but I do not know enough about the subject.

I hope that that is clear enough. Can someone point me in a good direction?

Thanks in advanced
 
Engineering news on Phys.org
  • #2
You can use a comparator for level detection. The output will be a pulse that is only high for as long as the sine wave is larger than the reference level you set on the comparator. You can stretch this pulse out or do other things by adding hysteresis or driving a one-shot with the comparator, but the basic idea is to use a comparator. You just need to be careful how you define your pulse width, level detection, and the problem of noise causing false triggers.

http://en.wikipedia.org/wiki/Comparator
 
Last edited:
  • #3
jmjsilvester said:
Hi all,

I am trying to create a square wave pulse that lasts for a relatively small amnount of time which corresponds (as close as possible) to the peak of a sin wave input of period about 1 second.

The only way that I can think of doing this is via a programmable device such as an arduino to create the signal. I am sure that there would be a clever electronic way that this can be done but I do not know enough about the subject.

I hope that that is clear enough. Can someone point me in a good direction?

Thanks in advanced

Welcome to the PF.

To reliably get as close to the peak as possible, yes, the best solution will be digital. You can either use a uC as you suggest, or you could make a CPLD circuit to do it. In both cases, you would be counting the time between zero crossings, and using half of that (plus knowing the polarity +/- of the sine wave signal) to trigger your square pulse.

EDIT -- if the sine wave were not so slow (like if it were more like 1kHz), you could do an analog differentiation with an opamp to get a cosine function, and use its zero crossing as your trigger...
 
  • #4
From an old obsolete analog guy -



if you integrate a sinewave two things happen
1. you shift it 90 degrees so the zero crossing of your new signal coincides with the peak of your original signal .
As Berkeman suggested, and wisely, that is a more friendly condition to detect necause it's pretty independent of variations in amplitude of original signal.
2.You attenuate the high frequency 'noise' that is so troublesome to fast analog comparators.

I'd hand integrated sinewave to a zero crossing comparator and trigger a monostable from result.

A differentiated sinewave will have more noise than it did as un-differentiated. Differentiation amplifies noise. It's basically highpass filtering.
Integrated sinewave will have less noise than un-integrated. Integration attenuates noise. It's basically lowpass filtering.
Only difficulty with pure integrators is keeping them zeroed but a R-C with long time constant relative to sinewave's period does an admirable job of approximate integration...

old jim
 
Last edited:
  • #5
Thank you all very much for the replies.
I'd hand integrated sinewave to a zero crossing comparator and trigger a monostable from result.

That is a very clever idea and defenitely something that I will look into.

However, I would like to trigger only on the peak of the sin wave, not twice per period. Unless I am mistaken this will trigger every time the integrated signal crosses zero.
 
  • #6
Try this circuit. It is designed to work on positive peaks only and is adjustable by the pot.
The values of the shunt cap and collector resistor may need tweaking.
The output will require squaring up to the desired length of pulse.
 

Attachments

  • peakdetect1.jpg
    peakdetect1.jpg
    7.5 KB · Views: 702
Last edited:
  • #7
You said a period of about 1 second. Is this a fixed, known frequency, or will it vary? If variable, what percentage variation from 1 second?

It may be feasible to generate an additional pulse, one of, say, 0.6 seconds, and use this to block that unwanted pulse at 0.5 secs. Otherwise a "divide-by-two" counter could be used to eliminate one out of every pair of pulses.
 
  • #8
"Edge Triggering" is another option.

When driven from point A this will trigger on falling edge of comparator output and ignore rising edge. You'd choose a simple DC level comparator then, comparing integrated sinewave to zero.

Sooo many circuits, so little time !

http://www.allaboutcircuits.com/vol_6/chpt_8/4.html
45011.png
 
  • #9
Ah that seems perfect! Thanks a lot jim really helpfull.

(I just found this and was having a little play with it
http://www.falstad.com/circuit/e-555monostable.html)

Must say the whole process does seem quite complicated but it does look like it will do the trick. Now just to have a little play around.
 
  • #10
Build an operational amplifier adder circuit. (sometimes called summing amplifier)
Apply a sine wave from a function generator to input of adder circuit.
Apply pulse from a function generator to different input of adder circuit.
View output of adder circuit on oscilloscope.
Adjust sine wave and pulse to get whatever you want.
 

1. What is a square wave pulse?

A square wave pulse is a type of electrical signal that alternates between two discrete voltage levels at regular intervals. It is characterized by having a sharp, vertical rise and fall in voltage, resulting in a flat, or square, waveform.

2. How is a square wave pulse created?

A square wave pulse can be created by converting a sine wave, which has a smooth, curved shape, into a series of discrete voltage levels using a waveform generator. The generator produces a series of rapid voltage transitions, resulting in a square wave pulse at the desired peak of the sine wave.

3. What is the purpose of creating a square wave pulse at the peak of a sine wave?

Creating a square wave pulse at the peak of a sine wave is often used in electronic circuits to generate precise timing signals. It can also be used in digital communication systems to encode and transmit data.

4. What factors affect the creation of a square wave pulse at the peak of a sine wave?

The frequency and amplitude of the sine wave, as well as the duty cycle (ratio of time spent at the high voltage level to the total time), can all affect the resulting square wave pulse. Additionally, the precision and capabilities of the waveform generator used can also play a role.

5. What are some applications of a square wave pulse at the peak of a sine wave?

Square wave pulses are commonly used in digital electronics, such as in microcontrollers, to control the timing of various functions. They can also be used in audio and music production to create unique sound effects, and in medical equipment to generate precise electrical signals for diagnostic and therapeutic purposes.

Similar threads

  • Electrical Engineering
2
Replies
39
Views
2K
  • Electrical Engineering
Replies
10
Views
2K
Replies
16
Views
1K
  • Electrical Engineering
Replies
21
Views
1K
  • Electrical Engineering
Replies
32
Views
3K
  • Biology and Medical
Replies
6
Views
429
Replies
19
Views
2K
Replies
9
Views
4K
  • Electrical Engineering
Replies
25
Views
2K
  • Introductory Physics Homework Help
Replies
17
Views
1K
Back
Top