.MEAS RMS error


 

I have this simple circuit: https://groups.io/g/LTspice/files/Temp/MEAS_RMS_error.asc

.meas rms command gives wrong values when injecting DC+AC signal, so must have to calculate the average of the signal Vm to calculate the difference between signal and Vm to calculate RMS

In the example there is a square waveform 0-1V which RMS value is sqrt((0.5^2*n/n))=0.5, not 0.707!!!!!!!!!!!!!

 


 

Vt1 has the same rms value as a 0.707V peak value sinewave. LTspice uses peak values.

Le 15/07/2024 à 10:58, Javier Lopez a écrit :

I have this simple circuit: https://groups.io/g/LTspice/files/Temp/MEAS_RMS_error.asc

.meas rms command gives wrong values when injecting DC+AC signal, so must have to calculate the average of the signal Vm to calculate the difference between signal and Vm to calculate RMS

In the example there is a square waveform 0-1V which RMS value is sqrt((0.5^2*n/n))=0.5, not 0.707!!!!!!!!!!!!!

 


 

Javier,
 
The RMS value of a pulse wave is sqrt(duty cycle) which equals sqrt(0.5) for a square wave which equals 0.707.
 
All for now

 
 
Sent: Monday, July 15, 2024 at 4:58 AM
From: "Javier Lopez via groups.io" <jlopez2022@...>
To: LTspice@groups.io
Subject: [LTspice] .MEAS RMS error

I have this simple circuit: https://groups.io/g/LTspice/files/Temp/MEAS_RMS_error.asc

.meas rms command gives wrong values when injecting DC+AC signal, so must have to calculate the average of the signal Vm to calculate the difference between signal and Vm to calculate RMS

In the example there is a square waveform 0-1V which RMS value is sqrt((0.5^2*n/n))=0.5, not 0.707!!!!!!!!!!!!!

 


 

Actually, the rms value of a 50% duty ratio square wave is 0.5 times the peak amplitude.
The rms value of a sinewave is 0.707 times the peak amplitude.

In order to show the same rms value, the sinewave must have a max amplitude of 0.707.

Le 15/07/2024 à 12:27, eewiz via groups.io a écrit :

Javier,
 
The RMS value of a pulse wave is sqrt(duty cycle) which equals sqrt(0.5) for a square wave which equals 0.707.
 
All for now
 
 
Sent: Monday, July 15, 2024 at 4:58 AM
From: "Javier Lopez via groups.io" <jlopez2022@...>
To: LTspice@groups.io
Subject: [LTspice] .MEAS RMS error

I have this simple circuit: https://groups.io/g/LTspice/files/Temp/MEAS_RMS_error.asc

.meas rms command gives wrong values when injecting DC+AC signal, so must have to calculate the average of the signal Vm to calculate the difference between signal and Vm to calculate RMS

In the example there is a square waveform 0-1V which RMS value is sqrt((0.5^2*n/n))=0.5, not 0.707!!!!!!!!!!!!!

 


 
Змінено

There are no sinewaves here. We shouldn't talk about sinewaves.

Out of curiosity, what is going on in the uploaded schematic, why are there two sources? The two pulse voltage sources are identical. Why are there two, or is it just by coincidence and you left one in for redundancy?

Javier wrote, ".meas rms command gives wrong values when injecting DC+AC signal". Why did you write that? Did you come to this question assuming that the .MEAS command gives wrong values? Or does your circuit attempt to show that it is wrong?

Hint: The .MEAS command is correct.

Did you believe that RMS should remove the DC portion of a signal, before computing RMS? That would be incorrect. Remember, the RMS value of a 5 V DC signal plus a 0 V AC signal is 5 V. RMS is often described as the voltage that gives the same amount of heating, and both DC and AC components must be counted.

The mean average of V(t1)^2 between 0 and 0.5 ms is 1.0. The mean average of V(t1)^2 between 0.5 and 1.0 ms is 0.0. The mean average over the interval 0 to 1 ms is 0.5, and that exact pattern repeats indefinitely. The square root of 0.5 is 0.707107 volts. LTspice's answer from .MEAS is 0.707107. It is the correct answer.

The RMS value of V(t1) or V(t2) is not 0.5. I don't know why you think it should have been 0.5.

Now, if your PULSE voltage alternated between -0.5 and +0.5 V, so that its peak-to-peak amplitude was the same but without the DC offset, then that signal's RMS voltage would be 0.5 V. But that is a different signal, and if you examined the heat from the resistor, it would indeed be less.

