0
\$\begingroup\$

I have a comparator circuit and I need to find the mean value of the output square wave. I have calculated it like this:

\$Vmean=1/T*integral(U*dt)\$ from 0 to T and I got \$Vmean=-0.7896V\$

Can someone please check if that is correct?

circuit in ltspice

\$\endgroup\$
1
  • 1
    \$\begingroup\$ This would be more of a calculus question. You'd probably set up the integral \$ \displaystyle \frac{1}{T}\int_0^T f(t) dt \$ \$\endgroup\$ – user103380 Oct 2 '19 at 18:46
1
\$\begingroup\$

You can check it yourself in the LTspice simulation:
Zoom the waveform to the region of interest (make sure you are seeing a whole number of periods).
Then move the mouse to the label of the trace (V(n002) or V(004) in your case), hold down the control key and left mouse click.

The pop-up window will show the average and RMS value.

\$\endgroup\$
2
  • \$\begingroup\$ Thank you didn't know that ltspice can do that makes my life much simpler. \$\endgroup\$ – user229923 Oct 3 '19 at 19:15
  • \$\begingroup\$ @TihomirRaicevic You'll find LTspice to be one of the most important/powerful tools for an EE. \$\endgroup\$ – Huisman Oct 3 '19 at 19:22
1
\$\begingroup\$

Since it's a square wave you can just use the duty cycle times the Max value.

\$\endgroup\$
0
\$\begingroup\$

I've used Mathematica to construct a function:

enter image description here

Finding:

$$\overline{\text{V}}_{\space\text{square}}=\frac{1}{\text{T}}\int_0^\text{T}\text{V}_{\space\text{square}}\left(t\right)\space\text{d}t=-\frac{19}{3}\approx-6.33333\space\text{V}\tag1$$

And the RMS value:

$$\text{V}_{\space\text{square}\space\text{RMS}}=\sqrt{\frac{1}{\text{T}}\int_0^\text{T}\text{V}_{\space\text{square}}^2\left(t\right)\space\text{d}t}=\sqrt{\frac{313}{3}}\approx10.2144\space\text{V}\tag2$$

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for the help I hope it didn't take too much of your time really appreciate it. \$\endgroup\$ – user229923 Oct 3 '19 at 19:17
  • \$\begingroup\$ @TihomirRaicevic You're welcome man! \$\endgroup\$ – Jan Oct 3 '19 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy