i need a a little help since im stuck since weeks..
I need to fit -lets say- Curve C to Curve D. Curve D is fix, Curve C is calculated from Curve B - Curve A. Curve A and B can be shifted and can be compressed, thus Curve C is shifted and compressed. Curve A and B can be compressed and shifted independently and in my work have more elements than Curve C. The shift and compression of Curve A shall be calculated automatically. (Parameters of shift and compression can be set manually for Curve B)
How do i fit Curve C to Curve D in respect to Curve A AND calculate the shift and compression from Curve C to Curve D, or better directly the shift and compression of Curve A?
i can use lsqr with Curve_C * x = Curve_D, but this happends in no relation to Curve A and Curve B.
x_shift = -trapz(y,x_C-x_D)/abs(ylims_2-ylims_1)
but i neglect the compression. Right now, the compression can be manually set as an input, but thus this problem can be solved directly in matlab, i want to do that for my thesis.
The big problem i see is that Curve C change its look when f.e. only Curve A is shifted. Thus it is difficult to fit the Curve C directly to Curve D.
In the attachment you can see a png file of my problem and example data.
Thanks in advance!