LTspice is doing the right thing. Your interpretation or your understanding of RMS is in error.

Andy


 

The process of computing an RMS value assumes that you know that the order of operations is essential. The correct order of operations is:

  1. Square one period of the signal. (N.B. All values of the squared signal are positive and >= 0)
  2. Compute the mean of the squared signal over one period (N.B. this actually preserves any DC component)
  3. Take the square root of the mean value computed in step 2. (N.B. this is also a positive value)
Any other sequence of steps will produce garbage.


 
Змінено

 

Le 15/07/2024 à 13:31, Andy I a écrit :
There are no sinewaves here. We shouldn't talk about sinewaves.
That's because of the 0.707 factor mentioned by the OP, which is pertinent to sinewaves.

Out of curiosity, what is going on in the uploaded schematic, why are there two sources? The two pulse voltage sources are identical. Why are there two, or is it just by coincidence and you left one in for redundancy?

Javier wrote, ".meas rms command gives wrong values when injecting DC+AC signal". Why did you write that? Did you come to this question assuming that the .MEAS command gives wrong values? Or does your circuit attempt to show that it is wrong?

Hint: The .MEAS command is correct.

Did you believe that RMS should remove the DC portion of a signal, before computing RMS? That would be incorrect. Remember, the RMS value of a 5 V DC signal plus a 0 V AC signal is 5 V. RMS is often described as the voltage that gives the same amount of heating, and both DC and AC components must be counted.

The mean average of V(t1)^2 between 0 and 0.5 ms is 1.0. The mean average of V(t1)^2 between 0.5 and 1.0 ms is 0.0. The mean average over the interval 0 to 1 ms is 0.5, and that exact pattern repeats indefinitely. The square root of 0.5 is 0.707107 volts. LTspice's answer from .MEAS is 0.707107. It is the correct answer.

The RMS value of V(t1) or V(t2) is not 0.5. I don't know why you think it should have been 0.5.

Now, if your PULSE voltage alternated between -0.5 and +0.5 V, so that its peak-to-peak amplitude was the same but without the DC offset, then that signal's RMS voltage would be 0.5 V. But that is a different signal, and if you examined the heat from the resistor, it would indeed be less.

LTspice is doing the right thing. Your interpretation or your understanding of RMS is in error.

Andy


 

Javier,
 
Asking for the RMS value of a pulse wave is simply not a correct question to ask.
Although mathematically correct the answer is meaningless.
RMS applies only to waveforms that do not spend an equal amount time at each point value.
A sine wave spends less time at it's 5% value then it does at it's 95% value.
Since energy is power * time, the RMS value of a sine wave is usefull.
For a pulse wave, RMS provides a result that does not reflect the heating value.
A unipolar square wave will fully heat a resistor half the time and provide no heat for the other half.
The energy contained in a pulse wave is related to the average value of that wave not the RMS value.
The average value of a pulse wave is it's on-time divided by the period of one cycle.
On-time divided by period is a pulse wave's duty cycle.
The energy of a unipolar pulse wave is directly related to it's duty cycle not it's RMS value.
 
All for now.
 

 
Sent: Monday, July 15, 2024 at 11:29 AM
From: "Jerry Lee Marcel via groups.io" <jerryleemarcel@...>
To: LTspice@groups.io
Subject: Re: [LTspice] .MEAS RMS error

 

Le 15/07/2024 à 13:31, Andy I a écrit :
There are no sinewaves here. We shouldn't talk about sinewaves.
That's because of the 0.707 factor mentioned by the OP, which is pertinent to sinewaves.

Out of curiosity, what is going on in the uploaded schematic, why are there two sources? The two pulse voltage sources are identical. Why are there two, or is it just by coincidence and you left one in for redundancy?

Javier wrote, ".meas rms command gives wrong values when injecting DC+AC signal". Why did you write that? Did you come to this question assuming that the .MEAS command gives wrong values? Or does your circuit attempt to show that it is wrong?

Hint: The .MEAS command is correct.

Did you believe that RMS should remove the DC portion of a signal, before computing RMS? That would be incorrect. Remember, the RMS value of a 5 V DC signal plus a 0 V AC signal is 5 V. RMS is often described as the voltage that gives the same amount of heating, and both DC and AC components must be counted.

