summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorlaranjeiro2008-05-16 14:49:18 +0000
committerlaranjeiro2008-05-16 14:49:18 +0000
commita9cb57871d47127798625284f07a49d2c8c3675c (patch)
tree1a3ef6511d32f7d5810fe4ba0dd30b9e9e69421f /cesar
parentebaa856444c0709fbe25e76d89e653382c7b2e10 (diff)
PWL : Simulation files.
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2008 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cp2/pwl/doc/scilab/estimate_acl_freq_increase.sce31
-rw-r--r--cesar/cp2/pwl/doc/scilab/estimate_acl_stable.sce6
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/estimateBP.sce (renamed from cesar/cp2/pwl/doc/scilab/estimateBP.sce)0
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_freq_increase.sce19
-rw-r--r--cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_stable.sce (renamed from cesar/cp2/pwl/doc/scilab/zc_capture_50hz_stable.sce)0
5 files changed, 53 insertions, 3 deletions
diff --git a/cesar/cp2/pwl/doc/scilab/estimate_acl_freq_increase.sce b/cesar/cp2/pwl/doc/scilab/estimate_acl_freq_increase.sce
new file mode 100644
index 0000000000..69dc0d7367
--- /dev/null
+++ b/cesar/cp2/pwl/doc/scilab/estimate_acl_freq_increase.sce
@@ -0,0 +1,31 @@
+// SPiDCOM Technologies.
+// Nélio Laranjeiro
+// 16-05-2008
+// Cesar project.
+
+// Launch a test to verify the estimation function.
+
+// load the file, containing the function to generate a stable 50hz zero
+// cross.
+getf ('src/zc_capture_50hz_freq_increase.sce');
+getf ('src/estimateBP.sce');
+
+// Initialise the environment.
+date_ntb = [240000; 0];
+// 50 Hz in ticks.
+bp_ntb = 1e6;
+zc_ntb = bp_ntb / 4;
+
+// Write the result in a file.
+result_file = file('open', 'result_increase.csv', 'unknown');
+
+fprintf (result_file, "Per, Per(ATU), Zc 1, Zc 2\n");
+for i = 1:1000
+ res = cp_pwl_estimate_beacon_period (date_ntb, bp_ntb, zc_ntb);
+ date_ntb(2) = res(2);
+ date_ntb(1) = res(3);
+ fprintf (result_file, "%d, %d, %d, %d\n", res(1), res(1) / 256, res(3), res(2));
+end
+
+// Close the file.
+file('close', result_file);
diff --git a/cesar/cp2/pwl/doc/scilab/estimate_acl_stable.sce b/cesar/cp2/pwl/doc/scilab/estimate_acl_stable.sce
index be5758b7d3..c1cf9c7593 100644
--- a/cesar/cp2/pwl/doc/scilab/estimate_acl_stable.sce
+++ b/cesar/cp2/pwl/doc/scilab/estimate_acl_stable.sce
@@ -7,8 +7,8 @@
// load the file, containing the function to generate a stable 50hz zero
// cross.
-getf ('zc_capture_50hz_stable.sce');
-getf ('estimateBP.sce');
+getf ('src/zc_capture_50hz_stable.sce');
+getf ('src/estimateBP.sce');
// Initialise the environment.
date_ntb = [240000; 0];
@@ -17,7 +17,7 @@ bp_ntb = 1e6;
zc_ntb = bp_ntb / 4;
// Write the result in a file.
-result_file = file('open', 'result.csv', 'unknown');
+result_file = file('open', 'result_stable.csv', 'unknown');
fprintf (result_file, "Per, Per(ATU), Zc 1, Zc 2\n");
for i = 1:1000
diff --git a/cesar/cp2/pwl/doc/scilab/estimateBP.sce b/cesar/cp2/pwl/doc/scilab/src/estimateBP.sce
index 2f81a1ff9e..2f81a1ff9e 100644
--- a/cesar/cp2/pwl/doc/scilab/estimateBP.sce
+++ b/cesar/cp2/pwl/doc/scilab/src/estimateBP.sce
diff --git a/cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_freq_increase.sce b/cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_freq_increase.sce
new file mode 100644
index 0000000000..aea3a5c408
--- /dev/null
+++ b/cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_freq_increase.sce
@@ -0,0 +1,19 @@
+// SPiDCOM Technologies.
+// Nélio Laranjeiro
+// 16-05-2008
+// Cesar project.
+
+// This script will provide a function to generate a increasing 50 Hz frequency
+// AC Line based on the NTB date.
+
+
+// Function to simulate the frequency of the AC line.
+// @param phy the previous value provided.
+// @Return phy + 250 000
+function phy = phy_clock_get_zero_cross_captured_date(phy)
+
+phy = phy + 900000;
+return phy;
+
+endfunction
+
diff --git a/cesar/cp2/pwl/doc/scilab/zc_capture_50hz_stable.sce b/cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_stable.sce
index ba46a463ec..ba46a463ec 100644
--- a/cesar/cp2/pwl/doc/scilab/zc_capture_50hz_stable.sce
+++ b/cesar/cp2/pwl/doc/scilab/src/zc_capture_50hz_stable.sce