Signal Fitting with sine curve (and how to find out the phase shift?)
Ältere Kommentare anzeigen
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 Kommentare
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
am 10 Mär. 2023
Ashfaq Ahmed
am 10 Mär. 2023
Bearbeitet: Ashfaq Ahmed
am 10 Mär. 2023
Jan
am 10 Mär. 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
am 10 Mär. 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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Spectral Measurements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



