 |
 |
| View previous topic :: View next topic |
| Author |
Message |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Fri May 02, 2014 2:14 pm |
|
|
Sorry newguy. I disagree.
My method computes R.M.S. values for ANY waveform, bipolar, uni-polar or any anything in-between.
It is a bog standard algorithm which worked over half a century ago when I studied statistics. I don't see why it should not work now.
The real beauty; it is a single pass process, any offset falls out at the end.
Mike |
|
 |
newguy
Joined: 24 Jun 2004 Posts: 1938
|
|
Posted: Fri May 02, 2014 2:46 pm |
|
|
I put together a spreadsheet with a sinusoidal waveform and added random noise. Computed RMS the traditional way and your way and the values agreed closely.
I then added a DC offset to the sinusoid and the two methods suddenly no longer agreed. The greater the offset, the higher the difference.
For example:
- create a spreadsheet with 500 samples, 0-499
- omega column = 2*pi()*sample/500
- sample noisy waveform = 18.3 + 5.15*sin(omega)+(3.52*(rand() - .5)))
Using the traditional method of calculating RMS value, I get 18.702. The magic number method gives me 3.821. If I make the offset term 0, the traditional RMS value is 3.832 and the magic number method gives 3.850.
My original assertion stands: this method doesn't take DC offsets into account properly. |
|
 |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat May 03, 2014 1:53 am |
|
|
First thoughts.
You're testing with a sine-wave of amplitude 5.15.
Whichever method you use, the RMS value of the pure waveform should be 5.15/(2^0.5)
That's ~3.64.
My method gives the RMS value of the AC component of the waveform and ignores the DC offset, which is what the O/P appeared to want.
With noise you will get higher values.
I'll do a repeat of your noisy spread sheet analysis and come back.
Mike |
|
 |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sat May 03, 2014 3:50 am |
|
|
OK. I've done a spreadsheet analysis on noisy sine-waves with Excel.
I performed the calculations on 1000 values for one cycle of the sine-wave.
I varied the sine-wave & noise amplitudes, and the offset
Each time F9 is pressed, Excel generates a new set of random Nos and new RMS values.
I calculated by both the traditional and the faster method on the each set of values.
Both methods produced exactly the same RMS value on each iteration (within Excel's limitations).
Mike |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|