2d multi-peak detector (matrix)

Hi all,
I was looking for a method to find peaks over a 2d array data set (matrix).
I found some topics in old threads but noone seems exactly to help me.
In fact I was looking for something that returns (i,j) indexes of maximums found over a 2d data array (my seeking area=window).
This means that maybe I should consider the derivatives over 2d data (or maybe some 2d surface evaluation for maximums), in order to find peaks that are internal to the matrix area (but not near to the border, because these maximums could belong to peaks that are outside my seeking area).
A little example about the operation that I need to perform:
Given a (row x column) matrix:
0    10    10    0    0    0    0    0
10    5    0    0    0    5    0    0
20    10    0    0    5    10    5    0
30    20    10    0    10    20    10    0
20    10    0    0    10    15    5    0   
10    5    0    0    5    5    0    0
0    0    0    0    0    0    0    0
The real peak I want to find is 20 at (3,5) NOT 30 at (3,0), because this could be a false peak coming from a maximum located outside the border of the window.
Ideas are welcomed expecially in LV 7.1 (or LV 8.2.1).
Thanks for your suggestions!
Marco

In the last example you discarded the first row and the first column to find maximums in the sub-matrix and then recompute indexes to the original one.
here stands the problem!
in fact in the sub-matrix i could have maximums that belong to peaks located outside my seeking area (i.e. the starting matrix) and so they are only a "ramp" but not real local maximums!
Example:
Matrix:
0    10    10    0    0    0    0    0
10    5    0    0    0    5    0    0
20    10    0    0    5    10    5    0
30    20    10    0    10    20    10    0
20    10    0    0    10    15    5    0   
10    5    0    0    5    5    0    0
0    0    0    0    0    0    0    0
Sub Matrix:
5    0    0    0    5    0    0
10    0    0    5    10    5    0
20    10    0    10    20    10    0
10    0    0    10    15    5    0   
5    0    0    5    5    0    0
 0    0    0    0    0    0    0
Max: 20 at (2,0): is a FALSE MAX (a ramp coming from a peak outside my seeking area), in fact if i evaluate the part. derivatives there is no change of sign.
Real Max= 20 at (2,4) in the submatrix (where part,. derivatives have a change of sign)
thanks
marco

