cancel
Showing results for
Did you mean:
cancel
Showing results 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

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
11-Garnet
(To:ptc-2676093)
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
1-Newbie
(To:ptc-2676093)
That one does it all, put in trig form if you wish.

jmG
19-Tanzanite
(To:ptc-2676093)
See the worksheet here:

Richard
23-Emerald I
(To:ptc-2676093)
Sounds like a job for an FFT (CFFT?)
Fred Kohlhepp
fkohlhepp@sikorsky.com
1-Newbie
(To:ptc-2676093)
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
1-Newbie
(To:ptc-1368288)
Spline smoothlet demo attached.

jmG
Announcements
Top Tags