RF Measurement Devices

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency measurement question

hi,
 
i'm trying to get a graph/table of the frequency of a signal as it varies with time using LabVIEW 8.2. the frequency of the signal i'm analyzing is constantly changing, so i would like to, ideally, find the frequency of each pulse so that i would be able to graph that frequency as a function of time. the signal is generated by a fiber optic system which is hooked up to a standard NI DAQ card.
 
right now i'm trying to use the Spectral Measurement VI wired to a graph, however it doesn't seem to be producing the desired results.
 
thanks
0 Kudos
Message 1 of 10
(10,658 Views)
Hi emhart01,

Let's start by making sure that you're using the correct DAQmx task for this application.  You should be Acquiring >> Counter Input >> Frequency >> Continuously.  The Spectral Measurements VI computes frequency with the FFT.  The FFT of a digital signal would contain harmonics irrelevant to the measurement of interest.  If the pulse has a time-varying period, the Spectral Measurement VI would probably output data meaningless to you.  Let's make sure that DAQmx is doing the bulk of the work for us, then we'll work on displaying the data.



Message Edited by Pie56694 on 07-02-2008 05:38 PM
0 Kudos
Message 2 of 10
(10,632 Views)

Hi Steve,

I have a fiber optic system producing an ANALOG pulse train that is sent to a NI PCI- 6034E DAQ card. The frequency of the pulse train is constantly changing-- in fact the only portion of the signal I am concerned with is the portion during which the frequency is changing. Previously I was selecting voltage as the measurement task then selecting the specific input that the fiber optic is connected to. When I select "counter input" I am no longer able to select that input, and when I test the frequency task, no data is returned. Do you know if my DAQ card supports the counter input:frequency task? and if it does, is that the correct measurement task to use for the application described?

With voltage as the measurement I'm trying to take the voltage signal and use the pulse measurements vi or the tone measurements express vi to output either the period or frequency of each pulse in the signal to produce an "instantaneous frequency" vs. time graph. FFT doesn't seem to be the best option as it gives a frequency amplitude vs. frequency graph instead of a graph in the time domain.

Thanks,

Ben Oswald

 



Message Edited by emhart01 on 07-03-2008 08:14 AM
0 Kudos
Message 3 of 10
(10,625 Views)
Hi Ben,

The PCI-6034E has two 24-bit counters that support a frequency or period measurement (see page 8).  As you have noticed, the physical connection to the DAQ is different for an analog measurement than it is for a frequency measurement.  NI-DAQmx Help >> NI-DAQmx Device Considerations >> Counters >> Counter Signal Connections >> AO Series, E Series, and S Series shows the connections for counter tasks.  You will notice that frequency measurements made with one counter connect to PFI9, while frequency measurements made with two counters connect to PFI8.  You can also see this in the task configuration screen in Measurement and Automation Explorer.



If you are trying to "output either the period or frequency of each pulse in the signal" then you would like to use a frequency task.  A good example is NI-DAQmx: Continuously Measure Counter Frequency (Buffered Large Range).  If the transducer at the end of the fiber optic cable does not conform to the 5V TTL standard, you can build a comparator circuit to coerse it.  I suggest you take a look at Analog Sampling Basics.  It may help you understand why you don't what to use FFTs with digital signals.  I hope this helps.



Message Edited by Pie56694 on 07-07-2008 03:28 PM
0 Kudos
Message 4 of 10
(10,568 Views)
Steve,
 
Maybe I'm missing something here but I've tried, as far as I can tell, the only two methods of creating a frequency task: using a DAQmx assistant and selecting counter input -> frequency AND using the same method in the example you provided in which I manually create separate DAQmx VIs for channel creation, timing, etc. In both methods, I tried both counter 1 and counter 0 and in both cases the frequency values were grayed out when I tested the channel and the program timed out when I tried to run it. Additionally, I kept getting an error stating that the period of the signal was longer than the measurement period.
 
Perhaps this is a hardware problem and the DAQ card is not wired properly for a counter input and frequency measurements? I checked the device manager and there were no drivers that I could reinstall for the DAQ card.
 
I have been able to measure the frequency by analyzing the voltage output from the fiber optic system, however it is relatively low definition and any attempt to increase the definition (increase rate, decrease buffer) results in a buffer overflow error.
 
Thanks,
 
Ben
0 Kudos
Message 5 of 10
(10,558 Views)
Hi Ben,

Can you get a capture of the analog data from the fiber and display it on a graph?  If you can do this, please annotate the graph to show the start and end of the "pulse".  Attach this picture to the thread and I'll try to figure out where we're disconnected.  Thanks for your patience.
0 Kudos
Message 6 of 10
(10,533 Views)

Hi Steve,

I appreciated your continued support. Attached are two pictures of the graph generated by the fiber optic in software that's normally used to analyze the system I'm working with. An identical graph shows up in LabVIEW when I set up a voltage task. The 'general' view is a view of the whole signal and the 'pulses' view is zoomed in to show three of the pulses I'm refering to. The start and ending points of the first pulse occur at the vertical red lines.