Similar Messages

  • Multi peak fitting Error -20041

    I programmed a multipeak gaussian fit. Its displaying the following error
    "Error -20041 occurred at NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi:6620001"
    Possible reason(s):
    Analysis: The system of equations cannot be solved because the input matrix is singular.
    Can someone help me on this?
    Solved!
    Go to Solution.
    Attachments:
    Sum of N Gaussians with offseat fit.vi ‏38 KB
    sum of N Gaussians with offset model.vi ‏17 KB

    I cleaned things up a little bit and it all seems to work OK. (might need to tune the peak detector). LabVIEW 2013.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Sum of N Gaussians with offseat fit_MODCA.vi ‏35 KB
    sum of N Gaussians with offset model_MODCA.vi ‏17 KB

  • How to use filter vis and peak detectors in compactRio

    Hi  all,
               We are
    using compact rio 9002 with IO module 9215. We are accessing a sine
    wave(of 1 KHz) input with some DC components in it. We need to filter
    out the DC and get the peak value of that sine wave. We have developed
    a program to acquire the same. But the problem we are facing is we are
    not able to filter out the DC and get the peak values inspite of using
    the filter and peak detector VI's. Suggest the reason and the solution.
    Regards,
    Labview Lovers.

    Hi Shivkumar,
    If you need to filter out the DC portion of the signal before you acquire the signal you may want to consider implementing AC coupling.  Which particular Filter and Peak VIs are you using?
    Regards,
    Bassett

  • Deleting peak values detected by peak detector vi

    Hi,
    I m using the peak detector vi to detect peaks every 100 samples, if the difference between two consecutive peaks is greater than 15 i want to delete the peak with the higher amplitude only. This data set, should be plotted again on another waveform. I m able to detect peaks that have amplitudes greater than 15, but I dont kn ow how to delete only these peaks.
    Attached is the waveform, with a single peak with high amplitude which I want to delete.
    Any help would be appreciated.
    Thank you.
    Regards.
    Attachments:
    peak_detection.doc ‏88 KB

    Hi Prakruthi,
    please have a look at this forum thread:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=69416&requireLogin=False
    It contains a complete VI for deleting peaks. You only have to insert one more condition to deal with the "only peaks with difference > 15" requirement.
    Regards,
    Johannes Bauer

  • What does the location of the peak detector mean

    i would like to know what the locations of the peak detector refer to? what does the value of the location of the peak detector tell? does it tell the location of the peak and if so, what unit is it in? also, if i set a threshold value, does it mean that only one peak would be detected or any value higher than that threshold would also be detected? if i were to set the sampling rate for my peak detection to be 400 per millisecond, do i expect to see an array of values or one absolute peak value after one cycle?

    Greetings!
    The peak value VI gives you four outputs, actually: positive and negative peak values and the positive and negative peak "horizontal" locations. The locations are in data points, not actual time. To get the time, you have to calculate it from your sample rate. Also, the vi does indeed give you the absolute peak of a waveform, which, as you can guess, requires that the entire waveform is sampled BEFORE the calculation is made. This can slow down real-time sampling, since there is considerable processing involved in calculating the peak value...you need to keep this in mind when designing your application. To answer your last question, you will obtain ONE reading per trigger.
    Hope this helps!
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • Why different types of peak detectors show different results?

    In my project i need to insert a peak detector but when i use different types of peak detectors they show different results. why is this so?

    I also find the thresholds used will give different results.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • I am trying to detect signal peaks (derivatives of the peaks both +ve and -ve peaks). simultaneously 2 peaks detectors are running, 1 for +ve and other for -ve peaks.

    i am trying to detect signal peaks (derivatives of the peaks both +ve and -ve peaks). simultaneously 2 peaks detectors are running, 1 for +ve and other for -ve peaks. when a peaks get detected it would trigger a pulse of approx 1 sec duration and at the same time it would disable the other peak detector for 1 sec time duration. after the time period, again both the peak detectors would be enabled. i have been able to detect both peaks but still not able to control the detectors block the way mentioned before.
    the code and the data are attached.
    Attachments:
    eog peak detection.vi ‏192 KB

    I'm not suggesting any of this as a model, and your needs are different than mine.
    1) Go to Preferences -> Audio.  Under "Default Audio Tracks", Set "Mono Media: Mono".  Set "Stereo Media: Mono"  (Choices from the pull-down for both are Use File, Mono, Stereo, 5.1, Adaptive)
    You can change these, but I don't. I am using both mono and stereo tracks. I set up a custom sequence with the particular combination of stereo and mono tracks I want.
    2) Set audio for clips by selecting all clips and going to Modify Clip -> Audio Channels Tab.  Under "Number of Audio Tracks" there should be a "1".  Under Channel Format it should read "Stereo".
    I am not sending the audio to anyone else to edit further. I am doing a final stereo mix. If camera one is set up to record 2 mikes as a stereo track, then I leave that unchanged and put it onto a stereo track. If camera two is set up to record one mike onto channel 1 as ambient sound and channel 2 is a mono feed from a sound board, then I modify those clips as Preset Mono, 2 audio tracks, Channel format Mono, and that puts the left source channel (or whichever I choose) onto Audio track 1, channel 1 (of one), and right source channel onto audio track 2, channel 1.
    4) Delete all the existing audio tracks in the sequence and replace them all with mono tracks, so all tracks in the sequence are mono.
    I modify the tracks while creating the sequence, and ultimately use a custom sequence.
    Under my Effects Controls panel there is only Channel Volume, and nowhere to adjust the pan.
    I'm using the mixer, not the effects control panel.

  • How does the width parameter in the peak detector work?

    I would like to know how the window slides. For example if i take a width of 3. My first window is from 1 to 3. My next window will slide from 4 to 6 or from 2 to 4.
    Thank you.

    Madhuri,
    Please Refer to NI Article at http://zone.ni.com/devzone/conceptd.nsf/webmain/55181A206A523FD186256ABE00626EA9?opendocument
    I have Used Peak Detetor in the past. One thing is the width function works on sets of Points.
    It Performs a Least Squares Fit based on points you provide then extracts the quadratic Polynomial then checks this polynomial for Peaks using Parabolic Concavity.
    I can be at best vague on how it does this. But my experience shows that you have to play with the width no to kind of optimize the peak detection for your dataset
    If you can find additional information please post it here for others..
    Good Luck
    Mache
    Good Luck!
    Mache

  • Threshold control for peak detector

    Hi there,
    I am building a vi which recieves a set of data, and then needs to find the peaks in the data (there should be no more than 3). The problem is that the peaks are variable in amplitude, depending on the source and I need a method of controling the threshold without having to examine the raw data. The ideal solution would be a graph being displayed with a horizontal line whose height / distance from the threshold and is actively controllable.
    Any ideas?
    Attachments:
    labview pic.JPG ‏84 KB

    What I usually do for automated peak detection is, assuming one ofthe the desired peaks is the highest values in the original array, I find the max value in this array and then set my threshold to some percentage of this value (i.e. 0.7 times the max value).
    Randall Pursley

  • Can I find out the peak of Output 1-2 without having to play whole track?

    Can I find out the peak of Output 1-2 without having to play whole track? I am preparing my album for mastering and I was told to have each track peak at no more than -2dB. Is there an offline peak detector or maybe another trick people use?

    You should deliver your mixes to the mastering house in 24bit format. They should be converted to 16bit and dithered AFTER the mastering. Also, as long as the mixes are not overloaded, the levels could be handled in mastering also. That's what mastering is about, matching the perceived levels between the tracks. As far as your last question, "Do you just slap a multipressor on the output at that point and call it mastered?" the answer is heck no. I'd suggest selecting some professionally mastered cds in your genre, and put a few into your "mastering song" in logic and use them to compare to your mixes. Play with the mastering tools (multi compressor, EQ, adlimiter, etc) on your tracks and try to bring them into the ballpark with the reference songs. It will take a while to get a handle on it, but with practice, it will get you there.

  • How can I get the peak and valley of a MZI signal

    I am using MZI signal which is similar to sine wave with frequency of 10MHz to calibrate an interference signal. I want to get the peak and valley of the MZI signal and get the corresponding value of interference signal at the same location. The problem is that the MZI signal aquired by DAQ is not smooth, Please see attached filter.PNG, the top left is the MZI, top right is the MZI Zoomed in, you can see that there may be two values that are approximately same to each other. I used a peak detector to detect both the peak and valley and a build array to concatenate them. I am worried that the peak detector may find two peaks or two valleys in a fringe. So I used the filter function in express to bandpass the MZI signal (cutoff frequency is 8MHZ~12MHZ) to smooth the signal, the result zoomed in is  the bottom graph in filter.PNG. But I found that it did not solve the problem but cause phase shift. Is there somebody can give some help?
    Attachments:
    filter.PNG ‏143 KB
    peak detector.PNG ‏69 KB

    I don't know anything about MZI signals, but I do know sine waves.  If this is a sine wave, it is relatively easy to measure its amplitude as long as you know the frequency.  Since you say it is 10 MHz, you appear to know the frequency.  You can use Fourier analysis to determine the magnitude and phase of your signal, as long is it is a steady signal that doesn't change frequency or amplitude.
    Generate a sine and cosine wave using the same frequency.  Divide each wave by the sum of its points.  Multiply each one by your incoming signal and sum all the values, one sum for sine and one sum for cosine.  The sums should be the coefficients of the sine and cosine components of your unknown signal.  The ratio tells you the phase of the signal.  If you multiply the sine and cosine waves by their coefficients and add them together, you should be very close to your incoming signal.  The amplitude of your signal is equal to square root of A*A+B*B, where A and B are your coefficients.
    I may be off by a constant factor here somewhere (probably pi), since I didn't write down the equations and verify them.  These equations are the basis of the Fourier series, though, so they would be fairly easy to find.
    Another option would be resampling.  If you upsampled the data and increased the data resolution by a factor of 10 or so and filtered the results using an FIR filter, you would have a much cleaner signal with a lot more detail.  You wouldn't have any problem locating and measuring peaks and valleys.  This would probably work better with your data, since it looks like it doesn't have a constant magnitude.  To upsample the data, just add 9 zeroes between each data point.  Create a lowpass FIR filter that is based on 10 times the original sampling frequency and has an amplitude of 10.  The cutoff frequency should be half the original sampling rate.  Filter your new data and you should get the same waveform with 10 times the resolution.
    Bruce
    Message Edited by Bruce Ammons on 10-02-2008 09:10 PM
    Bruce Ammons
    Ammons Engineering

  • Block Peak Detection and Display

    I am doing a project on a spike check automation program in Labview. I am trying to detect the peaks and valleys from a probe test on a wafer.The probes are attached to the wafer and connect to an oscilloscope. Right now finding the peaks and valleys are done manually but take a lot of time from one pin.
    My program has to optimally run for 20 seconds and, at every interval, of let’s say 20microseconds, has to take the worst case scenario for the peaks and take the screenshot from the oscilloscope and save it until the worst case scenario in the next block on 20 microseconds until the 30 seconds are up.
    I am using LV 2010 and I don’t have experience with LV before. I have researched and found a VI called waveform peak detector which seems helpful but I am not sure how to save a screenshot at each interval or block.  
    I am also unsure on what to put in a loop so my program can run continuously for 30 seconds without stopping.  I also have the instrument drivers for my particular oscilloscope so I can control the scope from my computer and LV program.
    Any help is appreciated and thanks in advance for your assistance. 

    Share for care... oops share for cure...!!
    please share your code or more info..!!
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • When using the built-in peak

    detect.vi in Labview, if I have a 1-D array of elements that I am passing into this peak detect vi, how do I kind of book mark the peak values? For example, I only want to use the data from my 1D array that is between two peaks. How do I get this subarray?I am graphing my 1D array, and for my assignment, I wish to calculate the mean value of the array between two peaks. Therefore, how can I detect where the peaks are and then go back to my 1D array and locate the subsection between two peaks?

    detect.vi in Labview, if I have a 1-D array of elements that I am passing into this peak detect vi, how do I kind of book mark the peak values? For example, I only want to use the data from my 1D array that is between two peaks. How do I get this subarray?Peak Detector.vi seems to pass out the indices of detected peaks and valleys - I would think you could use these as input to Get Array Subset.
    cheers,
    - kevin

  • How to fit multiple guassian peaks ?

    Hi,
    I have a  two column data set (x,y) that contain large number of Gaussian peaks ( several hundredes infact). You can think of it more like a wavelength spectrum. The number of spectral peaks is not known exactly. There is no problem in detecting the peaks as they are of same amplitude. Eventually I want to fit a Gaussian funtion to each of these spectral  peak and obtain the the parameters  such as  amplitude, line-center and sigma.  This seems a somewhat tricky in LabVIEW. There is an example ( Sum of 3 Gaussian with offset) that comes bundled with LabVIEW. This example VI however uses a static refrence to a model function which is sum of three gaussian curves.  This works well for few number of peaks in the data. If we have large number of peaks ( e.g spectroscopy data) then creating such a model function for a large number of peaks is nealy  impractical.  Is there a  better way to handle  such peak-fitting problems in LabVIEW? Would greatly appreciate if someone could point out any existing  LV code/library function.
    Regards,
    RK
    Solved!
    Go to Solution.

    Many Thanks Altenbach. That was something I was after. I've attached an example data file of the sep...
    Regards,
    RK
    Attachments:
    multi-peak-spectra.txt ‏1128 KB

  • How to count peaks??

    Hello everyone,
    I'm a new user of LabVIEW and I'm gonna ask you about a problem that surely many of you will find quite boring.
    I'm developing a software for a test machine gestione that uses an alternate bending, by a revolution counter that generates a rectangular analog output signal in volts, from 0V to 8V. As far I have thi signal in a waveform graph.
    My aim is to be able to count the number of cycles of the machine and being able to count the voltage peaks and subsequently to be able to work on the machine with regard to the number of turns to make. the ultimate goal is to be able to tell the machine how many turns/cycles to do and the voltage to apply on the load cell.
    would you be able to give me some useful advices about it? Especially about counting and memorizing the number of turns.
    if necessary I could send a screenshot of the program.
    I tried to use a threshold peak detector but I'm still inexperienced, that's why I'm asking for your help.
    can anyone help me?
    thanks in advance.
    greetings
    LV  
    Solved!
    Go to Solution.

    Hey lucavilla! I think you are getting there :-)
    "Memorize the number of turns" could mean different things, please be more specific. Also, I do not see "turns" anywhere in your block diagram.
    Your code does not follow the "best practices" therefore it is a little difficult to understand and tell what is going on.
    There are lots of material to look at (see a few links below). I personally prefer to learn from examples (Help->Find Examples) but it is up to you.
    A few hints:
    - Make sure it is readable and well organized
    - use error the error wires to create data flow
    - Most people like to see bloack diagrams as icons, try that.
    http://zone.ni.com/devzone/cda/pub/p/id/1735
    Debugging and Handling Errors
    http://www.ni.com/academic/students/learn-labview/debugging/
    https://decibel.ni.com/content/docs/DOC-8592
    http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/block_diagram_objects/
    https://decibel.ni.com/content/docs/DOC-9121
    ftp://ftp.ni.com/pub/events/user_groups/
    https://decibel.ni.com/content/docs/DOC-14909
    https://decibel.ni.com/content/docs/DOC-20725
    https://decibel.ni.com/content/docs/DOC-22047
    https://decibel.ni.com/content/docs/DOC-15597
    https://decibel.ni.com/content/docs/DOC-15049

