- refactored
This commit is contained in:
Executable
+2
@@ -0,0 +1,2 @@
|
||||
cd f:
|
||||
cd \work\dpa\matlab\sim\kap2
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
cd f:
|
||||
cd \work\dpa\matlab\sim\kap4
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
% Magnitude Estimation von x
|
||||
% Schätzung des mittleren Betrages von x
|
||||
% mit kombinierter Anstiegs- und Abfallzeit trf
|
||||
% ---------------------------------------------
|
||||
%
|
||||
% Aufruf:
|
||||
% function [mx,mxf] = mx(x,trf,mxi)
|
||||
%
|
||||
% Parameter:
|
||||
% x : Eingangsvektor
|
||||
% trf : Zeitkonstante Anstiegs- und Abfallzeit
|
||||
% mxi : Initial Condition Anfangsbetrag von x
|
||||
%
|
||||
% Rückgabewerte:
|
||||
% mx : Ausgang mittlerer Betrag von x
|
||||
% mxf : Endbetrag von x
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Datum : 26.07.2001
|
||||
% Autor : Jens Ahrensfeld
|
||||
% Thema : Diplomarbeit
|
||||
% Datei : mx.m
|
||||
% Benötigte Dateien: filter, lge, abs
|
||||
%
|
||||
% -------------------------------------------------------------------------
|
||||
function [mx,mxf] = mx(x,trf,mxi)
|
||||
|
||||
N = lge(x);
|
||||
x(1) = x(1) + mxi*(1/trf-1);
|
||||
%x = abs(x);
|
||||
a = [1,-(1-trf)];
|
||||
mx = filter(trf,a,x);
|
||||
mxf = mx(N);
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Ende mx.m
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
% Magnitude Estimation von x
|
||||
% Schätzung des mittleren Betrages von x
|
||||
% mit getrennter Anstiegs- und Abfallzeit tr, tf
|
||||
% ----------------------------------------------
|
||||
%
|
||||
% Aufruf:
|
||||
% function [mx,mxf] = mx2(x,tr,tf,mxi)
|
||||
%
|
||||
% Parameter:
|
||||
% x : Eingangsvektor
|
||||
% tr : Zeitkonstante Anstiegszeit
|
||||
% tf : Zeitkonstante Abfallzeit
|
||||
% mxi : Initial Condition Anfangsbetrag von x
|
||||
%
|
||||
% Rückgabewerte:
|
||||
% mx : Ausgang mittlerer Betrag von x
|
||||
% mxf : Endbetrag von x
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Datum : 27.03.2002
|
||||
% Autor : Jens Ahrensfeld
|
||||
% Thema : Diplomarbeit
|
||||
% Datei : mx2.m
|
||||
%
|
||||
% -------------------------------------------------------------------------
|
||||
function [mx,mxf] = mx2(x,tr,tf,mxi)
|
||||
|
||||
N = lge(x);
|
||||
x = abs(x);
|
||||
mx(1) = mxi;
|
||||
|
||||
for n = 2:N,
|
||||
if(x(n) > mx(n-1))
|
||||
mx(n) = tr*x(n) + (1-tr)*mx(n-1);
|
||||
else
|
||||
mx(n) = tf*x(n) + (1-tf)*mx(n-1);
|
||||
end;
|
||||
end;
|
||||
mxf = mx(N);
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Ende mx2.m
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
% Long-Term Magnitude Estimation von x
|
||||
% -------------------------------------
|
||||
%
|
||||
% Aufruf:
|
||||
% Function [xl,xlf] = xlte(x,xs,af,pl,xli)
|
||||
%
|
||||
% Parameter:
|
||||
% x :
|
||||
% ar :
|
||||
% af :
|
||||
% xsi :
|
||||
%
|
||||
% Rückgabewerte:
|
||||
% xs :
|
||||
% xsf :
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Datum : 26.07.2001
|
||||
% Autor : Jens Ahrensfeld
|
||||
% Thema : Diplomarbeit
|
||||
% Datei : xste.m
|
||||
% Benötigte Dateien:
|
||||
%
|
||||
% -------------------------------------------------------------------------
|
||||
function [xl,xlf] = xlte(x,xs,af,pl,xli)
|
||||
|
||||
N = lge(x);
|
||||
x = abs(x);
|
||||
xl(1) = xli;
|
||||
|
||||
for n = 2:N,
|
||||
if(xs(n) > pl*xl(n-1))
|
||||
xl(n) = xl(n-1);
|
||||
else
|
||||
xl(n) = af*x(n) + (1-af)*xl(n-1);
|
||||
end;
|
||||
end;
|
||||
xlf = xl(N);
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Ende xlte.m
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
% Short-Term Magnitude Estimation von x
|
||||
% -------------------------------------
|
||||
%
|
||||
% Aufruf:
|
||||
% Function [xs,xsf] = xste(x,ar,af,xsi)
|
||||
%
|
||||
% Parameter:
|
||||
% x :
|
||||
% ar :
|
||||
% af :
|
||||
% xsi :
|
||||
%
|
||||
% Rückgabewerte:
|
||||
% xs :
|
||||
% xsf :
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Datum : 26.07.2001
|
||||
% Autor : Jens Ahrensfeld
|
||||
% Thema : Diplomarbeit
|
||||
% Datei : xste.m
|
||||
% Benötigte Dateien:
|
||||
%
|
||||
% -------------------------------------------------------------------------
|
||||
function [xs,xsf] = xste(x,ar,af,xsi)
|
||||
|
||||
N = lge(x);
|
||||
x = abs(x);
|
||||
xs(1) = xsi;
|
||||
|
||||
for n = 2:N,
|
||||
if(x(n) > xs(n-1))
|
||||
xs(n) = ar*x(n) + (1-ar)*xs(n-1);
|
||||
else
|
||||
xs(n) = af*x(n) + (1-af)*xs(n-1);
|
||||
end;
|
||||
end;
|
||||
xsf = xs(N);
|
||||
|
||||
% -------------------------------------------------------------------------
|
||||
% Ende xste.m
|
||||
Reference in New Issue
Block a user