|
Hey,
(my first post in this forum)
I am trying to fit a curve to a measured bode plot.
I.e. I've been plotting measured data in a bode plot, say...
f = [1 3 5 1e1 3e1 5e1 1e2 3e2 5e2 1e3 3e3 5e3 1e4 3e4 ...
5e4 1e5 3e5 5e5 1e6];
amp = [2.85 2.81 2.85 2.81 2.81 2.78 2.75 2.28 2 1.56 1.08 ...
.94 .85 .75 .70 .66 .5 .41 .33];
phase = -[2 3 3 4 7 8 13 22 29 32 26 26 16 17 18 18 26 29 30];
subplot 211
semilogx(f,amp)
subplot 212
semilogx(f,phase)
...then I want to find a model/parameters which fits with this bode plot.
I already know that there should be one pole (around 100Hz) and one zero (around 1200Hz) for this plot, but I first want to fit a curve and then afterwards find the zero, the pole and the amplitude levels from the fitted curve. So I need some kind of curvefit (least-squares) for the bode plot. But I don't think lscurvefit does the job, however I might be wrong.
I've been trying several methods and been searching google (combining searches on 'regression', 'bode', 'least squares', 'curvefit') and matlabwiki with no results. Is there an easy way to do this (built-in matlab function) or do I have to make it myself for this case?
Would be great if someone had a quick way to do this. I am able to make it myself but it might be faster if someone knew a matlab method which can be easily modified to do this. Cheers,
Anders
|