LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding maximum peak values and how to change x_axis to frequency and y_axis to gain

Solved!
Go to solution

HI i have a VI file, that takes wav file and converts it to spectrum . i need to find all maximum peaks by treshold (-30) level. I found couple of examples but i can not understand why it displays wrong data at my vi, may be i'm doing something wrong?  and another issue , how to display the right x-axis with frequency and gain in y_axis. i know that formula for x_axis is 

 

bin num * sample rate(8000)/framesize (???) which framesize i need to take?

 

and must to enter this value to scale multiply in the property window. this vi after compilation to dll, will be used in my C# project.

 

i have attached the vi , and wav file two tones 2KHz and 4KHz.

 

 

Download All
0 Kudos
Message 1 of 6
(3,697 Views)

@Arbo wrote:

HI i have a VI file, that takes wav file and converts it to spectrum . i need to find all maximum peaks by treshold (-30) level. I found couple of examples but i can not understand why it displays wrong data at my vi, may be i'm doing something wrong?  


Why do you have a For loop iterating through the same data..? By default you have a zero wired to the N input on the loop, so you won't get any values out. Either get rid of the loop, or set a value of 1 instead of 0.

What do you mean by wrong data? What is it supposed to be and what are you getting?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 6
(3,671 Views)
Thanks for an answer i have settled the N=1 and attached the graph view, the Gain displays the right value but frequency has a value of 0.006 how i can convert this value to the graph. the signal of wav file has 2 main tones 2Khz and 4Khz, and at spectrum i want to see the these frequencies at right places.
0 Kudos
Message 3 of 6
(3,649 Views)
Solution
Accepted by topic author Arbo

Hi Arbo,

 

do you note the coercion dot at the FFT function input? It has a reason to be shown!

 

Please read the help for the functions you use in your VI: The FFT function expects a waveform input - waveforms include timing information.

Your data are just a 1D array of samples without any timing information…

 

Solution: Povide the data for FFT with a waveform including proper timing information!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(3,639 Views)

thanks, for a help. i resolved this issue with proper timing .

 

but i have another question how i can insert an marker to the graph as it made in spectrum analizer with peak marker function. 

0 Kudos
Message 5 of 6
(3,437 Views)

Hi Arbo,

 

graphs support cursors and annotations. You can use both as "markers" in the graph.

There are also example VIs in the LabVIEW example finder explaining how to use both…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(3,434 Views)