summaryrefslogtreecommitdiff
path: root/cesar/cp2/pwl/doc/scilab/src
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/cp2/pwl/doc/scilab/src')
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/estimateBP.sce5
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/zc_capture.sce5
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/zc_capture_decrease.sce21
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/zc_capture_increase.sce21
4 files changed, 46 insertions, 6 deletions
diff --git a/cesar/cp2/pwl/doc/scilab/src/estimateBP.sce b/cesar/cp2/pwl/doc/scilab/src/estimateBP.sce
index 9564822286..3f7329db01 100644
--- a/cesar/cp2/pwl/doc/scilab/src/estimateBP.sce
+++ b/cesar/cp2/pwl/doc/scilab/src/estimateBP.sce
@@ -14,11 +14,10 @@
// @param date_ntb the matrix containing the previous zc cross.
// @param bp_ntb the beacon period in NTB clock base.
// @param zc ntb the ACL zero cross.
-// @param fvar_ntb the frequency variation in NTB.
// @return the [per, date_ntb']
-function [res] = cp_pwl_estimate_beacon_period (date_ntb, bp_ntb, zc_ntb, fvar_ntb)
+function [res] = cp_pwl_estimate_beacon_period (date_ntb, bp_ntb, zc_ntb)
-date_ntb(1) = phy_clock_get_zero_cross_captured_date (date_ntb(2), fvar_ntb);
+date_ntb(1) = phy_clock_get_zero_cross_captured_date (date_ntb(2));
diff_ntb = modulo((date_ntb(1) - date_ntb(2)), bp_ntb + 10000);
per_ntb = (4-(diff_ntb / zc_ntb)) * zc_ntb + diff_ntb;
diff --git a/cesar/cp2/pwl/doc/scilab/src/zc_capture.sce b/cesar/cp2/pwl/doc/scilab/src/zc_capture.sce
index 089dedf019..ba46a463ec 100644
--- a/cesar/cp2/pwl/doc/scilab/src/zc_capture.sce
+++ b/cesar/cp2/pwl/doc/scilab/src/zc_capture.sce
@@ -9,11 +9,10 @@
// Function to simulate the frequency of the AC line.
// @param phy the previous value provided.
-// @param var The variation of frequency.
// @Return phy + 250 000
-function phy = phy_clock_get_zero_cross_captured_date(phy, var)
+function phy = phy_clock_get_zero_cross_captured_date(phy)
-phy = phy + 1000000 + var;
+phy = phy + 1000000;
return phy;
endfunction
diff --git a/cesar/cp2/pwl/doc/scilab/src/zc_capture_decrease.sce b/cesar/cp2/pwl/doc/scilab/src/zc_capture_decrease.sce
new file mode 100644
index 0000000000..2009ebeb72
--- /dev/null
+++ b/cesar/cp2/pwl/doc/scilab/src/zc_capture_decrease.sce
@@ -0,0 +1,21 @@
+// SPiDCOM Technologies.
+// Nélio Laranjeiro
+// 16-05-2008
+// Cesar project.
+
+// This script will provide a function to generate a 50 Hz frequency
+// AC Line based on the NTB date with a little jitter.
+
+
+// Function to simulate the frequency of the AC line.
+// @param phy the previous value provided.
+// @param var The variation of frequency.
+// @Return phy + 250 000
+function phy = phy_clock_get_zero_cross_captured_date(phy)
+
+var = int(rand (1) * 100000);
+phy = phy + 1000000 - var;
+return phy;
+
+endfunction
+
diff --git a/cesar/cp2/pwl/doc/scilab/src/zc_capture_increase.sce b/cesar/cp2/pwl/doc/scilab/src/zc_capture_increase.sce
new file mode 100644
index 0000000000..f20f6843a4
--- /dev/null
+++ b/cesar/cp2/pwl/doc/scilab/src/zc_capture_increase.sce
@@ -0,0 +1,21 @@
+// SPiDCOM Technologies.
+// Nélio Laranjeiro
+// 16-05-2008
+// Cesar project.
+
+// This script will provide a function to generate a 50 Hz frequency
+// AC Line based on the NTB date with a little jitter.
+
+
+// Function to simulate the frequency of the AC line.
+// @param phy the previous value provided.
+// @param var The variation of frequency.
+// @Return phy + 250 000
+function phy = phy_clock_get_zero_cross_captured_date(phy)
+
+var = int(rand (1) * 100000);
+phy = phy + 1000000 + var;
+return phy;
+
+endfunction
+