09-28-2020 01:20 PM
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
09-30-2020 12:31 PM
Hi, @Pukhtun_Yum,
-joeorbob
09-30-2020 12:43 PM
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.
09-30-2020 01:11 PM
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.
09-30-2020 01:20 PM
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
09-30-2020 01:30 PM
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.
09-30-2020 01:39 PM
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.
09-30-2020 02:14 PM
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?
09-30-2020 03:20 PM
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.
09-30-2020 05:37 PM
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