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.

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
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Attachments:
creating_matrix.vi ‏131 KB
creating_matrix_(2).vi ‏119 KB
matlab.vi ‏30 KB

Similar Messages

  • How to calculate difference and percentage in matrix report dynamic columns in SSRS 2008

    Hi Friends,
    I need to calculate Difference and Percentage In matrix report SSRS 2008
    1) Row grouping based On Product
    2) Column Grouping Week and Fiscal Year Current week  and Previous Year same Weeks 
    3)Data Invnetory(Value fileld)
    Example:
    If value1 and Value2 Available we need to calculate Percentage and Difference.Otherwise Not required NA I need to Show.
    For example If Particular week,Current year data is available,Previous year  week data is not available No
    need to cal Diff and Percentage we need to show Empty.
    Below Code is working for If two values is available.
    If any one of the fiscal year week data is not there it's taking some garbage values.
    I tries with If condition in GetPCT() and GetDiff() It's not working.
    Can some one please help me on this.
    I am using the custom code 
    Public Shared Value1 as String
    Public Shared Value2 as String
    Public Shared previous as string
    Public Shared previousweek as string
    Public Shared Function GetValue(Value as String,partner as String,Week as String) as String
    If partner =previous and Week =previousweek Then
    Value2=Value
    Else
    previous=partner
    previousweek=Week
    Value1=Value
    End If
    return Value
    End Function
    Public Shared Function GetDiff()
    return Value2-Value1
    End Function
    Public Shared Function GetPct()
    return (Value2-Value1)/Value1
    End Function
    How to handle this.
    Thank You, Manasa.V

    Hi veerapaneni,
    According to your description, if one of the fiscal year week doesn’t have data, the custom code returns false results.
    For your requirement, if NULL value exists in the database, we should replace it as zero then perform calculate. So within the code, we should judge whether the value is NULL. To achieve your goal, please refer to the steps below:
    1. Create a table like below.
    create table dif4
    ([Product Group] varchar(50),
    [Week] varchar(50),
    [Fiscalyearweek] varchar(50),
    value int
    insert into dif4 values
    ('Desktops','W01','FY14W01',0),
    ('Desktops','W01','FY15W01',45),
    ('Desktops','W02','FY14W02',null),
    ('Desktops','W02','FY15W02',30),
    ('Desktops','W03','FY14W03',12),
    ('Desktops','W03','FY15W03',50),
    ('Notebooks','W01','FY14W01',35),
    ('Notebooks','W01','FY15W01',56),
    ('Notebooks','W02','FY14W02',45),
    ('Notebooks','W02','FY15W02',87),
    ('Notebooks','W03','FY14W03',75),
    ('Notebooks','W03','FY15W03',105),
    ('Tablets','W01','FY14W01',34),
    ('Tablets','W01','FY15W01',46),
    ('Tablets','W02','FY14W02',49),
    ('Tablets','W02','FY15W02',96),
    ('Tablets','W03','FY14W03',42),
    ('Tablets','W03','FY15W03',113)
    2. Add the custom code in the Report Properties.
    Public Shared Value1 as Integer
    Public Shared Value2 as Integer
    Public Shared previous as string
    Public Shared previousweek as string
    Public Shared Function GetValue(Value as Integer,product as String,Week as String) as Integer
    If Value=Nothing Then
    Value=0
    End If
    If product =previous and Week =previousweek Then
    Value2=Value
    Else
    previous=product
    previousweek=Week
    Value1=Value
    End If
    return Value
    End Function
    Public Shared Function GetPct()
    If Value1=0 Then
    return 0
    Else
    return (Value2-Value1)/Value1
    End If
    End Function
    Public Shared Function GetDiff()
    return Value2-Value1
    End Function
    3. Design the matrix like below.
    4. Then get the expected results.<o:p></o:p>
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Enter an equation into a textbox and it will automatically calculate an answer

    Hi All,
    I have created two textboxes.
    What I would like to do is after entering an equation, e.g.
    "(9-5)*30 + 1", into the textbox 1,
    textbox 2 will automatically gives me the answer "121".
    I have no idea which function can give me an int 121 from a
    string "(9-5)*30 + 1" or I have to build one by myself.
    Are there any build-in functions in AIR could help?
    If I have to build one by myself, are there any sample code
    for me to reference??
    Many Thanks!!

    Your choices are:
    * Parse the expression and calculate it yourself, which is
    probably hard.
    * Google for a library that aleady does it
    * Pass the expression string to the browser via
    ExternalInterface and evaluate it using javascript's eval()
    function.
    Tracy

  • Array of different (digital and analog) values into multigraph

    Hello everyone,
    So I have an array with a timestamp on the first column, either "off" or "on" string on the second column, and a number value string on another. The columns are based of variables that reads data based on an update rate. My question is, what is the easiest way to separate these values into a digital and analog graphs. This is because the number values are so high that the "off" and "on" signal is being pushed down as the y-axis auto-scales. I'm hoping that I can use a multigraph, but the multigraph puts the data in one graph (since it's one array). 
    Any suggestions or help is appreciated.

    Hi jachy25, 
    Below is a link to a KnowledgeBase article that goes over how to use stacked plots in LabVIEW.
    http://digital.ni.com/public.nsf/allkb/21E8163F259DA2058625703B007511AA
    The second link contains a lot of general information on configuring graphs and charts in LabVIEW, and is a useful document to have when configuring plots.
    http://zone.ni.com/reference/en-XX/help/371361L-01/lvconcepts/customizing_graphs_and_charts/
    I hope this information helps!
    Regards,
    Kelly B.
    Applications Engineering
    National Instruments

  • My iphone 4 only turns on when its plugged into a wall and when it finally turns on it lasts for about a minute then it turns off and while its on the signal says searching, what should i do?

    my iphone 4 only turns on when its plugged into a wall and when it finally turns on it lasts for about a minute then it turns off and while its on the signal says searching, what should i do?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.      
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem. You likely have a bad battery.
    Apple Retail Store - Genius Bar                       
    Apple will exchange your iPod for a refurbished one with a new battery for $79. They do not fix yours.
    Apple - iPod Repair price                       
    A third-party place like the following will replace yur battery for less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the battery yourself if you are up to it. A replacement costs about $10
    iPod Touch Repair – iFixit

  • I am about to go get my 4th iphone 4s since November!  Up in the left coener where it shows your signal strength, it goes into searching mode and stays there.  Kills my battery.  This one has lasted the longest-I got it December 23.  Any ideas out there?

    I am about to go get my 4th iphone 4s since November!  Up in the left corner where it shows your signal strength, it goes into searching mode and stays there.  Kills my battery.  While in searching, no calls can be made/recieved, no internet, etc. This one has lasted the longest-I got it December 23.  Any ideas out there?

    Both.  The first two, I did use my itunes.  The guy at the apple store said that could be the problem.  The last time they gave me a new phone and SIM card, and the tech said it wouldnt be the itunes.  Just to be safe, I never connected this phone to the itunes until last night-after it started searching- to save everything since I'm sure they will be replacing the phone today.  But hey, thanks for the suggestions.  I'm about at my wits end with Apple!!  Especially since i added a third line to my account just so I could get an iphone back.

  • How do i change 2 row of array into waveform with delta time and time

    Hello,
    How do i change 2 row of array into waveform with delta time and time
    so the waveform graph will display two waveform,
    waveform, not cluster =]
    and how to extract 1d array from waveform?

    Hi AxE,
    Here is an example VI, that do what You asked for.
    Both requests.
    Hope it Helps...
    Attachments:
    2D_to_Waveform.vi ‏75 KB

  • I have an iPhone 5, yesterday it wasn't receiving any signal. I reset it and when it cam back on it said plug into iTunes, i did that but now it comes up with error 9006 and 39. What do i do, i have tried different wires, and different plug

    I have an iPhone 5, yesterday it wasn't receiving any signal. I reset it and when it cam back on it said plug into iTunes, i did that but now it comes up with error 9006 and 39. What do i do, i have tried different wires, and different plug in holes, I've left it for the night and tired again this morning.

    Error code 9006 is related to the computer's security software settings, 39 is not listed inResolve iOS update and restore errors try turning the security/anti-virus software off if you are using something like that.  Then you may need to restore via the recovery mode since that is what the graphic of a USB wire connecting to iTunes means, it has already entered recovery mode...see http://support.apple.com/kb/HT1808 for instructions on recovery mode restoring.

  • I'm lost with my new "used" iPod touch 4th gen.  Just downloaded iOS 6; seems to be trying to access a WIFI signal but I have it hard wired into my MAC and I do not have WIFI.  Need iPod for dummies.

    I'm lost with my new "used" iPod touch 4th gen.  Just downloaded iOS 6; seems to be trying to access a WIFI signal but I have it hard wired into my MAC and I do not have WIFI.  Need iPod for dummies - very basic and simple help.

    On the computer you should be able to go to the network properites. Go to the TCP part and unchec the line that says obtaind DNS automatically and check the one that says use the following. Add the 8.8.8.8 and Google other 8.8.4.4.
    For more info see:
    https://developers.google.com/speed/public-dns/

  • How to make two matrix and table into same group in SSRS

    Hi
    i need to dispaly to dispaly data  matrix and table .  but matrix data on first page and table data on second page.
    how to achive this . if i give pagebreak for every new instance for matrix, only matrix data is getting dispalyed in one page and on the second page seocond record date is getting displayed. after all matrix data is displayed ( in separate pages) , table
     data is being dispalyed.
    but i want to display matrix data on first page and table data on the second page for the first record. for second record  also it should display matrix data on 3rd page and table data on 4th page etc..
    i mean how to make matrix and table data as same group. so that i can set "page break for new instamce" etc..
    how to achive this in SSRS2008

    Hi Ramkanuganti,
    From your description, you want to group both the matrix and table on the same field and add a page break between the two controls for each instance at run time.
    To achieve your goal, we can display the matrix in a list and display the table in a nesting list. Please refer to the steps below:
    Drag a “List” to the design surface. Drag the matrix into the top of the list (list1).
    Drag a “”List” to the list1, under the matrix. Drag the table into the nesting list (list2).
    Select “list1” and open the “Group Properties” from the “Row Groups” pane. Add the field on which you want to group the data. In the “Page Breaks” tab, select the “Between each instance of a group”.
    Repeat step 3 to configure the “list2” using the same field. Additionally, please also select the “Also at the start of a group” option.
    For more information about how to work with list, please refer to:
    Adding a List
    If you have any further questions, please feel free to ask.
    Regards,
    Mike Yin

  • Is there a way to separate an array into it's positive and negative elements?

    I'm working with an array, and I'd like to be able to seperate this array into it's positive and negative elements. I'd like to be able to store each of these values in two other arrays (positive and negative arrays if you will). If anyone could suggest an algorithm for doing this, I'd appreciate any help I can get.

    Actually, if you slightly modify the VI in the example, you can use it as a sub-VI for your application. In the front panel, right-click the VI's icon located on the top-right of your VI. Then select "Show Connector" and add the necessary connetcors to the VI (One for the input and two for the output) for the VI so it can be used as a Sub-VI. Save it with a different name and location so you don't change the original.
    www.vartortech.com

  • How to change the image into byte and byte array into image

    now i am developing one project. i want change the image into byte array and then byte array into image.

    FileInputStream is = new FileInputStream(file);
    byte[] result = IOUtils.toByteArray(is);
    with apache common IO lib

  • I am having problems loading sampler patches into the exs24 sampler, when i got into edit menu and load multiple samples all the samples r greyed out and i cannot slect them, any help with this would be much appreciated

    I am having problems loading sampler patches into the exs24 sampler, when i got into edit menu and load multiple samples all the samples r greyed out and i cannot slect them, any help with this would be much appreciated

    It is very difficult to offer troubleshooting suggestions when the "os version" you are using is unknown as each os has their own troubleshooting solutions. 
    How large is your hard drive and how much hard drive space do you have left? 

  • Acquiring AC voltage signal using NI 9206 9205 and cRIO

    Hello.  I am having difficulty accurately acquiring an AC voltage signal using a NI 9206 and cRIO.  I'm attempting to acquire voltage signals from two types of Magnelab Current Transformers: split core and rope.  In Labview, I first populate an array of size 2,500 with the sensor signal (DIFF mode), then compute the RMS of the array.  For the split core CTs, I am able to accurately acquire the correct voltage reading (verified by measuring the corresponding amp on the line using a Fluke 434 Power Analyzer.  For the rope CT, however, using the same array/RMS method, I am unable to accurately acquire the correct voltage reading.  Measuring the amp on the line using the Fluke 434 PA, the correct voltage from the rope CT should be 0.05v.  Using the 9206 (DIFF mode), the RMS from the array gives a voltage reading of 0.071.  Now the interesting part is when I measure the line voltage using two different True RMS DMMs, I get two different readings.  One multi-meter, a Klein CL2000, reads the correct voltage at 0.05v.  Another multi-meter, a Fluke 189, reads incorrectly at 0.071, the same as I get using LabView and the NI 9206.  I suppose the question is how is the Klein interpreting the signal differently than the Fluke 189 and the NI 9206 via LabView.  One difference between the split-core and rope CTs is that the rope CTs require an external power supply 12-30v AC or DC.  I am providing them with 12v DC.  I have tried multiple voltages in both AC and DC and still get the same incorrect reading.  I'm quite certain it is not a power supply issue, although perhaps the integrator in the rope is creating a unique signal.  Any ideas?  I appreciate any input.
    Thanks,
    J.Grant
    Solved!
    Go to Solution.

    AK2DM:
    Update - solution found
    While the Butterworth low-pass filter sort of worked, it was NOT the solution.  I spent some time analyzing the rope CT signals by sampling at a very high rate.  The AC signal coming off the rope CTs is triangular NOT sinusoidal.  The RMS function in LabView assumes a sinusoidal waveform and essentially calculates the RMS as the average of voltage peaks (for each cycle) / sq.rt (2).  Since the AC voltage single emanating from a regular split-core CT is basically sinusoidal, the LabView RMS of the signal gives an accurate reading of the voltage signal.  Unable to find a RMS function in LabView for a triangular AC voltage signal, I ended up developing my own custom triangular RMS function in LabView.  My function analyzes the signal by finding the peak of every cycle within the signal, takes the average of these peaks, then divides this average peak by sq.rt (3).  see this link for formulas:
    http://www.optics.arizona.edu/nofziger/OPTI%20380B/Lab%201/AVG%20and%20RMS%20Values%20of%20Periodic%...
    Using the triangular method, I am able to accurately acquire the signal off the rope CTs. 
    Thanks for your help!

  • Add time stamp array into first column of text file

    I am writing daq output to a file by using array to spreadsheet string vi then write that to a file but I would like to add a time stamp array into the first column of the text file. How do I do this?

    When you use a DAQmx Read, you have the option of returning a waveform data type. This includes time data. If you were to use this and either Export Waveforms to Spreadsheet File or Write Measurement File, this would included. To stick with the regular Write to Spreadsheet File, you would have to create an array of timestamps yourself based on a start time and the sample rate of the DAQ. Then you would convert this and the data array to strings and use the string array type of Write to Spreadsheet instead of the DBL type.
    Message Edited by Dennis Knutson on 09-25-2007 01:12 PM
    Attachments:
    Write to Spreadsheet - Strings.PNG ‏1 KB

