# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## FFT peak Analysis

Hello everyone,

In my application, I am trying to analyze a sound signal.

I have used spectral measurements vi for get FFT peaks.

Now I want to know the number of instances at which amplitues goes beyond a certain limit, say 0.01.

Since I am not an expert, I could really use some help.

I am attaching my vi along with an example sound file.

Thanks

Message 1 of 9
(2,155 Views)
Solution
Accepted by topic author rk_t

## Re: FFT peak Analysis

The result of the power spectrum is an array of clusters. Each cluster has three elements: f0, df and an array of magnitudes. Unbundle all elements, use the array with a peak detector function. Multiply the "Locations" with df and then add f0. The resulting array contains all peaks with the configured threshold already scaled to the currect frequencies.

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 9
(2,151 Views)

## Re: FFT peak Analysis

Norbert, Thank you very much for your reply. I implemented that, it is giving me the frequency at which the peak occurs, I want to get number of instances at which the amplitude crosses a certain level. Thanks
Message 3 of 9
(2,119 Views)

## Re: FFT peak Analysis

Well, what you say is that you want to create a histogram of threshold exceedances.

What you have to do is to compare the peak threshold exceedances of time n with the threshold exceedances of time n+1.

If a new peak (frequency) shows up, you have to increment its histogram value. So essentially you keep the histogram as counter per frequency bucket. Each peak you detect is part of one bucket (e.g. 5-10 Hz). Once a peak occurs newly in n+1, you increment that bucket.

Once you have done that for the whole sound file, you got the histogram of frequency buckets showing you how often the sound exceeded the specific bucket threshold level.

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 9
(2,115 Views)

## Re: FFT peak Analysis

Thank you! Norbert.

I could do it ultimately using a for loop and magnitudes from the unbundle.

Thank you once again!

Message 5 of 9
(2,112 Views)

## Re: FFT peak Analysis

here I posted a vi that also migth do the job. It uses tone detection to find the n max frequencies ... detect one frequency, remove it, look for next..   instead of fixed n for loop searches you can use a while loop and define an end ...

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 6 of 9
(2,085 Views)

Henrick,

Message 7 of 9
(2,078 Views)

## Re: FFT peak Analysis

Try this one

https://forums.ni.com/ni/attachments/ni/300/8543/1/test%20successif%20tone%20removal%202.vi

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 8 of 9
(2,068 Views)

## Re: FFT peak Analysis

Thank you Henrik,

Will certainly try out your vi.

Regards

Message 9 of 9
(2,043 Views)