LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak Detection of the passband waveform

Solved!
Go to solution

I need to find the peak of the frequency and their Q values of 1D and 2D passband. I am using the Network analyzer E5061B Keysight. I tried to use the Peak Detector Vi to find the peaks, but I am getting 0 values of the peak. Also, I don't know how to find the Q value of all these peaks and display all that data. I have attached the vi and the front panel pic to show the waveform I am getting from the Network Analyzer. If someone can really help figure this out, I highly appreciate your help. Please help.

 

Thanks

Shreya

Download All
0 Kudos
Message 1 of 19
(1,754 Views)

It would be best if you could just post a VI that has a data set and the peak detect VI to play with just that part.  All the data acquisition part isn't needed.

 

Best guess is you're either setting the width too wide (can't see how dense your data is, but 125 seems excessive when the default is 3) or that it might not like to see negative data points.  If it's the second, maybe try adding a constant to all the values to make the graph identical but all positive (for instance, add 100 to all values).

0 Kudos
Message 2 of 19
(1,715 Views)

Thanks for the reply. Actually the graph is the real time data. So I cannot show only peak detector VI.

 

I tried your suggestion of adding constant and reducing the width but both does not work in my application. It still reads 0.

 

Please help.

0 Kudos
Message 3 of 19
(1,699 Views)

@shreya51 wrote:

Thanks for the reply. Actually the graph is the real time data. So I cannot show only peak detector VI.

Please help.


What I mean is to do this:

 

1. Run your VI and then stop it with the data on the graph showing (i.e. a good example set of data).

2. Create a new VI

3. Copy the graph output from your VI to the new VI

4. On the new VI, right-click the graph and choose "Data Operations --> Make current value default"

5. Copy your peak detection code to the new VI and, using a local variable to read it, take the data from the graph and wire it up to the peak detection VI

6. Confirm it runs but doesn't detect any peaks, just like in your real VI

7. Save and upload that new VI to post here.

 

 

0 Kudos
Message 4 of 19
(1,673 Views)

Thank you for guiding me. I followed the steps you have mentioned and attached that vi here. Let me know how to make it work to detect peaks.

 

0 Kudos
Message 5 of 19
(1,634 Views)

Kyle97330_0-1597076922302.png

With these modifications I got a bunch of peaks to display.  As I suspected, the main thing limiting the detection was that the values needed to be positive, so by subtracting the lowest value (-99 or so) it started to work.  Reducing the width showed more peaks as well.

0 Kudos
Message 6 of 19
(1,593 Views)

@Kyle97330 wrote:

As I suspected, the main thing limiting the detection was that the values needed to be positive, so by subtracting the lowest value (-99 or so) it started to work.  Reducing the width showed more peaks as well.


Alternatively, instead of subtracting out values, you could adjust the "threshold" to be the minimum value of your data array - it has the same result, but preserves the initial data.

 

Peak Detection debugging_JoB.PNG

Or you could programmatically choose a different threshold, to filter out lower peaks you may not want.

 

(I agree with @Kyle97330 - tweak your "width" to find the peaks you want.)

 

-joeorbob

 

0 Kudos
Message 7 of 19
(1,587 Views)

But I need to find only the main peaks instead on bunch of other peaks. How to get that?

Also I need to have Locations of the peak in frequency. How to get that part?

Please help. I am new to labview and struggling to figure out this thing since a week.

0 Kudos
Message 8 of 19
(1,581 Views)

Hi shreya,

 


@shreya51 wrote:

But I need to find only the main peaks instead on bunch of other peaks. How to get that?


First you need to define the difference between "main peaks" and "bunch of other peaks"!

Have you tried to play with peak detection parameters?

 


@shreya51 wrote:

Also I need to have Locations of the peak in frequency. How to get that part?


Right now you use the difference between the first two samples of your plot ("Y") data to scale the positions ("X") output data of the PeakDetector: what is the reason to do this? What kind of result do you expect here?

You already get the locations, but you scale them in a weird way…

 


@shreya51 wrote:

I am new to labview and struggling to figure out this thing since a week.


Did you notice the "Training Resources" section in the header of this LabVIEW board?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 19
(1,565 Views)

Hi Gred

 

I played with the Peak Detector parameters but it is real time data, I cannot make difference between the "main peak" and bunch of other peaks. If you can help me with that, it would be highly appreciated.

 

After your suggestions, I removed the use of difference between the first two samples of plot ("Y") data to scale the positions ("X") output data of the PeakDetector. But still I don't get the Locations in frequency.

 

I already took training and following the examples but when I realized when I need to work with real-time data, it takes longer to figure out the results I want. That's the reason I am seeking help.

 

0 Kudos
Message 10 of 19
(1,557 Views)