LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Complex problem that I need some help with

 Now I am fairly new to labview, and I don't really know how to even start with such a set-up and some help on how to get started would be greatly appreciated.

 

Ill first give you an impression of the calculation I want to do. I have two continuous streams of data and I sample these signals at a sample rate of 200 hertz. Now what I want to do is collect data for 6 seconds, and then calculate the mean of both the signals over that 6-second period. This should then be added to an array that saves the last 40 6-second means tat should be updated after every 6 second window. .

 

Next a Pearson correlation coefficient should be calculated over the last 40 6-second means of both signals. This Pearson correlation coefficient should be updated after every 6-second window.

0 Kudos
Message 1 of 3
(2,324 Views)

Well, you've really only got two significantly different things to do: (1) collect data at a fixed rate, and (2) do math with what you (then) already have.

 

You could start with either task. For me personally, the routine to take the data is the more difficult (there's always some condition I haven't thought about that adds another fork in your routine), so I'd start tackling that one first.

 

The math, well basically it's a matter of getting used to how LabVIEW handles arrays, and once you've got that down, it's smooth sailing (hint: one way is to use FOR loops and shift registers). There are enough built-in math functions in LabVIEW (including the Pearson correlation coefficient) that you can easily do just about anything.

 

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>
0 Kudos
Message 2 of 3
(2,315 Views)

Hello Camerond,

 

There's one other thing he should think about/keep in mind:

 

How he's going to implement his 40 "6 second mean" buffers.
Basically a simple circular buffer should do the trick, but still there are different ways to do/implement this.

 

Vitual: Which part have you already tested/tried?

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 3 of 3
(2,271 Views)