LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does LabView Tone measurements express vi measure frequency?

Solved!
Go to solution

Hello dear LabView community.

 

I am using Omega FPR303/315 turbine type flow meter to measure volumetric flow rate of a water flow. The flow meter is connected to the NI USB-6009 DAQ board. The DAQ board is connected to the computer. I have LabView 2017 installed on the computer. My .vi is attached.

 

The idea behind turbine type flow meters is that each time the turbine's blade with a magnet embedded in it passes by the sensor, the sensor sends an impulse to the DAQ board. The DAQ board sends the "impulsed" voltage signal to the computer. Therefore, the tusk of my .vi is to read the "impulsed" voltage signal, calculate the frequency of the impulses, convert the frequency to flow rate using the conversion factor supplied with the flow meter.

 

The main problem I experienced while writing my .vi was with frequency measurements. I didn't know how to do that.

 

I found this tutorial where it was advised to use Tone measurements express vi LabView block to measure frequency.

 

So, I used that block. It did the job. But now I need to understand how it calculates frequency. I found its specs here. But I can't understand from the specs how frequency measurements are done.

 

I understand that LabView is proprietary software and I'm not asking for the code. I'm asking to explain the theory behind the code which is a reasonable request I suppose.

 

So, I'm wondering what, theoretically, does the Tone measurements express vi do behind the scenes to measure frequency.

 

Thank you in advance.

 

Ivan

 

0 Kudos
Message 1 of 9
(573 Views)

I found this tutorial where it was advised to use Tone measurements express vi LabView block to measure frequency.

 

So, I used that block. It did the job. But now I need to understand how it calculates frequency. I found its specs here. But I can't understand from the specs how frequency measurements are done.

 

I understand that LabView is proprietary software and I'm not asking for the code. I'm asking to explain the theory behind the code which is a reasonable request I suppose.


Hello, Ivan.

     You want to know what algorithm NI used to create their estimation of the Tone Frequency used by the Tone Measurement Express VI.  The Short Answer is "I don't know -- the details aren't available to us", but the longer answer is "I know enough about signals and time-and-frequency analysis that I could write such a routine for myself" (and might well do it, too, as I dislike most Express VIs, many of which "oversimplify the problem").

 

     So have you had a course on Signal Theory?  [If you are an undergraduate Engineering Major, you should eventually encounter such a course].  Here's a question for you to "think about" -- suppose I get an oscillator and connect it to a loud speaker and get it to play a "pure tone" at some frequency between 200 Hz and 800 Hz.  I give you your own oscillator (and speaker) and say "Use your oscillator and tell me what frequency I'm playing on my oscillator."  What would you do?

 

     [As it happens, the method you should be able to figure out works, but probably is not the method that the Express VI is using.  Turns out there was a French mathematician, Joseph Fourier, who showed that any signal can be expressed as a sum of pure sinusoids, a process now called "Fourier Analysis".  Turns out the method of comparing single sinusoids with the unknown signal and finding the "best fit" of the known "test" sinusoid with the unknown signal takes a while, and there is a much faster method of performing Fourier Analysis.  When you take Signal Theory, remember Fourier's name, and you'll have an "Aha!" moment.]

 

Bob Schor

0 Kudos
Message 2 of 9
(532 Views)

I don't know how NI does it but...

 

One way to determine frequency is to count how many times the signal crosses zero during a set time period and do some math.

========================
=== Engineer Ambiguously ===
========================
Message 3 of 9
(516 Views)

@RTSLVU wrote:

I don't know how NI does it but...

 

One way to determine frequency is to count how many times the signal crosses zero during a set time period and do some math.


Ahhh, that's too easy ...  [Hmm, maybe it's not -- makes you think "what do you mean by "the signal", how is it represented in LabVIEW, how does LabVIEW deal with variables (let's call them "signals") that vary with time, how does LabVIEW even represent something like a signal ...].

 

Food for thought.

 

Bob Schor

 

 

Message 4 of 9
(513 Views)

Thank you @Bob_Schor and @RTSLVU for your responses, but none of them has been helpful so far.

 

Before I go ahead and mark Bob's answer as the solution (i.e. admitting that there is no way we can find out how the vi works), I have one more question.

 

Bob, you seem to be knowledgeable about signal processing. The specs for the vi state that it "Calculates the frequency of the detected single tone in Hertz".

I'm wondering if you can suggest a very tentative general formula for frequency calculation based on this description.

 

Thank you.

 

Ivan

 

P.S. For completeness, I called NI asking for the formula they use to calculate frequency. I was told they wouldn't help me because I have basic support plan and the community forum is the only source of help.

0 Kudos
Message 5 of 9
(450 Views)

Hi Ivan,

 


@nepomnyi wrote:

So, I'm wondering what, theoretically, does the Tone measurements express vi do behind the scenes to measure frequency.


The only nice things about ExpressVIs is: you can look "behind the scenes" to see what they are doing!

 

So the answer to your question is quite simple: open the frontpanel of that ExpressVI (instance) and see for yourself how it determines frequency from your signal!

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 6 of 9
(425 Views)
Solution
Accepted by topic author nepomnyi

Some years ago there was a NI presentation on how it works

resposted  here and

here

 

If it comes to uncertainties of the detected frequency and amplitude , some results for tone detection are in the presentation, however it has been noted, that the code was changed (improved) since then.

Some papers on sine fitting  have been published, rule of thumb: more points, and better SNR helps

So validation with MonteCarlo and your setup is the way i would go.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 7 of 9
(392 Views)

However, .. what do want to measure:

Flow rate or volume ?

A turbine meter is an integral method, so I would not use frequency detection. instead I would use a counting method.

tone detection vi asume a constant frequency and amplitude, both not valid here

Totalizing the pulses   better volume measurement

reciproce frequency measurement ( n pulses / time between them)  better flow rate

 

maybe not valid:

If the flow rate measurement is done rigth, the integral of it should result in total volume 😉  (asuming you want to log  'equal' time stamped)

 

EDIt: My fault: turbine output isn't a strickt linear flow rate depended on some meters I had in thae past..

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 8 of 9
(390 Views)

Big thank you to @Henrik Volkers for the brief and straight to the point response!

 

I did mark his answer as the solution, however there are still several things to clarify here.

 

The first one is to find those papers on uncertainty calculations.

 

The second one is to actually write down the formula for frequency calculation. That formula isn't written explicitly in the presentation that Henrik cited. I need to go through the presentation more thoroughly and infer the formula.

 

Once I find the papers and infer the formula, I'll post them here. That will complete Henrik's answer to my question.

 

Ivan

 

0 Kudos
Message 9 of 9
(346 Views)