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?

Please refer the attached labelled screenshot. In the screenshot i have three signals with three frequencies and three durations in a single plot. How can we get the unknown frequencies and unknown durations of the signals from a single plot?

0 Kudos
Message 1 of 21
(4,781 Views)

You don't say enough about the waveforms.  From your picture, it looks like the situation is you have periods of silence and periods where a single pure tone plays for some amount of time, I'm assuming some integer number of cycles, all at a fixed amplitude.

 

If this is the case, the following algorithm should work (here I'll assume the sinsuoid has amplitude 1, and is zero-mean):

  • Search the sampled signal for a sample > 0.1.
  • Work backward to find the point at which the signal began to deviate from 0.
  • Work forward to find the point at which the signal stops oscillating and returns to a constant 0 (it may simply be "look for two successive points within epsilon of 0").  Also keep track of how many peaks you find as you search for the end.
  • From the difference between start and end point, and the sampling rate, you have the duration of the burst.
  • From the number of peaks and the duration, you have the frequency.

Such code is not difficult to write in LabVIEW.  Give it a try, test it on some data such as you showed us, try to figure out by yourself how to do this, and come back if you get "stuck".

 

Bob Schor

0 Kudos
Message 2 of 21
(4,747 Views)

There are functions in the signal processing palette which can identify/return the amplitude / frequency / phase of signals in a waveform (e.g. Extract Tone / Extract Tones) - the only thing I'm not sure on is how it will behave if the signal is not continuous - you might need to find a way to split the waveform into its distinct parts and then use Extract Tone(s) on each part.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 21
(4,732 Views)

Hi,

Thanks!!!

Adding to Kongot Query, Actually we need to extract the audio signal information (frequency, Duration, Start time, End time) of all the signals present in the captured duration. These signals may occur in different instances or any combinations which is dynamic. Some expected combinations below.

Tone1-Freq-500Hz, Duration-50mS, Start time-5mS, End Time 55mS

Tone2-Freq-600Hz, Duration-80mS, Start time-1mS, End Time 81mS

Tone3-Freq-600Hz, Duration-60mS, Start time-4mS, End Time 64mS.

Scenario1-Tone1-Delay-Tone2-Delay-Tone2-Delay-Tone1-Delay-Tone3

Scenario2-Tone1-Delay-Tone1 -Tone2-Tone3-Delay-Tone3

Scenario3-Tone2-Tone3-Delay-Tone2-Tone3-Delay-Tone3.

Delay is Dynamic say 5ms, 40mS etc.

 

0 Kudos
Message 4 of 21
(4,672 Views)

It sounds like what you are looking for is called a "spectrogram". If you open LabVIEW and go to Examples>Toolkits and Modules>Time Frequency Analysis, you will see a variety of good examples. Basically, they give an intensity plot of frequency vs.time.

0 Kudos
Message 5 of 21
(4,660 Views)

Attached is a screenshot of what I mean by a spectrogram.

0 Kudos
Message 6 of 21
(4,655 Views)

find a software that transposes music to MIDI and analyse the midi stream ? 😄

 

Spectrogram is the first part:  with a simple level monitoring of the 2D array output of the spetrogram vi cut out the coarse tone parts and use tone detection to finalise the frequency.

Detecting the start and beginning is also possible the spectrogram, depending on the accuracy you want you need to play with the step and window size.

 

 

 

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 ǝɥʇ'


0 Kudos
Message 7 of 21
(4,608 Views)

A spectrogram is certainly a possibility, particularly if you have situations where the tones are (a) other than pure sinusoids and (b) can overlap.  However, your statement of the problem makes it seem as though both of these conditions are false -- your tones do seem to be pure sinusoids and (b) there appears to be "blank space" between them.

 

If my assertions above are true, the simple algorithm I described earlier is (a) fairly easy to implement, (b) requires little sophistication in Signal Theory (you don't need to understand FFTs, for example), and (c) doesn't require any specialized LabVIEW functions or toolkits.

 

Bob Schor

0 Kudos
Message 8 of 21
(4,589 Views)

Hi,

How to measure the frequency and duration of each frequency captured using analog channel of NI DAQcard. Signal is an audio signal captured at 22050 samples per second. There will be sinewaves of different frequencies in the captured data. I need to find all frequncies present in the data and duration of each frequency.There will small gap between each frequency.  Attached two different signal captued and expected frequency and duration of frequency is mentioned.

 

Thanks in Advance!!!

 

0 Kudos
Message 9 of 21
(4,470 Views)

You forgot to store the data in the controls.  You need to do:  Edit > Make Current Values Default, and then save the VI.

 

Since this smells like schoolwork our next question will likely be:  What have you tried?  Have you managed to separate the signal sections from the silent sections?  There is a Get Waveform Subset VI that will help once you find valid signal thresholds...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 10 of 21
(4,457 Views)