LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding the percentage change in frequency amplitudes

Solved!
Go to solution

Hello, 

 

I have read in two csv excel spread sheets with frequencies and their corresponding amplitudes, created two separate 2d arrays and plotted these arrays as frequency v.s. amplitude graphs. Now I need to take these two 2d arrays and find the percent difference of amplitudes for like frequencies. I am looking for the best route to take here. This is my projected solution but other recommendations are more than welcome. 

 

1) I need to iterate through one 2d array searching for the matching x value in the second array (finding like frequencies).

2) From here I assume I should create a third array and store the frequency and corresponding amplitudes to be further analyzed in step 3. 

3) Then I need to subtract the frequencies corresponding amplitude (y1, y2 -values) values and multiply by 100 to find the percent difference. 

4) Potentially create one last array with the frequency and corresponding percent difference. 

5) Once the above two steps have been accomplished I need to display red, yellow, or green lights for each frequency depending on the value of the percent difference. 0 - 2.5 green, 2.6 - 5.5 yellow and 6.0 + red.

 

Any guidance on the most efficient method of accomplishing this would be greatly appreciated. I am fairly new to LabView but very familiar with Java in sorting and searching contexts so terminology and functional knowledge is not a problem but implementing it in this environment is proving to be a challenge.  

 

Thank you. 

 

0 Kudos
Message 1 of 3
(2,963 Views)
Solution
Accepted by topic author FinFam00

You can do all of this in a single FOR loop.  Just choose one array and make it the master.  Autoindex on that array.  The other array needs to just pass straight into the loop.  Then you just search the current frequency in the second array.  You get that index and use it to get the amplitude.  So you now have both amplitudes at that frequency.  Do the percent error calculation, make an array with the frequency and error and let that autoindex on the output.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(2,924 Views)

I used your concept and ended up with this. 

 

Thank you for the assistance.

0 Kudos
Message 3 of 3
(2,875 Views)