04-17-2008 10:34 AM
04-17-2008 11:35 AM
04-17-2008 12:13 PM - edited 04-17-2008 12:16 PM
Periodic functions can be very hard to fit if your guesses are wrong, because you can equally well fit to an alias frequency or a phase shifts corresponding to an integer multiple of the wavelength.
Anyway, If your initial estimates are reasonable, you should have no problem. In your case, just graph also the function calculated with the initial estimate and you can see that it is almost inverted (A1=-01, vs. A1=0.1, different sign!). Here's it can roll either way or go off into the woods. You can even interactively adjust the guesses until things look similar before fitting.
If your data typilcally looks similar (less than one full wave, one frequency, etc.) you should calculate the initial estimates from features in the data (average Y, max(y), min(y), x(max Y), x(min(y), etc.) Now things will be much more robust!
To make sure we're not dealing with an alias frequency, I also typically graph the final function calculated with much denser x-values and use an xy graph.
You might also use wires for the function as follows. Looks nice and is easier to debug.
04-18-2008 02:34 PM
04-18-2008 03:14 PM
DSPGuy wrote:
A reasonable starting point can be usually be found using the Extract Single Tone information.vi, and Basic Averaged DC-RMS.vi.
04-20-2008 11:50 AM
04-21-2008 08:40 AM
04-21-2008 10:52 AM
johnsold wrote:
If you have two zero crossings you can get a pretty good estimate of the frequency from that.
04-21-2008 11:30 AM