Jerry Avins wrote:> banton wrote: ... > > > I want to use this for extraplation of a 1d motion (like > > a fader). > > e.g. if I would move a fader the system would find the parameters of > > a damped sinusoid for the sampled motion and would create a control > > signal from the estimated parameters. (I also wanted to learn > > something about state-space realizations, that is why I was > > putting it in this form). > > Any suggestions, ideas or corrections are appreciated. > >Will moving a fader necessarily provide exponential damping?That's a good point. However, one must note that Anton's ansatz was that the fader motion satisfies a linear recurrence of second order, ie. y[n] =3D a * y[n-1] + b * y[n-2] . Damped sinusoids are just one class of solution to this equation. If you set a =3D 2 and b =3D -1, the solution is a second order polynomial curve. But I do agree that this model may be unrealistic. Also, I don't quite understand why the fader motion needs to be extrapolated to generate the control signal - why not just take the (pre-processes) fader motion directly? Regards, Andor> > Jerry > -- > Engineering is the art of making what you want from things you can get. > =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF==AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF
parameters of sinusoid
Started by ●November 26, 2006
Reply by ●November 26, 20062006-11-26
Reply by ●November 26, 20062006-11-26
>banton wrote: > > ... > >> I want to use this for extraplation of a 1d motion (like >> a fader). >> e.g. if I would move a fader the system would find the parameters of >> a damped sinusoid for the sampled motion and would create a control >> signal from the estimated parameters. (I also wanted to learn >> something about state-space realizations, that is why I was >> putting it in this form). >> Any suggestions, ideas or corrections are appreciated. > >Will moving a fader necessarily provide exponential damping?Hi Jerry, If we would be simple robots.. maybe. Of course not. I am just trying different methods of extrapolations, so I started with something simple which I can maybe achieve in a finite time. I also thought about lpc but I wanted to see what I can achieve with looking at a minimal number of samples first. Andor asked what I want to control: Parameters for sound synthesis. So there is a lot of room for "errors". As long as I can achieve some extrapolation which is visibly (and audible) related to the motion, I might be happy with it. I am not looking at the stock market. gr. Anton
Reply by ●November 26, 20062006-11-26
Andor wrote:>Jerry Avins wrote: >> banton wrote: ... >> >> > I want to use this for extraplation of a 1d motion (like >> > a fader). >> > e.g. if I would move a fader the system would find the parameters of >> > a damped sinusoid for the sampled motion and would create a control >> > signal from the estimated parameters. (I also wanted to learn >> > something about state-space realizations, that is why I was >> > putting it in this form). >> > Any suggestions, ideas or corrections are appreciated. >> >>Will moving a fader necessarily provide exponential damping? > >That's a good point. However, one must note that Anton's ansatz was >that the fader motion satisfies a linear recurrence of second order, >ie. > >y[n] =3D a * y[n-1] + b * y[n-2] . > >Damped sinusoids are just one class of solution to this equation. If >you set a =3D 2 and b =3D -1, the solution is a second order polynomial >curve. But I do agree that this model may be unrealistic. > >Also, I don't quite understand why the fader motion needs to be >extrapolated to generate the control signal - why not just take the >(pre-processes) fader motion directly?Hi Andor, A fader is just what I use know to try out extrapolation methods. What I have in mind is a performer (electronic music) that controls parameters for sound synthesis. The performer would start streams of sound with a gesture and the structure of those streams (or voices if you want) would continue this gesture in a way which should be clearly a result of that gesture. So those gestures would be just one short movement which implies a sound which continous longer than the sensed motion, but is related to it. The model that I stated might be really unsuitable to achieve results that would convince me, but hey.. I don't know a lot about prediction or estimation, so I have to start somewhere, and this model would (hopefully) at least be related to the periodicity of the motion (it oscillates instead of just drifting away or approaching a constant) gr. Anton
Reply by ●November 26, 20062006-11-26
"Tim Wescott" <tim@seemywebsite.com> wrote in message news:CNCdnWvn8ME8e_TYnZ2dnUVZ_rWdnZ2d@web-ster.com...> Peter Nachtwey wrote: >> Tim Wescott wrote: >> >>>banton wrote: >>> >>> >>>>Hello, >>>> >>>>The following system (in state-space form) >>>>gives a damped sinusoid >>>> >>>>A = >>>>[ 0 1 ] >>>>[ -0.98 1.365 ] >>>> >>>>C = [ 1 0 ] >>>> >>>>x[n+1] = A x[n] >>>>y = C x[n] >>>> >>>>A is the state-matrix, x the state (with initial condition [1;0]) >>>>and y the output. >>>> >>>>Now if I have a known output can I somehow find the state-matrix A? >>>>I know that it is possible to find the parameters of a >>>>damped sinusoid from 3 samples. So it has to be possible to >>>>find a state-matrix from a known output which is >>>>assumed to be a sine-wave. >>>> >>> >>>No you cannot, and no it is not. >>> >>>Altogether, A and C have six parameters. Your damped sinusoid only >>>specifies three. Without restricting three of the parameters in some >>>way you cannot fully specify the system from the original damped >>>sinusoid. >>> >>>You should, however, be able to specify a three-dimensional surface in >>>six-dimensional space, any point on which will yield the same output for >>>the same starting state. >>> >> >> I don't see why it can't be done. I don't see where there are 6 >> parameters that need to be calculated. Only the lower two numbers of >> the A array will change. >> > There is no law that says only the lower two numbers will change.The A array in the continous domain for a damped sinusoid is [ 0 1 ; -omega^2 -zeta*omega . There are two things wrong with banton's example. First it must be a damped cosine because the position starts at 1 and the velocity starts at 0. Second, the term in the lower right corner of the A array must be negative.> You may choose to only change the lower two numbers of the A matrix, and > to constrain the C matrix to being C = [c 0] to accommodate amplitude > changes in the response -- but you're doing exactly what I was talking > about, constraining three of the available six numbers and only adjusting > the remaining three.That would meet banton's goal.> So you cannot find _the_ state matrix (and output matrix) from the > provided data, because there isn't a unique solution.banton doesn't need to. Assume C is [ 1 0 ]. Focus and the goal. Peter Nachtwey
Reply by ●November 26, 20062006-11-26
"Rune Allnor" <allnor@tele.ntnu.no> wrote in message news:1164551568.550452.139060@l39g2000cwd.googlegroups.com...> > banton skrev: >> Hello, >> >> The following system (in state-space form) >> gives a damped sinusoid > ... >> Now if I have a known output can I somehow find the state-matrix A? > > I think Kalman filters are used to identify parameters > of state-space models. > > Rune >No, the state space parameters are necessary for the model part of the Kalman filter so it can make good estimates. These state space parameters must be determined using some sort of system identification using techniques such as least squares system identification or Levenberg-Marquardt. The Kalman gains are used to determine the weight is given to the error between the feedback and the estimate from the model. Peter Nachtwey
Reply by ●November 26, 20062006-11-26
"banton" <bantone@web.de> wrote in message news:ScOdnafL2IjIfPTYnZ2dnUVZ_v-dnZ2d@giganews.com...> > >>I can find the parameters> of an undamped sinusoid from 3 samples, but for a damped one > I need 4 samples. Because for the undamped one a=1, so I just > need to find b. (I am unsure about everything I am saying here) > Let's drop the state-space stuff (I hoped it would give me > a easier view on it...) and look at it this way: > > y[n] = a * y[n-1] + b * y[n-2] > > now I have a signal and I want to get to 'a' and 'b' from > a given set of samples 'y'.Now you need to keep track of y[n]. I think it would be easier to keep the system in a higher form like what I first suggested.> As I said I guess I need 4 samples to find a unique solution. > Like this: > > y[3] = a y[2] + b y[1] > y[4] = a y[3] + b y[2] > > and the y's are known.Still easy but you must know all the y's.> > I want to use this for extraplation of a 1d motion (like > a fader). > e.g. if I would move a fader the system would find the parameters of > a damped sinusoid for the sampled motion and would create a control > signal from the estimated parameters. (I also wanted to learn > something about state-space realizations, that is why I was > putting it in this form). > Any suggestions, ideas or corrections are appreciated.Use least squares system identificaiton or Levenberg Marquardt to ID the system. This is easy to do with a math package. Peter Nachtwey
Reply by ●November 27, 20062006-11-27
Peter Nachtwey wrote:> "Tim Wescott" <tim@seemywebsite.com> wrote in message > news:CNCdnWvn8ME8e_TYnZ2dnUVZ_rWdnZ2d@web-ster.com... > >>Peter Nachtwey wrote: >> >>>Tim Wescott wrote: >>> >>> >>>>banton wrote: >>>> >>>> >>>> >>>>>Hello, >>>>> >>>>>The following system (in state-space form) >>>>>gives a damped sinusoid >>>>> >>>>>A = >>>>>[ 0 1 ] >>>>>[ -0.98 1.365 ] >>>>> >>>>>C = [ 1 0 ] >>>>> >>>>>x[n+1] = A x[n] >>>>>y = C x[n] >>>>> >>>>>A is the state-matrix, x the state (with initial condition [1;0]) >>>>>and y the output. >>>>> >>>>>Now if I have a known output can I somehow find the state-matrix A? >>>>>I know that it is possible to find the parameters of a >>>>>damped sinusoid from 3 samples. So it has to be possible to >>>>>find a state-matrix from a known output which is >>>>>assumed to be a sine-wave. >>>>> >>>> >>>>No you cannot, and no it is not. >>>> >>>>Altogether, A and C have six parameters. Your damped sinusoid only >>>>specifies three. Without restricting three of the parameters in some >>>>way you cannot fully specify the system from the original damped >>>>sinusoid. >>>> >>>>You should, however, be able to specify a three-dimensional surface in >>>>six-dimensional space, any point on which will yield the same output for >>>>the same starting state. >>>> >>> >>>I don't see why it can't be done. I don't see where there are 6 >>>parameters that need to be calculated. Only the lower two numbers of >>>the A array will change. >>> >> >>There is no law that says only the lower two numbers will change. > > > The A array in the continous domain for a damped sinusoid is [ 0 1 > ; -omega^2 -zeta*omega .You mean [0 1; -omega^2 -2*zeta*omega]. That is but one possible A matrix. Another is [0 -omega^2; 1 -2*zeta*omega]. Yet another is [-zeta*omega -sqrt(1 - zeta^2)*omega; sqrt(1 - zeta^2)*omega -zeta*omega]. You can choose any two positions of the matrix and constrain them to be nearly any values that you want, and I can give you numbers for the other two that will come out with a specified pair of eigenvalues. That's what I meant by "not a unique solution". If you're just interested in getting a matrix representation that yields the desired behavior from initial state to output you can just pick your desired form (which pins three of the available six parameters) and figure out the other three, exactly as I said. If you are interested in a model that matches the reality (such as getting the velocity and position of a spring/damper system) you need to dig deeper. Ditto if you are interested in a model that leads to the best computational efficiency.> There are two things wrong with banton's example. > First it must be a damped cosine because the position starts at 1 and the > velocity starts at 0. Second, the term in the lower right corner of the A > array must be negative. >The initial state of a system says nothing about it's state evolution. The starting point is just the starting point; where it goes is up to the system.> >> You may choose to only change the lower two numbers of the A matrix, and >>to constrain the C matrix to being C = [c 0] to accommodate amplitude >>changes in the response -- but you're doing exactly what I was talking >>about, constraining three of the available six numbers and only adjusting >>the remaining three. > > That would meet banton's goal. >I'm glad you know that. Since he never stated what he really wanted I can't be so sure.> >>So you cannot find _the_ state matrix (and output matrix) from the >>provided data, because there isn't a unique solution. > > > banton doesn't need to. Assume C is [ 1 0 ]. Focus and the goal. >If he's just interested in a transfer function, no he doesn't. Indeed, he has since clarified that he's just interested in the transfer function, so either we're having an interesting philosophical discussion or this thread has degenerated. Or both. That doesn't change the fact that his original question was vague, and contained implicit assumptions about state space systems that will, at best, restrict the range of answers he can get and that at worst will lead him down the garden path to thinking he's achieved an understanding that he hasn't. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by ●November 27, 20062006-11-27
Peter Nachtwey wrote:> "Rune Allnor" <allnor@tele.ntnu.no> wrote in message > news:1164551568.550452.139060@l39g2000cwd.googlegroups.com... > >>banton skrev: >> >>>Hello, >>> >>>The following system (in state-space form) >>>gives a damped sinusoid >> >>... >> >>>Now if I have a known output can I somehow find the state-matrix A? >> >>I think Kalman filters are used to identify parameters >>of state-space models. >> >>Rune >> > > No, the state space parameters are necessary for the model part of the > Kalman filter so it can make good estimates. These state space parameters > must be determined using some sort of system identification using techniques > such as least squares system identification or Levenberg-Marquardt. The > Kalman gains are used to determine the weight is given to the error between > the feedback and the estimate from the model. > > Peter Nachtwey > >"Adaptive Control" by Astrom and Wittenmark, second edition, chapter 2, page 51, remark 2: "The least-squares estimate can be interpreted as a Kalman filter for the process...". For off-line system ID using a Kalman filter would probably be terribly inefficient, but if you must do it on-line and step-by-step it can be the most efficient way around. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html






