From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-09-2012 09:57 AM
Hello,
Solved! Go to Solution.
05-09-2012 10:09 AM
05-09-2012 10:13 AM
Thank for the quick reply and the solution.The other question i have is if i can take an average in every peak of my signal?Can you propose a suggestion how this can be done.
05-09-2012 10:19 AM
How will you determine which is the peak you want to take and average. If you use the Array Min and Max it will give you min (Least) and Max (highest) values but its pretty tricky to do what you want to achieve. For instance if you know the number of cycle (If it is a standard wave) then you can divide the array into that many segments and find the min and max among them and then find the average of those values.
05-09-2012 10:26 AM
I would like to find the average when the voltage as shown in the graph is above 4 volts and also to take an average when the voltage goes below 1 voltage.I am not sure that i understand correct what you suggesting,can you please provide a code example to help me understand.
05-09-2012 10:37 AM
I have done little modifications with GredW's code check it.
Good luck
05-09-2012 10:56 AM
Thank for your help but this is not exactly what i would like,let me explain, GredW's provide a code how to delete the intermediary values between 4 and 1 volts and now the array 2 has only values above 4 voltage and below 1 voltage,from these values of the array i want to calculate an average when the values of the array are above 4 and below 1.
05-09-2012 11:14 AM
So you want the average of the entire array with the values between 1 and 4 removed? If that's the case, just take GredW's code and put a Mean.vi at the end. The VI is located in the Mathematics->Probability and Statistics palette.
05-09-2012 11:18 AM
Ha.. Yes Now I have modified that check. Still with that Idea you can try creating by your own that will be much helpful for you.
05-09-2012 11:38 AM
I post a picture which i think would help more to understand.In the picture you see the signal which is 1D array after the intermediary values where delete.The array 2 contains all the values.As you see in the picture i have mark the maximum and the minimum i want to find the average,so according to the signal (red cirlce in the picture the yelllow by mistake should be also red) we see that we have 9 peaks,that means that inside our array we have values which are above 4 voltage,so some how i must find them and find an average for each peak i have.The same for minimum (purple cirlce in the picture) we see that we have 8 peaks that means that inside our array we have values which are below 1 voltage,so some how i must find them and take an average for each peak i have.
I hope this more helpfull now.