LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting multiple Max Min points from a non uniform sinousodal signal.

I hope everone is enjoying good health.

I am stuck in a situation where I have to collect max point from each peak of a signal and then take mean average deviation of all the max point of each peak to calculate the amount of noise present in the signal. I have a reference signal (Square wave) and a response signal. Can someone help me to find the appropriate way out of how to do it ?

Thank you

0 Kudos
Message 1 of 27
(2,409 Views)

Hi, @Pukhtun_Yum,

  • What have you tried?
  • Where are you stuck?
  • Can you attach some (or all) of your code as a LV Snippet, a .vi file, or a .zip file containing the project?

-joeorbob

0 Kudos
Message 2 of 27
(2,341 Views)

The VI is attached, I am extracting value of signal after every half time period and extracting max and min points from it. I want to plot those max min point with respect to the original wave form. Please see the VI for corrections.

0 Kudos
Message 3 of 27
(2,339 Views)

Do you want to process an array as a hole (as you have now), or as it comes in part by part (as in a DAQ application)?

 

The VI will only work for a complete (finite) array of data, and even if you can get it working, it won't translate well for processing streaming data. You'd need a PtByPt-ish solution, and it will be very different from what you have now.

 

I'm just trying to prevent wasting time working on or helping with a solution that won't work. I'd prefer to work towards the definite solution.

Message 4 of 27
(2,328 Views)

The array is a sinusiodal wave with non uniform peaks. I get array from DAQ for every increasing chopping frequency and as the chopping frequency increases I get wave with decreasing amplitude. what i want is to take the max of each peak and min of each valley and then take the average of all the max and min and subtract it to get the peak to peak voltage

0 Kudos
Message 5 of 27
(2,322 Views)

What does the fluctuation of the peaks and valleys have to do with the "noise"? Is this a heavily filtered signal? What does the red signal represent? What's the significance of the processing to turn the "before" into the "after"? What is the raw signal? What's the significance of the rest of the code?

 

So do you want the average of all max and all min or do you want or do you want a trend of the local max&min over time or as a function of frequency, for example.

0 Kudos
Message 6 of 27
(2,314 Views)

I am using two channels of DAQ for Red signal is a chopper signal and the white one is the response signal from the sensor. Before is when the red and white signal are not in phase and after is when they are in phase. In the VI after making the two signals in phase, I have started to take the signal when it is in ON state and later I have extracted every half time period of the signal to check for max and min point of each peak.

I am doing all this to calculate peak to peak voltage and also to calculate noise by mean average deviation method.

0 Kudos
Message 7 of 27
(2,306 Views)

Why do you need the red signal at all? Rotating an array seems ill advised because the data is not circular or guaranteed to contain an integer number of cycles. It seems trivial to just take the original white trace and get all the local max and mins. Isn't that all you need?

0 Kudos
Message 8 of 27
(2,298 Views)

Here's one possible way to get the difference between adjacent peaks (probably needs a few tweaks depending on the phase near the edges. Might just give you some ideas.

 

altenbach_0-1601497214756.png

 

Message 9 of 27
(2,287 Views)

I took what @altenbach made, added comments (it helped me follow his work), separated out the Maxima from the Minima, averaged the Maxima and Minima separately, and subtracted those averages to find the Peak to Peak value.

 

This also made the maxima and minima available as separate arrays, from which the Mean Absolute Deviation can be easily calculated. (I'm not sure what the Mean Average Deviation is, but maybe it's similar?)

 

Anyway, see the attached file if you think it may help. 😄

-Joeorbob

0 Kudos
Message 10 of 27
(2,278 Views)