I still won't be able to wade through your file as I am missing expertise on my side and more comments in the file on yours. Whenever I try I loose track. So I didn't check how you manipulated your signals but concentrated on the sums at the end of the "unfiltered" section (in the "Sine fitted" section you would have to work on the problem with the different dimensions of vectors first, I think).
You didn't spot the zeros Alan was talking about? Look at the vector Xdd for example - the first 344 elements are zero, so all elements from number 40 to nr 65 are zero. But as you didnt saw the zeros I think you have a problem with the understanding of the sum. What did you think that the expression
would do? I guess you thought that it will look up your vector tX and sums up the expression for all values in the involved vectors which correspond to elements in your vector tX which are in the range from 40 to 65.
But thats not true. The expression above will run an integer variable tX (which has nothing to do with your vector tX) from 40 to 65 in steps of 1 and calculate the expression and adds it to the sum. In the example above the same result would be calculated 26 times and it would use the full vectors Fhydro, Xdd, etc. Sure not what you had in mind.
See in the attached file a solution to this - are the values Cd and Cm more reasonable now?