findpeaks failure on redundant points

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

findpeaks failure on redundant points

Fritz Sonnichsen
I am running findpeaks on some realworld chemical spectra and it works
quite well most of the time. However in the case of a redundant y value
it fails to find the peak. I have snipped a subset of the dataset to
show this below. If you run the code you will only get one peak at index
y=33003.55.    The peak at 63064.69 is not detected. However if you
remove the 2nd occurrence of 63064.69, findpeaks can then detect the peak.
Am I missing some parameter here for this or is this  a bug?

Thanks
Fritz
========================================
clear all
pkg load signal
data = [
312.446    7925.49;
312.903    9374.54;
313.36    11117.28;
313.817    12726.53;
314.274    14367.34;
315.187    20680.54;
316.557    24241.28;
317.47    33003.55;
317.926    35064.26;
318.382    28287.45;
318.839    15017.83;
319.295    6056.53;
319.751    2554.04;
320.663    1185.09;
321.575    867.13;
324.765    694.79;
325.22    731.2;
325.675    757.9;
326.131    862.27;
331.136    2702.11;
332.954    3389.01;
333.409    4088.05;
334.317    5578.36;
335.226    9338.13;
335.68    12634.3;
336.588    21462.11;
337.042    27889.39;
337.95    49156.71;
338.404    59644.74;
338.858    63064.69;
338.859    63064.69;
340.672    8942.49;
341.126    3338.04;
341.579    1495.78;
342.033    1034.6;
342.486    884.12;
]
wavel=data(:,1);
inten=data(:,2);
[hite, idx, parms] = findpeaks(inten);
disp(   sprintf("index=%d wavelength=%d intensity=%d
\r\n",[idx,wavel(idx),hite]')    );
plot(wavel,inten ,'color','r'  );



Reply | Threaded
Open this post in threaded view
|

Re: findpeaks failure on redundant points

Mike Miller-4
On Mon, May 07, 2018 at 15:51:15 -0400, Fritz Sonnichsen wrote:
> I am running findpeaks on some realworld chemical spectra and it works quite
> well most of the time. However in the case of a redundant y value it fails
> to find the peak.

This has been fixed in version 1.4.0 of the signal package.

--
mike



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: findpeaks failure on redundant points

Fritz Sonnichsen
OK and thanks. Unfortunately I am running on windoze--I will install on
unix until 1.4.1 comes out.
fritz

On 5/7/2018 4:00 PM, Mike Miller wrote:
> On Mon, May 07, 2018 at 15:51:15 -0400, Fritz Sonnichsen wrote:
>> I am running findpeaks on some realworld chemical spectra and it works quite
>> well most of the time. However in the case of a redundant y value it fails
>> to find the peak.
> This has been fixed in version 1.4.0 of the signal package.
>