Sum of sines fitting algorithm: What is happening to the phase value?
Mostrar comentarios más antiguos
I am trying to figure out what is happening with the sine fit function in matlab. To do this I have input a sine function with known parameters, then use the sine fitting function in the curve fitting toolbox to reproduce my results. The fit values for the amplitude and frequency make sense, but I cant make sense of the phase value.
Here is an example:
time=[2007.1
2007.2
2007.3
2007.4
2007.6
2007.7
2007.8
2008.0
2008.1
2008.3]; %Time in decimal years
A=10; % meters
f=2*pi; %wavelength of 1 year
phi=0; %no phase shift
y=A*sin(f*time+phi)
The sine fitting function spits out this:
A=10
f=2*pi
phi= -2601
What is the meaning of -2601 radians? I entered phi = 0 , so why is this not zero?
Thanks,
Al
Respuesta aceptada
Más respuestas (1)
Grzegorz Knor
el 22 de Oct. de 2011
0 votos
Your function is periodic so there is an infinite phase shifts, that will be a good answer.
You could add a constraints in fit options.
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!