资源简介
在MATLAB中写调用函数,给函数不同参数可进行分峰拟合。
代码片段和文件信息
function [FitResultsLowestErrorBestStartxiyi]=peakfit(signalcenterwindowNumPeakspeakshapeextraNumTrialsstartAUTOZERO)
% 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); 将单个高斯峰适合于矩阵“信号”的一部分。 该部分以x值“中心”为中心,宽度为“窗口”(x单位)
% 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). “NumPeaks”=模型中峰的数量(如果未指定,默认值为1)
%
% PEAKFIT(signalcenterwindowNumPeakspeakshape); peakshape指定模型的峰形 1-高斯 2-洛伦兹
% 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) 指定在Pearson中使用的‘extra‘的值和指数展宽的高斯形状来微调峰形。
% Specifies the value of ‘extra‘ used in the Pearson and the
% exponentionally broadened Gaussian shapes to fine-tune the peak shape.
%
% PEAKFIT(signalcenterwindowNumPeakspeakshapeextraNumTrials); 执行“NumTrials”试验适合并选择最好的(最低拟合误差)
% Performs “NumTrials“ trial fits and selects the best one (with lowest
% fitting error). NumTrials can be any positive integer (default is 1).
%
% PEAKFIT(signalcenterwindowNumPeakspeakshapeextraNumTrialsstart) 为峰位置和宽度指定第一猜测矢量“firstguess”
% Specifies the first guesses vector “firstguess“ for the peak positions
% and widths e.g. start=[position1 width1 position2 width2 ...]
%
% [FitResultsMeanFitError]=PEAK
- 上一篇:图片坏点检测
- 下一篇:MATLAB代码,用于快速平滑滤波
评论
共有 条评论