The mean average of V(t1)^2 between 0 and 0.5 ms is 1.0. The mean average of V(t1)^2 between 0.5 and 1.0 ms is 0.0. The mean average over the interval 0 to 1 ms is 0.5, and that exact pattern repeats indefinitely. The square root of 0.5 is 0.707107 volts. LTspice's answer from .MEAS is 0.707107. It is the correct answer.

The RMS value of V(t1) or V(2) is not 0.5. I don't know why you think it should have been 0.5.

Now, if your PULSE voltage alternated between -0.5 and +0.5 V, so that its peak-to-peak amplitude was the same but without the DC offset, then that signal's RMS voltage would be 0.5 V. But that is a different signal, and if you examined the heat from the resistor, it would indeed be less.

LTspice is doing the right thing. Your interpretation or your understanding of RMS is in error.

Andy


 
Змінено

eewiz wrote:

.    "Asking for the RMS value of a pulse wave is simply not a correct question to ask.
     Although mathematically correct the answer is meaningless.
     RMS applies only to waveforms that do not spend an equal amount time at each point value."

I have to disagree.

The RMS value is not meaningless. For example, it is useful for computing heat dissipated in a resistive load. And who knows what else.

It applies to ANY waveforms of ANY shape.

     "For a pulse wave, RMS provides a result that does not reflect the heating value."

That is not true.

     "The energy contained in a pulse wave is related to the average value of that wave not the RMS value."

Again, incorrect.

     "The energy of a unipolar pulse wave is directly related to it's duty cycle not it's RMS value."

The energy is related to its duty cycle, AND to its RMS value, and the RMS value depends on its duty cycle.

Andy


 

Very strange assertion. I'd like to see a proof.

Le 15/07/2024 à 19:28, eewiz via groups.io a écrit :

Javier,
 
Asking for the RMS value of a pulse wave is simply not a correct question to ask.
Although mathematically correct the answer is meaningless.
RMS applies only to waveforms that do not spend an equal amount time at each point value.
A sine wave spends less time at it's 5% value then it does at it's 95% value.
Since energy is power * time, the RMS value of a sine wave is usefull.
For a pulse wave, RMS provides a result that does not reflect the heating value.
A unipolar square wave will fully heat a resistor half the time and provide no heat for the other half.
The energy contained in a pulse wave is related to the average value of that wave not the RMS value.
The average value of a pulse wave is it's on-time divided by the period of one cycle.
On-time divided by period is a pulse wave's duty cycle.
The energy of a unipolar pulse wave is directly related to it's duty cycle not it's RMS value.
 
All for now.
 
 
Sent: Monday, July 15, 2024 at 11:29 AM
From: "Jerry Lee Marcel via groups.io" <jerryleemarcel@...>
To: LTspice@groups.io
Subject: Re: [LTspice] .MEAS RMS error

 

Le 15/07/2024 à 13:31, Andy I a écrit :
There are no sinewaves here. We shouldn't talk about sinewaves.
That's because of the 0.707 factor mentioned by the OP, which is pertinent to sinewaves.

Out of curiosity, what is going on in the uploaded schematic, why are there two sources? The two pulse voltage sources are identical. Why are there two, or is it just by coincidence and you left one in for redundancy?

Javier wrote, ".meas rms command gives wrong values when injecting DC+AC signal". Why did you write that? Did you come to this question assuming that the .MEAS command gives wrong values? Or does your circuit attempt to show that it is wrong?

Hint: The .MEAS command is correct.

Did you believe that RMS should remove the DC portion of a signal, before computing RMS? That would be incorrect. Remember, the RMS value of a 5 V DC signal plus a 0 V AC signal is 5 V. RMS is often described as the voltage that gives the same amount of heating, and both DC and AC components must be counted.

The mean average of V(t1)^2 between 0 and 0.5 ms is 1.0. The mean average of V(t1)^2 between 0.5 and 1.0 ms is 0.0. The mean average over the interval 0 to 1 ms is 0.5, and that exact pattern repeats indefinitely. The square root of 0.5 is 0.707107 volts. LTspice's answer from .MEAS is 0.707107. It is the correct answer.

The RMS value of V(t1) or V(2) is not 0.5. I don't know why you think it should have been 0.5.

Now, if your PULSE voltage alternated between -0.5 and +0.5 V, so that its peak-to-peak amplitude was the same but without the DC offset, then that signal's RMS voltage would be 0.5 V. But that is a different signal, and if you examined the heat from the resistor, it would indeed be less.

LTspice is doing the right thing. Your interpretation or your understanding of RMS is in error.

