From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sine period measurement

Hello,
I have to measure the standard deviation of the period of the sine signal.
Sine signal is acquired by the analog input of the PCI-6023E card.
It's the low frequency signal - from 5 to 100Hertz. How can I measure the pulse and then deviation without any hardware modifications?

Thanks in advance,
Radek
0 Kudos
Message 1 of 9
(2,993 Views)
Several issues come to mind. Do you need to measure every period of the signal or only sample it occasionally? Is the signal very clean or does it have a lot of noise? How many periods are you acquiring? How fast does the period change?

If you have a clean signal just search through the waveform data for rising zero crossings and calculate the time between them. Pass the array of periods to the Mean and Standard Deviation function. If your signal has a lot of noise, you will need to do some smoothing or filtering before looking for the zero crossings. Noise can cause multiple, high frequency zero crossings and destroy your statistics.

Lynn
0 Kudos
Message 2 of 9
(2,993 Views)
About my signal: I acqiure from 500 to 5000 periods. I have to count the deviation of all the periods.
Signal isn't too clear. The idea with the zero crossing already came to my mind, too. But - how to do it? First - detect the rising slope, then - compare to zero and detect when the sign has changed, and at last - measure time between to crossings?

Cheers,
Radek
0 Kudos
Message 3 of 9
(2,993 Views)
There is a frequency estimator VI : "SINAD Analyser.vi". It will give you your frequency then you can compute the average.

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 4 of 9
(2,993 Views)
Average frequency and also average period - yes. But - how to measure the standard deviation of the period??

Radek
0 Kudos
Message 5 of 9
(2,993 Views)
You slice your data into N smaller parts, compute SINAD and compute the stats you want to compute on your N points.
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 6 of 9
(2,993 Views)
Hello again,
Please, take a look at the attachment. Is this what You ment? I'm not sure if I did it well...

Radek
0 Kudos
Message 7 of 9
(2,993 Views)
SINAD Analyzer uses FFT. FFT is not very effective if you only give it one period of the waveform to work on. The theory behind Fourier transforms is originally based on infinitely continuous time signals.

I would try a moving average smoother before looking for zero crossings. If you have 10 or more samples per period at the highest frequency a 3- or 5-element moving average may be enough to eliminate much of your noise. A shift register with multiple prior elements is a very simple way to implement the moving average.

The attached file has a simulated noisy signal, a smoother, and a simple zero crossing detector. With the noise amplitude setting used the smoother does not always succeed in eliminating the noise at zero crossings. If you
have this much noise on your real signal, more smoothing or other signal processing will be required.

Lynn
0 Kudos
Message 8 of 9
(2,993 Views)
Hi Radek,

You can always just use the Trigger and Gate Express VI to break apart your signal into period lengths, and then manually calculate each period by subtracting timestamps from the first element of the waveform and the last. Then, maintain a running index of where you left off, and just iteratively calculate periods and store in an array until you've done the whole signal. Now you have an array of periods to calculate the standard deviation. If the signal's not too clear, use a Filter Express VI to clean it up. Hope this helps!

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 9 of 9
(2,993 Views)