Fitting a single amplitude sine wave to known peak/trough points

6 次查看(过去 30 天)
Hi again everyone,
I have a vector of data which I want to fit a sine wave to, I want the amplitude of the wave to remain constant though.
I have a script which finds the peaks and troughs in the original data (it is almost a sine wave on it's own) all I need to know is how to get Matlab to create a fixed amplitude sine wave between these known points. Alternatively Matlab could fit the wave to the original data, if that would be better.
I have searched for the answer but I think it's so simple most people don't have a problem. I have the signal processing and statistics toolboxes.
Thanks,
Rod.
An example of the data I have:

采纳的回答

Right Grievous
Right Grievous 2013-9-16
I solved this problem by taking each location of a peak, using linspace to create the numbers 90-180 (as many numbers as I had time data points) between the peak and the next trough, then I did the same for between the trough and the next peak (180-270) and that peak and the next trough (270-360) and from that trough onto the next peak (360-450).
Then I subtracted 360 from any number over 360 to make all the values range from 0-360 in a correct sin function.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Measurements and Feature Extraction 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by