Fitting scattered data to multiple cosine functions
显示 更早的评论

Hello,
I have data that represent 16 cosine shaped curves, but the data is in the form of scattered points (x_i y_i) i= 1,2,3 .... N. please relate to the attached plot. The points are not associated to the functions, further more, I don't have the exact functions but only their models, more specifically, each function follows the form: f_k = A_k cos(phi_0k + omega*x), omega is fixed for all the functions, only the amplitude A_k and the phase shift phi_k are specific to each function. Is there an easy way to associate each data point to one of the 16 curves?
Thanks in advance.
6 个评论
KALYAN ACHARJYA
2018-7-11
How can you link the scattered points with cosine signal?
f_k = A_k cos(phi_0k + omega*x)
What is x here, is it time?
Ahmad Hamad
2018-7-11
编辑:Ahmad Hamad
2018-7-11
dpb
2018-7-11
"Easy?" Not possible to have a unique solution in all likelihood with no additional information.
But, attach your data file and maybe somebody will give it a shot and see what happens.
Anton Semechko
2018-7-11
编辑:Matt J
2018-7-11
Two or more curves intersect at multiple points and data is a bit noisy in some places. Combined effect of these observations is that it will not be possible to assign each data point to a single curve. Unique assignments can be made for the majority of the data points, but not the ones that lie close to the points of intersection. Still, doing so will not be "easy" as you will first have to use nonlinear least squares to estimate parameters (i.e., amplitudes and phase-shifts) of the 16 curves.
Ahmad Hamad
2018-7-11
编辑:Ahmad Hamad
2018-7-11
dpb
2018-7-11
Well, that's the issue; if you just throw all the data at a NLLSQ algorithm trying to estimate 32 parameters (mag and phase for sixteen functions), it'll fail miserably unless you have some way a priori to associate which point(s) belong to which term; otherwise it just looks basically like random noise.
采纳的回答
更多回答(1 个)
Matt J
2018-7-11
0 个投票
You need to implement a sort of sinusoidal Hough transform. Bin the 2D space of coordinates (A,phi) into cells and loop over the cells. For each combination (A,phi), generate the appropriate curve y=f(x) and see how many points lie within a tolerance region of that curve. This will give you a tableau Counts(A,phi). The top 16 peaks in that tableau will give you your 16 sinusoids.
3 个评论
dpb
2018-7-11
Ah...that's not a bad idea at all...
Ahmad Hamad
2018-7-12
Matt J
2018-7-12
You could start with coarse sampling, e.g., 10x10x10 and gradually refine.
类别
在 帮助中心 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

