# Question on using op amp applications

Discussion in 'Electronics Homework Help' started by mngeow, Apr 29, 2015.

1. ### mngeow

24
0
Jan 13, 2010
Hi.

I'm having some trouble grasping the concept of op amps. My first question is on how to set the cut off frequency for a first order LPF. I have an image of my lecture slide attached and I'll be referring to it.
would my cut off frequency be f3db as the signal has unity gain before that point? In that cause I would set my cut off frequency using the equation f3db = 1 / 2pi x RC? Also , assuming that this is the case, assuming the cut off frequency is 5KHz , so for 50KHZ the signal would be attenuated by -20dB and -40dB for 500KHZ?

Another question would be the generation of a square wave from a sine wave using an opamp as a comparator. I know that using the op amp as a comparator would allow me to generate the square waveform and that varying the Ref. voltage would allow me to set the duty cycle. But what exactly are the calculations involved? Eg. If I have a 2V peak to peak sine wave input signal and I want to generate a rectangular waveform with 30% duty cycle , how should I set my Ref. v for the op amp accordingly?

Thanks for the help!

File size:
78.4 KB
Views:
186
2. ### Harald KappModeratorModerator

11,310
2,589
Nov 17, 2011
The equation in your image tells you how. For determining the cut-off frequency, the constant gain term is irrelevant.

Find the voltage (threshold) of the sinusoidal signal where the sine is above this threshold 30% of the time, 70% below. Set the threshold of the comparator to this voltage and you're done.

3. ### mngeow

24
0
Jan 13, 2010
Is there a way to calculate this threshold? Like a mathematical way

4. ### Harald KappModeratorModerator

11,310
2,589
Nov 17, 2011
Yes there is:
• f(a*t)=sin(*t) is the basic equation where a is a constant defining the frequency and t is time. (let's forget the amplitude for a moment, we can sclae all numbers by the amplitude as required or scale the signal such that it fits the 1...+1 amplitude of sin() ).
• Now select an arbitrary point t1 such that a*t1 < pi (this ensures you are within the fi´rst half cycle). This will be the point where sin(a*t) crosses the threshold and the outut of the comparator goes high. you get V1=sin(a*t1).
• Leaving aside hysteresis the function sin(a*t) will cross the same voltage level V1 at some later time t2= t1+dt (this time from a high value to a low value). During the time dt the output of the comparator will be high.
• You now have the following variables and equations:
- T = period of the sine
- dt/T = 0.3 (for a 30% duty cycle) -> dt = 0.3*T
- V1 = sin(a+t1)
- V1 = sin(a*(t1+dt))
With two equations for V1 and two unknowns (V1, t1) you can solve for t1 and V1 and hence the threshold you are looking for.

5. ### Laplace

1,252
184
Apr 4, 2010
It is not really necessary to calculate with time functions, the voltage can be found simply from radian position as shown below:

Harald Kapp likes this.
6. ### Harald KappModeratorModerator

11,310
2,589
Nov 17, 2011
... and this leads to a set of equations much easier to solve, thanks Laplace.

Anyway: This is a nice exercise, but to generate a square wave with a defined duty cycle in pratctice you'd neve resort to this scheme. You'd directly synthesize the square wave e.g. by a timer.