Just to clarify, does the Counter I/O -> Frequency task work with non-digital signals? I ask because on the side of the window in which you create the task it gives information on finding the "digital frequency". Also, it would seem that the Analog I/O -> Frequency would be the ideal task for my application, however it doesn't seem as though it is supported by my card as when I go to set it up, "no device is found".

Thanks,

Ben

Download All
Message 7 of 10
(10,525 Views)
Hi Ben,

Ah, I get it now, thank you for the pictures.

"Just to clarify, does the Counter I/O -> Frequency task work with non-digital signals?"  No, the input to a counter task must conform to the 5V TTL logic standard.  Here is a document that talks about how to use non-TTL signals with counter tasks.  Since you are interested in the length of time between two adjacent peaks or troughs, it would be nice to use a digital frequency task, but this analog signal needs a lot of help before you can use it as a TTL counter input.

"Also, it would seem that the Analog I/O -> Frequency would be the ideal task for my application, however it doesn't seem as though it is supported by my card..." You are correct, you cannot directly take an analog frequency measurement with your hardware.  Different hardware is required.

What's coming to mind is a direct measurement between two adjacent peaks and troughs.  LabVIEW ships with some very nice examples for this type of measurement.  From LabVIEW's Help Menu >> Find Examples... >> Analyzing and Processing Signals >> Time Domain Analysis >> Peak Detection and Display.  Please note that some of the VIs required by this example are not included in the LabVIEW Base Package.  Below is a screen shot of the front panel.  Computing the frequency of each pulse is then a matter of calculating the time between two adjacent peak or trough values.  I hope this gives you some ideas.




Message Edited by Pie56694 on 07-09-2008 11:34 AM

Message Edited by Pie56694 on 07-09-2008 11:35 AM
0 Kudos
Message 8 of 10
(10,504 Views)
Hi Steve,
 
 
Since obtaining new hardware and/or converting the signal to TTL are out of the question, it would seem that I have two viable options: use the method you described above OR use the tone measurements vi on the voltage signal as described here. I would like to have the system gathering frequency data continuously... the voltage method can do that easily, the problem I'm having with it now is that it is relatively low definition. My question is can LabVIEW, using the peak detection vi, take the array(?) that contains the valley locations and find the difference between two adjacent values (the period) and produce a time domain graph without slowing the program down too far (or causing the buffer to overwrite itself)?
 
Basically the fiber optic is watching a rotation station in a bottle inspection machine, and is picking up a pulse off each bottle that spins through the station. The frequency of that pulse is proportional to the angular velocity: the data I need to gather. I'd like to have a graph of the angular velocity (the frequency modified by a constant) versus time for each bottle.
 
Ideally, I would like LabVIEW to take a waveform chart of frequency versus time, that is being updated continuously, and divide it up on regular intervals and then save each to a file. My question is how much of that can LabVIEW do? I.e. can I only save a table of data? or can I save the waveform in graphical form? if so can I divide it up into separate graphs?
 
Sorry for the loaded questions/deviation from the original issue. Thanks for all the suggestions and info on analog signal analysis Smiley Happy.
 
 
-Ben
0 Kudos
Message 9 of 10
(10,494 Views)
Hi Ben,

"My question is can LabVIEW, using the peak detection vi, take the array(?) that contains the valley locations and find the difference between two adjacent values (the period) and produce a time domain graph without slowing the program down too far (or causing the buffer to overwrite itself)?"  This depends on how much data must be processed.

The Peak Detector VI takes a 1D array.  A Waveform data cluster also contains a 1D array that works well with the Peak Detector VI.  Be careful when computing the actual period of the pulse, though.  Waveform data is based on a start instant (t0) and a change in time (dt).  However,
since the peak detection algorithm uses a quadratic fit to find the peaks, it actually interpolates between the data points. Therefore, the indexes are not integers. In other words, the peaks found are not necessarily actual points in the waveform data but may be at fractions of an index and at amplitudes not found in the input array.  To view the locations in terms of time, use the following equation:

Time Locations [i] = t0 + dt * Locations[i]

This information is found in the LabVIEW detailed help for the Peak Detector VI.  Once you have the time locations, the period of the pulse is the difference between two adjacent time locations.

"...how much of that can LabVIEW do? I.e. can I only save a table of data? or can I save the waveform in graphical form?
"  This is more a question of "how much do you want to program?"  Support for logging waveform data to text and binary files is native to LabVIEW.  This data is then easily read from the file and plotted in a waveform indicator.  Other file logging functionality is built into the Report Generation Toolkit.  You can also run VBA macros from LabVIEW to build Excel charts, or call into the Excel COM library to automate to your heart's content.
0 Kudos
Message 10 of 10
(10,446 Views)