Maker Pro
Maker Pro

Question on using op amp applications

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!
 

Attachments

  • LPF.jpg
    LPF.jpg
    78.4 KB · Views: 186

Harald Kapp

Moderator
Moderator
My first question is on how to set the cut off frequency for a first order LPF.
The equation in your image tells you how. For determining the cut-off frequency, the constant gain term is irrelevant.

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?
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.
 
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.

Is there a way to calculate this threshold? Like a mathematical way
 

Harald Kapp

Moderator
Moderator
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.

 

Harald Kapp

Moderator
Moderator
... 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.
 
Top