LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single tone extraction and Multi tone extraction

Hello, 

I have a big problem with single tone extraction and how i can use the multitone extraction.

i have attached the front and block panel of my model in order to help you more.

I have built the theory of my experiment on labview with which i have a cavity length of my sensor 75um which creates a sinusoidal signal. this signal i do resampling and interpolation on it and then i apply the single tone extraction to get the attributes. then i build a sinusoidal and i coplot the two signals.

My problem is that when i introduce a second cavity, signal with similar length, the multitone extraction gives me back two different frequencies , which if i use them to create two signlas they are way different from my initial ones. 

In brief, i create a signal with two cavbities 75um and 80 um, i apply the single tone and i get two frequencies which when i turn them to cavity length i have 70um and 0.5um respectively.

how can i make the multitone extraction detect frequencies which are very close to each other?

Thanks a lot in advance

 

Kind Regards

Dimitris

Download All
0 Kudos
Message 1 of 8
(4,135 Views)

Dmitri,

 

     Since this is your first Post on the Forum, you probably have not participated enough to know that posting pictures of code is not helpful, but posting the actual code (by attaching the VI, itself), is extremely helpful.

 

     I'll wait to look at your VI (rather than frustrate myself looking at static pictures ...).

 

Bob Schor

0 Kudos
Message 2 of 8
(4,110 Views)

Hi Bob, 

sorry for the snapshots i attached. I send my model's VI, even though it is kind of messy the issue i have is about the single tone and multitone extraction i used.

Thank you a lot in advance for your help

Kind Regards

Dimitrios

 

P.S. i attached the subVI for cavity length. 

with these subVIs the model should run properly

0 Kudos
Message 3 of 8
(4,083 Views)

Dimitrios,

 

Ugh! It is condsidered good practice to keep the block diagram to a size which will fit on one screen. Yours is 5-6 screens wide. This makes it very difficult to see what is going on.

 

Other comments:

- Avoid the use of sequence structures. They are almost never needed in LabVIEW.

- Avoid the use of local variables. They require extra copies of the data, can lead to race conditions, are slower than wires, and make it difficult to tell where data is used or originates. Use wires.

- You have a mixture of Extended Precision, Double Precision, and Integer data types. The mathematics is all done in Double precision in your code so why not just use that data type. [Note: At first I thought this might have been part of the problem with your code due to round off, but I think I found something else.] 

- Duplication of code: When code occurs more than once It should usually be converted to a subVI. Also, duplicating constants (like the 16000 wired to for loop N terminals) can become a problem if you ever need to change the value: Did you find and change all of them?

- Rube Goldberg code: The for loop with the unitialized shift register (probably should be initialized) and the divide afterwards can be replaced by Array Subset and Mean.vi. This much more clearly indicates what to code does and takes up much less block diagram space.

 

Remove mean.png

 

Now, on to the problem with the cavity. The Extract Tone Information VIs use the FFT internally. They process the spectral peaks to find the tones. Read the Detailed Help for more information. When a signal processing VI does not produce the results I expect, one of the first things I do is to look at the input data on a graph. The spectrum of the signal you are feeding to Extract Tones is shown below.  Both graphs have the same data. The left graph has an expanded X-axis near zero.

 

Spectrum.png

 

Note that there is only one true peak, at about 7E-13. The high point at zero may represent a low-frequency peak or the residual DC component after removing the mean. if it does represent two components they are mixed together in a way the cannot be separated with the data you have. The zero point is about 27 dB below the true peak.  That may be near or below the default threshold for tone detection.  The fact that it returns two "peaks" indicates that it found something.

 

I suspect that the problem is in the data you are generating.  I did not try to figure out what you are doing there. 

 

One othe comment: It might be better to normalize the data in some way so that you are not repeatedly multiplying and dividing by 1E14 sized values. Do all the calculations with values within a few orders of magnitude and then scale the result for display at the end. Using really large and really small numbers in the same calculation can cause subtle problems - subtle in the sense that they are not the obvious cause but often not subtle in the magnitude of the errors.

 

Lynn

0 Kudos
Message 4 of 8
(4,062 Views)

Here I posted a NI presentation that explains more on the tone detection vi

 

as johnsold wrote: to seperate two sine frequencies quite close together the FFT bins must be small enougth.. so a longer sample time is needed -> smaller bins

for a single tone about 10 to 15 periodes are fine, to seperate two sines I would assume at least one (??)  or 10 periodes of the beat frequency...

 

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 5 of 8
(4,050 Views)

Henrik,

 

Interesting comment! 

 

I cannot recall ever thinking about the resolving power of the these VIs. It might be a useful study to investigate the capability to detect tones close in frequency. 

 

Lynn

0 Kudos
Message 6 of 8
(4,035 Views)

Thanks you very much for your comments and help.

I really appreciate it.

I will try all your suggestions tomorrow morning and i will let you know about my results, achievements or more questions i might have.

Regards

Dimitrios

0 Kudos
Message 7 of 8
(4,032 Views)

Hello, 

thank you a lot for your replies. I didn't find a solution of extracting two frequencies close to each other, even though i followed your instructions step by step. Also i cleaned up my model as you suggested.

The problem is that i need more data points at my input signal, which i cannot as the interoggation system i use gives me 16000 data points. Or i can increase the interpolated data points in my model, which i cannot either, as my computer runs out of memory.

Anyhow, thanks a lot for your help.

I will post again, in case i have any other problem.

Dimitris

0 Kudos
Message 8 of 8
(3,936 Views)