I have some circuit that i need to optimize and looks like sin wave. I use lsqcurvefit to optimize my circuit as close to sin wave. This part is actually pretty easy:
[m,N] = size(xdata);
I need to draw someting like sin wav based on x0 after optimaliation but I need in this polt that thd(Total harmonic distortion - so actually a function) that will be less than 1. So in short - after optimazation I need to check that my output meet my constraints based on function - if not try again.
Can you help me with this one?