# How to find out the control function of a cosine wave?

I have a system which is sampling at 100Hz. There is only one input for the system. The output is similar to cosine waveforms with varying frequency. I have no clue how to find out the exact formula to put into the cosine function to generate the exact output as the system. Please give me some suggestion. Thanks

Here are some data

When input = 0.1, local max occurs at the following data points

1 3545 5014 6140 7090 7927 8684 9379

When input = 0.2,

1 2507 3545 4342 5014 5605 6140 6632 7090 7520 7927 8314 8684 9038 9379 9709

When input = 0.3,

1 2047 2895 3545 4094 4577 5014 5415 5789 6140 6473 6788 7090 7380 7658 7927 8187 8439 8684 8922 9153 9379 9600 9816

-
While this ought to be far too little information to answer the question, it looks like your data points increase in a $\sqrt n$ fashion, which suggests that the function is of the form $\cos(ct^2)$ for some $c$. For example, I get a pretty good fit to your second data set with $\cos(t^2/200)$, where $t$ is in seconds. – Rahul Apr 6 '12 at 19:02

The trick is to compute the square of your values and then the differences between these squares :

v1=[1, 3545, 5014, 6140, 7090, 7927, 8684, 9379]
vector(#v1-1,k,v1[k+1]^2-v1[k]^2)
= [12567024, 12573171, 12559404, 12568500, 12569229, 12574527, 12553785]
(mean value $m_1=12566520$)

v2=[1, 2507, 3545, 4342, 5014, 5605, 6140, 6632, 7090, 7520, 7927, 8314, 8684, 9038, 9379, 9709] vector(#v2-1,k,v2[k+1]^2-v2[k]^2)
= [6285048, 6281976, 6285939, 6287232, 6275829, 6283575, 6283824, 6284676, 6282300, 6286929, 6285267, 6289260, 6273588, 6280197, 6299040]
(mean value $m_2=6284312$)

with $\dfrac{m1}{m_2}=1.99966\cdots$ a rather good approximation of $2$ !

Your function could be given by $f(x)= a\cdot \cos(b\cdot I\cdot x^2)\$ with $I$ the input and $a$ and $b$ two constants.

Let's find $b$ for $I=0.1$ we must have $2\pi = b\cdot 0.1\cdot 12566520$ so that $b=\dfrac {2\pi\cdot 10}{12566520}\approx 5\cdot 10^{-6}$ and your answer should be near of : $$f(x)= a\cdot \cos\left(5\cdot 10^{-6}\cdot I\cdot x^2\right)$$ (or $\cdots (x-1)^2)$ if you prefer...)

Here is a plot of the result for $I=0.1$ :

-