07-08-2014 03:01 PM
From any signal (e.g. sine), I need to calculate the RMS value, with a 1 millisecond integration time, through a Rectangular Window, with a 25% time gap.
In other words, instead of calculating an RMS value by considering every 1 ms interval, I need to calculate the RMS value of a 1 ms window, then apply a 25% (of the window) time gap and then calculate the next RMS value by considering a 1 ms interval, and so on.
So, in a single 1 ms window, there is a 75% superposition.
I appreciate any help.
Thank you in advance.
Solved! Go to Solution.
07-08-2014 03:34 PM
Use the point by point functions to get the RMS for evry "Window" In this case every mSec then decimate the arrar to remove all the points you don't need
07-09-2014 06:21 PM
First, I want to thank you for your quick answer.
Second, can you share some more explanation about the routine? Where do you calculate the RMS?
Can you join the VI? Or can you tell me where I can find such items as in the joined file?
Thank you very much.
07-09-2014 08:01 PM
Firstly that's a snippet. Just drag drop to a block diagram. Poof code. Sum divided by count in the loop is moving average. RMS is not what you wanted. It would look really funny during zero crossings. But you could square the waveform and take the square root.
07-10-2014 08:13 AM
Hello Jeff,
At my side the dragging an dropping from the browser doesn't seem to work.
If I save the png, then it does work.
I get the following message:
http://forums.ni.com/t5/image/serverpage/image-id/147934i8CA7AD4AFF879317/image-size/original?v=mpbl...
Can you confirm that this is the same at your side?
From here I can drag and drop the snippets:
http://www.ni.com/white-paper/9330/en/
07-10-2014 08:17 AM
Depending on the browser used you may need to drag-n-drop to desktop then to a LabVIEW Block diagram
07-10-2014 08:27 AM
Hey Jeff,
Thanks for the feedback!
I think it's over here a combination of browser and image placeholders being used on the fora.
Drag and drop to desktop or just saving the png to the pc is indeed working ok.
07-15-2014 08:45 PM
(Att: joined files)
Hello,
Thank you for your answers.
1) In your routine, I don't understand the use of the:
a) division operator : 0.001/dt, why? I could stand dt/0.001, but the other way, I can't. Plus, is this value a constant?
b) equal operator, consisting of comparating 2 same values (thus always TRUE)!
2) "Use the point by point functions to get the RMS for evry "Window" In this case every mSec then decimate the array to remove all the points you don't need ". What does that actually mean?
3) But you could square the waveform and take the square root. Do you think this will do it?
Thank you.
07-15-2014 09:47 PM
@AlainKabs wrote:
(Att: joined files)
Hello,
Thank you for your answers.
1) In your routine, I don't understand the use of the:
a) division operator : 0.001/dt, why? I could stand dt/0.001, but the other way, I can't. Plus, is this value a constant?
b) equal operator, consisting of comparating 2 same values (thus always TRUE)!
2) "Use the point by point functions to get the RMS for evry "Window" In this case every mSec then decimate the array to remove all the points you don't need ". What does that actually mean?
3) But you could square the waveform and take the square root. Do you think this will do it?
Thank you.
a) time in LabVIIEW is commonly in mSec- it is a conversion 1k mSec = 1 second
b) Not-A-Number or "NaN" is a special case for IEEE-754 floats. (They are not really numbers but, the best answer a compurters memory can represent for real numbers) NaN is never equal to anything..BY DEFINITION!. even NaN! So a DBLl equal to itself must be a number and not "Not A Number"
NaN is not graphed in LabVIEW Graphs and Charts.
3) But you could square the waveform and take the square root. Do you think this will do it? NO
11-20-2014 01:38 AM - edited 11-20-2014 01:51 AM
Hello.
It has been a long time since I last posted a thing.
I have succeeded to get what I wanted, now I need to optimize it.
I simulate a sine wave and I get a 1 millisecond integration time 't' just fixing the number of samples 'N' and the sampling frequency 'fs' ( fs = N / t <=> t = N / fs ). Then I use the 'Extract Portion of Signal' tool and I calculate the RMS value of that portion in a loop.
Does anyone know if there is a way to do the same thing without the 'Extract Portion of Signal' because that tool uses too much memory so the treatment time is just too long with 4k samples and at 4M samples/second.
Thank you.