LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to monitor a Sine wave for noise

I posted a similar quesiton in the DASYLab forums, because DASYLab has a module that supposedly does this, but I haven't been able to get it to work.

Here's the deal:

I'm going to be monitoring a high frequency AC voltage (3V rms, 5.2khz).  I need to be able to acquire data if there is any noise in the signal, or if the signal changes from its original amplitude or frequency.  The DASYLab module (called "Check Reference Signal") allows you to record a reference signal, and then ouput a value (in my case a TTL "high") if the signal deviates from the reference by more than a specific value or percentage.  This is what I need to do, but there doesn't seem to be a way for me to synchronize the input stream with the reference signal.

Enter Labview.  I know that we can do the same thing using Labview, but my head is swimming with how to go about implementing it.  How can I set up a loop to monitor the data input and trigger if there is any deviation from the desired signal?

Thanks for any help you might be able to offer.
0 Kudos
Message 1 of 12
(5,412 Views)
Under LabVIEW 8.x Signal Processing VI's there is a waveform "Tone" measurement that gives you frequency and amplitude of your time based signal.

What kind of noise are you looking for? Periodic random noise, white noise, phase noise? I'm not an RF expert but I believe the different types of noise signals demand a different measurement technique.
0 Kudos
Message 2 of 12
(5,394 Views)
I've tried the "tone" express VI, as well as the basic one.  I don't seem to be getting any output though.

I'm looking for periodic random noise.  The initial plan was to record a segment of the signal and, once its verified that no noise exists on it, use it as a reference signal to compare to.  This, to me, means two possibilities:  1. synchronize the signals and compare the actual values, or 2. compare the frequency and amplitude for a specified slice of the signal.

To do the first, I acquired 1000 data points using the "write waveform to file" VI.  Then, in a separate VI, I called up the file using the "read waveform from file" VI and ran the output through the "Align Waveforms" VI (tried both the single shot and continuous versions of this VI) along with 1000 data points acquired from the DAQ system.  Then I tried to display the output in a waveform plot, just to see if it worked.  I got nothing at all in the waveform plot.

For the second, I started the same way (reading file of 1000 data points and acquiring 1000 data points) and ran the two signals through the "tone" VI (both the express VI and the standard one), and then compared the frequency outputs from the VIs.  The outputs wouldn't display on a Waveform chart or graph, and the comparison boolean stated that the values were not the same.

Am I missing something in here?  I'm running these on Labview 8.0.  I'll try to attach the VIs that I'm referring to. 

The other issue is that I have it all set up to repeat until there is something detected, and then write the data to a file.  I'm currently using the "write to measurement file" Express VI, and it seems to take forever for this VI to work.  (Its not the computer...)

Thanks for any help!
0 Kudos
Message 3 of 12
(5,367 Views)
Your attachment did not get attached. The usual culprit: Previewing Post after attaching disconnects the attachment. Attach last.

What is "periodic random noise?"

From your description I suspect that you have some fundamental, but probably easily fixed problem with your code. We can probably help once we see the code.

Lynn
0 Kudos
Message 4 of 12
(5,361 Views)
The attachment didn't get attached.  I'm trying to recreate what I had, and found a possible culprit.  My "waveform" that I was running into the align VI had no time reference...  I'll try to attach it shortly.
0 Kudos
Message 5 of 12
(5,359 Views)
Ok, here's the VI that I am talking about.  This doesn't have the triggering stuff in it, as I just want to see that the two waveforms are actually being aligned at this point.
0 Kudos
Message 6 of 12
(5,355 Views)
Without the subVIs it is difficult to tell where the problem may be.

These are some things I noticed:

1. Your signal is at 5.2 kHz but your scan rate is set to 1000 samples/second. Mr. Nyquist will not be happy! You need to sample at 10.4 kS/z or higher. Since you want to monitor noise on the signal, you should probably sample somewhat faster, perhaps 20 or 25 kS/s.

2. You do not need the sequence structure inside the loop. Dataflow takes care of that.

3. Read the reference signal from the file outside the loop. If you are using the same reference signal for all comparisons,there is no need to read the same data repeatedly.

4. The specified dt (2E-6) when you build a waveform does not match your scan rate (1000 S/s). This will cause errors in your analysis.

Lynn
0 Kudos
Message 7 of 12
(5,344 Views)
Not sure why the sample rate changed.  I have it set to 500khz (dt of 2E-6) on my machine here.  All of the DAQ IO subVI's are from IOTech, for handling the Wavebook (DAQ hardware).  I have it set to acquire 1000 samples for each iteration of the loop.

I was wondering about the sequence structure.  It does seem kind of redundant.

I put the "read ref signal" in the loop because I figured it would need to re-align the signal each iteration.  I guess I could still do that, using the same ref signal if it was read before the loop.

Is it possible that the reference signal file isn't being read correctly?  Labview doesn't specify a file type for the file anywhere, so I just called it a .txt file. 

I guess I'll change things a little and try again.
0 Kudos
Message 8 of 12
(5,339 Views)
I would suggest measuring frequency and amplitude in the time domain and noise in the frequency domain, e.g., using an SNR measurement and comparing it against some spec. This would make comparing the samples from two signals a lot easier than trying to align the two waveforms.
0 Kudos
Message 9 of 12
(5,318 Views)
Bill,
That was one of the things I tried, using the "tone" VIs.  I'm still trying things, and will probably go back and go through it all again.

Here are my thoughts:  Any random noise will make change the frequency of the signal, at least for a short period.  Therefore, if I analyze the signal in small chunks (100-1000 samples) I should be able to pick up any noise by looking at the frequency of the signal.  However, using an FFT will give me more than just the main frequency.  I thought that the "tone" vi would be the way to go, by allowing me to pick out the main frequency of the signal.  I guess I need to quantify the test signal to find that main frequency (which is supposedly 5.2khz) and then set up a window of acceptable shift.

What's the best way to set up a window like that?  Should I just use the greater than/less than comparators and set the values at my main frequency +- a set value?  I suppose that's probably the simplest way.

The other issue that seems to be making things difficult is that the ouput from the "data read" subVI is an array, with the number of dimensions based on the number of channels acquired from the DAQ.  If I just index the array to pick the channel I want, everything should be fine, right?

I'm pretty rusty when it comes to Labview, and I'm not much of a programmer (my brain doesn't seem to think the right way), so this is an interesting exercise for me.  
0 Kudos
Message 10 of 12
(5,304 Views)