LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure frequencies of a interval sine wave.

The attached is a waveform from a interval buzzer,it is a DC buzzer, you know,with DC applied,it will sound like bee..bee..bee..bee..

There are 2 frequencies need to be measured: the Bee frequency and the interval frequency.

How to measure them of this waveform?

I tried to use Extract Multiple Tone Information 1 Chan.vi,but failed.

Any ideas,thanks!

111.png

0 Kudos
Message 1 of 13
(4,084 Views)

What I have done for something similar is use the RMS PtByPt VI to perform a moving RMS calculation on the waveform.  The result will be a square wave.  From there, you can just find the frequency of the square wave (use the time between rising edges) to get your f2.  For f1, you just take the samples between a rising edge and the corresponding rising edge and use the Extract Single Tone Information.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 13
(4,069 Views)

It is going to be a square wave,but how to get there finally.And also how to define the rising edge in a simple and reliable way?You know actually the waveform is not a ideal one,there may be some noise in it.

201.png

0 Kudos
Message 3 of 13
(4,049 Views)

Any ideas about this?

0 Kudos
Message 4 of 13
(4,013 Views)

You should not have the Initialize input wire up.  You are essentially doing nothing to the data right now.  When you do the moving RMS properly, it will be an obvious square wave (not filled in with you sinusoid).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 13
(4,006 Views)

 

or try  the hilbert function

 

 

I would guess that with 15 beeps and a coarse guess of the frequencies feeded into the tone detection.vi all should be fine 🙂 

 

or use threshold / edge detection and detect the fist edge after a longer time...  or or

 

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 ǝɥʇ'


0 Kudos
Message 6 of 13
(4,001 Views)

You've had a number of good suggestions for the "frequency" of the square wave, or, more to the point, the period of the beep cycle (which you can get just by looking at the plot -- the time to the onset of the fifth "beep" is 1.2 seconds, so the period is 1.2/4 = 0.3 sec, making the frequency 3.3Hz).  Of course, you want to compute this, so doing a "moving RMS" should do the trick.

 

For this dataset, the above method actually works better for finding the beep frequency (e.g. the one near 3 Hz) than a "spectral analysis".  I tried the following -- rectify the signal, low pass filter it (I used 20 Hz), then take the Power Spectrum.  Note that because of the high sampling interval, the spectrum is much "wider" than the area of interest, namely frequencies below 10 Hz, which are not very well resolved.  There is a "bump" at 3 Hz though ...

 

Incidentally, I get the frequency of the tone as 2.87 KHz.

 

Bob Schor

0 Kudos
Message 7 of 13
(3,993 Views)

Could you please share your sample code?I really cannot figure it out by the functions.

0 Kudos
Message 8 of 13
(3,955 Views)

@avater wrote:

Could you please share your sample code?I really cannot figure it out by the functions.


Then show us what you have done so far and tell us what you do not understand/where you are stuck.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 13
(3,946 Views)

Thanks for you attention.How to make the raw wave to a square wave?eew.png

0 Kudos
Message 10 of 13
(3,940 Views)