Signal Fitting with sine curve (and how to find out the phase shift?)
Afficher commentaires plus anciens
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 commentaires
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
le 10 Mar 2023
Ashfaq Ahmed
le 10 Mar 2023
Modifié(e) : Ashfaq Ahmed
le 10 Mar 2023
Jan
le 10 Mar 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
le 10 Mar 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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spectral Measurements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



