From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sample signal arrays into a matrix and calculate covariance matrix

i want to gather signals from different channels and put these into a matrix which will be updated at every time step. then this matrix should be normalized and the covariance matrix should be calculated. then i want to calculate the eigenvalues of this latter matrix and display them. this last part(normalize,covariance and eigenvalue) can be done either at every time step or after a specific time interval.(i prefer time interval because i don't need that dense information). my main problem is to update the signal matrix. i tried to use "insert into array" but as the matrix should be empty initially it creates problems while trying to connect this to other blocks. the minor problem is i am new and i canno
t find a block to calculate the covariance matrix although i realized that the software has the capability to do it while fitting curves etc. thanks for help.
0 Kudos
Message 1 of 4
(3,040 Views)
cigdem,

in order to answer your question, i have to get some more information:
- which version of LV do you use?
- where does the signals come from?

as far as i understand your posting, you want to collect several channels of e.g. a data acquisitionboard (6024 for example) in a matrix. your question is how you can insert the new values into this matrix.

i am afraid that there is indeed no "block" (actually, they are called virtual instrument, vi) for the covariance matrix.

-Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(3,040 Views)
It is the LabView 7.0 Evaluation version with all tools enabled(with limited time).

indeed i couldn't handle the acquisition part yet. i'm just generating 2 sinusoidal signals for now.

i am actually a Matlab Simulink user but i could not handle a matrix with changing dimensions all the time in Simulink and decided to try it in LabView. as you say that there is no covariance matrix vi, now i have to have a matrix that i can feed into a matlab script. that is: i will acquire the data online and from time to time will feed some of it(say next 100 rows each time) to matlab script and do some covariance and eigenvalue calculation there. so i guess i need some kind of trigger and/or enable but i am lost there.

i appreciate your help.
0 Kudos
Message 3 of 4
(3,040 Views)
cigdem,

i attached two examples which show how you can solve the issue with generating the 2D-array (matrix). i annoted it the best way i could, but if you have any questions, feel free to post them.
we have a toolkit called "simultion interface toolkit". you can insert matlab-code in LabVIEW with it and vice versus.
the question about "trigger" is not very specific in this point. normally you trigger the acquisition via a starttrigger and then continue to acquire data either continousely or in "N samples". the time of filling a row the matrix is defined therefore by number of samples and samplerate.

-Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Download All
Message 4 of 4
(3,040 Views)