Signal Fitting with sine curve (and how to find out the phase shift?)
Mostrar comentarios más antiguos
Hi!
I have a temperature signal (Y-axis) consisting of 764 values that looks like this -
And the time (X-axis) of this signal is a bit nonperiodic. Each of the observation points are like this -
I have timetable and the temperature data (attached). Can anyone please suggest me how can I fit this signal into a sine curve and get the amplitude, mean, and phase shift? Any feedback will be greatly appreciated!
5 comentarios
Fitting a sine wave to a non-periodic function is an expensive random number generator.
Did you search in the forum already? You'd find e.g. https://www.mathworks.com/matlabcentral/answers/121579-curve-fitting-to-a-sinusoidal-function#answer_128539
Ashfaq Ahmed
el 10 de Mzo. de 2023
Ashfaq Ahmed
el 10 de Mzo. de 2023
Editada: Ashfaq Ahmed
el 10 de Mzo. de 2023
Jan
el 10 de Mzo. de 2023
"Expensive random number generator" means, that the output has not more mathematical significance than rand(1, 4).
The function, Star Strider is fitting is:
fit = @(b,x) b(1).*(sin(2*pi*x.*b(2) + 2*pi*b(3))) + b(4)
Then 2*pi*b(3) is the phaseshift.
John D'Errico
el 10 de Mzo. de 2023
That signal does not have an even remotely fixed frequency. So there is no constant phase shift that could be estimated. Trying to do so would be meaningless.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spectral Measurements 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!



