⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 peakest.m

📁 Interactive smoothing for time-series signals, with sliders that allow you to adjust the smoothing
💻 M
字号:
function [PeakX, PeakY, Width]=PeakEst(x,y,pos,wid)
% Least-squares estimate of peak height, position, and width of a Gaussian
% peak in the signal x,y located at approximately x=pos and with approximate 
% half-width "wid".  Fits parabola to log of points near the peak.
% [PeakX, PeakY, Width]=PeakEst(x,y,pos,wid)
% Tom O'Haver, July 2006
   xrange=[(pos-wid):(pos+wid)];
   coef=polyfit(x(xrange),log(abs(y(xrange))),2);  % Fit parabola to log of sub-group
   c1=coef(3);c2=coef(2);c3=coef(1);
   PeakX=-c2/(2*c3);   % Compute peak position and height of Gaussian
   PeakY=exp(c1-c3*(c2/(2*c3))^2);
   Width=2.35703/(sqrt(2)*sqrt(-1*c3));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -