Prev: How I can do the Coherence function using AR method
Next: Similarity between Goertzel filter and bandpass filter
From: Luna Moon on 24 Mar 2010 19:40 Hi all, We have a task in Matlab that I don't know how to it: We would like to find the "robust" peak/max in an numeric array. The "robust" here means that if the peak or max is a singleton and all the surrounding regions around that peak/spike/max are deep valleys, then this peak/max is not a "robust" max, it's a spike, or random noise. We don't want to get such a max. Instead, we would like to see a slow varying top, or stable flat top. We would like to see that if the surrounding regions around the peak/ max are also high values, then that peak/max is a "robust" max, it's not a spike or random noise. How do I fulfill this task in Matlab? Thanks a lot!
From: Tim Wescott on 24 Mar 2010 20:01 Luna Moon wrote: > Hi all, > > We have a task in Matlab that I don't know how to it: > > We would like to find the "robust" peak/max in an numeric array. > > The "robust" here means that if the peak or max is a singleton and all > the surrounding regions around that peak/spike/max are deep valleys, > then this peak/max is not a "robust" max, it's a spike, or random > noise. > > We don't want to get such a max. > > Instead, we would like to see a slow varying top, or stable flat top. > We would like to see that if the surrounding regions around the peak/ > max are also high values, then that peak/max is a "robust" max, it's > not a spike or random noise. > > How do I fulfill this task in Matlab? > > Thanks a lot! Does Matlab have a "find" function, to find the index of an array element? In Scilab you'd do ix = find(array = max(array)). That would get you the position in one dimension of the maximum (or maxima); then you'd have to get that into 2D, then you'd have to check the neighbors. I suspect Matlab lets you do something similar. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
From: Vladimir Vassilevsky on 24 Mar 2010 20:12 Luna Moon wrote: > Hi all, > > We have a task in Matlab that I don't know how to it: > > We would like to find the "robust" peak/max in an numeric array. > > The "robust" here means that if the peak or max is a singleton and all > the surrounding regions around that peak/spike/max are deep valleys, > then this peak/max is not a "robust" max, it's a spike, or random > noise. > > We don't want to get such a max. > > Instead, we would like to see a slow varying top, or stable flat top. > We would like to see that if the surrounding regions around the peak/ > max are also high values, then that peak/max is a "robust" max, it's > not a spike or random noise. > > How do I fulfill this task in Matlab? Lowpass your data, find maximum, then refine the position of maximum over the initial data. And remember: MATLAB is for STUPIDENTS and toy problems. VLV
From: Luna Moon on 29 Mar 2010 09:07 On Mar 24, 8:12 pm, Vladimir Vassilevsky <nos...(a)nowhere.com> wrote: > Luna Moon wrote: > > Hi all, > > > We have a task in Matlab that I don't know how to it: > > > We would like to find the "robust" peak/max in an numeric array. > > > The "robust" here means that if the peak or max is a singleton and all > > the surrounding regions around that peak/spike/max are deep valleys, > > then this peak/max is not a "robust" max, it's a spike, or random > > noise. > > > We don't want to get such a max. > > > Instead, we would like to see a slow varying top, or stable flat top. > > We would like to see that if the surrounding regions around the peak/ > > max are also high values, then that peak/max is a "robust" max, it's > > not a spike or random noise. > > > How do I fulfill this task in Matlab? > > Lowpass your data, find maximum, then refine the position of maximum > over the initial data. > > And remember: MATLAB is for STUPIDENTS and toy problems. > > VLV Do you think low-pass filter will work here? Let's say you have the following shape: 1 1 1 1 1 1 0 0 0 1 1 0 2 0 1 1 0 0 0 1 1 1 1 1 1 Let's say I don't want to identify the 2 in the middle as my peak. Because that's a spike which is not robust. I suspect a low pass filter will still pick that 2 up... Any more thoughts? Thank you!
From: Jerry Avins on 29 Mar 2010 12:55
Luna Moon wrote: > On Mar 24, 8:12 pm, Vladimir Vassilevsky <nos...(a)nowhere.com> wrote: >> Luna Moon wrote: >>> Hi all, >>> We have a task in Matlab that I don't know how to it: >>> We would like to find the "robust" peak/max in an numeric array. >>> The "robust" here means that if the peak or max is a singleton and all >>> the surrounding regions around that peak/spike/max are deep valleys, >>> then this peak/max is not a "robust" max, it's a spike, or random >>> noise. >>> We don't want to get such a max. >>> Instead, we would like to see a slow varying top, or stable flat top. >>> We would like to see that if the surrounding regions around the peak/ >>> max are also high values, then that peak/max is a "robust" max, it's >>> not a spike or random noise. >>> How do I fulfill this task in Matlab? >> Lowpass your data, find maximum, then refine the position of maximum >> over the initial data. >> >> And remember: MATLAB is for STUPIDENTS and toy problems. >> >> VLV > > Do you think low-pass filter will work here? > > Let's say you have the following shape: > > > 1 1 1 1 1 > 1 0 0 0 1 > 1 0 2 0 1 > 1 0 0 0 1 > 1 1 1 1 1 > > Let's say I don't want to identify the 2 in the middle as my peak. > Because that's a spike which is not robust. > > I suspect a low pass filter will still pick that 2 up... Of course it will, because it's the closest thing to a peak that there is. Never mind how to program it. If you, with all your intelligence, can't provide an answer for a simple case, what hope do you have of instructing a machine to do it for you? Jerry -- Discovery consists of seeing what everybody has seen, and thinking what nobody has thought. .. Albert Szent-Gyorgi ����������������������������������������������������������������������� |