LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency detection

Attached vi generates three sine waves with 40 Hz, 120 Hz, and 190 Hz (randomly chosen). Later it is combining all these waves one after the other in a file. It is not summing them though! I am lloking for a way to do this in backwards. I mean I would like to be able to extract sine waves with different frequencies from a data set. For example for this data set I would like to see that data points from 1-100 is  40 Hz and so on. Someone told me STFT (short time fourier transform) would help but I could not make the example Vi's work like this. I have been trying several VIs and wrote many VIs but I was unsuccessful. Can someone please help me out with this?
 
Thank you very much.
 
ilter
0 Kudos
Message 1 of 5
(3,899 Views)
Here is the VI and the generated file.
 
Thank you.
Download All
0 Kudos
Message 2 of 5
(3,898 Views)

By converting the dynamic data to DBL arrays, you are removing all of the timing information. If you were to convert the dynamic data to a single wavevorm, you would see the dt. This is the inverse of the sample rate you select in the Simulate Signal properties. A delta time is required to reproduce a frequency. You have another problem with your code. By using the Insert into Array, all you have done is create a 2D array with all of the y information in a single column. How do you even know where one waveform sttops and another starts?

You can make if much simpler by using the Merge Signal function on the outputs of the Simulate Signals and wiring the result to a Write to Measurement File.

0 Kudos
Message 3 of 5
(3,889 Views)

Thank you for replying and sorry for the errors in my VI. (I am having problems with dynamic data type)

In my experiment I am monitoring vortex shedding frequency. I am recording 20 seconds of data. Since the frequency is changing at random times to random values I end up with a data set composed of different frequencies.

I was trying to simulate this using the previous Vi. I tried to work on the VI as you told but not sure if it is ok now. Attached text file has the y values of the three sine waves and the first column is the time information. (Data acquisition is at 1000 hz ).

Is it possible to find the time that frequency changes and the value of the frequency?

I will really appreciate if you can help me.

Thank you very much again...

 

Download All
0 Kudos
Message 4 of 5
(3,869 Views)

Howdy,

Denis made some good points above. To answere: “find the time that frequency changes and the value of the frequency?” This is going to be something you will have to code yourself (there is no perfect VI or example). But it won’t be too difficult. Having the Signal Processing VIs can help you a lot.

Basically, you will want to acquire your data with different frequencies at different ranges in the total domain. I attached a VI that will generate such a signal. Then you will need to break that data up into smaller chunks. Pass each chunk into a function that will return frequency information (maybe an FFT). Finally, make note of where that chunk is relative to the entire data set to know what time the frequency corresponds too. Easier said than done; right. Smiley Wink

Charlie M. CLD
0 Kudos
Message 5 of 5
(3,825 Views)