08-19-2020 03:34 AM
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:
What have you tried so far and where are you stuck?
08-19-2020 03:59 AM
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 ?
08-19-2020 04:12 AM
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…
08-19-2020 04:15 AM
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 ?
08-19-2020 04:23 AM
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…)
08-19-2020 06:48 AM
How would I know that how much samples will be used to bring both signals in phase ?
08-19-2020 08:42 AM
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…
08-19-2020 11:24 AM
@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.
08-19-2020 11:33 AM
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)
08-19-2020 12:07 PM
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: