02-17-2016 10:34 AM
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
02-17-2016 10:50 AM
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...
02-17-2016 12:19 PM
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
02-18-2016 04:10 AM
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!!!
02-18-2016 01:37 PM
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.
02-21-2016 05:15 AM
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!!!
02-21-2016 05:16 AM
Saved the same waveform to excel and attached.
Sampling frequency- 22050
Data type-DBL
Data points- 506000
Expected frequency:- 1500Hz for50mS
Thanks in Advance!!!
02-21-2016 12:27 PM
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
02-22-2016 06:29 AM - edited 02-22-2016 06:30 AM
Her is a after lunch break quick and dirty try (ALBQAD)
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 😄
02-23-2016 03:40 PM
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