Info

This question is closed. Reopen it to edit or answer.

Matlab modle (using curve fit tool) not matching Labquest model.

1 view (last 30 days)
We are analyzing sound pressure data. By recording sound from 1 source in to microphones separated at a distance of x=.25 meters. By modeling you can derive the velocity of sound from the difference of phase angles.
This works well when modeling with the Labquest device. However when using matlab I get different numbers for my phase (c).
I am using the custom equation function. (a*cos(2*pi*500*x+c)+d) The model seems to work well with a good fit but the calculation with matlab leads to a Speed of sound of 441m/s when its really around 341m/s.
Is there somthing i am doing with matlab incorrectly when modeling using the curve fit tool?
To be clear C=phase angle=.19 for mic1 from Labquest and C2=-2.65. Giving a difference of phase=2.44rad/s
However matlab gives
C=0.02785
C2=1.343
c-c2=completely not right.
Velocity equation used: V=(x*Hz*2*pi)/(c2-c1)
x=displacement
I have attached pictures of the models from matlab. Thank you for your help.
  2 Comments
Charles
Charles on 20 Jun 2014
Also why does matlab assign a negative coeffcient to my equation. I type a*cos(b*x+c)+d. In the Results window you see: -a*cos(b*x+c)+d
dpb
dpb on 20 Jun 2014
The two datasets aren't particularly close to each other; not sure why you would think you would get the same fitted results. There is quite a lot more distortion from a pure cosine in the second than the first so I'm not surprised the model doesn't come up with very good estimates for the physical parameters given that disparity. I'd presume if you use the same data in the two packages you'll get similar results.

Answers (0)

Community Treasure Hunt

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

Start Hunting!