Andy


 

O.K. I have prepaired my meal of crow and am now prepared to eat it.
Andy is correct. I was wrong.
My error was not realizing that an RMS voltage value will produce an RMS current value.
 
Assuming a 1 volt peak square wave driving a 1 Ohm load.
Related to duty cycle; 1A * 1V * 0.5 time + 0V * 0A * 0.5 time = 0.5 W
as well as, the RMS calculation; 0.7071V * 0.7071A = 0.5W.
 
Using the RMS value of a pulse wave provides a correct power result.
So, if an RMS voltage value of a pulse wave is available, use it.
It's just not necessary to spend effort to determine the RMS value of a pulse wave where one is not readily available.
Peak value times duty cycle, which is often easier to determine, provides the same result.
 
All for now
 

Sent: Monday, July 15, 2024 at 4:43 PM
From: "Jerry Lee Marcel via groups.io" <jerryleemarcel@...>
To: LTspice@groups.io
Subject: Re: [LTspice] .MEAS RMS error

Very strange assertion. I'd like to see a proof.

Le 15/07/2024 à 19:28, eewiz via groups.io a écrit :
Javier,
 
Asking for the RMS value of a pulse wave is simply not a correct question to ask.
Although mathematically correct the answer is meaningless.
RMS applies only to waveforms that do not spend an equal amount time at each point value.
A sine wave spends less time at it's 5% value then it does at it's 95% value.
Since energy is power * time, the RMS value of a sine wave is usefull.
For a pulse wave, RMS provides a result that does not reflect the heating value.
A unipolar square wave will fully heat a resistor half the time and provide no heat for the other half.
The energy contained in a pulse wave is related to the average value of that wave not the RMS value.
The average value of a pulse wave is it's on-time divided by the period of one cycle.
On-time divided by period is a pulse wave's duty cycle.
The energy of a unipolar pulse wave is directly related to it's duty cycle not it's RMS value.
 
All for now.
 
 
Sent: Monday, July 15, 2024 at 11:29 AM
From: "Jerry Lee Marcel via groups.io" <jerryleemarcel@...>
To: LTspice@groups.io
Subject: Re: [LTspice] .MEAS RMS error

 

Le 15/07/2024 à 13:31, Andy I a écrit :
There are no sinewaves here. We shouldn't talk about sinewaves.
That's because of the 0.707 factor mentioned by the OP, which is pertinent to sinewaves.

Out of curiosity, what is going on in the uploaded schematic, why are there two sources? The two pulse voltage sources are identical. Why are there two, or is it just by coincidence and you left one in for redundancy?

Javier wrote, ".meas rms command gives wrong values when injecting DC+AC signal". Why did you write that? Did you come to this question assuming that the .MEAS command gives wrong values? Or does your circuit attempt to show that it is wrong?

Hint: The .MEAS command is correct.

Did you believe that RMS should remove the DC portion of a signal, before computing RMS? That would be incorrect. Remember, the RMS value of a 5 V DC signal plus a 0 V AC signal is 5 V. RMS is often described as the voltage that gives the same amount of heating, and both DC and AC components must be counted.

The mean average of V(t1)^2 between 0 and 0.5 ms is 1.0. The mean average of V(t1)^2 between 0.5 and 1.0 ms is 0.0. The mean average over the interval 0 to 1 ms is 0.5, and that exact pattern repeats indefinitely. The square root of 0.5 is 0.707107 volts. LTspice's answer from .MEAS is 0.707107. It is the correct answer.

The RMS value of V(t1) or V(2) is not 0.5. I don't know why you think it should have been 0.5.

Now, if your PULSE voltage alternated between -0.5 and +0.5 V, so that its peak-to-peak amplitude was the same but without the DC offset, then that signal's RMS voltage would be 0.5 V. But that is a different signal, and if you examined the heat from the resistor, it would indeed be less.

LTspice is doing the right thing. Your interpretation or your understanding of RMS is in error.

Andy


 

Really strange how lengthy such a discussion about nothing can be. Do you know that there is a great source of knowledge called internet? https://en.wikipedia.org/wiki/Root_mean_square


 

Pukses, as wll as sinewaves, are particular cases.
The rms formula is valid for any waveform.


 

Pulses!

Le 16/07/2024 à 10:14, Jerry Lee Marcel a écrit :

Pukses, as wll as sinewaves, are particular cases.
The rms formula is valid for any waveform.