LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify unknown frequencies and durations dynamically through LabVIEW from a signal which has many frequencies?

Hi,

Yes tried taking subset of waveform. like 50 array elements at a time and calculate the frequency of that 50 elements. I was able to get fequency but not acurate say +/-50Hz deviation. Tried calculating duration by recording start time of each block of data for frequency detected and difference between first block and last block start time of same frequency detected.

I have saved the waveform data in constants inside block diagram.

 

Thanks

Download All
0 Kudos
Message 11 of 21
(1,901 Views)

Your deviation might be caused by the high frequency anomaly you get when you don't slice your waveform right at a zero-crossing.  Those point on the end may appear like a very high frequency component and throw off the calculations.  Another technique to minimize this effect is called apodization (or windowing).  There are several window function VIs in Signal Processing > Windows.  Try the Hann window.  It will take in a waveform datatype or an array of floats.

 

https://en.wikipedia.org/wiki/Window_function

 

Caveat:  I only have basic knowledge on this subject so take it with a grain of salt but I know there are some experts around here who will probably chime in... Smiley Happy 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 12 of 21
(1,893 Views)

Kakkarak,

 

     I understand that you have several seconds of data sampled at 22050 Hz.  I presume you are saving it in an array (I16? I32? Dbl?) and may even have written it to a file.

 

     Can you attach a sample Data File?  You may want to compress it into a Zip file.  If you can send such a file, please indicate (a) the sampling frequency, (b) the data type, and (c) how many data points are present.

 

     I'm convinced that my simple-minded algorithm will work, but don't have any data to try out -- you have data and no (working) code, I have an Idea and no data.

 

Bob Schor

0 Kudos
Message 13 of 21
(1,880 Views)

Hi,

I am displaying the capturing waveform continuously on a graph indicator and after acquisition is over I will change the graph indicator to constant from block diagram, repeat the same for all signals captured. Attaching the signals captured vi, please see the block diagram of  the attachment. Mentioned the expected frequencies and duration near to all waveform constants. Done acquisition at a sampling frequency of 22050Hz. Data type is DBL number of data points present is calculated by array size for each signal.

 

Thanks in Advance!!!

0 Kudos
Message 14 of 21
(1,854 Views)

Maybe I wasn't clear --

 

"Can you attach a sample Data File?  You may want to compress it into a Zip file.  If you can send such a file, please indicate (a) the sampling frequency, (b) the data type, and (c) how many data points are present."

 

As I understood your problem, you have data representing non-overlapping tone bursts, and want an algorithm to tell you (a) when a burst starts, (b) when a burst ends, and (c) the (constant) frequency of the burst.  I think I can do that, so I'm asking you for a single file that contains bursts, sampled at 22050 Hz, of the types of signals you want to analyze.  Once I have the data, I can try to implement my (simple) algorithm and can tell you whether or not it works.  But it makes no sense to develop an algorithm if I don't correctly understand the data format, hence my original (and here, repeated) request.

 

Bob Schor

 

P.S. -- do not send a VI -- send a binary data file, see above.

0 Kudos
Message 15 of 21
(1,834 Views)

Hi Bob,

Sorry, I was bit confused on data file format. I have written the waveform to binary TDMS file, compressed and attached.  Please check this file format is fine.

Sampling frequency- 22050

Data type-DBL

Data points- 506000

Expected frequency:- 1500Hz for50mS

Thanks in Advance!!!

0 Kudos
Message 16 of 21
(1,805 Views)

Saved the same waveform to excel and attached.

Sampling frequency- 22050

Data type-DBL

Data points- 506000

Expected frequency:- 1500Hz for50mS

Thanks in Advance!!!

0 Kudos
Message 17 of 21
(1,803 Views)

Thanks for the data.  I started by writing a little LabVIEW code to read the second Excel column (minus the row header).  When I plot the data, I see mostly silence (values near 0) except for 4 periods that appear to contain 8 tone bursts of near-sinusoids having an amplitude of about 0.75.  It looks to me like the signals always start going positive and end going negative, which suggests a simple "walking algorithm" would easily be able to tell when the signals start and stop, and would similarly easily be able to estimate the frequency (assuming that it was supposed to be a pure tone of constant frequency).

 

This approach might not be efficient or "elegant", but I'd guess it would give me the answers in less time than it took to read the data in from Excel (about 3 seconds).  Of course, it will take me more time than that to write it, but I'll give it a whirl ...

 

Bob Schor

Message 18 of 21
(1,777 Views)

Her is a after lunch break quick and dirty try   (ALBQAD)

signal Q&D 2.png

 

I used a hilbert transform to get the envelope and searched that for thresholds .... cut out the tone and used tone detection ...

still some homework to do 😉  ...   but not for me 😄

 

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 19 of 21
(1,750 Views)

Here is my version, which I developed without looking at the one Henrik posted. You will note that he and I think alike on many things.

 

I used the data posted as constants in the Signals Captured_22050.vi rather than reading from the file. It appears that the notes about frequencies in those constants may not be accurate.

 

This VI "finds" extra segments due to transients or other effects in the data. Those can usually be identified by relatively low amplitudes. Whether that is valid for all your data is something we cannot answer.

 

Lynn

Message 20 of 21
(1,719 Views)