You are on page 1of 5

BurakYILMAZ

2009502076

EED4303LABREPORT6
1) Inthefirstquestionwewereaskedtofindtheimpulseresponsefunctionofgivendataset.The
resultsasfollows

clc
clearall
u=[11111111111]
y=[00.130.090.100.100.100.170.080.110.100.10]
t=1:13

N=length(u)
l=0

forl=1:11

buff=0
a=0
forj=1:Nl
a=(1/(Nl))*u(j)*u(j+l)
buff=buff+a
end
ruu(l)=buff
end

forp=1:11
buff2=0
a=0
fork=1:Np
a=(1/(Np))*u(k)*y(k+p)
buff2=buff2+a
end
ruy(p)=buff2
end

Ruu=toeplitz(ruu)

g=inv(Ruu)*ruy'
stem(g)

2)InthesecondquestionwewereaskedtofindLSEofimpulseresponsecoefficient.Aftertheestimation
processtheresiduals.
clc
clearall
g1=0.0835
g2=0.0601
g3=0.0442
N=11
par=3

u=[11111111111]
y=[00.130.090.100.100.100.170.080.110.100.10]
t=1:13

fi1=u(3:11)
fi2=u(2:10)
fi3=u(1:9)

fi=[fi1'fi2'fi3']

y=y(3:11)
y=y'
est=inv(fi'*fi)*fi'*y

e=yfi*est
stem(e),title('Residuals')

covE=(1/Npar)*sum(e.^2)*mean((fi'*fi)^(1))
covE

est=

0.0014
0.1350
0.0364

3)Inthelastquestionwesimplifiedthegivenfunctionbyusingtrigonometry.Accordingtogivenfrequency
wefoundtheestimateofamplitude(A)andphasedifference.
clc

clearall

t=[2.1883.0434.2074.9375.6756.1046.2607.1508.6009.655]

y=[1.1122.3581.8071.2020.8141.2982.5200.1321.4210.302]

y=y'
w=4*pi

fori=1:10

fi(i,:)=[sin(w*t(i))cos(w*t(i))]

end


v_est=inv(fi'*fi)*fi'*y

A=sqrt(v_est(1)^2+v_est(2)^2)
theta=atan(v_est(2)/v_est(1))
A
theta

A=

2.5036

theta=

1.2938

CONCLUSION

Inthisexperimenttheleastsquareestimationmethodtoestimatesystemparameterworkedon.In
thismethodLeastsquareestimationisamethodtoestimatetheunknownsfromgivendatabyusing
predictionerrors.
Byusingtheparameterestimationformulaonecaneasilyestimatetheparametervalues.Butthe
realimportantpointisthecorrectnessoftheestimatedparameters.Atthispointaccuracyoftheparameters
shouldbedetermined.Todothiscovarianceofthematricesused.Ifthefoundstandarddeviationsare
higherorsoclosetoestimatedparameterswecansaythattheestimationisnotcorrect.
Forourexamplewecanseethatthestandarddeviationsforfirstandthirdparametersareabithigh
forsecondquestion.

You might also like