LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

polynomial fit

Hey guys,

 

I had a question on using the polynomial fit VI. I am working on a cardiac mapping device that will illustrate and characterize the speed and direction of an electrical signal as it moves along the surface of the heart. Right now I have a 9x9 matrix of electrodes and am successfully measuring activation times of each electrode after I send a small voltage through the tissue. What I am wanting to do from here is use the polyfit model to create a 2d spacial representation of direction and speed of the signal. Eventually I would like to get it into a contour map that is color coded to represent the varying conduction speeds. Each electrode has an X and Y component for its physical location as well as a Z component for the activation time.

 

Delta time/ Delta distance = Velocity

 

What do you think the best way of setting this up is?

 

Electrode schematic:  *   *   *   *   *   *   *   *   * 

                                        *   *   *   *   *   *   *   *   *

                                        *   *   *   *   *   *   *   *   *  

                                        *   *   *   *   *   *   *   *   *  

 

                                        *   *   *   *   *   *   *   *   *    

                                        *   *   *   *   *   *   *   *   *  

                                        *   *   *   *   *   *   *   *   *  

                                        *   *   *   *   *   *   *   *   *  

                                        *   *   *   *   *   *   *   *   *                                

 

 

I appologize if this is an naive question or if I have not given the required detail to solve this problem and would be happy to give additional info..

0 Kudos
Message 1 of 5
(3,310 Views)

This is an interesting non-LabVIEW question, probably best addressed in a different Forum, one dealing with Signal Propagation through a 2-D (or 3-D) Medium.  Should be a topic in a number of Engineering disciplines -- I'm sure there are textbooks, maybe even information out there on the Web, to get you started.

 

Once you have an idea about the algorithm, it might be time to think about how you might code it up in LabVIEW.  Since I, for one, don't do this type of analysis typically, before coming to us with your code (please post it in "executable" format, i.e. a VI or a LabVIEW Snippet) if you get stuck, also provide us with the background to understand the algorithm you are using.

 

Bob Schor

0 Kudos
Message 2 of 5
(3,302 Views)

Apololgies..

 

I don't think I explained how far along I am with this. I have multiple LabView VIs that are able to get data into a 3x81 file.

 

The test polyfit excel file is what I am able to determine from my existing LabView Vis: 1st column is X location, 2nd column is Y location, 3rd column is activation time.

 

From here I know the algorithm that is needed to run through. I was able to create it in Matlab and perform all of the analysis post experiment and I am wanting to convert these files over to LabView to obtain the same data analysis in real time.

 

Attached are the VIs for stimulation and recording as well as how I am able to determine activation times of each electrode. Polyfit and velcity contour are the files that I am needing to convert over into a LabView scheme. 

0 Kudos
Message 3 of 5
(3,294 Views)

If you have m script, you probably can try MathScript firstly.

 

http://zone.ni.com/reference/en-XX/help/373123C-01/

0 Kudos
Message 4 of 5
(3,269 Views)

The fragment of LabVIEW code you posted suggests that you are very much a beginner in LabVIEW, one who does not understand how LabVIEW works, what Data Flow means, the use of Wires and Structures, etc.

 

You apparently do know (some) Matlab, however.  You have posted two VIs, one that you may have written (velocity contour) and one that seems to come from a Matlab Toolkit (polyfitn).  I don't think the LabVIEW Forum is an appropriate place to ask a volunteer to do the job of taking an algorithm developed by another company (MathSoft) and converting it to LabVIEW for you.  You might check the "LabVIEW Developers Seeking Employment" Forum (go to support.ni.com and look at Discussion Forums) and see if you can hire someone to do this for you.

 

However, the Velocity Contour should be fairly simple to code in LabVIEW, and might be instructive for you.  Why don't you tell us, in words, what it is that you did with your Matlab code?  Feel free to use terms like "Array", "Vector", dot product, whatever else will make the algorithm clear.  It is often easier to "start fresh" from the root algorithm than to try to first "go backwards" (from Matlab Implementation to Algorithm) and then go forward again (from Algorithm to LabVIEW Implementation).  Start by describing the Algorithm, please.

 

Bob Schor

0 Kudos
Message 5 of 5
(3,241 Views)