diff --git a/REQUIRE b/REQUIRE index 8debf7d5154ece2ac5b6109aac40b618df14c5bc..2d16982f767f0521c641ce61b7efff0d9d590608 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,3 @@ SCS Convex +DSP diff --git a/src/SystemIdentification.jl b/src/SystemIdentification.jl index 655bec8d051137b86304a597a0e7531fab5dcc19..155553f0feecbb7a2b798e9422009a373f9c7c65 100644 --- a/src/SystemIdentification.jl +++ b/src/SystemIdentification.jl @@ -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 diff --git a/src/transfer_functions.jl b/src/transfer_functions.jl index d862c4a03469fed438a08ca07df285330a5960ad..eb0814b5001950c65048119fab3b197a3ca42f59 100644 --- a/src/transfer_functions.jl +++ b/src/transfer_functions.jl @@ -1,17 +1,19 @@ 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))