1
$\begingroup$

How I can approximate the signal $x(t)=0.001\,t^3 \exp(-0.1t)$ in the interval $[0,100]$ using a linear combination of the following functions:

$f_1(t)=A_1$

$f_2(t)=A_2\cos(0.05t)$

$f_3(t)=A_3\cos(0.1t)$

$f_4(t)=A_4\cos(0.2t+1)\exp(-0.2t)$

$f_5(t)=A_5\,t^3$

I try to write a matlab code. Is this correct?

t=[0:100];
x_t=0.001*(t.^3).*exp(-0.1*t); %signal given for aproximation
f1_t=x_t.^0;
f2_t=cos(0.05*x_t);
f3_t=cos(0.1*x_t);
f4_t=cos(0.2*x_t+1).*exp(-0.2*x_t);
f5_t=x_t.^3;
M=[f1_t' f2_t' f3_t' f4_t' f5_t']; %matrix with linear components
A=M\x_t'; %matrix with coefficients
f_t=(A(1)*f1_t)+(A(2)*f2_t)+(A(3)*f3_t)+(A(4)*f4_t)+(A(5)*f5_t);
figure(1),plot(f_t);
$\endgroup$
  • 1
    $\begingroup$ What's your question? If you execute the above MATLAB code and compare the plot against the target function $x(t) = 0.001t^2\exp(-0.1t)$, then it looks like they agree pretty well. $\endgroup$ – Jason R May 19 '13 at 20:42
  • $\begingroup$ I am not sure if the right way of doing a signal aproximation is what i have implement in code. $\endgroup$ – 20317 May 19 '13 at 20:53
3
$\begingroup$

The method you chose is a standard least squares approximation, i.e. you minimize the sum of squared errors on the chosen grid. You obtain your coefficients by solving an overdetermined system of linear equations in a least squares sense. I think that's a very sane approach.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.