Maybe you are looking for

  • I can no longer view PDFs on my computer.

    Recently, I'm no longer able to read PDFs.  I get a blank black screen stating to download adobe reader or adobe acrobat.  I've done both an still cannot read PDFs in safari or firefox. Any suggestions...

  • Iphoto directory structure and multiple copies

    I want to manage the directory structure of my photos because I use them with applications and want to put them where I want to. Thus, I never cared for iPhoto 08 and how it organized the directory structure how it wanted to. Additionally, it seems i

  • Scroll gesture moves drawbars with no effect?

    After using Mainstage 2 for a while and then installing Mainstage 3 I was frustrated to find that the 2 finger scrolling gesture will move the drawbars in the Vintage B3 interface without changing the setting. This is not the case in the original EB3

  • Can't figure out why my zoom into stills shakes

    I have been using keyframes to create zooms and pans over pics, but every once in a while one of the pics shakes while it's moving. I can't figure out why this happens- any ideas? THANKS

  • 1142N unable to open Web GUI and CMD line options not available

    I am currently trying to configure two 1142N APs (AIR-LAP1142N-A-K9) to be stand alone APs. I have followed the PDFs http://www.cisco.com/en/US/customer/docs/wireless/access_point/12.3_8_JA/configuration/guide/s38frst.html#wp1103248 and http://www.ci