资源简介
高斯多峰拟合,需要数据基本符合高斯分布(正态分布)
代码片段和文件信息
function [FitResultsLowestErrorBestStartxiyi]=peakfit(signalcenterwindowNumPeakspeakshapeextraNumTrialsstartAUTOZERO)
% peakfit([x‘ y‘].4.721010[.3 .1 .5 .1]0);
% Version 2.2: October 2011. Adds exponential pulse and sigmoid models
% A command-line peak fitting program for time-series signals
% written as a self-contained Matlab function in a single m-file.
% Uses an non-linear optimization algorithm to decompose a complex
% overlapping-peak signal into its component parts. The objective
% is to determine whether your signal can be represented as the sum of
% fundamental underlying peaks shapes. Accepts signals of any length
% including those with non-integer and non-uniform x-values. Fits
% Gaussian equal-width Gaussians exponentially-broadened Gaussian
% Lorentzian equal-width Lorentzians Pearson Logistic exponential
% pulse abd sigmoid shapes (expandable to other shapes). This is a command
% line version usable from a remote terminal. It is capable of making
% multiple trial fits with sightly different starting values and taking
% the one with the lowest mean fit error. Version 2.2: Sept 2011.
% PEAKFIT(signal);
% Performs an iterative least-squares fit of a single Gaussian
% peak to the data matrix “signal“ which has x values
% in column 1 and Y values in column 2 (e.g. [x y])
%
% PEAKFIT(signalcenterwindow);
% Fits a single Gaussian peak to a portion of the
% matrix “signal“. The portion is centered on the
% x-value “center“ and has width “window“ (in x units).
%
% PEAKFIT(signalcenterwindowNumPeaks);
% “NumPeaks“ = number of peaks in the model (default is 1 if not
% specified).
%
% PEAKFIT(signalcenterwindowNumPeakspeakshape);
% Specifies the peak shape of the model: “peakshape“ = 1-5.
% (1=Gaussian (default) 2=Lorentzian 3=logistic 4=Pearson
% 5=exponentionally broadened Gaussian; 6=equal-width Gaussians;
% 7=Equal-width Lorentzians; 8=exponentionally broadened equal-width
% Gaussian 9=exponential pulse 10=sigmoid).
%
% PEAKFIT(signalcenterwindowNumPeakspeakshapeextra)
% Specifies the value of ‘extra‘ used in the Pearson and the
% exponentionally broadened Gaussian shapes to fine-tune the peak shape.
%
% PEAKFIT(signalcenterwindowNumPeakspeakshapeextraNumTrials);
% Performs “NumTrials“ trial fits and selects the best one (with lowest
% fitting error). NumTrials can be any positive integer (default is 1).
%
% PEAKFIT(signalcenterwindowNumPeakspeakshapeextraNumTrialsstart)
% Specifies the first guesses vector “firstguess“ for the peak positions
% and widths e.g. start=[position1 width1 position2 width2 ...]
%
% [FitResultsMeanFitError]=PEAKFIT(signalcenterwindow...)
% Returns the FitResults vector in the order peak number peak
% position peak height peak width and peak area) and the MeanF
- 上一篇:模拟退火算法的matlab程序,简单易懂
- 下一篇:多目标优化粒子群算法MATLAB
评论
共有 条评论