Maybe you are looking for

  • USB external mass storage devices doesn't work.

    Hey guys, I couldn't find any answer to my problem so I hope you can help me... I have USB Seagate external USB drive which was working perfectly with my mac until I installed VMware. The thing is that since first time I installed XP on VMware and un

  • Oracle VM Server 2.0 for Sun Fire v240?

    Hi all, I am searching and trying all day long to install Oracle VM Server on SPARC 64 Sun Fire v240. I still can not find information is it supported or not? I have Oracle Solaris 10 5.10 Generic_142909-17 sun4u sparc the CPUs are UltraSPARC-IIIi (p

  • Office Updates + Battery 1.3

    Any known issues with Battery Update 1.3? I checked my bundle and it is 1.2 right now. also when i did an up date of Office 2004 for Mac all my icons in my System Configuration folder have office icons on them as opposed to the correct ones? Screen s

  • Which Recovery Media DVDs are unique for each delivered pc?

    This is related to the other thread: what is "boot media" and "data media" Having just finished making recovery media for the E520 I've just purchased for my daughter, I'm soon going to need to repeat the process for the other identical E520 I've jus

  • Can't Output to DVCPRO HD

    I'm working with DVCPRO HD via FW and I got to digitize some footage, but I can't seem to get it to output back to my deck (via FW) I've downloaded all the DVCPRO HD components and upgrades but I still get an ERROR massage that says "DVCPRO HD OUT MI