06-30-2016 03:46 AM
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!
06-30-2016 05:05 AM
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.
06-30-2016 11:02 AM
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.
07-03-2016 02:52 AM
Any ideas about this?
07-03-2016 06:25 AM
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).
07-03-2016 07:30 AM - edited 07-03-2016 07:31 AM
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
07-03-2016 08:55 AM
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
07-05-2016 09:09 AM
Could you please share your sample code?I really cannot figure it out by the functions.
07-05-2016 10:03 AM
@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.
07-05-2016 10:31 AM
Thanks for you attention.How to make the raw wave to a square wave?