LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure and plot RMS value of real time data?

Solved!
Go to solution

hi

i need to measure and plot real time RMS value of EMG voltage. I made a VI. But I dont know why it didn't work. Can anyone please help me out? My VI is attached  in 2013 and 2011 both version. One sample data is also attached. Thanks at advance.

Download All
0 Kudos
Message 1 of 15
(8,428 Views)

@taslim.reza wrote:

hi

i need to measure and plot real time RMS value of EMG voltage. I made a VI. But I dont know why it didn't work. Can anyone please help me out? My VI is attached  in 2013 and 2011 both version. One sample data is also attached. Thanks at advance.




You don't say what happens when "it didn't work." That makes it much harder to troubleshoot. But, you did attach your VI, good. I'll guess that your graph came out with a single visible point, or maybe no visible points. That's because you only gave it one point to plot. You took the RMS of the whole array and that's your Y value and the first X value is your only X. You need to at least read up on the LabVIEW help pages to see how to make graphs, and it would do you a world of good to at least work through basic LabVIEW tutorials, some of which are listed below. (Hint: you'll probably need to use a loop somewhere)

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
Message 2 of 15
(8,417 Views)

hi cameron

no graph was shown at output. Y-data were 1D array before "RMS.vi". after this block it was changed to rms value double. but X-data remained 1D array. do you think this is the reason why no graph was found at output? if so, then how I could be able to get 1D array of rms value? thanks.

0 Kudos
Message 3 of 15
(8,402 Views)

You seem to select EMG voltage vs Angle(Z-axis). Is that really what you want? More resasonable would seem e.g. EMG voltage vs. time.

If you want to process the 3D (xyz data), you probably need to add some more math). Why are you taking the absolute value? RMS does not care about the sign anyway, right?

 

They you are trying an XY graph with a single point, because your Y value is only a single number. You need an equal number of points for Y.

 

Here's a quick modification that graph EMG(mV) vs. time(ms) and takes the RMS of the EMG data. See if this gives you some ideas.

 

Please provide more information what you want to do with the angles.

 

Message 4 of 15
(8,396 Views)

If you also want to plot the RMS value (boring, because it is the same everywhere!), you could do as follows (of course you would only need the first and last point, but the method shown is simpler).

 

 

Message 5 of 15
(8,393 Views)

Thanks for you reply Dr. I got an idea to process EMG signal from an online pdf (please see the attachment, page no: 26-27) and I tried to make it. I wanted to see how it works for me.

 

The angle I was talking about the resultant acceleration angle (to get it I used a kinematics sensor). I am trying to plot EMG vs angle because I want to detect the human intention (whether he wants to stand up or sit down). So this would be really convinient if I know how EMG varies with this angle. There is no speciality of z-axis. It could be x or y depending on how I place the kinematics sensor in a human body.

 

Right now I am really confused. May be the idea that I wanted to execute was a stupid one. Smiley Sad

 

 

0 Kudos
Message 6 of 15
(8,390 Views)

Well, once you take the RMS of the entire dataset, you get one single value and nothing interesting is left. What they seem to do is take a moving RMS. Look into the ptbypt RMS function instead.

 

If they take the absolute value by convention, that ok. Simply put the absolute value function back in place. The RMS will be the same.

Message 7 of 15
(8,382 Views)

Thanks Dr. I have tried RMS PtByPt VI. But it wasn't wired because the source was 1D array of double and the sink was double. BTW I went through Biosignal RMS VI  and it worked. But there was nothing significant in the waveform that you said in the last msg. May be I have to think of about different ideas to process the signal. Any idea from you will be highly appreciable. 

 

Regards-

Taslim

0 Kudos
Message 8 of 15
(8,371 Views)
Solution
Accepted by topic author taslim.reza

@taslim.reza wrote:

I have tried RMS PtByPt VI. But it wasn't wired because the source was 1D array of double and the sink was double.


Well, the ptbypt tools operate on one value at a time, thus you need to place them in a FOR loop. Here's how.

 

 

Message 9 of 15
(8,361 Views)

That is a very good solution. Thanks Dr. If I want to plot polar plot (EMG vs Acceleration angle), how to get 1D array of cluster of 2 elements? Thanks at advance. Smiley Happy

0 Kudos
Message 10 of 15
(8,353 Views)