Sine function fit

버전 1.0.0.0 (2.05 KB) 작성자: R P
Optimization of parameters of the sine function to time series
다운로드 수: 4.4K
업데이트 날짜: 2013/4/11

라이선스 보기

Syntax:
[param]=sine_fit(x,y)

which is the same that
[param]=sine_fit(x,y,[],[],[]) % no fixed_params, automatic initial_params

[param]=sine_fit(x,y,fixed_params) % automatic initial_params
[param]=sine_fit(x,y,[],initial_params) % use it when the estimation is poor
[param]=sine_fit(x,y,fixed_params,initial_params,plot_flag)

param = [offset, amplitude, phaseshift, frequency]

if fixed_params=[NaN, NaN , NaN , NaN] % or fixed_params=[]
optimization of offset, amplitude, phase shift and frequency (default)

if fixed_params=[NaN, 1 , NaN , 1/(2*pi)]
optimization of offset and phase shift of a sine of amplitude=1 and frequency=1/(2*pi)

if fixed_params=[0, NaN , NaN , NaN]
optimization of amplitude, phase shift and frequency of a sine of offset=0


Example:
%% generate data vectors (x and y)
fsine = @(param,timeval) param(1) + param(2) * sin( param(3) + 2*pi*param(4)*timeval );
param=[0 1 0 1/(2*pi)]; % offset, amplitude, phaseshift, frequency
timevec=0:0.1:10*pi;
x=timevec;
y=fsine(param,timevec) + 0.1*randn(size(x));

%% standard parameter estimation
[estimated_params]=sine_fit(x,y)

%% parameter estimation with forced 1.5 fixed amplitude
[estimated_params]=sine_fit(x,y,[NaN 1.5 NaN NaN])

%% parameter estimation without plotting
[estimated_params]=sine_fit(x,y,[],[],0)

인용 양식

R P (2024). Sine function fit (https://www.mathworks.com/matlabcentral/fileexchange/41246-sine-function-fit), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R13
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

줌: sigm_fit

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0