LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking 1st maxmin 2nd maxmin & 3rd maxmin from 1d array.

Hi Yum,

 


@Pukhtun_Yum wrote:

What I want is to take the average of some 3 max points and 3 min points at every high and low locations on the signal. 


Two simple steps:

  1. Determine the "high" and "low" locations of your signal by using thresholding as already discussed in your other thread.
  2. Take the average of the samples at those locations…

 

What have you tried so far and where are you stuck?

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 11 of 31
(368 Views)

I was thinking of the same but these two signals are slightly out of phase. The red signal is the one from chopper and I can control its phase. If i calculate the phase of the white signal (OUTPUT) and set the phase of the red signal accordingly would it work that way ? or are there any other options to conduct ?

0 Kudos
Message 12 of 31
(365 Views)

Hi Yum,

 

What I want is to take the average of some 3 max points and 3 min points at every high and low locations on the signal.


@Pukhtun_Yum wrote:

If i calculate the phase of the white signal (OUTPUT) and set the phase of the red signal accordingly would it work that way ?


How does the phase difference to another signal come into play here?

 

All you wanted is:


@Pukhtun_Yum wrote:

What I want is to take the average of some 3 max points and 3 min points at every high and low locations on the signal.


Find the min/max locations and calculate an average for each of them…

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 13 of 31
(360 Views)

The phase difference is due to the time constant of the sensor.

The understood what you mean by taking min max value but can you tell me how would i make the phase of both signals similar ?

0 Kudos
Message 14 of 31
(358 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

The understood what you mean by taking min max value but can you tell me how would i make the phase of both signals similar ?


Still don't understand how the phase difference is connected to finding the min/max of a signal…

 

You need to shift one signal by an amount of samples to correct the phase "lag" between those two signals.

(Or use the waveform datatype and manipulate its t0 element…)

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 15 of 31
(354 Views)

How would I know that how much samples will be used to bring both signals in phase ?

 

0 Kudos
Message 16 of 31
(351 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

How would I know that how much samples will be used to bring both signals in phase ?


You can count them easily when you determine X position of  the chopper signal state transition and the corresponding change in the thermopile sensor signal…

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 17 of 31
(330 Views)

@Pukhtun_Yum wrote:

What I want is to take the average of some 3 max points and 3 min points at every high and low locations on the signal. 


You really (really!!) need to stop posting pictures and start attaching actual data so we can try a few things.

0 Kudos
Message 18 of 31
(316 Views)

I have attached the VI this time. I am getting two signals and they are out of phase, what should i do to make it get in phase ? secondly, I want to take three points at both the maximum and minimum of the wave so that i could take the avverage of all maximum and all minimum to get the accurate amplitude of the white signal (output)

0 Kudos
Message 19 of 31
(313 Views)

Thanks for the data. I am currently in a meeting and will look at it later.

 

About the code (quick glance only):

 

You really don't need xy graphs. because the points are spaced equally. Just set x0 and dx. SIgnificantly simpler data structures!

 

There are some Rube Goldberg bits, for example the "=TRUE" just returns the input unchanged and can be deleted. You also don't need to wire the index:

 

altenbach_0-1597856764225.png

 

0 Kudos
Message 20 of 31
(295 Views)