Remove peaks less than a threshold
3 ビュー (過去 30 日間)
古いコメントを表示
Hello guys, I'm dealing with analysis of a spectra and I found that there are many unwanted small peaks in it(see the image). I want to remove the peaks that has the intensity (abscissa) less than say 15.0. Is there any function in matlab that does this. Can someone get me a script for that.

Im attaching my file here
1 件のコメント
Adam
2016 年 11 月 25 日
編集済み: Adam
2016 年 11 月 25 日
What do you mean by 'remove them'? Set only the peak values to 0? Doing only this would obviously result in new small peaks in most places where the newly zeroed point would cause small peaks either side of it.
You can use various settings in the findpeaks function if you have the signal processing toolbox in order to not include the small peaks, but by the sounds of it you want to get rid of them from your spectrum rather than just find the peaks that do matter.
回答 (1 件)
Image Analyst
2016 年 11 月 25 日
To set values smaller than some threshold to zero, do this:
threshold = 15; % Whatever....
elementsToSetToZero = y < threshold;
y(elementsToSetToZero ) = 0;
I think Adam's comments about small side peaks getting created was if you zeroed out tall spikes, not short ones. Or else he was zeroing out just the single element at the very peak instead of everything (multiple elements) less than some threshold value. My code above will not create any additional peaks.
4 件のコメント
Image Analyst
2016 年 11 月 26 日
What are you going to do? Why is it so important that the really low tails on the larger peaks be kept intact?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!