cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to solve for an unknown sine wave

ptc-2676093
1-Newbie

How to solve for an unknown sine wave

I have data collected from an oscilloscope and I am trying to create an ideal sine wave to match the collected data. I need to solve for amplitude, frequency, phase, and DC offset. (n = amplitude * sine (frequency * x + phase) + offset)

My goal is to have an automated process that will use a solve block or something similar to come up with the best fit for all of these parameters. Does anyone have an idea of how to solve this?

Thanks,
Dale
6 REPLIES 6

You can set up a solve block equating a vector evaluation of your function (with parameters) to the measurements, or use minerr. Check out the help and the Quicksheet examples.

You need to give initial estimates of all the paramters. You can estimate amplitude from the max-min of measurements, take the mean as an offset estimate. Use one of the DFT functions to estimate freq (compute from the index at max magntude). I think you can start with any phase (e.g. zero) and get convergence if the other parameters are reasonably estimated.

For any automated process, I recommend that you compute the actual error/goodness-of-fit given by the purported solution (with actions as appropriate) just to make sure the solving algorithm hasn't put you off in deep space.

If you still have trouble, post an example worksheet with whatever you have done.

Lou

That one does it all, put in trig form if you wish.

jmG
RichardJ
19-Tanzanite
(To:ptc-2676093)

See the worksheet here:

http://collab.mathsoft.com/read?124003,63

Richard

Sounds like a job for an FFT (CFFT?)
Fred Kohlhepp
fkohlhepp@sikorsky.com

On 4/29/2010 10:23:36 AM, dmradcliff wrote:
>I have data collected from an
>oscilloscope and I am trying
>to create an ideal sine wave
>to match the collected data.
>I need to solve for amplitude,
>frequency, phase, and DC
>offset. (n = amplitude * sine
>(frequency * x + phase) +
>offset)
>
...
>Thanks,
>Dale
_______________________________

Alternately and in conjonction to "ideal sine", it's probably possible to run a spline smoothlet. Comparing both will result in an analytical "deviation function" which is in fact of more indicative value than a simple residual bar plot. All discrete filtering/smoothing do distort. Your project as a typical demo might takes only few minutes.

jmG

Spline smoothlet demo attached.

jmG
Top Tags