Commit ca562212 authored by Fredrik Bagge Carlson's avatar Fredrik Bagge Carlson
Browse files

TF -> TFdata

parent a490a644
......@@ -4,7 +4,7 @@ export
Model,LinearModel,NonLinearModel,
Network,
Polynom,PolynomMatrix,
TF,
TFdata,
AR,
ARX,
RBFARX,
......@@ -18,6 +18,7 @@ toeplitz, kalman
## Fit Methods =================
:LS
:LS_reg
:L1
:LM
## Types =======================
......@@ -59,7 +60,7 @@ type ARX <: LinearModel
nb::Polynom{Int}
end
type TF <: LinearModel
type TFdata <: LinearModel
P
F
end
......
using DSP
function tfest(y,u)
Cyu = xcorr(y,u)
Cuu = xcorr(u,u)
Syu = welch_pgram(Cyu)
Suu = welch_pgram(Cuu)
return H = TF(Syu.power./Suu.power,Syu.freq)
return H = TFdata(Syu.power./Suu.power,Syu.freq)
end
tfest(iddata::IdData) = tfest(iddata.y,iddata.u)
N = 200000;
u = randn(N);
y = filt(ones(30),30,u);
y = filt(ones(5),5,u);
H = tfest(y,u);
loglog(H.f,abs(H.P))
semilogy(H.F,abs(H.P))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment