diff --git a/.gitignore b/.gitignore
index e257658..3adafd7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,3 +32,4 @@
*.out
*.app
+.DS_Store
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..db68fb9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,28 @@
+BSD 3-Clause License
+
+Copyright (c) 2024, Yoshiya Usui
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
index 6839ead..70c5d8c 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,51 @@
-# TracMT
+# TRACMT
+Robust transfer function analysis code for magnetotellurics.
+In TRACMT, you can use the RRMS estimator developed by Usui et al. (2024) and the fast and robust bootstrap method evaluated by Usui et al (2025).
+
+_Yoshiya Usui, Makoto Uyeshima, Shin'ya Sakanaka, Tasuku Hashimoto, Masahiro Ichiki, Toshiki Kaida, Yusuke Yamaya, Yasuo Ogawa, Masataka Masuda, Takahiro Akiyama, 2024. New robust remote reference estimator using robust multivariate linear regression, Geophysical Journal International, 238(2), [https://doi.org/10.1093/gji/ggae19_9](https://doi.org/10.1093/gji/ggae199)_
+
+_Yoshiya Usui, 2024. Prewhitening of magnetotelluric data using a robust filter and robust PARCOR. Bull. Earthq. Res. Inst. Univ. Tokyo, 99, [https://doi.org/10.15083/0002012817](https://doi.org/10.15083/0002012817)_
+
+_Yoshiya Usui, Makoto Uyeshima, Shin'ya Sakanaka, Tasuku Hashimoto, Masahiro Ichiki, Toshiki Kaida, Yusuke Yamaya, Yasuo Ogawa, Masataka Masuda, Takahiro Akiyama, 2025, Application of the fast and robust bootstrap method to the uncertainty analysis of the magnetotelluric transfer function, Geophysical Journal International, 242(1), [https://doi.org/10.1093/gji/ggaf162](https://doi.org/10.1093/gji/ggaf162)_
+
+We developed the RRMS estimator by applying the robust multivariate linear regression S-estimator to the two-input-multiple-output relationship between the local EM field and the reference magnetic field that leads to the same equation as by the original remote reference method.
+The RRMS estimator can give an unbiased estimate of the MT transfer function and suppress the influence of outliers in the electric field and magnetic
+field.
+
+## How to compile TRACMT
+1) Download all source files of TRACMT to a directory.
+2) Download source files of CLAPACK (https://www.netlib.org/clapack/) to another directory and make library files.
+3) Copy library files of CLAPACK (blas_LINUX.a, lapack_LINUX.a, and libf2c.a) to "lib" directory and copy header files (blaswrap.h, clapack.h, and f2c.h) to "include" directory.
+4) If your compiler supports C++11, you can compile TRACMT by "make -f Makefile_C++11" command.
+ If your compiler does NOT support C++11, download mt19937-64.tgz from http://math.sci.hiroshima-u.ac.jp/m-mat/MT/mt64.html and rename mt19937-64.c to mt19937-64.cpp.
+ After copying mt19937-64.cpp and mt64.h to the source-file directory of TRACMT, you can compile TRACMT by the make command (Make -f Makefile).
+5) To read MTH5 files (Peacock et al., 2022), please use "Makefile_C++11_MTH5" or "Makefile_MTH5". Before compiling TRACMT, HDF5 library should be installed and path to HDF5 libraries should be added as follows.
+ export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/hdf5-1.10.5/lib"
+ export LIBRARY_PATH="${LIBRARY_PATH}:/usr/local/hdf5-1.10.5/lib"
+ export PATH="${PATH}:/usr/local/hdf5-1.10.5/lib"
+
+## Functional Overview
+**Input file format**: Text (Ascii) file / .ats files of Metronix instruments / MTH5 files (Peacock et al., 2022) / .dat files of ELOG-MT
+
+**Prewhitening**: Non-robust prewhitening / Robust prewhitening / Robust prewhitening with robust filter
+
+**Transfer function estimation method**: Ordinary least square / Non-robust remote reference / Robust remote reference / RRMS estimator
+
+**Error estimation method**: Parametric approach / Bootstrap method / Jackknife method
+
+## Release note
+_**v1.2.0**_ June. 13, 2024: Initial release.
+
+_**v1.3.4**_ July. 14, 2024: A parametric error estimation method was added for the RRMS estimator. Some bugs relating to the ELOG reading option and calibration were fixed.
+
+_**v1.3.6**_ August. 15, 2024: A function to read ELOG-DUAL binary files was modified.
+
+_**v2.0.0**_ January. 1, 2025: The fast and robust bootstrap method was added. Some equations of the parametric error estimation method were modified.
+
+_**v2.1.0**_ January. 14, 2025: The equation of the AIC is modified.
+
+_**v2.2.0**_ February. 10, 2025: The option for reading MTH5 files is added.
+
+_**v2.3.0**_ October. 22, 2025: The computational efficiency of the RRMS estimator was improved.
+
diff --git a/Samples/NonRobustRemoteReference/TRACMT.cvg b/Samples/NonRobustRemoteReference/TRACMT.cvg
new file mode 100644
index 0000000..acfef8a
--- /dev/null
+++ b/Samples/NonRobustRemoteReference/TRACMT.cvg
@@ -0,0 +1,420 @@
+================================================================================
+Now Frequency(Hz): 0.00146484, Period(s): 682.667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.88469
+ Estimated response function: ( 3.7554e-01, 4.2087e-01), ( 3.3244e-01, 4.4139e-01)
+ Amplitude of the estimated response function: 5.6406e-01, 5.5257e-01
+ Phase(deg.) of the estimated response function: 48.3, 53.0
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.943059
+ Estimated response function: ( -6.7784e-01, -8.3556e-01), ( -1.5476e-01, -1.5345e-01)
+ Amplitude of the estimated response function: 1.0759e+00, 2.1794e-01
+ Phase(deg.) of the estimated response function: -129.1, -135.2
+================================================================================
+Now Frequency(Hz): 0.00195312, Period(s): 512
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.881175
+ Estimated response function: ( 4.5545e-01, 4.7352e-01), ( 3.8421e-01, 5.4449e-01)
+ Amplitude of the estimated response function: 6.5701e-01, 6.6640e-01
+ Phase(deg.) of the estimated response function: 46.1, 54.8
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.952068
+ Estimated response function: ( -8.0225e-01, -1.0040e+00), ( -1.8291e-01, -2.1313e-01)
+ Amplitude of the estimated response function: 1.2852e+00, 2.8086e-01
+ Phase(deg.) of the estimated response function: -128.6, -130.6
+================================================================================
+Now Frequency(Hz): 0.00292969, Period(s): 341.333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.810574
+ Estimated response function: ( 4.7326e-01, 5.9456e-01), ( 4.3491e-01, 7.6086e-01)
+ Amplitude of the estimated response function: 7.5992e-01, 8.7639e-01
+ Phase(deg.) of the estimated response function: 51.5, 60.2
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.917953
+ Estimated response function: ( -9.3048e-01, -1.3085e+00), ( -1.8189e-01, -2.2954e-01)
+ Amplitude of the estimated response function: 1.6056e+00, 2.9286e-01
+ Phase(deg.) of the estimated response function: -125.4, -128.4
+================================================================================
+Now Frequency(Hz): 0.00390625, Period(s): 256
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.795293
+ Estimated response function: ( 6.0472e-01, 7.0462e-01), ( 4.3766e-01, 9.1245e-01)
+ Amplitude of the estimated response function: 9.2854e-01, 1.0120e+00
+ Phase(deg.) of the estimated response function: 49.4, 64.4
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.898233
+ Estimated response function: ( -1.2107e+00, -1.5316e+00), ( -2.0797e-01, -2.9546e-01)
+ Amplitude of the estimated response function: 1.9524e+00, 3.6131e-01
+ Phase(deg.) of the estimated response function: -128.3, -125.1
+================================================================================
+Now Frequency(Hz): 0.00585938, Period(s): 170.667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.69714
+ Estimated response function: ( 8.2872e-01, 9.2629e-01), ( 6.3990e-01, 1.1135e+00)
+ Amplitude of the estimated response function: 1.2429e+00, 1.2843e+00
+ Phase(deg.) of the estimated response function: 48.2, 60.1
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.858605
+ Estimated response function: ( -1.5595e+00, -1.8754e+00), ( -3.0034e-01, -3.2833e-01)
+ Amplitude of the estimated response function: 2.4391e+00, 4.4498e-01
+ Phase(deg.) of the estimated response function: -129.7, -132.5
+================================================================================
+Now Frequency(Hz): 0.0078125, Period(s): 128
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.662431
+ Estimated response function: ( 1.0339e+00, 1.0460e+00), ( 8.5128e-01, 1.3658e+00)
+ Amplitude of the estimated response function: 1.4707e+00, 1.6093e+00
+ Phase(deg.) of the estimated response function: 45.3, 58.1
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.81653
+ Estimated response function: ( -1.7951e+00, -2.2401e+00), ( -4.1262e-01, -3.9622e-01)
+ Amplitude of the estimated response function: 2.8706e+00, 5.7205e-01
+ Phase(deg.) of the estimated response function: -128.7, -136.2
+================================================================================
+Now Frequency(Hz): 0.0117188, Period(s): 85.3333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.562555
+ Estimated response function: ( 1.3891e+00, 1.2224e+00), ( 1.0533e+00, 1.8187e+00)
+ Amplitude of the estimated response function: 1.8504e+00, 2.1017e+00
+ Phase(deg.) of the estimated response function: 41.3, 59.9
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.758964
+ Estimated response function: ( -2.4524e+00, -2.9277e+00), ( -4.3863e-01, -5.8231e-01)
+ Amplitude of the estimated response function: 3.8192e+00, 7.2903e-01
+ Phase(deg.) of the estimated response function: -130.0, -127.0
+================================================================================
+Now Frequency(Hz): 0.015625, Period(s): 64
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.488236
+ Estimated response function: ( 1.5185e+00, 1.3183e+00), ( 1.3435e+00, 2.1202e+00)
+ Amplitude of the estimated response function: 2.0109e+00, 2.5100e+00
+ Phase(deg.) of the estimated response function: 41.0, 57.6
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.671128
+ Estimated response function: ( -2.9422e+00, -3.2299e+00), ( -5.5561e-01, -5.7310e-01)
+ Amplitude of the estimated response function: 4.3691e+00, 7.9821e-01
+ Phase(deg.) of the estimated response function: -132.3, -134.1
+================================================================================
+Now Frequency(Hz): 0.0234375, Period(s): 42.6667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.285299
+ Estimated response function: ( 1.8094e+00, 1.5365e+00), ( 1.7851e+00, 2.7188e+00)
+ Amplitude of the estimated response function: 2.3738e+00, 3.2525e+00
+ Phase(deg.) of the estimated response function: 40.3, 56.7
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.541271
+ Estimated response function: ( -3.7694e+00, -3.9053e+00), ( -8.2834e-01, -9.5551e-01)
+ Amplitude of the estimated response function: 5.4277e+00, 1.2646e+00
+ Phase(deg.) of the estimated response function: -134.0, -130.9
+================================================================================
+Now Frequency(Hz): 0.03125, Period(s): 32
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.182882
+ Estimated response function: ( 2.4038e+00, 1.7105e+00), ( 2.2720e+00, 3.4053e+00)
+ Amplitude of the estimated response function: 2.9502e+00, 4.0937e+00
+ Phase(deg.) of the estimated response function: 35.4, 56.3
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.416897
+ Estimated response function: ( -4.5305e+00, -4.3722e+00), ( -1.0212e+00, -1.1243e+00)
+ Amplitude of the estimated response function: 6.2961e+00, 1.5189e+00
+ Phase(deg.) of the estimated response function: -136.0, -132.2
+================================================================================
+Now Frequency(Hz): 0.046875, Period(s): 21.3333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0
+ Estimated response function: ( 3.4951e+00, 2.1127e+00), ( 2.7520e+00, 4.2758e+00)
+ Amplitude of the estimated response function: 4.0841e+00, 5.0849e+00
+ Phase(deg.) of the estimated response function: 31.2, 57.2
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0.137491
+ Estimated response function: ( -5.7019e+00, -4.8532e+00), ( -1.0653e+00, -1.0137e+00)
+ Amplitude of the estimated response function: 7.4877e+00, 1.4705e+00
+ Phase(deg.) of the estimated response function: -139.6, -136.4
+================================================================================
+Now Frequency(Hz): 0.0625, Period(s): 16
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0
+ Estimated response function: ( 3.8661e+00, 2.4595e+00), ( 3.7929e+00, 5.6612e+00)
+ Amplitude of the estimated response function: 4.5821e+00, 6.8144e+00
+ Phase(deg.) of the estimated response function: 32.5, 56.2
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0
+ Estimated response function: ( -5.7741e+00, -5.9493e+00), ( -1.3897e+00, -1.3007e+00)
+ Amplitude of the estimated response function: 8.2906e+00, 1.9034e+00
+ Phase(deg.) of the estimated response function: -134.1, -136.9
+================================================================================
+Now Frequency(Hz): 0.09375, Period(s): 10.6667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( 3.9019e+00, 2.2656e+00), ( 4.4292e+00, 7.3770e+00)
+ Amplitude of the estimated response function: 4.5120e+00, 8.6045e+00
+ Phase(deg.) of the estimated response function: 30.1, 59.0
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( -6.8066e+00, -7.2849e+00), ( -4.3713e-01, -2.5180e+00)
+ Amplitude of the estimated response function: 9.9699e+00, 2.5557e+00
+ Phase(deg.) of the estimated response function: -133.1, -99.8
+================================================================================
+Now Frequency(Hz): 0.125, Period(s): 8
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( 5.2436e+00, 1.8981e+00), ( 5.8367e+00, 7.6169e+00)
+ Amplitude of the estimated response function: 5.5766e+00, 9.5961e+00
+ Phase(deg.) of the estimated response function: 19.9, 52.5
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( -9.2962e+00, -8.5980e+00), ( 2.5354e-02, -1.6449e+00)
+ Amplitude of the estimated response function: 1.2663e+01, 1.6451e+00
+ Phase(deg.) of the estimated response function: -137.2, -89.1
+================================================================================
+Now Frequency(Hz): 0.1875, Period(s): 5.33333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( 4.7388e+00, 3.6659e+00), ( 8.5635e+00, 9.6804e+00)
+ Amplitude of the estimated response function: 5.9912e+00, 1.2925e+01
+ Phase(deg.) of the estimated response function: 37.7, 48.5
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( -1.1045e+01, -1.1288e+01), ( -2.2411e-01, -5.9487e-01)
+ Amplitude of the estimated response function: 1.5793e+01, 6.3568e-01
+ Phase(deg.) of the estimated response function: -134.4, -110.6
+================================================================================
+Now Frequency(Hz): 0.25, Period(s): 4
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( 5.8663e+00, 4.0237e+00), ( 1.1449e+01, 8.7057e+00)
+ Amplitude of the estimated response function: 7.1136e+00, 1.4383e+01
+ Phase(deg.) of the estimated response function: 34.4, 37.2
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( -1.5791e+01, -8.7705e+00), ( -2.1661e+00, 6.6073e-01)
+ Amplitude of the estimated response function: 1.8063e+01, 2.2646e+00
+ Phase(deg.) of the estimated response function: -151.0, 163.0
+================================================================================
+Now Frequency(Hz): 0.375, Period(s): 2.66667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( -3.4466e+00, -5.2926e+00), ( 2.3350e+01, 8.4248e+00)
+ Amplitude of the estimated response function: 6.3159e+00, 2.4823e+01
+ Phase(deg.) of the estimated response function: -123.1, 19.8
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( -1.3650e+01, -3.9352e+00), ( -4.6476e-02, -1.1209e+01)
+ Amplitude of the estimated response function: 1.4206e+01, 1.1209e+01
+ Phase(deg.) of the estimated response function: -163.9, -90.2
+================================================================================
+Now Frequency(Hz): 0.5, Period(s): 2
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( 1.2138e+00, -1.2061e+00), ( 2.1695e+01, 6.6378e+00)
+ Amplitude of the estimated response function: 1.7112e+00, 2.2687e+01
+ Phase(deg.) of the estimated response function: -44.8, 17.0
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( -5.3388e+00, -5.2437e+00), ( -6.0756e+00, 1.4369e+00)
+ Amplitude of the estimated response function: 7.4833e+00, 6.2432e+00
+ Phase(deg.) of the estimated response function: -135.5, 166.7
+================================================================================
+Now Frequency(Hz): 0.75, Period(s): 1.33333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( -2.1007e+01, 2.5791e+00), ( 1.6554e+01, 1.0975e+01)
+ Amplitude of the estimated response function: 2.1164e+01, 1.9862e+01
+ Phase(deg.) of the estimated response function: 173.0, 33.5
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( 4.6419e+00, -4.1036e+00), ( -1.1865e+01, -1.0362e+01)
+ Amplitude of the estimated response function: 6.1958e+00, 1.5753e+01
+ Phase(deg.) of the estimated response function: -41.5, -138.9
+================================================================================
+Now Frequency(Hz): 1, Period(s): 1
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( 1.1221e+01, 1.0270e+01), ( 2.1550e+01, -2.5333e+01)
+ Amplitude of the estimated response function: 1.5211e+01, 3.3259e+01
+ Phase(deg.) of the estimated response function: 42.5, -49.6
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( -1.1946e+01, -5.6520e+00), ( -2.0656e+01, -1.9537e+01)
+ Amplitude of the estimated response function: 1.3216e+01, 2.8432e+01
+ Phase(deg.) of the estimated response function: -154.7, -136.6
diff --git a/Samples/NonRobustRemoteReference/TRACMT.log b/Samples/NonRobustRemoteReference/TRACMT.log
new file mode 100644
index 0000000..2559946
--- /dev/null
+++ b/Samples/NonRobustRemoteReference/TRACMT.log
@@ -0,0 +1,418 @@
+Start TRACMT Version v2.0
+Read parameters. ( 0 sec )
+================================================================================
+Summary of control parameters
+================================================================================
+Number of threads : 1
+Procedure type : ordinary remote reference
+The first M-estimator : not to be used
+The second M-estimator : not to be used
+Error estimation method : parametric
+Number of output variables : 2
+Number of input variables : 2
+Number of remote reference variables : 2
+Sampling frequency (Hz) : 32
+Number of time-series sections : 1
+Ratio of overlapping part to whole segment length : 0.5
+Output level : 0
+Output apparent resistivity and phase to a seperate csv file
+Information about the segment lengths and frequencies :
+ Segment# Length Index Frequency(Hz) Period(sec)
+ 0 65536 3 1.464843750e-03 6.826666667e+02
+ 0 65536 4 1.953125000e-03 5.120000000e+02
+ 1 32768 3 2.929687500e-03 3.413333333e+02
+ 1 32768 4 3.906250000e-03 2.560000000e+02
+ 2 16384 3 5.859375000e-03 1.706666667e+02
+ 2 16384 4 7.812500000e-03 1.280000000e+02
+ 3 8192 3 1.171875000e-02 8.533333333e+01
+ 3 8192 4 1.562500000e-02 6.400000000e+01
+ 4 4096 3 2.343750000e-02 4.266666667e+01
+ 4 4096 4 3.125000000e-02 3.200000000e+01
+ 5 2048 3 4.687500000e-02 2.133333333e+01
+ 5 2048 4 6.250000000e-02 1.600000000e+01
+ 6 1024 3 9.375000000e-02 1.066666667e+01
+ 6 1024 4 1.250000000e-01 8.000000000e+00
+ 7 512 3 1.875000000e-01 5.333333333e+00
+ 7 512 4 2.500000000e-01 4.000000000e+00
+ 8 256 3 3.750000000e-01 2.666666667e+00
+ 8 256 4 5.000000000e-01 2.000000000e+00
+ 9 128 3 7.500000000e-01 1.333333333e+00
+ 9 128 4 1.000000000e+00 1.000000000e+00
+Information about the time-series data :
+ Section# Channel# Type NSkip NData File
+ 0 0 Out0 0 2764800 ../ex.txt
+ 0 1 Out1 0 2764800 ../ey.txt
+ 0 2 Inp0 0 2764800 ../hx.txt
+ 0 3 Inp1 0 2764800 ../hy.txt
+ 0 4 RR0 0 2764800 ../hrx.txt
+ 0 5 RR1 0 2764800 ../hry.txt
+Rotation angle (deg.) : 0
+ Channel# Type Azimuth(deg.)
+ 0 Out0 0
+ 1 Out1 90
+ 2 Inp0 0
+ 3 Inp1 90
+ 4 RR0 0
+ 5 RR1 90
+Parameters for robust prewhitening :
+ Least square estimator is used
+ Maximum degree of AR model: 10
+================================================================================
+Read data from ../ex.txt ( 0 sec )
+Read data from ../ey.txt ( 1 sec )
+Read data from ../hx.txt ( 2 sec )
+Read data from ../hy.txt ( 3 sec )
+Read data from ../hrx.txt ( 4 sec )
+Read data from ../hry.txt ( 4 sec )
+Perform preprocessing ( 5 sec )
+Secton 0, Channel 0 ( 5 sec )
+Subtract mean (-0.889991) ( 5 sec )
+Secton 0, Channel 1 ( 5 sec )
+Subtract mean (1.69968) ( 5 sec )
+Secton 0, Channel 2 ( 5 sec )
+Subtract mean (0.0092652) ( 5 sec )
+Secton 0, Channel 3 ( 5 sec )
+Subtract mean (1.30261) ( 5 sec )
+Secton 0, Channel 4 ( 5 sec )
+Subtract mean (0.0346805) ( 5 sec )
+Secton 0, Channel 5 ( 5 sec )
+Subtract mean (1.2857) ( 5 sec )
+Perform prewhitening for channel 0 ( 5 sec )
+Degree of AR model: 1, Sigma: 7.6076, AIC: 1.90665e+07 ( 5 sec )
+Degree of AR model: 2, Sigma: 7.60293, AIC: 1.90631e+07 ( 5 sec )
+Degree of AR model: 3, Sigma: 7.59862, AIC: 1.906e+07 ( 5 sec )
+Degree of AR model: 4, Sigma: 7.5946, AIC: 1.90571e+07 ( 5 sec )
+Degree of AR model: 5, Sigma: 7.59088, AIC: 1.90544e+07 ( 5 sec )
+Degree of AR model: 6, Sigma: 7.58783, AIC: 1.90521e+07 ( 5 sec )
+Degree of AR model: 7, Sigma: 7.58446, AIC: 1.90497e+07 ( 5 sec )
+Degree of AR model: 8, Sigma: 7.58162, AIC: 1.90476e+07 ( 5 sec )
+Degree of AR model: 9, Sigma: 7.57884, AIC: 1.90456e+07 ( 5 sec )
+Degree of AR model: 10, Sigma: 7.57665, AIC: 1.9044e+07 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (1.9044e+07) ( 6 sec )
+AR coefficients: 0.0320459 0.0276236 0.0274305 0.0273417 0.0271195 0.0250291 0.0274279 0.0257729 0.0263083 0.0240252 ( 6 sec )
+Perform prewhitening for channel 1 ( 6 sec )
+Degree of AR model: 1, Sigma: 7.54273, AIC: 1.90192e+07 ( 6 sec )
+Degree of AR model: 2, Sigma: 7.52209, AIC: 1.9004e+07 ( 6 sec )
+Degree of AR model: 3, Sigma: 7.50561, AIC: 1.89919e+07 ( 6 sec )
+Degree of AR model: 4, Sigma: 7.49133, AIC: 1.89814e+07 ( 6 sec )
+Degree of AR model: 5, Sigma: 7.47891, AIC: 1.89722e+07 ( 6 sec )
+Degree of AR model: 6, Sigma: 7.46782, AIC: 1.8964e+07 ( 6 sec )
+Degree of AR model: 7, Sigma: 7.45798, AIC: 1.89567e+07 ( 6 sec )
+Degree of AR model: 8, Sigma: 7.44899, AIC: 1.895e+07 ( 6 sec )
+Degree of AR model: 9, Sigma: 7.44151, AIC: 1.89444e+07 ( 6 sec )
+Degree of AR model: 10, Sigma: 7.43417, AIC: 1.8939e+07 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (1.8939e+07) ( 6 sec )
+AR coefficients: 0.0497931 0.0484711 0.0453945 0.0449254 0.0443603 0.0443792 0.0440958 0.0444201 0.0425092 0.0444076 ( 6 sec )
+Perform prewhitening for channel 2 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.15041, AIC: 8.62097e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 0.999605, AIC: 7.84398e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.94325, AIC: 7.5231e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.913582, AIC: 7.34638e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.895124, AIC: 7.23352e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.882753, AIC: 7.15657e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.873879, AIC: 7.1007e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.867031, AIC: 7.0572e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.861586, AIC: 7.02236e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.857167, AIC: 6.99392e+06 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (6.99392e+06) ( 6 sec )
+AR coefficients: 0.100812 0.0994283 0.099345 0.0994338 0.100341 0.0991599 0.0983786 0.0996401 0.100555 0.101158 ( 6 sec )
+Perform prewhitening for channel 3 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.15933, AIC: 8.66365e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 1.01002, AIC: 7.90131e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.95364, AIC: 7.58368e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.923737, AIC: 7.40751e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.905428, AIC: 7.29681e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.892914, AIC: 7.21985e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.884029, AIC: 7.16455e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.877216, AIC: 7.12177e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.871841, AIC: 7.08779e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.867445, AIC: 7.05983e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.05983e+06) ( 7 sec )
+AR coefficients: 0.0992426 0.0997661 0.0999695 0.100685 0.0994892 0.0998831 0.0983119 0.0990847 0.0994668 0.100303 ( 7 sec )
+Perform prewhitening for channel 4 ( 7 sec )
+Degree of AR model: 1, Sigma: 1.16254, AIC: 8.67898e+06 ( 7 sec )
+Degree of AR model: 2, Sigma: 1.00903, AIC: 7.89586e+06 ( 7 sec )
+Degree of AR model: 3, Sigma: 0.952405, AIC: 7.57651e+06 ( 7 sec )
+Degree of AR model: 4, Sigma: 0.922235, AIC: 7.39851e+06 ( 7 sec )
+Degree of AR model: 5, Sigma: 0.90364, AIC: 7.28588e+06 ( 7 sec )
+Degree of AR model: 6, Sigma: 0.891244, AIC: 7.2095e+06 ( 7 sec )
+Degree of AR model: 7, Sigma: 0.882213, AIC: 7.15318e+06 ( 7 sec )
+Degree of AR model: 8, Sigma: 0.875262, AIC: 7.10944e+06 ( 7 sec )
+Degree of AR model: 9, Sigma: 0.869864, AIC: 7.07523e+06 ( 7 sec )
+Degree of AR model: 10, Sigma: 0.865547, AIC: 7.04772e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.04772e+06) ( 7 sec )
+AR coefficients: 0.0989261 0.10121 0.0987917 0.100744 0.100552 0.0988028 0.0993482 0.100374 0.0999452 0.0995135 ( 7 sec )
+Perform prewhitening for channel 5 ( 7 sec )
+Degree of AR model: 1, Sigma: 1.16036, AIC: 8.66857e+06 ( 7 sec )
+Degree of AR model: 2, Sigma: 1.01086, AIC: 7.90589e+06 ( 7 sec )
+Degree of AR model: 3, Sigma: 0.953982, AIC: 7.58566e+06 ( 7 sec )
+Degree of AR model: 4, Sigma: 0.924434, AIC: 7.41168e+06 ( 7 sec )
+Degree of AR model: 5, Sigma: 0.906107, AIC: 7.30095e+06 ( 7 sec )
+Degree of AR model: 6, Sigma: 0.893431, AIC: 7.22305e+06 ( 7 sec )
+Degree of AR model: 7, Sigma: 0.884431, AIC: 7.16707e+06 ( 7 sec )
+Degree of AR model: 8, Sigma: 0.877486, AIC: 7.12347e+06 ( 7 sec )
+Degree of AR model: 9, Sigma: 0.872098, AIC: 7.08941e+06 ( 7 sec )
+Degree of AR model: 10, Sigma: 0.867816, AIC: 7.0622e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.0622e+06) ( 7 sec )
+AR coefficients: 0.0995885 0.098903 0.101124 0.0988656 0.0991358 0.100713 0.0990429 0.100438 0.0997109 0.0989688 ( 7 sec )
+===============================================================================
+Perform analysis for segment length : 65536 ( 7 sec )
+Convert time-series data to frequency-domain ( 7 sec )
+Total number of segments : 83 ( 7 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00146484, Period(s): 682.667 ( 10 sec )
+Perform calibration correction ( 10 sec )
+Calculate rotated fields ( 10 sec )
+Calculate response functions by ordinary remote reference ( 10 sec )
+Calculate response functions for output variable 0 ( 10 sec )
+Calculate response functions by the ordinary least square method ( 10 sec )
+Parametric error estimation is performed ( 10 sec )
+Calculate response functions for output variable 1 ( 10 sec )
+Calculate response functions by the ordinary least square method ( 10 sec )
+Parametric error estimation is performed ( 10 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00195312, Period(s): 512 ( 10 sec )
+Perform calibration correction ( 10 sec )
+Calculate rotated fields ( 10 sec )
+Calculate response functions by ordinary remote reference ( 10 sec )
+Calculate response functions for output variable 0 ( 10 sec )
+Calculate response functions by the ordinary least square method ( 10 sec )
+Parametric error estimation is performed ( 10 sec )
+Calculate response functions for output variable 1 ( 10 sec )
+Calculate response functions by the ordinary least square method ( 10 sec )
+Parametric error estimation is performed ( 10 sec )
+===============================================================================
+Perform analysis for segment length : 32768 ( 10 sec )
+Convert time-series data to frequency-domain ( 10 sec )
+Total number of segments : 167 ( 10 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00292969, Period(s): 341.333 ( 12 sec )
+Perform calibration correction ( 12 sec )
+Calculate rotated fields ( 12 sec )
+Calculate response functions by ordinary remote reference ( 12 sec )
+Calculate response functions for output variable 0 ( 12 sec )
+Calculate response functions by the ordinary least square method ( 12 sec )
+Parametric error estimation is performed ( 12 sec )
+Calculate response functions for output variable 1 ( 12 sec )
+Calculate response functions by the ordinary least square method ( 12 sec )
+Parametric error estimation is performed ( 12 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00390625, Period(s): 256 ( 12 sec )
+Perform calibration correction ( 12 sec )
+Calculate rotated fields ( 12 sec )
+Calculate response functions by ordinary remote reference ( 12 sec )
+Calculate response functions for output variable 0 ( 12 sec )
+Calculate response functions by the ordinary least square method ( 12 sec )
+Parametric error estimation is performed ( 12 sec )
+Calculate response functions for output variable 1 ( 12 sec )
+Calculate response functions by the ordinary least square method ( 12 sec )
+Parametric error estimation is performed ( 12 sec )
+===============================================================================
+Perform analysis for segment length : 16384 ( 12 sec )
+Convert time-series data to frequency-domain ( 12 sec )
+Total number of segments : 336 ( 12 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00585938, Period(s): 170.667 ( 14 sec )
+Perform calibration correction ( 14 sec )
+Calculate rotated fields ( 14 sec )
+Calculate response functions by ordinary remote reference ( 14 sec )
+Calculate response functions for output variable 0 ( 14 sec )
+Calculate response functions by the ordinary least square method ( 14 sec )
+Parametric error estimation is performed ( 14 sec )
+Calculate response functions for output variable 1 ( 14 sec )
+Calculate response functions by the ordinary least square method ( 14 sec )
+Parametric error estimation is performed ( 14 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0078125, Period(s): 128 ( 14 sec )
+Perform calibration correction ( 14 sec )
+Calculate rotated fields ( 14 sec )
+Calculate response functions by ordinary remote reference ( 14 sec )
+Calculate response functions for output variable 0 ( 14 sec )
+Calculate response functions by the ordinary least square method ( 14 sec )
+Parametric error estimation is performed ( 14 sec )
+Calculate response functions for output variable 1 ( 14 sec )
+Calculate response functions by the ordinary least square method ( 14 sec )
+Parametric error estimation is performed ( 14 sec )
+===============================================================================
+Perform analysis for segment length : 8192 ( 14 sec )
+Convert time-series data to frequency-domain ( 14 sec )
+Total number of segments : 674 ( 14 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0117188, Period(s): 85.3333 ( 16 sec )
+Perform calibration correction ( 16 sec )
+Calculate rotated fields ( 16 sec )
+Calculate response functions by ordinary remote reference ( 16 sec )
+Calculate response functions for output variable 0 ( 16 sec )
+Calculate response functions by the ordinary least square method ( 16 sec )
+Parametric error estimation is performed ( 16 sec )
+Calculate response functions for output variable 1 ( 16 sec )
+Calculate response functions by the ordinary least square method ( 16 sec )
+Parametric error estimation is performed ( 16 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.015625, Period(s): 64 ( 16 sec )
+Perform calibration correction ( 16 sec )
+Calculate rotated fields ( 16 sec )
+Calculate response functions by ordinary remote reference ( 16 sec )
+Calculate response functions for output variable 0 ( 16 sec )
+Calculate response functions by the ordinary least square method ( 16 sec )
+Parametric error estimation is performed ( 16 sec )
+Calculate response functions for output variable 1 ( 16 sec )
+Calculate response functions by the ordinary least square method ( 16 sec )
+Parametric error estimation is performed ( 16 sec )
+===============================================================================
+Perform analysis for segment length : 4096 ( 16 sec )
+Convert time-series data to frequency-domain ( 16 sec )
+Total number of segments : 1349 ( 16 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0234375, Period(s): 42.6667 ( 17 sec )
+Perform calibration correction ( 17 sec )
+Calculate rotated fields ( 17 sec )
+Calculate response functions by ordinary remote reference ( 17 sec )
+Calculate response functions for output variable 0 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Parametric error estimation is performed ( 17 sec )
+Calculate response functions for output variable 1 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Parametric error estimation is performed ( 17 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.03125, Period(s): 32 ( 17 sec )
+Perform calibration correction ( 17 sec )
+Calculate rotated fields ( 17 sec )
+Calculate response functions by ordinary remote reference ( 17 sec )
+Calculate response functions for output variable 0 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Parametric error estimation is performed ( 17 sec )
+Calculate response functions for output variable 1 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Parametric error estimation is performed ( 17 sec )
+===============================================================================
+Perform analysis for segment length : 2048 ( 17 sec )
+Convert time-series data to frequency-domain ( 17 sec )
+Total number of segments : 2699 ( 17 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.046875, Period(s): 21.3333 ( 19 sec )
+Perform calibration correction ( 19 sec )
+Calculate rotated fields ( 19 sec )
+Calculate response functions by ordinary remote reference ( 19 sec )
+Calculate response functions for output variable 0 ( 19 sec )
+Calculate response functions by the ordinary least square method ( 19 sec )
+Parametric error estimation is performed ( 19 sec )
+Calculate response functions for output variable 1 ( 19 sec )
+Calculate response functions by the ordinary least square method ( 19 sec )
+Parametric error estimation is performed ( 19 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0625, Period(s): 16 ( 19 sec )
+Perform calibration correction ( 19 sec )
+Calculate rotated fields ( 19 sec )
+Calculate response functions by ordinary remote reference ( 19 sec )
+Calculate response functions for output variable 0 ( 19 sec )
+Calculate response functions by the ordinary least square method ( 19 sec )
+Parametric error estimation is performed ( 19 sec )
+Calculate response functions for output variable 1 ( 19 sec )
+Calculate response functions by the ordinary least square method ( 19 sec )
+Parametric error estimation is performed ( 19 sec )
+===============================================================================
+Perform analysis for segment length : 1024 ( 19 sec )
+Convert time-series data to frequency-domain ( 19 sec )
+Total number of segments : 5399 ( 19 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.09375, Period(s): 10.6667 ( 20 sec )
+Perform calibration correction ( 20 sec )
+Calculate rotated fields ( 20 sec )
+Calculate response functions by ordinary remote reference ( 20 sec )
+Calculate response functions for output variable 0 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Parametric error estimation is performed ( 20 sec )
+Calculate response functions for output variable 1 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Parametric error estimation is performed ( 20 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.125, Period(s): 8 ( 20 sec )
+Perform calibration correction ( 20 sec )
+Calculate rotated fields ( 20 sec )
+Calculate response functions by ordinary remote reference ( 20 sec )
+Calculate response functions for output variable 0 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Parametric error estimation is performed ( 20 sec )
+Calculate response functions for output variable 1 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Parametric error estimation is performed ( 20 sec )
+===============================================================================
+Perform analysis for segment length : 512 ( 20 sec )
+Convert time-series data to frequency-domain ( 20 sec )
+Total number of segments : 10799 ( 20 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.1875, Period(s): 5.33333 ( 22 sec )
+Perform calibration correction ( 22 sec )
+Calculate rotated fields ( 22 sec )
+Calculate response functions by ordinary remote reference ( 22 sec )
+Calculate response functions for output variable 0 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Parametric error estimation is performed ( 22 sec )
+Calculate response functions for output variable 1 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Parametric error estimation is performed ( 22 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.25, Period(s): 4 ( 22 sec )
+Perform calibration correction ( 22 sec )
+Calculate rotated fields ( 22 sec )
+Calculate response functions by ordinary remote reference ( 22 sec )
+Calculate response functions for output variable 0 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Parametric error estimation is performed ( 22 sec )
+Calculate response functions for output variable 1 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Parametric error estimation is performed ( 22 sec )
+===============================================================================
+Perform analysis for segment length : 256 ( 22 sec )
+Convert time-series data to frequency-domain ( 22 sec )
+Total number of segments : 21599 ( 22 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.375, Period(s): 2.66667 ( 24 sec )
+Perform calibration correction ( 24 sec )
+Calculate rotated fields ( 24 sec )
+Calculate response functions by ordinary remote reference ( 24 sec )
+Calculate response functions for output variable 0 ( 24 sec )
+Calculate response functions by the ordinary least square method ( 24 sec )
+Parametric error estimation is performed ( 24 sec )
+Calculate response functions for output variable 1 ( 24 sec )
+Calculate response functions by the ordinary least square method ( 24 sec )
+Parametric error estimation is performed ( 24 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.5, Period(s): 2 ( 24 sec )
+Perform calibration correction ( 24 sec )
+Calculate rotated fields ( 24 sec )
+Calculate response functions by ordinary remote reference ( 24 sec )
+Calculate response functions for output variable 0 ( 24 sec )
+Calculate response functions by the ordinary least square method ( 24 sec )
+Parametric error estimation is performed ( 24 sec )
+Calculate response functions for output variable 1 ( 24 sec )
+Calculate response functions by the ordinary least square method ( 24 sec )
+Parametric error estimation is performed ( 24 sec )
+===============================================================================
+Perform analysis for segment length : 128 ( 24 sec )
+Convert time-series data to frequency-domain ( 24 sec )
+Total number of segments : 43199 ( 24 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.75, Period(s): 1.33333 ( 25 sec )
+Perform calibration correction ( 25 sec )
+Calculate rotated fields ( 25 sec )
+Calculate response functions by ordinary remote reference ( 25 sec )
+Calculate response functions for output variable 0 ( 25 sec )
+Calculate response functions by the ordinary least square method ( 25 sec )
+Parametric error estimation is performed ( 25 sec )
+Calculate response functions for output variable 1 ( 25 sec )
+Calculate response functions by the ordinary least square method ( 25 sec )
+Parametric error estimation is performed ( 25 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 1, Period(s): 1 ( 25 sec )
+Perform calibration correction ( 25 sec )
+Calculate rotated fields ( 25 sec )
+Calculate response functions by ordinary remote reference ( 25 sec )
+Calculate response functions for output variable 0 ( 25 sec )
+Calculate response functions by the ordinary least square method ( 25 sec )
+Parametric error estimation is performed ( 25 sec )
+Calculate response functions for output variable 1 ( 25 sec )
+Calculate response functions by the ordinary least square method ( 25 sec )
+Parametric error estimation is performed ( 25 sec )
+End TRACMT ( 25 sec )
diff --git a/Samples/NonRobustRemoteReference/apparent_resistivity_and_phase.csv b/Samples/NonRobustRemoteReference/apparent_resistivity_and_phase.csv
new file mode 100644
index 0000000..c9e855f
--- /dev/null
+++ b/Samples/NonRobustRemoteReference/apparent_resistivity_and_phase.csv
@@ -0,0 +1,21 @@
+frequency,period,app_res_0_2,phase_0_2,app_res_0_3,phase_0_3,coherence_0_2+3,app_res_1_2,phase_1_2,app_res_1_3,phase_1_3,coherence_1_2+3,dapp_res_0_2,dphase_0_2,dapp_res_0_3,dphase_0_3,dapp_res_1_2,dphase_1_2,dapp_res_1_3,dphase_1_3
+1.4648437500e-03,6.8266666667e+02,4.3439931212e+01,4.8258024132e+01,4.1688452809e+01,5.3014214814e+01,8.8469008246e-01,1.5805526300e+02,-1.2905058619e+02,6.4849560945e+00,-1.3524485798e+02,9.4305915727e-01,3.3690232144e+00,2.2223702517e+00,3.4635140769e+00,2.3807774441e+00,6.2136295221e+00,1.1263075660e+00,1.3208211789e+00,5.8449817321e+00
+1.9531250000e-03,5.1200000000e+02,4.4201790775e+01,4.6114671043e+01,4.5475091489e+01,5.4792118884e+01,8.8117476976e-01,1.6913516599e+02,-1.2862575255e+02,8.0773816625e+00,-1.3063638437e+02,9.5206812438e-01,3.6600424768e+00,2.3728104457e+00,4.0482366560e+00,2.5511057134e+00,6.2247090309e+00,1.0543924593e+00,1.4833727938e+00,5.2684701321e+00
+2.9296875000e-03,3.4133333333e+02,3.9422126341e+01,5.1480630538e+01,5.2432599053e+01,6.0247384811e+01,8.1057433654e-01,1.7599584294e+02,-1.2541588946e+02,5.8552117518e+00,-1.2839384516e+02,9.1795261351e-01,2.8192223353e+00,2.0491535694e+00,3.7894049717e+00,2.0708890615e+00,5.8225755132e+00,9.4781846380e-01,1.2377879501e+00,6.0674792759e+00
+3.9062500000e-03,2.5600000000e+02,4.4143542485e+01,4.9363170827e+01,5.2434467640e+01,6.4375151174e+01,7.9529312750e-01,1.9515981731e+02,-1.2832541387e+02,6.6839689192e+00,-1.2514079521e+02,8.9823309221e-01,3.3801634274e+00,2.1941651353e+00,4.4135400945e+00,2.4120768517e+00,7.3597276715e+00,1.0804127890e+00,1.6317675464e+00,7.0113387294e+00
+5.8593750000e-03,1.7066666667e+02,5.2729192716e+01,4.8182052659e+01,5.6301329724e+01,6.0116226115e+01,6.9714037413e-01,2.0306618106e+02,-1.2974416401e+02,6.7586186926e+00,-1.3245111721e+02,8.5860507996e-01,3.3124269277e+00,1.7999450940e+00,4.2331392213e+00,2.1544622365e+00,6.3747196406e+00,8.9936081000e-01,1.4383141127e+00,6.1081738115e+00
+7.8125000000e-03,1.2800000000e+02,5.5373578002e+01,4.5333555005e+01,6.6303173500e+01,5.8064666615e+01,6.6243101745e-01,2.1095797199e+02,-1.2870685937e+02,8.3774706370e+00,-1.3616142787e+02,8.1652992410e-01,3.9364069731e+00,2.0369554542e+00,5.2652867417e+00,2.2755926948e+00,7.8105239459e+00,1.0607222319e+00,1.9025883137e+00,6.5202211360e+00
+1.1718750000e-02,8.5333333333e+01,5.8437573450e+01,4.1348027239e+01,7.5383241750e+01,5.9922540845e+01,5.6255496758e-01,2.4893409741e+02,-1.2995152666e+02,9.0707118284e+00,-1.2698899909e+02,7.5896390227e-01,3.6840792837e+00,1.8063478075e+00,5.1720678440e+00,1.9659264221e+00,7.7422263542e+00,8.9102854844e-01,1.8267885581e+00,5.7793133809e+00
+1.5625000000e-02,6.4000000000e+01,5.1760990943e+01,4.0963272318e+01,8.0640264680e+01,5.7638466973e+01,4.8823618087e-01,2.4433951559e+02,-1.3233082051e+02,8.1554356349e+00,-1.3411193012e+02,6.7112788794e-01,4.0194513109e+00,2.2251843996e+00,6.3182040702e+00,2.2451506574e+00,9.4708442748e+00,1.1104904161e+00,2.1790521255e+00,7.6773879253e+00
+2.3437500000e-02,4.2666666667e+01,4.8083059538e+01,4.0337977971e+01,9.0272215363e+01,5.6711840247e+01,2.8529865609e-01,2.5139035783e+02,-1.3398485460e+02,1.3646001184e+01,-1.3092226722e+02,5.4127075001e-01,3.5795687954e+00,2.1332001001e+00,6.6589253788e+00,2.1136895315e+00,8.9021145539e+00,1.0145183185e+00,2.8158790988e+00,5.9220871332e+00
+3.1250000000e-02,3.2000000000e+01,5.5704971072e+01,3.5435669997e+01,1.0725112638e+02,5.6289234236e+01,1.8288167094e-01,2.5370444257e+02,-1.3601879048e+02,1.4764311300e+01,-1.3224793142e+02,4.1689718636e-01,5.0225304352e+00,2.5838570119e+00,9.1700701378e+00,2.4501676819e+00,1.1254288242e+01,1.2709199982e+00,3.5723723600e+00,6.9486637394e+00
+4.6875000000e-02,2.1333333333e+01,7.1166112619e+01,3.1151888685e+01,1.1031797611e+02,5.7234235225e+01,0.0000000000e+00,2.3921212412e+02,-1.3959727801e+02,9.2260852110e+00,-1.3642252652e+02,1.3749136535e-01,6.1173036659e+00,2.4632768659e+00,9.9861813035e+00,2.5941446459e+00,1.1697062865e+01,1.4009723052e+00,3.0119436807e+00,9.3944140839e+00
+6.2500000000e-02,1.6000000000e+01,6.7186815892e+01,3.2462794842e+01,1.4859458243e+02,5.6178846629e+01,0.0000000000e+00,2.1995117514e+02,-1.3414376018e+02,1.1593824880e+01,-1.3689299548e+02,0.0000000000e+00,8.7410625152e+00,3.7297486912e+00,1.7841539826e+01,3.4417808559e+00,1.5789500836e+01,2.0569704208e+00,4.9753916696e+00,1.2390346059e+01
+9.3750000000e-02,1.0666666667e+01,4.3429860513e+01,3.0140602239e+01,1.5794748034e+02,5.9018744701e+01,0.0000000000e+00,2.1205209697e+02,-1.3305620911e+02,1.3933591532e+01,-9.9848555846e+01,0.0000000000e+00,8.6086422504e+00,5.6879062616e+00,2.2782719944e+01,4.1358303983e+00,1.9281914266e+01,2.6058531973e+00,6.8591322543e+00,1.4249010152e+01
+1.2500000000e-01,8.0000000000e+00,4.9756690032e+01,1.9899467883e+01,1.4733574563e+02,5.2537500448e+01,0.0000000000e+00,2.5655127865e+02,-1.3723463362e+02,4.3301730676e+00,-8.9116917318e+01,0.0000000000e+00,1.4944799814e+01,8.6372883093e+00,3.0368940619e+01,5.9154252456e+00,3.6583247388e+01,4.0885503014e+00,5.6125343002e+00,4.0396452284e+01
+1.8750000000e-01,5.3333333333e+00,3.8287795343e+01,3.7725280039e+01,1.7817974707e+02,4.8503439711e+01,0.0000000000e+00,2.6603859751e+02,-1.3437444590e+02,4.3102862340e-01,-1.1064334081e+02,0.0000000000e+00,2.1191952025e+01,1.6066063085e+01,5.2553779861e+01,8.4805726387e+00,5.9528113316e+01,6.4236266607e+00,2.7544624445e+00,3.6000000000e+02
+2.5000000000e-01,4.0000000000e+00,4.0483046079e+01,3.4446274250e+01,1.6548963640e+02,3.7249895138e+01,0.0000000000e+00,2.6101784068e+02,-1.5095164189e+02,4.1029062342e+00,1.6303682644e+02,0.0000000000e+00,3.1821660337e+01,2.3142825901e+01,7.6642870554e+01,1.3389166013e+01,8.9078314793e+01,9.8248255834e+00,1.3304017548e+01,3.6000000000e+02
+3.7500000000e-01,2.6666666667e+00,2.1275077719e+01,-1.2307247151e+02,3.2863961430e+02,1.9839626363e+01,0.0000000000e+00,1.0763695474e+02,-1.6391873627e+02,6.7011511919e+01,-9.0237564498e+01,0.0000000000e+00,4.3429979397e+01,3.6000000000e+02,2.6886698296e+02,2.4145831783e+01,7.1747554228e+01,1.9468280361e+01,8.9171193704e+01,4.1708594952e+01
+5.0000000000e-01,2.0000000000e+00,1.1712247875e+00,-4.4816155073e+01,2.0588790332e+02,1.7012371582e+01,0.0000000000e+00,2.2399698921e+01,-1.3551513404e+02,1.5590968093e+01,1.6669346345e+02,0.0000000000e+00,7.5753105221e+00,3.6000000000e+02,2.1428080610e+02,3.1357893175e+01,1.7702730579e+01,2.3275675508e+01,3.1509626435e+01,3.6000000000e+02
+7.5000000000e-01,1.3333333333e+00,1.1944686208e+02,1.7300053406e+02,1.0519975799e+02,3.3543938500e+01,0.0000000000e+00,1.0236687330e+01,-4.1477825957e+01,6.6177497072e+01,-1.3886878892e+02,0.0000000000e+00,1.6964566872e+02,4.5245516761e+01,1.8535393568e+02,6.1758602935e+01,3.1572335160e+01,3.6000000000e+02,9.3459013428e+01,4.4920407031e+01
+1.0000000000e+00,1.0000000000e+00,4.6277191207e+01,4.2464688138e+01,2.2123687969e+02,-4.9613047546e+01,0.0000000000e+00,3.4931890994e+01,-1.5468047827e+02,1.6167769729e+02,-1.3659513255e+02,0.0000000000e+00,1.2325192597e+02,3.6000000000e+02,5.7971489516e+02,3.6000000000e+02,9.2340982943e+01,3.6000000000e+02,4.2735026826e+02,3.6000000000e+02
diff --git a/Samples/NonRobustRemoteReference/param.dat b/Samples/NonRobustRemoteReference/param.dat
new file mode 100644
index 0000000..e6551f6
--- /dev/null
+++ b/Samples/NonRobustRemoteReference/param.dat
@@ -0,0 +1,51 @@
+NUM_OUT
+2
+SAMPLING_FREQ
+32
+NUM_SECTION
+1
+SEGMENT
+10
+65536 2 3 4
+32768 2 3 4
+16384 2 3 4
+8192 2 3 4
+4096 2 3 4
+2048 2 3 4
+1024 2 3 4
+512 2 3 4
+256 2 3 4
+128 2 3 4
+ROTATION
+0.0
+AZIMUTH
+0.0 90.0
+0.0 90.0
+0.0 90.0
+MESTIMATORS
+-1
+-1
+OUTPUT_RHOA_PHS
+PREWHITENING
+0
+10
+5
+PROCEDURE
+0
+ERROR_ESTIMATION
+0
+DATA_FILES
+2764800
+../ex.txt
+0
+../ey.txt
+0
+../hx.txt
+0
+../hy.txt
+0
+../hrx.txt
+0
+../hry.txt
+0
+END
diff --git a/Samples/NonRobustRemoteReference/response_functions.csv b/Samples/NonRobustRemoteReference/response_functions.csv
new file mode 100644
index 0000000..48a328e
--- /dev/null
+++ b/Samples/NonRobustRemoteReference/response_functions.csv
@@ -0,0 +1,21 @@
+frequency,period,resp_real_0_2,resp_imag_0_2,resp_real_0_3,resp_imag_0_3,coherence_0_2+3,resp_real_1_2,resp_imag_1_2,resp_real_1_3,resp_imag_1_3,coherence_1_2+3,dresp_0_2,dresp_0_3,dresp_1_2,dresp_1_3
+1.4648437500e-03,6.8266666667e+02,3.7553820017e-01,4.2087363768e-01,3.3243638090e-01,4.4138577273e-01,8.8469008246e-01,-6.7784440534e-01,-8.3555866519e-01,-1.5476304204e-01,-1.5344587919e-01,9.4305915727e-01,2.1873087828e-02,2.2954071290e-02,2.1149082551e-02,2.2194285161e-02
+1.9531250000e-03,5.1200000000e+02,4.5544857553e-01,4.7352371439e-01,3.8421100852e-01,5.4449480370e-01,8.8117476976e-01,-8.0225452024e-01,-1.0040409803e+00,-1.8290990486e-01,-2.1313058674e-01,9.5206812438e-01,2.7201084488e-02,2.9661911055e-02,2.3649508781e-02,2.5789031546e-02
+2.9296875000e-03,3.4133333333e+02,4.7325994887e-01,5.9455662019e-01,4.3491283983e-01,7.6085903553e-01,8.1057433654e-01,-9.3047711320e-01,-1.3085398150e+00,-1.8188757126e-01,-2.2953565043e-01,9.1795261351e-01,2.7172209868e-02,3.1669119087e-02,2.6560092321e-02,3.0955698147e-02
+3.9062500000e-03,2.5600000000e+02,6.0472014875e-01,7.0462195953e-01,4.3765943304e-01,9.1244995303e-01,7.9529312750e-01,-1.2107121638e+00,-1.5316302550e+00,-2.0796664613e-01,-2.9545920539e-01,8.9823309221e-01,3.5549961220e-02,4.2590591203e-02,3.6813030195e-02,4.4103809574e-02
+5.8593750000e-03,1.7066666667e+02,8.2872344233e-01,9.2629262330e-01,6.3989762316e-01,1.1135457113e+00,6.9714037413e-01,-1.5594640887e+00,-1.8754402895e+00,-3.0034351832e-01,-3.2832937427e-01,8.5860507996e-01,3.9039243982e-02,4.8281847422e-02,3.8284496690e-02,4.7348412502e-02
+7.8125000000e-03,1.2800000000e+02,1.0338873781e+00,1.0459958318e+00,8.5127811729e-01,1.3657574023e+00,6.6243101745e-01,-1.7951117014e+00,-2.2401160150e+00,-4.1261865410e-01,-3.9622063683e-01,8.1652992410e-01,5.2275563242e-02,6.3900593401e-02,5.3141305459e-02,6.4958859213e-02
+1.1718750000e-02,8.5333333333e+01,1.3891345140e+00,1.2224491283e+00,1.0532910900e+00,1.8186711360e+00,5.6255496758e-01,-2.4524326255e+00,-2.9277220646e+00,-4.3863034994e-01,-5.8231472358e-01,7.5896390227e-01,5.8328194320e-02,7.2097874138e-02,5.9390820027e-02,7.3411356500e-02
+1.5625000000e-02,6.4000000000e+01,1.5185112514e+00,1.3183136943e+00,1.3434936737e+00,2.1201522179e+00,4.8823618087e-01,-2.9421960630e+00,-3.2299391608e+00,-5.5560572962e-01,-5.7310180788e-01,6.7112788794e-01,7.8078327300e-02,9.8329243113e-02,8.4675322809e-02,1.0663727938e-01
+2.3437500000e-02,4.2666666667e+01,1.8093730204e+00,1.5365229620e+00,1.7851365055e+00,2.7188348414e+00,2.8529865609e-01,-3.7693573785e+00,-3.9053492175e+00,-8.2833789941e-01,-9.5550881111e-01,5.4127075001e-01,8.8357885759e-02,1.1996035627e-01,9.6101356857e-02,1.3047339134e-01
+3.1250000000e-02,3.2000000000e+01,2.4037562191e+00,1.7105138905e+00,2.2719800121e+00,3.4053039984e+00,1.8288167094e-01,-4.5304948017e+00,-4.3721774900e+00,-1.0211877886e+00,-1.1243216359e+00,4.1689718636e-01,1.3300121794e-01,1.7500551855e-01,1.3964777332e-01,1.8375118186e-01
+4.6875000000e-02,2.1333333333e+01,3.4951354558e+00,2.1127199981e+00,2.7519546708e+00,4.2758064900e+00,0.0000000000e+00,-5.7019240790e+00,-4.8531848706e+00,-1.0652917315e+00,-1.0136652544e+00,1.3749136535e-01,1.7552907521e-01,2.3014521543e-01,1.8306734250e-01,2.4002902613e-01
+6.2500000000e-02,1.6000000000e+01,3.8661238649e+00,2.4594646221e+00,3.7929013994e+00,5.6612459746e+00,0.0000000000e+00,-5.7741092844e+00,-5.9493196421e+00,-1.3896584759e+00,-1.3007380964e+00,0.0000000000e+00,2.9806927530e-01,4.0909659139e-01,2.9757762442e-01,4.0842180630e-01
+9.3750000000e-02,1.0666666667e+01,3.9019206664e+00,2.2655600254e+00,4.4292457294e+00,7.3769684613e+00,0.0000000000e+00,-6.8066230237e+00,-7.2848681162e+00,-4.3713076268e-01,-2.5179927972e+00,0.0000000000e+00,4.4717867795e-01,6.2056869745e-01,4.5328307822e-01,6.2904003098e-01
+1.2500000000e-01,8.0000000000e+00,5.2435831843e+00,1.8980955348e+00,5.8367421539e+00,7.6169076432e+00,0.0000000000e+00,-9.2962168092e+00,-8.5979591876e+00,2.5354448993e-02,-1.6449058694e+00,0.0000000000e+00,8.3747986432e-01,9.8897563629e-01,9.0282832323e-01,1.0661452931e+00
+1.8750000000e-01,5.3333333333e+00,4.7387832652e+00,3.6658888826e+00,8.5634725028e+00,9.6804158779e+00,0.0000000000e+00,-1.1044579801e+01,-1.1288420713e+01,-2.2410881813e-01,-5.9486517134e-01,0.0000000000e+00,1.6580454254e+00,1.9060330681e+00,1.7668734138e+00,2.0311380510e+00
+2.5000000000e-01,4.0000000000e+00,5.8663087458e+00,4.0237084012e+00,1.1448673553e+01,8.7057405984e+00,0.0000000000e+00,-1.5790867096e+01,-8.7704513688e+00,-2.1661192484e+00,6.6072701972e-01,0.0000000000e+00,2.7958331837e+00,3.3305148333e+00,3.0822077414e+00,3.6716563284e+00
+3.7500000000e-01,2.6666666667e+00,-3.4465905605e+00,-5.2926160103e+00,2.3350002398e+01,8.4247649729e+00,0.0000000000e+00,-1.3650415635e+01,-3.9351547786e+00,-4.6476456345e-02,-1.1209122391e+01,0.0000000000e+00,6.4465103767e+00,1.0154257166e+01,4.7347498661e+00,7.4579679465e+00
+5.0000000000e-01,2.0000000000e+00,1.2138476800e+00,-1.2060828241e+00,2.1694670304e+01,6.6378489509e+00,0.0000000000e+00,-5.3388269985e+00,-5.2436793936e+00,-6.0755766250e+00,1.4369373350e+00,0.0000000000e+00,5.5337600149e+00,1.1806138254e+01,2.9570534728e+00,6.3087994474e+00
+7.5000000000e-01,1.3333333333e+00,-2.1006524904e+01,2.5790781806e+00,1.6554229461e+01,1.0975271268e+01,0.0000000000e+00,4.6419465867e+00,-4.1036458635e+00,-1.1865446987e+01,-1.0362276864e+01,0.0000000000e+00,1.5029379184e+01,1.7497664286e+01,9.5546024925e+00,1.1123761318e+01
+1.0000000000e+00,1.0000000000e+00,1.1221334153e+01,1.0269742736e+01,2.1550278604e+01,-2.5333177664e+01,0.0000000000e+00,-1.1946320447e+01,-5.6519804277e+00,-2.0656437395e+01,-1.9537146173e+01,0.0000000000e+00,2.0256538096e+01,4.3575331878e+01,1.7467809685e+01,3.7576292680e+01
diff --git a/Samples/OrdinaryRobustRemoteReference/TRACMT.cvg b/Samples/OrdinaryRobustRemoteReference/TRACMT.cvg
new file mode 100644
index 0000000..a88699f
--- /dev/null
+++ b/Samples/OrdinaryRobustRemoteReference/TRACMT.cvg
@@ -0,0 +1,2529 @@
+================================================================================
+Now Frequency(Hz): 0.00146484, Period(s): 682.667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.88469
+ Estimated response function: ( 3.7554e-01, 4.2087e-01), ( 3.3244e-01, 4.4139e-01)
+ Amplitude of the estimated response function: 5.6406e-01, 5.5257e-01
+ Phase(deg.) of the estimated response function: 48.3, 53.0
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.022806
+ Sum of weights: 82.9476
+ Squared coherence: 0.885022
+ Estimated response function: ( 3.7573e-01, 4.2087e-01), ( 3.3240e-01, 4.4119e-01)
+ Amplitude of the estimated response function: 5.6419e-01, 5.5240e-01
+ Phase(deg.) of the estimated response function: 48.2, 53.0
+ Weighted residual power: 0.000981678
+Iteration number = 1
+ Scale factor: 0.0227546
+ Sum of weights: 82.9452
+ Squared coherence: 0.885037
+ Estimated response function: ( 3.7574e-01, 4.2087e-01), ( 3.3240e-01, 4.4118e-01)
+ Amplitude of the estimated response function: 5.6419e-01, 5.5239e-01
+ Phase(deg.) of the estimated response function: 48.2, 53.0
+ Weighted residual power: 0.000981555
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0227546
+ Parameter c: 2.72115
+ Sum of weights: 52.3421
+ Squared coherence: 0.936934
+ Estimated response function: ( 3.6478e-01, 4.3058e-01), ( 3.1974e-01, 4.3805e-01)
+ Amplitude of the estimated response function: 5.6433e-01, 5.4233e-01
+ Phase(deg.) of the estimated response function: 49.7, 53.9
+ Weighted residual power: 0.000472609
+Iteration number = 1
+ Scale factor: 0.0227546
+ Parameter c: 2.72115
+ Sum of weights: 52.4908
+ Squared coherence: 0.936921
+ Estimated response function: ( 3.6093e-01, 4.3574e-01), ( 3.1606e-01, 4.3815e-01)
+ Amplitude of the estimated response function: 5.6581e-01, 5.4025e-01
+ Phase(deg.) of the estimated response function: 50.4, 54.2
+ Weighted residual power: 0.000466372
+Iteration number = 2
+ Scale factor: 0.0227546
+ Parameter c: 2.72115
+ Sum of weights: 52.4937
+ Squared coherence: 0.937038
+ Estimated response function: ( 3.5945e-01, 4.3869e-01), ( 3.1506e-01, 4.3901e-01)
+ Amplitude of the estimated response function: 5.6715e-01, 5.4036e-01
+ Phase(deg.) of the estimated response function: 50.7, 54.3
+ Weighted residual power: 0.000464009
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.943059
+ Estimated response function: ( -6.7784e-01, -8.3556e-01), ( -1.5476e-01, -1.5345e-01)
+ Amplitude of the estimated response function: 1.0759e+00, 2.1794e-01
+ Phase(deg.) of the estimated response function: -129.1, -135.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0222735
+ Sum of weights: 82.9436
+ Squared coherence: 0.943228
+ Estimated response function: ( -6.7752e-01, -8.3556e-01), ( -1.5541e-01, -1.5301e-01)
+ Amplitude of the estimated response function: 1.0757e+00, 2.1809e-01
+ Phase(deg.) of the estimated response function: -129.0, -135.4
+ Weighted residual power: 0.00091751
+Iteration number = 1
+ Scale factor: 0.0223012
+ Sum of weights: 82.9424
+ Squared coherence: 0.943231
+ Estimated response function: ( -6.7752e-01, -8.3556e-01), ( -1.5542e-01, -1.5300e-01)
+ Amplitude of the estimated response function: 1.0757e+00, 2.1809e-01
+ Phase(deg.) of the estimated response function: -129.0, -135.4
+ Weighted residual power: 0.000917455
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0223012
+ Parameter c: 2.72115
+ Sum of weights: 52.5864
+ Squared coherence: 0.96767
+ Estimated response function: ( -6.7183e-01, -8.2903e-01), ( -1.6088e-01, -1.5195e-01)
+ Amplitude of the estimated response function: 1.0671e+00, 2.2129e-01
+ Phase(deg.) of the estimated response function: -129.0, -136.6
+ Weighted residual power: 0.000494981
+Iteration number = 1
+ Scale factor: 0.0223012
+ Parameter c: 2.72115
+ Sum of weights: 52.6135
+ Squared coherence: 0.967771
+ Estimated response function: ( -6.6963e-01, -8.2683e-01), ( -1.6317e-01, -1.5197e-01)
+ Amplitude of the estimated response function: 1.0640e+00, 2.2298e-01
+ Phase(deg.) of the estimated response function: -129.0, -137.0
+ Weighted residual power: 0.000492262
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00195312, Period(s): 512
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.881175
+ Estimated response function: ( 4.5545e-01, 4.7352e-01), ( 3.8421e-01, 5.4449e-01)
+ Amplitude of the estimated response function: 6.5701e-01, 6.6640e-01
+ Phase(deg.) of the estimated response function: 46.1, 54.8
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0218496
+ Sum of weights: 82.6197
+ Squared coherence: 0.882984
+ Estimated response function: ( 4.5500e-01, 4.7346e-01), ( 3.8344e-01, 5.4390e-01)
+ Amplitude of the estimated response function: 6.5665e-01, 6.6547e-01
+ Phase(deg.) of the estimated response function: 46.1, 54.8
+ Weighted residual power: 0.000963873
+Iteration number = 1
+ Scale factor: 0.0216392
+ Sum of weights: 82.5946
+ Squared coherence: 0.883104
+ Estimated response function: ( 4.5497e-01, 4.7346e-01), ( 3.8339e-01, 5.4387e-01)
+ Amplitude of the estimated response function: 6.5663e-01, 6.6541e-01
+ Phase(deg.) of the estimated response function: 46.1, 54.8
+ Weighted residual power: 0.000962433
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0216392
+ Parameter c: 2.72115
+ Sum of weights: 51.9848
+ Squared coherence: 0.94671
+ Estimated response function: ( 4.5796e-01, 4.7390e-01), ( 3.9126e-01, 5.4359e-01)
+ Amplitude of the estimated response function: 6.5902e-01, 6.6975e-01
+ Phase(deg.) of the estimated response function: 46.0, 54.3
+ Weighted residual power: 0.000405453
+Iteration number = 1
+ Scale factor: 0.0216392
+ Parameter c: 2.72115
+ Sum of weights: 51.9775
+ Squared coherence: 0.947136
+ Estimated response function: ( 4.5955e-01, 4.7370e-01), ( 3.9451e-01, 5.4318e-01)
+ Amplitude of the estimated response function: 6.5998e-01, 6.7133e-01
+ Phase(deg.) of the estimated response function: 45.9, 54.0
+ Weighted residual power: 0.000403474
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 83
+ Squared coherence: 0.952068
+ Estimated response function: ( -8.0225e-01, -1.0040e+00), ( -1.8291e-01, -2.1313e-01)
+ Amplitude of the estimated response function: 1.2852e+00, 2.8086e-01
+ Phase(deg.) of the estimated response function: -128.6, -130.6
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0202773
+ Sum of weights: 82.6902
+ Squared coherence: 0.953928
+ Estimated response function: ( -8.0554e-01, -1.0066e+00), ( -1.8058e-01, -2.1369e-01)
+ Amplitude of the estimated response function: 1.2892e+00, 2.7978e-01
+ Phase(deg.) of the estimated response function: -128.7, -130.2
+ Weighted residual power: 0.000718665
+Iteration number = 1
+ Scale factor: 0.0200992
+ Sum of weights: 82.6802
+ Squared coherence: 0.953988
+ Estimated response function: ( -8.0565e-01, -1.0067e+00), ( -1.8050e-01, -2.1371e-01)
+ Amplitude of the estimated response function: 1.2894e+00, 2.7974e-01
+ Phase(deg.) of the estimated response function: -128.7, -130.2
+ Weighted residual power: 0.000717807
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0200992
+ Parameter c: 2.72115
+ Sum of weights: 54.5999
+ Squared coherence: 0.977877
+ Estimated response function: ( -8.1360e-01, -1.0059e+00), ( -1.8360e-01, -1.9836e-01)
+ Amplitude of the estimated response function: 1.2937e+00, 2.7029e-01
+ Phase(deg.) of the estimated response function: -129.0, -132.8
+ Weighted residual power: 0.000366205
+Iteration number = 1
+ Scale factor: 0.0200992
+ Parameter c: 2.72115
+ Sum of weights: 54.666
+ Squared coherence: 0.978069
+ Estimated response function: ( -8.1499e-01, -1.0054e+00), ( -1.8576e-01, -1.9361e-01)
+ Amplitude of the estimated response function: 1.2943e+00, 2.6831e-01
+ Phase(deg.) of the estimated response function: -129.0, -133.8
+ Weighted residual power: 0.000362375
+Iteration number = 2
+ Scale factor: 0.0200992
+ Parameter c: 2.72115
+ Sum of weights: 54.6546
+ Squared coherence: 0.978125
+ Estimated response function: ( -8.1503e-01, -1.0052e+00), ( -1.8687e-01, -1.9200e-01)
+ Amplitude of the estimated response function: 1.2941e+00, 2.6793e-01
+ Phase(deg.) of the estimated response function: -129.0, -134.2
+ Weighted residual power: 0.000361139
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00292969, Period(s): 341.333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.810574
+ Estimated response function: ( 4.7326e-01, 5.9456e-01), ( 4.3491e-01, 7.6086e-01)
+ Amplitude of the estimated response function: 7.5992e-01, 8.7639e-01
+ Phase(deg.) of the estimated response function: 51.5, 60.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0288886
+ Sum of weights: 166.415
+ Squared coherence: 0.814823
+ Estimated response function: ( 4.7388e-01, 5.9538e-01), ( 4.3979e-01, 7.6089e-01)
+ Amplitude of the estimated response function: 7.6094e-01, 8.7885e-01
+ Phase(deg.) of the estimated response function: 51.5, 60.0
+ Weighted residual power: 0.00175102
+Iteration number = 1
+ Scale factor: 0.0285009
+ Sum of weights: 166.298
+ Squared coherence: 0.81525
+ Estimated response function: ( 4.7421e-01, 5.9551e-01), ( 4.4048e-01, 7.6065e-01)
+ Amplitude of the estimated response function: 7.6125e-01, 8.7898e-01
+ Phase(deg.) of the estimated response function: 51.5, 59.9
+ Weighted residual power: 0.00174595
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0285009
+ Parameter c: 2.69063
+ Sum of weights: 100.247
+ Squared coherence: 0.894387
+ Estimated response function: ( 4.9245e-01, 5.9734e-01), ( 4.8112e-01, 7.4061e-01)
+ Amplitude of the estimated response function: 7.7416e-01, 8.8317e-01
+ Phase(deg.) of the estimated response function: 50.5, 57.0
+ Weighted residual power: 0.00083162
+Iteration number = 1
+ Scale factor: 0.0285009
+ Parameter c: 2.69063
+ Sum of weights: 100.909
+ Squared coherence: 0.897317
+ Estimated response function: ( 5.0209e-01, 5.9962e-01), ( 5.0016e-01, 7.3271e-01)
+ Amplitude of the estimated response function: 7.8207e-01, 8.8714e-01
+ Phase(deg.) of the estimated response function: 50.1, 55.7
+ Weighted residual power: 0.000825873
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.917953
+ Estimated response function: ( -9.3048e-01, -1.3085e+00), ( -1.8189e-01, -2.2954e-01)
+ Amplitude of the estimated response function: 1.6056e+00, 2.9286e-01
+ Phase(deg.) of the estimated response function: -125.4, -128.4
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0333414
+ Sum of weights: 166.919
+ Squared coherence: 0.918131
+ Estimated response function: ( -9.3035e-01, -1.3084e+00), ( -1.8163e-01, -2.2931e-01)
+ Amplitude of the estimated response function: 1.6054e+00, 2.9253e-01
+ Phase(deg.) of the estimated response function: -125.4, -128.4
+ Weighted residual power: 0.00170763
+Iteration number = 1
+ Scale factor: 0.0332804
+ Sum of weights: 166.913
+ Squared coherence: 0.918144
+ Estimated response function: ( -9.3035e-01, -1.3084e+00), ( -1.8161e-01, -2.2931e-01)
+ Amplitude of the estimated response function: 1.6054e+00, 2.9252e-01
+ Phase(deg.) of the estimated response function: -125.4, -128.4
+ Weighted residual power: 0.00170733
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0332804
+ Parameter c: 2.69063
+ Sum of weights: 114.527
+ Squared coherence: 0.95728
+ Estimated response function: ( -9.3352e-01, -1.3030e+00), ( -1.7784e-01, -2.2987e-01)
+ Amplitude of the estimated response function: 1.6029e+00, 2.9064e-01
+ Phase(deg.) of the estimated response function: -125.6, -127.7
+ Weighted residual power: 0.000879729
+Iteration number = 1
+ Scale factor: 0.0332804
+ Parameter c: 2.69063
+ Sum of weights: 114.55
+ Squared coherence: 0.957274
+ Estimated response function: ( -9.3460e-01, -1.3012e+00), ( -1.7667e-01, -2.2967e-01)
+ Amplitude of the estimated response function: 1.6020e+00, 2.8976e-01
+ Phase(deg.) of the estimated response function: -125.7, -127.6
+ Weighted residual power: 0.00087964
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00390625, Period(s): 256
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.795293
+ Estimated response function: ( 6.0472e-01, 7.0462e-01), ( 4.3766e-01, 9.1245e-01)
+ Amplitude of the estimated response function: 9.2854e-01, 1.0120e+00
+ Phase(deg.) of the estimated response function: 49.4, 64.4
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0310511
+ Sum of weights: 166.784
+ Squared coherence: 0.796375
+ Estimated response function: ( 6.0490e-01, 7.0408e-01), ( 4.3770e-01, 9.1133e-01)
+ Amplitude of the estimated response function: 9.2824e-01, 1.0110e+00
+ Phase(deg.) of the estimated response function: 49.3, 64.3
+ Weighted residual power: 0.00163652
+Iteration number = 1
+ Scale factor: 0.0309407
+ Sum of weights: 166.773
+ Squared coherence: 0.796417
+ Estimated response function: ( 6.0491e-01, 7.0403e-01), ( 4.3769e-01, 9.1124e-01)
+ Amplitude of the estimated response function: 9.2821e-01, 1.0109e+00
+ Phase(deg.) of the estimated response function: 49.3, 64.3
+ Weighted residual power: 0.00163594
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0309407
+ Parameter c: 2.69063
+ Sum of weights: 109.585
+ Squared coherence: 0.890475
+ Estimated response function: ( 6.2530e-01, 6.8916e-01), ( 4.4520e-01, 9.1482e-01)
+ Amplitude of the estimated response function: 9.3056e-01, 1.0174e+00
+ Phase(deg.) of the estimated response function: 47.8, 64.0
+ Weighted residual power: 0.000825154
+Iteration number = 1
+ Scale factor: 0.0309407
+ Parameter c: 2.69063
+ Sum of weights: 109.718
+ Squared coherence: 0.890703
+ Estimated response function: ( 6.3352e-01, 6.8379e-01), ( 4.4827e-01, 9.1508e-01)
+ Amplitude of the estimated response function: 9.3215e-01, 1.0190e+00
+ Phase(deg.) of the estimated response function: 47.2, 63.9
+ Weighted residual power: 0.000824492
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 167
+ Squared coherence: 0.898233
+ Estimated response function: ( -1.2107e+00, -1.5316e+00), ( -2.0797e-01, -2.9546e-01)
+ Amplitude of the estimated response function: 1.9524e+00, 3.6131e-01
+ Phase(deg.) of the estimated response function: -128.3, -125.1
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0320828
+ Sum of weights: 166.624
+ Squared coherence: 0.899563
+ Estimated response function: ( -1.2101e+00, -1.5314e+00), ( -2.0696e-01, -2.9203e-01)
+ Amplitude of the estimated response function: 1.9518e+00, 3.5793e-01
+ Phase(deg.) of the estimated response function: -128.3, -125.3
+ Weighted residual power: 0.00174138
+Iteration number = 1
+ Scale factor: 0.0320228
+ Sum of weights: 166.616
+ Squared coherence: 0.899589
+ Estimated response function: ( -1.2101e+00, -1.5314e+00), ( -2.0694e-01, -2.9196e-01)
+ Amplitude of the estimated response function: 1.9517e+00, 3.5786e-01
+ Phase(deg.) of the estimated response function: -128.3, -125.3
+ Weighted residual power: 0.00174085
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0320228
+ Parameter c: 2.69063
+ Sum of weights: 111.539
+ Squared coherence: 0.956214
+ Estimated response function: ( -1.2112e+00, -1.5584e+00), ( -1.9635e-01, -3.2332e-01)
+ Amplitude of the estimated response function: 1.9737e+00, 3.7827e-01
+ Phase(deg.) of the estimated response function: -127.9, -121.3
+ Weighted residual power: 0.000787953
+Iteration number = 1
+ Scale factor: 0.0320228
+ Parameter c: 2.69063
+ Sum of weights: 111.669
+ Squared coherence: 0.957058
+ Estimated response function: ( -1.2109e+00, -1.5662e+00), ( -1.9305e-01, -3.3339e-01)
+ Amplitude of the estimated response function: 1.9797e+00, 3.8525e-01
+ Phase(deg.) of the estimated response function: -127.7, -120.1
+ Weighted residual power: 0.000778579
+Iteration number = 2
+ Scale factor: 0.0320228
+ Parameter c: 2.69063
+ Sum of weights: 111.647
+ Squared coherence: 0.957266
+ Estimated response function: ( -1.2106e+00, -1.5685e+00), ( -1.9204e-01, -3.3643e-01)
+ Amplitude of the estimated response function: 1.9813e+00, 3.8739e-01
+ Phase(deg.) of the estimated response function: -127.7, -119.7
+ Weighted residual power: 0.000776143
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00585938, Period(s): 170.667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.69714
+ Estimated response function: ( 8.2872e-01, 9.2629e-01), ( 6.3990e-01, 1.1135e+00)
+ Amplitude of the estimated response function: 1.2429e+00, 1.2843e+00
+ Phase(deg.) of the estimated response function: 48.2, 60.1
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0475882
+ Sum of weights: 334.961
+ Squared coherence: 0.70271
+ Estimated response function: ( 8.2515e-01, 9.2992e-01), ( 6.4011e-01, 1.1171e+00)
+ Amplitude of the estimated response function: 1.2432e+00, 1.2875e+00
+ Phase(deg.) of the estimated response function: 48.4, 60.2
+ Weighted residual power: 0.00363032
+Iteration number = 1
+ Scale factor: 0.0477639
+ Sum of weights: 334.979
+ Squared coherence: 0.702626
+ Estimated response function: ( 8.2517e-01, 9.2988e-01), ( 6.4016e-01, 1.1171e+00)
+ Amplitude of the estimated response function: 1.2432e+00, 1.2875e+00
+ Phase(deg.) of the estimated response function: 48.4, 60.2
+ Weighted residual power: 0.00363163
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0477639
+ Parameter c: 2.67584
+ Sum of weights: 229.978
+ Squared coherence: 0.830192
+ Estimated response function: ( 8.3095e-01, 9.1333e-01), ( 6.5443e-01, 1.1158e+00)
+ Amplitude of the estimated response function: 1.2348e+00, 1.2935e+00
+ Phase(deg.) of the estimated response function: 47.7, 59.6
+ Weighted residual power: 0.00176792
+Iteration number = 1
+ Scale factor: 0.0477639
+ Parameter c: 2.67584
+ Sum of weights: 229.971
+ Squared coherence: 0.830423
+ Estimated response function: ( 8.3299e-01, 9.0717e-01), ( 6.5910e-01, 1.1151e+00)
+ Amplitude of the estimated response function: 1.2316e+00, 1.2954e+00
+ Phase(deg.) of the estimated response function: 47.4, 59.4
+ Weighted residual power: 0.00176226
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.858605
+ Estimated response function: ( -1.5595e+00, -1.8754e+00), ( -3.0034e-01, -3.2833e-01)
+ Amplitude of the estimated response function: 2.4391e+00, 4.4498e-01
+ Phase(deg.) of the estimated response function: -129.7, -132.5
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.043179
+ Sum of weights: 334.663
+ Squared coherence: 0.862036
+ Estimated response function: ( -1.5605e+00, -1.8813e+00), ( -3.0019e-01, -3.2961e-01)
+ Amplitude of the estimated response function: 2.4443e+00, 4.4583e-01
+ Phase(deg.) of the estimated response function: -129.7, -132.3
+ Weighted residual power: 0.00348942
+Iteration number = 1
+ Scale factor: 0.0434217
+ Sum of weights: 334.699
+ Squared coherence: 0.861959
+ Estimated response function: ( -1.5605e+00, -1.8812e+00), ( -3.0017e-01, -3.2963e-01)
+ Amplitude of the estimated response function: 2.4442e+00, 4.4582e-01
+ Phase(deg.) of the estimated response function: -129.7, -132.3
+ Weighted residual power: 0.00349146
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0434217
+ Parameter c: 2.67584
+ Sum of weights: 218.773
+ Squared coherence: 0.934817
+ Estimated response function: ( -1.5645e+00, -1.9067e+00), ( -2.9279e-01, -3.4999e-01)
+ Amplitude of the estimated response function: 2.4664e+00, 4.5631e-01
+ Phase(deg.) of the estimated response function: -129.4, -129.9
+ Weighted residual power: 0.00156197
+Iteration number = 1
+ Scale factor: 0.0434217
+ Parameter c: 2.67584
+ Sum of weights: 218.759
+ Squared coherence: 0.93531
+ Estimated response function: ( -1.5655e+00, -1.9144e+00), ( -2.9153e-01, -3.5669e-01)
+ Amplitude of the estimated response function: 2.4730e+00, 4.6067e-01
+ Phase(deg.) of the estimated response function: -129.3, -129.3
+ Weighted residual power: 0.00155742
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0078125, Period(s): 128
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.662431
+ Estimated response function: ( 1.0339e+00, 1.0460e+00), ( 8.5128e-01, 1.3658e+00)
+ Amplitude of the estimated response function: 1.4707e+00, 1.6093e+00
+ Phase(deg.) of the estimated response function: 45.3, 58.1
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0460144
+ Sum of weights: 335.168
+ Squared coherence: 0.666596
+ Estimated response function: ( 1.0353e+00, 1.0504e+00), ( 8.5002e-01, 1.3582e+00)
+ Amplitude of the estimated response function: 1.4749e+00, 1.6022e+00
+ Phase(deg.) of the estimated response function: 45.4, 58.0
+ Weighted residual power: 0.00337387
+Iteration number = 1
+ Scale factor: 0.0459654
+ Sum of weights: 335.155
+ Squared coherence: 0.666657
+ Estimated response function: ( 1.0354e+00, 1.0505e+00), ( 8.4997e-01, 1.3581e+00)
+ Amplitude of the estimated response function: 1.4750e+00, 1.6021e+00
+ Phase(deg.) of the estimated response function: 45.4, 58.0
+ Weighted residual power: 0.00337296
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0459654
+ Parameter c: 2.67584
+ Sum of weights: 231.347
+ Squared coherence: 0.814872
+ Estimated response function: ( 1.0069e+00, 1.0782e+00), ( 8.7246e-01, 1.3195e+00)
+ Amplitude of the estimated response function: 1.4753e+00, 1.5818e+00
+ Phase(deg.) of the estimated response function: 47.0, 56.5
+ Weighted residual power: 0.00158587
+Iteration number = 1
+ Scale factor: 0.0459654
+ Parameter c: 2.67584
+ Sum of weights: 231.639
+ Squared coherence: 0.815162
+ Estimated response function: ( 9.9871e-01, 1.0857e+00), ( 8.7903e-01, 1.3108e+00)
+ Amplitude of the estimated response function: 1.4752e+00, 1.5783e+00
+ Phase(deg.) of the estimated response function: 47.4, 56.2
+ Weighted residual power: 0.00158008
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 336
+ Squared coherence: 0.81653
+ Estimated response function: ( -1.7951e+00, -2.2401e+00), ( -4.1262e-01, -3.9622e-01)
+ Amplitude of the estimated response function: 2.8706e+00, 5.7205e-01
+ Phase(deg.) of the estimated response function: -128.7, -136.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0455373
+ Sum of weights: 335.227
+ Squared coherence: 0.818577
+ Estimated response function: ( -1.7943e+00, -2.2358e+00), ( -4.1218e-01, -3.9641e-01)
+ Amplitude of the estimated response function: 2.8668e+00, 5.7187e-01
+ Phase(deg.) of the estimated response function: -128.7, -136.1
+ Weighted residual power: 0.0034975
+Iteration number = 1
+ Scale factor: 0.0453679
+ Sum of weights: 335.203
+ Squared coherence: 0.818638
+ Estimated response function: ( -1.7943e+00, -2.2357e+00), ( -4.1220e-01, -3.9638e-01)
+ Amplitude of the estimated response function: 2.8667e+00, 5.7186e-01
+ Phase(deg.) of the estimated response function: -128.7, -136.1
+ Weighted residual power: 0.00349601
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0453679
+ Parameter c: 2.67584
+ Sum of weights: 224.586
+ Squared coherence: 0.912459
+ Estimated response function: ( -1.8245e+00, -2.2802e+00), ( -3.8474e-01, -4.1682e-01)
+ Amplitude of the estimated response function: 2.9203e+00, 5.6724e-01
+ Phase(deg.) of the estimated response function: -128.7, -132.7
+ Weighted residual power: 0.00160985
+Iteration number = 1
+ Scale factor: 0.0453679
+ Parameter c: 2.67584
+ Sum of weights: 224.574
+ Squared coherence: 0.913729
+ Estimated response function: ( -1.8321e+00, -2.2944e+00), ( -3.7612e-01, -4.2190e-01)
+ Amplitude of the estimated response function: 2.9361e+00, 5.6521e-01
+ Phase(deg.) of the estimated response function: -128.6, -131.7
+ Weighted residual power: 0.00159654
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0117188, Period(s): 85.3333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.562555
+ Estimated response function: ( 1.3891e+00, 1.2224e+00), ( 1.0533e+00, 1.8187e+00)
+ Amplitude of the estimated response function: 1.8504e+00, 2.1017e+00
+ Phase(deg.) of the estimated response function: 41.3, 59.9
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0742573
+ Sum of weights: 673.05
+ Squared coherence: 0.565359
+ Estimated response function: ( 1.3889e+00, 1.2208e+00), ( 1.0530e+00, 1.8221e+00)
+ Amplitude of the estimated response function: 1.8491e+00, 2.1045e+00
+ Phase(deg.) of the estimated response function: 41.3, 60.0
+ Weighted residual power: 0.00743701
+Iteration number = 1
+ Scale factor: 0.0744731
+ Sum of weights: 673.077
+ Squared coherence: 0.565286
+ Estimated response function: ( 1.3889e+00, 1.2207e+00), ( 1.0531e+00, 1.8221e+00)
+ Amplitude of the estimated response function: 1.8491e+00, 2.1045e+00
+ Phase(deg.) of the estimated response function: 41.3, 60.0
+ Weighted residual power: 0.00743906
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0744731
+ Parameter c: 2.66852
+ Sum of weights: 489.075
+ Squared coherence: 0.742511
+ Estimated response function: ( 1.3675e+00, 1.2292e+00), ( 1.0951e+00, 1.8011e+00)
+ Amplitude of the estimated response function: 1.8387e+00, 2.1079e+00
+ Phase(deg.) of the estimated response function: 42.0, 58.7
+ Weighted residual power: 0.00353595
+Iteration number = 1
+ Scale factor: 0.0744731
+ Parameter c: 2.66852
+ Sum of weights: 489.254
+ Squared coherence: 0.74254
+ Estimated response function: ( 1.3622e+00, 1.2308e+00), ( 1.1061e+00, 1.7975e+00)
+ Amplitude of the estimated response function: 1.8358e+00, 2.1105e+00
+ Phase(deg.) of the estimated response function: 42.1, 58.4
+ Weighted residual power: 0.00353299
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.758964
+ Estimated response function: ( -2.4524e+00, -2.9277e+00), ( -4.3863e-01, -5.8231e-01)
+ Amplitude of the estimated response function: 3.8192e+00, 7.2903e-01
+ Phase(deg.) of the estimated response function: -130.0, -127.0
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0736573
+ Sum of weights: 672.775
+ Squared coherence: 0.761626
+ Estimated response function: ( -2.4472e+00, -2.9333e+00), ( -4.4179e-01, -5.8236e-01)
+ Amplitude of the estimated response function: 3.8200e+00, 7.3097e-01
+ Phase(deg.) of the estimated response function: -129.8, -127.2
+ Weighted residual power: 0.00768526
+Iteration number = 1
+ Scale factor: 0.0735713
+ Sum of weights: 672.759
+ Squared coherence: 0.761659
+ Estimated response function: ( -2.4471e+00, -2.9334e+00), ( -4.4183e-01, -5.8239e-01)
+ Amplitude of the estimated response function: 3.8201e+00, 7.3102e-01
+ Phase(deg.) of the estimated response function: -129.8, -127.2
+ Weighted residual power: 0.00768386
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0735713
+ Parameter c: 2.66852
+ Sum of weights: 477.002
+ Squared coherence: 0.869332
+ Estimated response function: ( -2.4661e+00, -2.9406e+00), ( -4.6564e-01, -6.1156e-01)
+ Amplitude of the estimated response function: 3.8378e+00, 7.6865e-01
+ Phase(deg.) of the estimated response function: -130.0, -127.3
+ Weighted residual power: 0.003871
+Iteration number = 1
+ Scale factor: 0.0735713
+ Parameter c: 2.66852
+ Sum of weights: 476.746
+ Squared coherence: 0.86986
+ Estimated response function: ( -2.4713e+00, -2.9427e+00), ( -4.7131e-01, -6.2091e-01)
+ Amplitude of the estimated response function: 3.8428e+00, 7.7953e-01
+ Phase(deg.) of the estimated response function: -130.0, -127.2
+ Weighted residual power: 0.00386602
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.015625, Period(s): 64
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.488236
+ Estimated response function: ( 1.5185e+00, 1.3183e+00), ( 1.3435e+00, 2.1202e+00)
+ Amplitude of the estimated response function: 2.0109e+00, 2.5100e+00
+ Phase(deg.) of the estimated response function: 41.0, 57.6
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0724904
+ Sum of weights: 673.116
+ Squared coherence: 0.491499
+ Estimated response function: ( 1.5222e+00, 1.3148e+00), ( 1.3426e+00, 2.1181e+00)
+ Amplitude of the estimated response function: 2.0114e+00, 2.5078e+00
+ Phase(deg.) of the estimated response function: 40.8, 57.6
+ Weighted residual power: 0.00708811
+Iteration number = 1
+ Scale factor: 0.0723684
+ Sum of weights: 673.104
+ Squared coherence: 0.491541
+ Estimated response function: ( 1.5223e+00, 1.3148e+00), ( 1.3426e+00, 2.1181e+00)
+ Amplitude of the estimated response function: 2.0114e+00, 2.5077e+00
+ Phase(deg.) of the estimated response function: 40.8, 57.6
+ Weighted residual power: 0.00708714
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0723684
+ Parameter c: 2.66852
+ Sum of weights: 484.607
+ Squared coherence: 0.673544
+ Estimated response function: ( 1.5379e+00, 1.3279e+00), ( 1.3537e+00, 2.0805e+00)
+ Amplitude of the estimated response function: 2.0319e+00, 2.4821e+00
+ Phase(deg.) of the estimated response function: 40.8, 57.0
+ Weighted residual power: 0.00356131
+Iteration number = 1
+ Scale factor: 0.0723684
+ Parameter c: 2.66852
+ Sum of weights: 484.737
+ Squared coherence: 0.673597
+ Estimated response function: ( 1.5427e+00, 1.3317e+00), ( 1.3569e+00, 2.0699e+00)
+ Amplitude of the estimated response function: 2.0379e+00, 2.4750e+00
+ Phase(deg.) of the estimated response function: 40.8, 56.8
+ Weighted residual power: 0.00356028
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 674
+ Squared coherence: 0.671128
+ Estimated response function: ( -2.9422e+00, -3.2299e+00), ( -5.5561e-01, -5.7310e-01)
+ Amplitude of the estimated response function: 4.3691e+00, 7.9821e-01
+ Phase(deg.) of the estimated response function: -132.3, -134.1
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.0683443
+ Sum of weights: 671.868
+ Squared coherence: 0.676499
+ Estimated response function: ( -2.9375e+00, -3.2372e+00), ( -5.6057e-01, -5.7689e-01)
+ Amplitude of the estimated response function: 4.3713e+00, 8.0439e-01
+ Phase(deg.) of the estimated response function: -132.2, -134.2
+ Weighted residual power: 0.00826111
+Iteration number = 1
+ Scale factor: 0.0686162
+ Sum of weights: 671.933
+ Squared coherence: 0.676362
+ Estimated response function: ( -2.9375e+00, -3.2371e+00), ( -5.6056e-01, -5.7699e-01)
+ Amplitude of the estimated response function: 4.3713e+00, 8.0445e-01
+ Phase(deg.) of the estimated response function: -132.2, -134.2
+ Weighted residual power: 0.00826535
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.0686162
+ Parameter c: 2.66852
+ Sum of weights: 453.048
+ Squared coherence: 0.839968
+ Estimated response function: ( -2.9356e+00, -3.2364e+00), ( -5.7037e-01, -6.1945e-01)
+ Amplitude of the estimated response function: 4.3695e+00, 8.4204e-01
+ Phase(deg.) of the estimated response function: -132.2, -132.6
+ Weighted residual power: 0.00349775
+Iteration number = 1
+ Scale factor: 0.0686162
+ Parameter c: 2.66852
+ Sum of weights: 453.093
+ Squared coherence: 0.840113
+ Estimated response function: ( -2.9349e+00, -3.2365e+00), ( -5.7423e-01, -6.3253e-01)
+ Amplitude of the estimated response function: 4.3690e+00, 8.5430e-01
+ Phase(deg.) of the estimated response function: -132.2, -132.2
+ Weighted residual power: 0.00349658
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0234375, Period(s): 42.6667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.285299
+ Estimated response function: ( 1.8094e+00, 1.5365e+00), ( 1.7851e+00, 2.7188e+00)
+ Amplitude of the estimated response function: 2.3738e+00, 3.2525e+00
+ Phase(deg.) of the estimated response function: 40.3, 56.7
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.115513
+ Sum of weights: 1347.73
+ Squared coherence: 0.288686
+ Estimated response function: ( 1.8099e+00, 1.5348e+00), ( 1.7857e+00, 2.7240e+00)
+ Amplitude of the estimated response function: 2.3730e+00, 3.2572e+00
+ Phase(deg.) of the estimated response function: 40.3, 56.8
+ Weighted residual power: 0.0161098
+Iteration number = 1
+ Scale factor: 0.115815
+ Sum of weights: 1347.76
+ Squared coherence: 0.288633
+ Estimated response function: ( 1.8098e+00, 1.5348e+00), ( 1.7857e+00, 2.7240e+00)
+ Amplitude of the estimated response function: 2.3730e+00, 3.2572e+00
+ Phase(deg.) of the estimated response function: 40.3, 56.8
+ Weighted residual power: 0.0161126
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.115815
+ Parameter c: 2.66487
+ Sum of weights: 1007.23
+ Squared coherence: 0.522855
+ Estimated response function: ( 1.9083e+00, 1.5870e+00), ( 1.8507e+00, 2.7172e+00)
+ Amplitude of the estimated response function: 2.4819e+00, 3.2876e+00
+ Phase(deg.) of the estimated response function: 39.7, 55.7
+ Weighted residual power: 0.0082682
+Iteration number = 1
+ Scale factor: 0.115815
+ Parameter c: 2.66487
+ Sum of weights: 1005.03
+ Squared coherence: 0.526725
+ Estimated response function: ( 1.9289e+00, 1.5975e+00), ( 1.8642e+00, 2.7140e+00)
+ Amplitude of the estimated response function: 2.5045e+00, 3.2926e+00
+ Phase(deg.) of the estimated response function: 39.6, 55.5
+ Weighted residual power: 0.0082418
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.541271
+ Estimated response function: ( -3.7694e+00, -3.9053e+00), ( -8.2834e-01, -9.5551e-01)
+ Amplitude of the estimated response function: 5.4277e+00, 1.2646e+00
+ Phase(deg.) of the estimated response function: -134.0, -130.9
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.123226
+ Sum of weights: 1347.51
+ Squared coherence: 0.545925
+ Estimated response function: ( -3.7673e+00, -3.9069e+00), ( -8.2413e-01, -9.6010e-01)
+ Amplitude of the estimated response function: 5.4274e+00, 1.2653e+00
+ Phase(deg.) of the estimated response function: -134.0, -130.6
+ Weighted residual power: 0.0190019
+Iteration number = 1
+ Scale factor: 0.123251
+ Sum of weights: 1347.51
+ Squared coherence: 0.545922
+ Estimated response function: ( -3.7673e+00, -3.9069e+00), ( -8.2410e-01, -9.6011e-01)
+ Amplitude of the estimated response function: 5.4274e+00, 1.2653e+00
+ Phase(deg.) of the estimated response function: -134.0, -130.6
+ Weighted residual power: 0.0190021
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.123251
+ Parameter c: 2.66487
+ Sum of weights: 1000.12
+ Squared coherence: 0.747648
+ Estimated response function: ( -3.7331e+00, -3.8562e+00), ( -8.1722e-01, -1.0234e+00)
+ Amplitude of the estimated response function: 5.3671e+00, 1.3097e+00
+ Phase(deg.) of the estimated response function: -134.1, -128.6
+ Weighted residual power: 0.00904234
+Iteration number = 1
+ Scale factor: 0.123251
+ Parameter c: 2.66487
+ Sum of weights: 1001.08
+ Squared coherence: 0.746773
+ Estimated response function: ( -3.7264e+00, -3.8462e+00), ( -8.1508e-01, -1.0360e+00)
+ Amplitude of the estimated response function: 5.3553e+00, 1.3182e+00
+ Phase(deg.) of the estimated response function: -134.1, -128.2
+ Weighted residual power: 0.00905133
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.03125, Period(s): 32
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.182882
+ Estimated response function: ( 2.4038e+00, 1.7105e+00), ( 2.2720e+00, 3.4053e+00)
+ Amplitude of the estimated response function: 2.9502e+00, 4.0937e+00
+ Phase(deg.) of the estimated response function: 35.4, 56.3
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.117692
+ Sum of weights: 1347.7
+ Squared coherence: 0.18659
+ Estimated response function: ( 2.3990e+00, 1.7126e+00), ( 2.2691e+00, 3.4123e+00)
+ Amplitude of the estimated response function: 2.9476e+00, 4.0978e+00
+ Phase(deg.) of the estimated response function: 35.5, 56.4
+ Weighted residual power: 0.0178857
+Iteration number = 1
+ Scale factor: 0.117671
+ Sum of weights: 1347.69
+ Squared coherence: 0.186601
+ Estimated response function: ( 2.3990e+00, 1.7126e+00), ( 2.2691e+00, 3.4123e+00)
+ Amplitude of the estimated response function: 2.9476e+00, 4.0978e+00
+ Phase(deg.) of the estimated response function: 35.5, 56.4
+ Weighted residual power: 0.0178853
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.117671
+ Parameter c: 2.66487
+ Sum of weights: 989.787
+ Squared coherence: 0.467743
+ Estimated response function: ( 2.3768e+00, 1.7658e+00), ( 2.3306e+00, 3.4004e+00)
+ Amplitude of the estimated response function: 2.9610e+00, 4.1224e+00
+ Phase(deg.) of the estimated response function: 36.6, 55.6
+ Weighted residual power: 0.00848306
+Iteration number = 1
+ Scale factor: 0.117671
+ Parameter c: 2.66487
+ Sum of weights: 989.147
+ Squared coherence: 0.468887
+ Estimated response function: ( 2.3703e+00, 1.7797e+00), ( 2.3475e+00, 3.3996e+00)
+ Amplitude of the estimated response function: 2.9640e+00, 4.1313e+00
+ Phase(deg.) of the estimated response function: 36.9, 55.4
+ Weighted residual power: 0.00847388
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 1349
+ Squared coherence: 0.416897
+ Estimated response function: ( -4.5305e+00, -4.3722e+00), ( -1.0212e+00, -1.1243e+00)
+ Amplitude of the estimated response function: 6.2961e+00, 1.5189e+00
+ Phase(deg.) of the estimated response function: -136.0, -132.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.131509
+ Sum of weights: 1348.11
+ Squared coherence: 0.419911
+ Estimated response function: ( -4.5371e+00, -4.3670e+00), ( -1.0142e+00, -1.1239e+00)
+ Amplitude of the estimated response function: 6.2973e+00, 1.5139e+00
+ Phase(deg.) of the estimated response function: -136.1, -132.1
+ Weighted residual power: 0.0197379
+Iteration number = 1
+ Scale factor: 0.131457
+ Sum of weights: 1348.11
+ Squared coherence: 0.41992
+ Estimated response function: ( -4.5371e+00, -4.3670e+00), ( -1.0141e+00, -1.1239e+00)
+ Amplitude of the estimated response function: 6.2973e+00, 1.5138e+00
+ Phase(deg.) of the estimated response function: -136.1, -132.1
+ Weighted residual power: 0.0197375
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.131457
+ Parameter c: 2.66487
+ Sum of weights: 1019.39
+ Squared coherence: 0.653343
+ Estimated response function: ( -4.4342e+00, -4.3396e+00), ( -9.1178e-01, -1.0439e+00)
+ Amplitude of the estimated response function: 6.2044e+00, 1.3861e+00
+ Phase(deg.) of the estimated response function: -135.6, -131.1
+ Weighted residual power: 0.00995038
+Iteration number = 1
+ Scale factor: 0.131457
+ Parameter c: 2.66487
+ Sum of weights: 1022.78
+ Squared coherence: 0.651157
+ Estimated response function: ( -4.4130e+00, -4.3338e+00), ( -8.9339e-01, -1.0216e+00)
+ Amplitude of the estimated response function: 6.1852e+00, 1.3571e+00
+ Phase(deg.) of the estimated response function: -135.5, -131.2
+ Weighted residual power: 0.00998484
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.046875, Period(s): 21.3333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0
+ Estimated response function: ( 3.4951e+00, 2.1127e+00), ( 2.7520e+00, 4.2758e+00)
+ Amplitude of the estimated response function: 4.0841e+00, 5.0849e+00
+ Phase(deg.) of the estimated response function: 31.2, 57.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.190613
+ Sum of weights: 2696.85
+ Squared coherence: 0
+ Estimated response function: ( 3.4905e+00, 2.1061e+00), ( 2.7290e+00, 4.2591e+00)
+ Amplitude of the estimated response function: 4.0767e+00, 5.0584e+00
+ Phase(deg.) of the estimated response function: 31.1, 57.4
+ Weighted residual power: 0.0415517
+Iteration number = 1
+ Scale factor: 0.190219
+ Sum of weights: 2696.83
+ Squared coherence: 0
+ Estimated response function: ( 3.4905e+00, 2.1061e+00), ( 2.7287e+00, 4.2589e+00)
+ Amplitude of the estimated response function: 4.0767e+00, 5.0581e+00
+ Phase(deg.) of the estimated response function: 31.1, 57.4
+ Weighted residual power: 0.0415476
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.190219
+ Parameter c: 2.66305
+ Sum of weights: 2039.99
+ Squared coherence: 0.25142
+ Estimated response function: ( 3.4017e+00, 2.0860e+00), ( 2.6299e+00, 4.2306e+00)
+ Amplitude of the estimated response function: 3.9903e+00, 4.9814e+00
+ Phase(deg.) of the estimated response function: 31.5, 58.1
+ Weighted residual power: 0.0203781
+Iteration number = 1
+ Scale factor: 0.190219
+ Parameter c: 2.66305
+ Sum of weights: 2046.23
+ Squared coherence: 0.246995
+ Estimated response function: ( 3.3798e+00, 2.0824e+00), ( 2.6063e+00, 4.2245e+00)
+ Amplitude of the estimated response function: 3.9698e+00, 4.9638e+00
+ Phase(deg.) of the estimated response function: 31.6, 58.3
+ Weighted residual power: 0.0204523
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0.137491
+ Estimated response function: ( -5.7019e+00, -4.8532e+00), ( -1.0653e+00, -1.0137e+00)
+ Amplitude of the estimated response function: 7.4877e+00, 1.4705e+00
+ Phase(deg.) of the estimated response function: -139.6, -136.4
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.208203
+ Sum of weights: 2697.61
+ Squared coherence: 0.141308
+ Estimated response function: ( -5.6961e+00, -4.8610e+00), ( -1.0740e+00, -1.0233e+00)
+ Amplitude of the estimated response function: 7.4883e+00, 1.4834e+00
+ Phase(deg.) of the estimated response function: -139.5, -136.4
+ Weighted residual power: 0.0454558
+Iteration number = 1
+ Scale factor: 0.208441
+ Sum of weights: 2697.62
+ Squared coherence: 0.141288
+ Estimated response function: ( -5.6961e+00, -4.8610e+00), ( -1.0740e+00, -1.0233e+00)
+ Amplitude of the estimated response function: 7.4883e+00, 1.4834e+00
+ Phase(deg.) of the estimated response function: -139.5, -136.4
+ Weighted residual power: 0.0454571
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.208441
+ Parameter c: 2.66305
+ Sum of weights: 2082.6
+ Squared coherence: 0.444755
+ Estimated response function: ( -5.6530e+00, -4.9602e+00), ( -8.8944e-01, -1.1365e+00)
+ Amplitude of the estimated response function: 7.5206e+00, 1.4432e+00
+ Phase(deg.) of the estimated response function: -138.7, -128.0
+ Weighted residual power: 0.0238622
+Iteration number = 1
+ Scale factor: 0.208441
+ Parameter c: 2.66305
+ Sum of weights: 2081.68
+ Squared coherence: 0.44573
+ Estimated response function: ( -5.6433e+00, -4.9820e+00), ( -8.4906e-01, -1.1529e+00)
+ Amplitude of the estimated response function: 7.5278e+00, 1.4318e+00
+ Phase(deg.) of the estimated response function: -138.6, -126.4
+ Weighted residual power: 0.0238195
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0625, Period(s): 16
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0
+ Estimated response function: ( 3.8661e+00, 2.4595e+00), ( 3.7929e+00, 5.6612e+00)
+ Amplitude of the estimated response function: 4.5821e+00, 6.8144e+00
+ Phase(deg.) of the estimated response function: 32.5, 56.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.214947
+ Sum of weights: 2696.72
+ Squared coherence: 0
+ Estimated response function: ( 3.8557e+00, 2.4604e+00), ( 3.7434e+00, 5.6688e+00)
+ Amplitude of the estimated response function: 4.5738e+00, 6.7933e+00
+ Phase(deg.) of the estimated response function: 32.5, 56.6
+ Weighted residual power: 0.049531
+Iteration number = 1
+ Scale factor: 0.21527
+ Sum of weights: 2696.76
+ Squared coherence: 0
+ Estimated response function: ( 3.8559e+00, 2.4600e+00), ( 3.7437e+00, 5.6683e+00)
+ Amplitude of the estimated response function: 4.5738e+00, 6.7930e+00
+ Phase(deg.) of the estimated response function: 32.5, 56.6
+ Weighted residual power: 0.0495366
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.21527
+ Parameter c: 2.66305
+ Sum of weights: 2080.02
+ Squared coherence: 0.0308249
+ Estimated response function: ( 3.9277e+00, 2.4448e+00), ( 3.2823e+00, 5.5237e+00)
+ Amplitude of the estimated response function: 4.6264e+00, 6.4254e+00
+ Phase(deg.) of the estimated response function: 31.9, 59.3
+ Weighted residual power: 0.0247656
+Iteration number = 1
+ Scale factor: 0.21527
+ Parameter c: 2.66305
+ Sum of weights: 2092.65
+ Squared coherence: 0.0208152
+ Estimated response function: ( 3.9482e+00, 2.4427e+00), ( 3.1831e+00, 5.4907e+00)
+ Amplitude of the estimated response function: 4.6427e+00, 6.3466e+00
+ Phase(deg.) of the estimated response function: 31.7, 59.9
+ Weighted residual power: 0.0249937
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 2699
+ Squared coherence: 0
+ Estimated response function: ( -5.7741e+00, -5.9493e+00), ( -1.3897e+00, -1.3007e+00)
+ Amplitude of the estimated response function: 8.2906e+00, 1.9034e+00
+ Phase(deg.) of the estimated response function: -134.1, -136.9
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.219695
+ Sum of weights: 2698.47
+ Squared coherence: 0
+ Estimated response function: ( -5.7752e+00, -5.9441e+00), ( -1.4083e+00, -1.3112e+00)
+ Amplitude of the estimated response function: 8.2876e+00, 1.9242e+00
+ Phase(deg.) of the estimated response function: -134.2, -137.0
+ Weighted residual power: 0.0498645
+Iteration number = 1
+ Scale factor: 0.219928
+ Sum of weights: 2698.48
+ Squared coherence: 0
+ Estimated response function: ( -5.7751e+00, -5.9442e+00), ( -1.4081e+00, -1.3112e+00)
+ Amplitude of the estimated response function: 8.2877e+00, 1.9241e+00
+ Phase(deg.) of the estimated response function: -134.2, -137.0
+ Weighted residual power: 0.0498661
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.219928
+ Parameter c: 2.66305
+ Sum of weights: 2091.2
+ Squared coherence: 0.248979
+ Estimated response function: ( -6.0605e+00, -5.8105e+00), ( -1.4275e+00, -1.3844e+00)
+ Amplitude of the estimated response function: 8.3959e+00, 1.9886e+00
+ Phase(deg.) of the estimated response function: -136.2, -135.9
+ Weighted residual power: 0.0263899
+Iteration number = 1
+ Scale factor: 0.219928
+ Parameter c: 2.66305
+ Sum of weights: 2085.17
+ Squared coherence: 0.254814
+ Estimated response function: ( -6.1214e+00, -5.7715e+00), ( -1.4449e+00, -1.3872e+00)
+ Amplitude of the estimated response function: 8.4132e+00, 2.0030e+00
+ Phase(deg.) of the estimated response function: -136.7, -136.2
+ Weighted residual power: 0.0262236
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.09375, Period(s): 10.6667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( 3.9019e+00, 2.2656e+00), ( 4.4292e+00, 7.3770e+00)
+ Amplitude of the estimated response function: 4.5120e+00, 8.6045e+00
+ Phase(deg.) of the estimated response function: 30.1, 59.0
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.3301
+ Sum of weights: 5394.64
+ Squared coherence: 0
+ Estimated response function: ( 3.8949e+00, 2.2811e+00), ( 4.3922e+00, 7.3913e+00)
+ Amplitude of the estimated response function: 4.5137e+00, 8.5979e+00
+ Phase(deg.) of the estimated response function: 30.4, 59.3
+ Weighted residual power: 0.117904
+Iteration number = 1
+ Scale factor: 0.32998
+ Sum of weights: 5394.63
+ Squared coherence: 0
+ Estimated response function: ( 3.8950e+00, 2.2811e+00), ( 4.3922e+00, 7.3915e+00)
+ Amplitude of the estimated response function: 4.5138e+00, 8.5980e+00
+ Phase(deg.) of the estimated response function: 30.4, 59.3
+ Weighted residual power: 0.117905
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.32998
+ Parameter c: 2.66214
+ Sum of weights: 4164.24
+ Squared coherence: 0
+ Estimated response function: ( 3.8730e+00, 2.1104e+00), ( 4.5287e+00, 7.1763e+00)
+ Amplitude of the estimated response function: 4.4107e+00, 8.4858e+00
+ Phase(deg.) of the estimated response function: 28.6, 57.7
+ Weighted residual power: 0.0551405
+Iteration number = 1
+ Scale factor: 0.32998
+ Parameter c: 2.66214
+ Sum of weights: 4179.34
+ Squared coherence: 0
+ Estimated response function: ( 3.8739e+00, 2.0798e+00), ( 4.5622e+00, 7.1418e+00)
+ Amplitude of the estimated response function: 4.3969e+00, 8.4746e+00
+ Phase(deg.) of the estimated response function: 28.2, 57.4
+ Weighted residual power: 0.0556177
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( -6.8066e+00, -7.2849e+00), ( -4.3713e-01, -2.5180e+00)
+ Amplitude of the estimated response function: 9.9699e+00, 2.5557e+00
+ Phase(deg.) of the estimated response function: -133.1, -99.8
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.304303
+ Sum of weights: 5391.17
+ Squared coherence: 0
+ Estimated response function: ( -6.7845e+00, -7.3230e+00), ( -4.5213e-01, -2.6111e+00)
+ Amplitude of the estimated response function: 9.9827e+00, 2.6500e+00
+ Phase(deg.) of the estimated response function: -132.8, -99.8
+ Weighted residual power: 0.121071
+Iteration number = 1
+ Scale factor: 0.305432
+ Sum of weights: 5391.25
+ Squared coherence: 0
+ Estimated response function: ( -6.7849e+00, -7.3232e+00), ( -4.5196e-01, -2.6117e+00)
+ Amplitude of the estimated response function: 9.9832e+00, 2.6505e+00
+ Phase(deg.) of the estimated response function: -132.8, -99.8
+ Weighted residual power: 0.121094
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.305432
+ Parameter c: 2.66214
+ Sum of weights: 3996.97
+ Squared coherence: 0.0985905
+ Estimated response function: ( -6.8657e+00, -6.9912e+00), ( -1.3267e+00, -2.5057e+00)
+ Amplitude of the estimated response function: 9.7987e+00, 2.8352e+00
+ Phase(deg.) of the estimated response function: -134.5, -117.9
+ Weighted residual power: 0.0485671
+Iteration number = 1
+ Scale factor: 0.305432
+ Parameter c: 2.66214
+ Sum of weights: 4013.31
+ Squared coherence: 0.0861207
+ Estimated response function: ( -6.9019e+00, -6.9385e+00), ( -1.5094e+00, -2.4943e+00)
+ Amplitude of the estimated response function: 9.7866e+00, 2.9154e+00
+ Phase(deg.) of the estimated response function: -134.8, -121.2
+ Weighted residual power: 0.0492692
+Iteration number = 2
+ Scale factor: 0.305432
+ Parameter c: 2.66214
+ Sum of weights: 4012.28
+ Squared coherence: 0.0853595
+ Estimated response function: ( -6.9144e+00, -6.9310e+00), ( -1.5498e+00, -2.4941e+00)
+ Amplitude of the estimated response function: 9.7902e+00, 2.9364e+00
+ Phase(deg.) of the estimated response function: -134.9, -121.9
+ Weighted residual power: 0.0493184
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.125, Period(s): 8
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( 5.2436e+00, 1.8981e+00), ( 5.8367e+00, 7.6169e+00)
+ Amplitude of the estimated response function: 5.5766e+00, 9.5961e+00
+ Phase(deg.) of the estimated response function: 19.9, 52.5
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.361732
+ Sum of weights: 5397.06
+ Squared coherence: 0
+ Estimated response function: ( 5.2345e+00, 1.8737e+00), ( 5.8302e+00, 7.6385e+00)
+ Amplitude of the estimated response function: 5.5598e+00, 9.6092e+00
+ Phase(deg.) of the estimated response function: 19.7, 52.6
+ Weighted residual power: 0.136418
+Iteration number = 1
+ Scale factor: 0.362392
+ Sum of weights: 5397.09
+ Squared coherence: 0
+ Estimated response function: ( 5.2343e+00, 1.8739e+00), ( 5.8296e+00, 7.6385e+00)
+ Amplitude of the estimated response function: 5.5596e+00, 9.6089e+00
+ Phase(deg.) of the estimated response function: 19.7, 52.6
+ Weighted residual power: 0.136419
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.362392
+ Parameter c: 2.66214
+ Sum of weights: 4190.59
+ Squared coherence: 0
+ Estimated response function: ( 4.7311e+00, 1.9972e+00), ( 5.8180e+00, 7.9060e+00)
+ Amplitude of the estimated response function: 5.1354e+00, 9.8160e+00
+ Phase(deg.) of the estimated response function: 22.9, 53.7
+ Weighted residual power: 0.0674299
+Iteration number = 1
+ Scale factor: 0.362392
+ Parameter c: 2.66214
+ Sum of weights: 4193.77
+ Squared coherence: 0
+ Estimated response function: ( 4.6529e+00, 2.0178e+00), ( 5.7916e+00, 7.9785e+00)
+ Amplitude of the estimated response function: 5.0716e+00, 9.8589e+00
+ Phase(deg.) of the estimated response function: 23.4, 54.0
+ Weighted residual power: 0.0674119
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 5399
+ Squared coherence: 0
+ Estimated response function: ( -9.2962e+00, -8.5980e+00), ( 2.5354e-02, -1.6449e+00)
+ Amplitude of the estimated response function: 1.2663e+01, 1.6451e+00
+ Phase(deg.) of the estimated response function: -137.2, -89.1
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.34741
+ Sum of weights: 5390.19
+ Squared coherence: 0
+ Estimated response function: ( -9.2735e+00, -8.6384e+00), ( -3.3656e-02, -1.5436e+00)
+ Amplitude of the estimated response function: 1.2674e+01, 1.5440e+00
+ Phase(deg.) of the estimated response function: -137.0, -91.2
+ Weighted residual power: 0.156267
+Iteration number = 1
+ Scale factor: 0.348718
+ Sum of weights: 5390.42
+ Squared coherence: 0
+ Estimated response function: ( -9.2731e+00, -8.6408e+00), ( -3.3343e-02, -1.5414e+00)
+ Amplitude of the estimated response function: 1.2675e+01, 1.5418e+00
+ Phase(deg.) of the estimated response function: -137.0, -91.2
+ Weighted residual power: 0.156339
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.348718
+ Parameter c: 2.66214
+ Sum of weights: 4025.8
+ Squared coherence: 0
+ Estimated response function: ( -8.1755e+00, -8.0965e+00), ( -7.7671e-01, -2.2409e+00)
+ Amplitude of the estimated response function: 1.1506e+01, 2.3717e+00
+ Phase(deg.) of the estimated response function: -135.3, -109.1
+ Weighted residual power: 0.0570727
+Iteration number = 1
+ Scale factor: 0.348718
+ Parameter c: 2.66214
+ Sum of weights: 4121.07
+ Squared coherence: 0
+ Estimated response function: ( -8.0524e+00, -7.9570e+00), ( -9.3388e-01, -2.3522e+00)
+ Amplitude of the estimated response function: 1.1321e+01, 2.5308e+00
+ Phase(deg.) of the estimated response function: -135.3, -111.7
+ Weighted residual power: 0.0604893
+Iteration number = 2
+ Scale factor: 0.348718
+ Parameter c: 2.66214
+ Sum of weights: 4134.36
+ Squared coherence: 0
+ Estimated response function: ( -8.0428e+00, -7.9240e+00), ( -9.6379e-01, -2.3677e+00)
+ Amplitude of the estimated response function: 1.1291e+01, 2.5563e+00
+ Phase(deg.) of the estimated response function: -135.4, -112.1
+ Weighted residual power: 0.0610442
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.1875, Period(s): 5.33333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( 4.7388e+00, 3.6659e+00), ( 8.5635e+00, 9.6804e+00)
+ Amplitude of the estimated response function: 5.9912e+00, 1.2925e+01
+ Phase(deg.) of the estimated response function: 37.7, 48.5
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.502386
+ Sum of weights: 10757.9
+ Squared coherence: 0
+ Estimated response function: ( 4.6041e+00, 3.4384e+00), ( 8.5797e+00, 9.8077e+00)
+ Amplitude of the estimated response function: 5.7463e+00, 1.3031e+01
+ Phase(deg.) of the estimated response function: 36.8, 48.8
+ Weighted residual power: 0.372829
+Iteration number = 1
+ Scale factor: 0.502108
+ Sum of weights: 10757.4
+ Squared coherence: 0
+ Estimated response function: ( 4.6032e+00, 3.4316e+00), ( 8.5797e+00, 9.8081e+00)
+ Amplitude of the estimated response function: 5.7415e+00, 1.3031e+01
+ Phase(deg.) of the estimated response function: 36.7, 48.8
+ Weighted residual power: 0.372609
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.502108
+ Parameter c: 2.66169
+ Sum of weights: 7881.37
+ Squared coherence: 0
+ Estimated response function: ( 4.4361e+00, 2.6423e+00), ( 7.6949e+00, 1.0975e+01)
+ Amplitude of the estimated response function: 5.1634e+00, 1.3404e+01
+ Phase(deg.) of the estimated response function: 30.8, 55.0
+ Weighted residual power: 0.126534
+Iteration number = 1
+ Scale factor: 0.502108
+ Parameter c: 2.66169
+ Sum of weights: 7871.52
+ Squared coherence: 0
+ Estimated response function: ( 4.4089e+00, 2.5843e+00), ( 7.4182e+00, 1.1148e+01)
+ Amplitude of the estimated response function: 5.1105e+00, 1.3391e+01
+ Phase(deg.) of the estimated response function: 30.4, 56.4
+ Weighted residual power: 0.124191
+Iteration number = 2
+ Scale factor: 0.502108
+ Parameter c: 2.66169
+ Sum of weights: 7877.21
+ Squared coherence: 0
+ Estimated response function: ( 4.3979e+00, 2.5802e+00), ( 7.3493e+00, 1.1174e+01)
+ Amplitude of the estimated response function: 5.0989e+00, 1.3374e+01
+ Phase(deg.) of the estimated response function: 30.4, 56.7
+ Weighted residual power: 0.124257
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( -1.1045e+01, -1.1288e+01), ( -2.2411e-01, -5.9487e-01)
+ Amplitude of the estimated response function: 1.5793e+01, 6.3568e-01
+ Phase(deg.) of the estimated response function: -134.4, -110.6
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.478591
+ Sum of weights: 10711.5
+ Squared coherence: 0
+ Estimated response function: ( -1.0700e+01, -1.0857e+01), ( -2.9335e-01, -3.0862e-01)
+ Amplitude of the estimated response function: 1.5243e+01, 4.2580e-01
+ Phase(deg.) of the estimated response function: -134.6, -133.5
+ Weighted residual power: 0.386061
+Iteration number = 1
+ Scale factor: 0.469278
+ Sum of weights: 10715.1
+ Squared coherence: 0
+ Estimated response function: ( -1.0695e+01, -1.0861e+01), ( -2.9250e-01, -3.1651e-01)
+ Amplitude of the estimated response function: 1.5243e+01, 4.3097e-01
+ Phase(deg.) of the estimated response function: -134.6, -132.7
+ Weighted residual power: 0.386992
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.469278
+ Parameter c: 2.66169
+ Sum of weights: 7624.59
+ Squared coherence: 0
+ Estimated response function: ( -9.5926e+00, -1.0178e+01), ( -1.4037e-01, -9.6849e-01)
+ Amplitude of the estimated response function: 1.3986e+01, 9.7861e-01
+ Phase(deg.) of the estimated response function: -133.3, -98.2
+ Weighted residual power: 0.0962821
+Iteration number = 1
+ Scale factor: 0.469278
+ Parameter c: 2.66169
+ Sum of weights: 7821.6
+ Squared coherence: 0
+ Estimated response function: ( -9.4018e+00, -1.0021e+01), ( 3.1420e-02, -8.2711e-01)
+ Amplitude of the estimated response function: 1.3741e+01, 8.2770e-01
+ Phase(deg.) of the estimated response function: -133.2, -87.8
+ Weighted residual power: 0.103991
+Iteration number = 2
+ Scale factor: 0.469278
+ Parameter c: 2.66169
+ Sum of weights: 7862.78
+ Squared coherence: 0
+ Estimated response function: ( -9.3796e+00, -1.0002e+01), ( 8.9541e-02, -7.3514e-01)
+ Amplitude of the estimated response function: 1.3712e+01, 7.4057e-01
+ Phase(deg.) of the estimated response function: -133.2, -83.1
+ Weighted residual power: 0.105888
+Iteration number = 3
+ Scale factor: 0.469278
+ Parameter c: 2.66169
+ Sum of weights: 7868.34
+ Squared coherence: 0
+ Estimated response function: ( -9.3809e+00, -1.0003e+01), ( 1.0283e-01, -7.0506e-01)
+ Amplitude of the estimated response function: 1.3714e+01, 7.1252e-01
+ Phase(deg.) of the estimated response function: -133.2, -81.7
+ Weighted residual power: 0.106198
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.25, Period(s): 4
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( 5.8663e+00, 4.0237e+00), ( 1.1449e+01, 8.7057e+00)
+ Amplitude of the estimated response function: 7.1136e+00, 1.4383e+01
+ Phase(deg.) of the estimated response function: 34.4, 37.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.542211
+ Sum of weights: 10757.9
+ Squared coherence: 0
+ Estimated response function: ( 6.1989e+00, 3.9568e+00), ( 1.1643e+01, 8.5442e+00)
+ Amplitude of the estimated response function: 7.3541e+00, 1.4442e+01
+ Phase(deg.) of the estimated response function: 32.6, 36.3
+ Weighted residual power: 0.445821
+Iteration number = 1
+ Scale factor: 0.549359
+ Sum of weights: 10759.4
+ Squared coherence: 0
+ Estimated response function: ( 6.2000e+00, 3.9423e+00), ( 1.1628e+01, 8.5284e+00)
+ Amplitude of the estimated response function: 7.3473e+00, 1.4420e+01
+ Phase(deg.) of the estimated response function: 32.5, 36.3
+ Weighted residual power: 0.445345
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.549359
+ Parameter c: 2.66169
+ Sum of weights: 7867.71
+ Squared coherence: 0
+ Estimated response function: ( 3.6134e+00, 5.8625e+00), ( 9.3774e+00, 1.2662e+01)
+ Amplitude of the estimated response function: 6.8866e+00, 1.5756e+01
+ Phase(deg.) of the estimated response function: 58.4, 53.5
+ Weighted residual power: 0.169381
+Iteration number = 1
+ Scale factor: 0.549359
+ Parameter c: 2.66169
+ Sum of weights: 7723.02
+ Squared coherence: 0
+ Estimated response function: ( 3.0765e+00, 6.4204e+00), ( 8.6928e+00, 1.3783e+01)
+ Amplitude of the estimated response function: 7.1195e+00, 1.6295e+01
+ Phase(deg.) of the estimated response function: 64.4, 57.8
+ Weighted residual power: 0.162365
+Iteration number = 2
+ Scale factor: 0.549359
+ Parameter c: 2.66169
+ Sum of weights: 7630.66
+ Squared coherence: 0
+ Estimated response function: ( 2.9543e+00, 6.5618e+00), ( 8.4242e+00, 1.4246e+01)
+ Amplitude of the estimated response function: 7.1962e+00, 1.6550e+01
+ Phase(deg.) of the estimated response function: 65.8, 59.4
+ Weighted residual power: 0.158462
+Iteration number = 3
+ Scale factor: 0.549359
+ Parameter c: 2.66169
+ Sum of weights: 7590.53
+ Squared coherence: 0
+ Estimated response function: ( 2.9383e+00, 6.5768e+00), ( 8.3066e+00, 1.4406e+01)
+ Amplitude of the estimated response function: 7.2033e+00, 1.6629e+01
+ Phase(deg.) of the estimated response function: 65.9, 60.0
+ Weighted residual power: 0.156174
+Iteration number = 4
+ Scale factor: 0.549359
+ Parameter c: 2.66169
+ Sum of weights: 7579.46
+ Squared coherence: 0
+ Estimated response function: ( 2.9426e+00, 6.5689e+00), ( 8.2604e+00, 1.4446e+01)
+ Amplitude of the estimated response function: 7.1979e+00, 1.6641e+01
+ Phase(deg.) of the estimated response function: 65.9, 60.2
+ Weighted residual power: 0.15535
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 10799
+ Squared coherence: 0
+ Estimated response function: ( -1.5791e+01, -8.7705e+00), ( -2.1661e+00, 6.6073e-01)
+ Amplitude of the estimated response function: 1.8063e+01, 2.2646e+00
+ Phase(deg.) of the estimated response function: -151.0, 163.0
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.537948
+ Sum of weights: 10714.4
+ Squared coherence: 0
+ Estimated response function: ( -1.4965e+01, -9.4064e+00), ( -1.6618e+00, -2.1359e-01)
+ Amplitude of the estimated response function: 1.7675e+01, 1.6754e+00
+ Phase(deg.) of the estimated response function: -147.8, -172.7
+ Weighted residual power: 0.490929
+Iteration number = 1
+ Scale factor: 0.527053
+ Sum of weights: 10714.2
+ Squared coherence: 0
+ Estimated response function: ( -1.4927e+01, -9.3861e+00), ( -1.5579e+00, -1.9915e-01)
+ Amplitude of the estimated response function: 1.7633e+01, 1.5705e+00
+ Phase(deg.) of the estimated response function: -147.8, -172.7
+ Weighted residual power: 0.488524
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.527053
+ Parameter c: 2.66169
+ Sum of weights: 7617.27
+ Squared coherence: 0
+ Estimated response function: ( -1.3752e+01, -1.0902e+01), ( -1.3903e+00, -4.5545e-01)
+ Amplitude of the estimated response function: 1.7549e+01, 1.4630e+00
+ Phase(deg.) of the estimated response function: -141.6, -161.9
+ Weighted residual power: 0.134292
+Iteration number = 1
+ Scale factor: 0.527053
+ Parameter c: 2.66169
+ Sum of weights: 7639.36
+ Squared coherence: 0
+ Estimated response function: ( -1.3453e+01, -1.1256e+01), ( -1.2581e+00, -3.2005e-01)
+ Amplitude of the estimated response function: 1.7541e+01, 1.2982e+00
+ Phase(deg.) of the estimated response function: -140.1, -165.7
+ Weighted residual power: 0.134753
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.375, Period(s): 2.66667
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( -3.4466e+00, -5.2926e+00), ( 2.3350e+01, 8.4248e+00)
+ Amplitude of the estimated response function: 6.3159e+00, 2.4823e+01
+ Phase(deg.) of the estimated response function: -123.1, 19.8
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.901226
+ Sum of weights: 21306.4
+ Squared coherence: 0
+ Estimated response function: ( -3.2957e-01, -5.7979e+00), ( 2.4154e+01, 1.1911e+01)
+ Amplitude of the estimated response function: 5.8072e+00, 2.6931e+01
+ Phase(deg.) of the estimated response function: -93.3, 26.2
+ Weighted residual power: 1.98007
+Iteration number = 1
+ Scale factor: 0.942643
+ Sum of weights: 21285.8
+ Squared coherence: 0
+ Estimated response function: ( -3.0956e-02, -5.6683e+00), ( 2.3931e+01, 1.2061e+01)
+ Amplitude of the estimated response function: 5.6684e+00, 2.6799e+01
+ Phase(deg.) of the estimated response function: -90.3, 26.7
+ Weighted residual power: 1.94338
+Iteration number = 2
+ Scale factor: 0.938307
+ Sum of weights: 21286.5
+ Squared coherence: 0
+ Estimated response function: ( -1.7188e-02, -5.6557e+00), ( 2.3901e+01, 1.2075e+01)
+ Amplitude of the estimated response function: 5.6557e+00, 2.6777e+01
+ Phase(deg.) of the estimated response function: -90.2, 26.8
+ Weighted residual power: 1.94071
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.938307
+ Parameter c: 2.66146
+ Sum of weights: 14548.6
+ Squared coherence: 0
+ Estimated response function: ( 6.1592e+00, -5.2026e-01), ( 1.3440e+01, 1.8263e+01)
+ Amplitude of the estimated response function: 6.1811e+00, 2.2675e+01
+ Phase(deg.) of the estimated response function: -4.8, 53.6
+ Weighted residual power: 0.360629
+Iteration number = 1
+ Scale factor: 0.938307
+ Parameter c: 2.66146
+ Sum of weights: 15382.8
+ Squared coherence: 0
+ Estimated response function: ( 5.7045e+00, 9.2482e-01), ( 1.3924e+01, 1.6274e+01)
+ Amplitude of the estimated response function: 5.7790e+00, 2.1418e+01
+ Phase(deg.) of the estimated response function: 9.2, 49.4
+ Weighted residual power: 0.378927
+Iteration number = 2
+ Scale factor: 0.938307
+ Parameter c: 2.66146
+ Sum of weights: 15703.7
+ Squared coherence: 0
+ Estimated response function: ( 6.1688e+00, 1.4135e+00), ( 1.4146e+01, 1.6292e+01)
+ Amplitude of the estimated response function: 6.3286e+00, 2.1577e+01
+ Phase(deg.) of the estimated response function: 12.9, 49.0
+ Weighted residual power: 0.424679
+Iteration number = 3
+ Scale factor: 0.938307
+ Parameter c: 2.66146
+ Sum of weights: 15617.3
+ Squared coherence: 0
+ Estimated response function: ( 6.3659e+00, 1.7619e+00), ( 1.4129e+01, 1.6405e+01)
+ Amplitude of the estimated response function: 6.6052e+00, 2.1651e+01
+ Phase(deg.) of the estimated response function: 15.5, 49.3
+ Weighted residual power: 0.420139
+Iteration number = 4
+ Scale factor: 0.938307
+ Parameter c: 2.66146
+ Sum of weights: 15574.6
+ Squared coherence: 0
+ Estimated response function: ( 6.4454e+00, 1.9647e+00), ( 1.4078e+01, 1.6482e+01)
+ Amplitude of the estimated response function: 6.7381e+00, 2.1676e+01
+ Phase(deg.) of the estimated response function: 17.0, 49.5
+ Weighted residual power: 0.417482
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( -1.3650e+01, -3.9352e+00), ( -4.6476e-02, -1.1209e+01)
+ Amplitude of the estimated response function: 1.4206e+01, 1.1209e+01
+ Phase(deg.) of the estimated response function: -163.9, -90.2
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.697875
+ Sum of weights: 21353.1
+ Squared coherence: 0
+ Estimated response function: ( -1.3453e+01, -4.7179e+00), ( -9.4150e-01, -1.2448e+01)
+ Amplitude of the estimated response function: 1.4256e+01, 1.2484e+01
+ Phase(deg.) of the estimated response function: -160.7, -94.3
+ Weighted residual power: 1.07156
+Iteration number = 1
+ Scale factor: 0.729792
+ Sum of weights: 21357.2
+ Squared coherence: 0
+ Estimated response function: ( -1.3539e+01, -4.6822e+00), ( -8.1343e-01, -1.2587e+01)
+ Amplitude of the estimated response function: 1.4326e+01, 1.2613e+01
+ Phase(deg.) of the estimated response function: -160.9, -93.7
+ Weighted residual power: 1.08562
+Iteration number = 2
+ Scale factor: 0.731445
+ Sum of weights: 21353.4
+ Squared coherence: 0
+ Estimated response function: ( -1.3548e+01, -4.6895e+00), ( -7.9792e-01, -1.2619e+01)
+ Amplitude of the estimated response function: 1.4337e+01, 1.2644e+01
+ Phase(deg.) of the estimated response function: -160.9, -93.6
+ Weighted residual power: 1.08713
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 14750.6
+ Squared coherence: 0
+ Estimated response function: ( -1.4603e+01, -1.2206e+01), ( 2.1207e+00, -5.3262e+00)
+ Amplitude of the estimated response function: 1.9032e+01, 5.7328e+00
+ Phase(deg.) of the estimated response function: -140.1, -68.3
+ Weighted residual power: 0.329703
+Iteration number = 1
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 14740.9
+ Squared coherence: 0
+ Estimated response function: ( -1.1163e+01, -1.3313e+01), ( -6.8935e-01, -2.9053e+00)
+ Amplitude of the estimated response function: 1.7373e+01, 2.9860e+00
+ Phase(deg.) of the estimated response function: -130.0, -103.3
+ Weighted residual power: 0.220446
+Iteration number = 2
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 15448.6
+ Squared coherence: 0
+ Estimated response function: ( -1.0483e+01, -1.2945e+01), ( -2.2372e+00, -3.3493e+00)
+ Amplitude of the estimated response function: 1.6657e+01, 4.0278e+00
+ Phase(deg.) of the estimated response function: -129.0, -123.7
+ Weighted residual power: 0.248637
+Iteration number = 3
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 15555.1
+ Squared coherence: 0
+ Estimated response function: ( -1.0766e+01, -1.2790e+01), ( -2.3568e+00, -3.8572e+00)
+ Amplitude of the estimated response function: 1.6718e+01, 4.5202e+00
+ Phase(deg.) of the estimated response function: -130.1, -121.4
+ Weighted residual power: 0.26058
+Iteration number = 4
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 15486.1
+ Squared coherence: 0
+ Estimated response function: ( -1.0888e+01, -1.2874e+01), ( -2.1337e+00, -3.8963e+00)
+ Amplitude of the estimated response function: 1.6860e+01, 4.4422e+00
+ Phase(deg.) of the estimated response function: -130.2, -118.7
+ Weighted residual power: 0.257918
+Iteration number = 5
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 15455.4
+ Squared coherence: 0
+ Estimated response function: ( -1.0861e+01, -1.2923e+01), ( -2.0779e+00, -3.8331e+00)
+ Amplitude of the estimated response function: 1.6881e+01, 4.3601e+00
+ Phase(deg.) of the estimated response function: -130.0, -118.5
+ Weighted residual power: 0.25523
+Iteration number = 6
+ Scale factor: 0.731445
+ Parameter c: 2.66146
+ Sum of weights: 15458.6
+ Squared coherence: 0
+ Estimated response function: ( -1.0833e+01, -1.2927e+01), ( -2.0986e+00, -3.8127e+00)
+ Amplitude of the estimated response function: 1.6866e+01, 4.3521e+00
+ Phase(deg.) of the estimated response function: -130.0, -118.8
+ Weighted residual power: 0.255003
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.5, Period(s): 2
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( 1.2138e+00, -1.2061e+00), ( 2.1695e+01, 6.6378e+00)
+ Amplitude of the estimated response function: 1.7112e+00, 2.2687e+01
+ Phase(deg.) of the estimated response function: -44.8, 17.0
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.777726
+ Sum of weights: 21266.4
+ Squared coherence: 0
+ Estimated response function: ( 6.1250e+00, -2.1352e+00), ( 2.5598e+01, 9.8701e+00)
+ Amplitude of the estimated response function: 6.4865e+00, 2.7435e+01
+ Phase(deg.) of the estimated response function: -19.2, 21.1
+ Weighted residual power: 1.99314
+Iteration number = 1
+ Scale factor: 0.938241
+ Sum of weights: 21267.9
+ Squared coherence: 0
+ Estimated response function: ( 6.4251e+00, -2.3332e+00), ( 2.6330e+01, 1.0466e+01)
+ Amplitude of the estimated response function: 6.8356e+00, 2.8333e+01
+ Phase(deg.) of the estimated response function: -20.0, 21.7
+ Weighted residual power: 2.11245
+Iteration number = 2
+ Scale factor: 0.9598
+ Sum of weights: 21258.9
+ Squared coherence: 0
+ Estimated response function: ( 6.5193e+00, -2.3577e+00), ( 2.6417e+01, 1.0673e+01)
+ Amplitude of the estimated response function: 6.9325e+00, 2.8492e+01
+ Phase(deg.) of the estimated response function: -19.9, 22.0
+ Weighted residual power: 2.13004
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.9598
+ Parameter c: 2.66146
+ Sum of weights: 14409.3
+ Squared coherence: 0
+ Estimated response function: ( 7.9981e+00, 1.2492e+00), ( 1.7627e+01, 1.8127e+01)
+ Amplitude of the estimated response function: 8.0951e+00, 2.5284e+01
+ Phase(deg.) of the estimated response function: 8.9, 45.8
+ Weighted residual power: 0.377248
+Iteration number = 1
+ Scale factor: 0.9598
+ Parameter c: 2.66146
+ Sum of weights: 14938.6
+ Squared coherence: 0
+ Estimated response function: ( 8.0010e+00, 2.2643e+00), ( 1.7061e+01, 1.7211e+01)
+ Amplitude of the estimated response function: 8.3152e+00, 2.4234e+01
+ Phase(deg.) of the estimated response function: 15.8, 45.2
+ Weighted residual power: 0.406347
+Iteration number = 2
+ Scale factor: 0.9598
+ Parameter c: 2.66146
+ Sum of weights: 15126.6
+ Squared coherence: 0
+ Estimated response function: ( 8.3339e+00, 2.6289e+00), ( 1.7571e+01, 1.6561e+01)
+ Amplitude of the estimated response function: 8.7387e+00, 2.4146e+01
+ Phase(deg.) of the estimated response function: 17.5, 43.3
+ Weighted residual power: 0.432913
+Iteration number = 3
+ Scale factor: 0.9598
+ Parameter c: 2.66146
+ Sum of weights: 15106.5
+ Squared coherence: 0
+ Estimated response function: ( 8.5018e+00, 2.6752e+00), ( 1.8038e+01, 1.6063e+01)
+ Amplitude of the estimated response function: 8.9128e+00, 2.4154e+01
+ Phase(deg.) of the estimated response function: 17.5, 41.7
+ Weighted residual power: 0.432157
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 21599
+ Squared coherence: 0
+ Estimated response function: ( -5.3388e+00, -5.2437e+00), ( -6.0756e+00, 1.4369e+00)
+ Amplitude of the estimated response function: 7.4833e+00, 6.2432e+00
+ Phase(deg.) of the estimated response function: -135.5, 166.7
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.499754
+ Sum of weights: 21434
+ Squared coherence: 0
+ Estimated response function: ( -5.1478e+00, -4.8192e+00), ( -7.8560e+00, 1.9903e+00)
+ Amplitude of the estimated response function: 7.0516e+00, 8.1042e+00
+ Phase(deg.) of the estimated response function: -136.9, 165.8
+ Weighted residual power: 0.481852
+Iteration number = 1
+ Scale factor: 0.522253
+ Sum of weights: 21421.5
+ Squared coherence: 0
+ Estimated response function: ( -5.4162e+00, -4.4032e+00), ( -8.1627e+00, 1.7402e+00)
+ Amplitude of the estimated response function: 6.9802e+00, 8.3461e+00
+ Phase(deg.) of the estimated response function: -140.9, 168.0
+ Weighted residual power: 0.487055
+Iteration number = 2
+ Scale factor: 0.523792
+ Sum of weights: 21417
+ Squared coherence: 0
+ Estimated response function: ( -5.4480e+00, -4.3095e+00), ( -8.3763e+00, 1.7677e+00)
+ Amplitude of the estimated response function: 6.9464e+00, 8.5608e+00
+ Phase(deg.) of the estimated response function: -141.7, 168.1
+ Weighted residual power: 0.494324
+Iteration number = 3
+ Scale factor: 0.527559
+ Sum of weights: 21415.8
+ Squared coherence: 0
+ Estimated response function: ( -5.4748e+00, -4.2584e+00), ( -8.4422e+00, 1.7271e+00)
+ Amplitude of the estimated response function: 6.9360e+00, 8.6170e+00
+ Phase(deg.) of the estimated response function: -142.1, 168.4
+ Weighted residual power: 0.496214
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.527559
+ Parameter c: 2.66146
+ Sum of weights: 15218.2
+ Squared coherence: 0
+ Estimated response function: ( -8.8000e+00, -6.7967e+00), ( -1.1073e+01, -1.0097e+00)
+ Amplitude of the estimated response function: 1.1119e+01, 1.1119e+01
+ Phase(deg.) of the estimated response function: -142.3, -174.8
+ Weighted residual power: 0.235204
+Iteration number = 1
+ Scale factor: 0.527559
+ Parameter c: 2.66146
+ Sum of weights: 13765.9
+ Squared coherence: 0
+ Estimated response function: ( -9.7411e+00, -1.0796e+01), ( -8.8000e+00, -2.6436e+00)
+ Amplitude of the estimated response function: 1.4541e+01, 9.1886e+00
+ Phase(deg.) of the estimated response function: -132.1, -163.3
+ Weighted residual power: 0.168926
+Iteration number = 2
+ Scale factor: 0.527559
+ Parameter c: 2.66146
+ Sum of weights: 13408.6
+ Squared coherence: 0
+ Estimated response function: ( -1.0260e+01, -1.2521e+01), ( -7.6798e+00, -5.3105e+00)
+ Amplitude of the estimated response function: 1.6187e+01, 9.3371e+00
+ Phase(deg.) of the estimated response function: -129.3, -145.3
+ Weighted residual power: 0.156163
+Iteration number = 3
+ Scale factor: 0.527559
+ Parameter c: 2.66146
+ Sum of weights: 13042
+ Squared coherence: 0
+ Estimated response function: ( -1.0032e+01, -1.3651e+01), ( -5.4167e+00, -5.9975e+00)
+ Amplitude of the estimated response function: 1.6941e+01, 8.0815e+00
+ Phase(deg.) of the estimated response function: -126.3, -132.1
+ Weighted residual power: 0.133816
+Iteration number = 4
+ Scale factor: 0.527559
+ Parameter c: 2.66146
+ Sum of weights: 13027.9
+ Squared coherence: 0
+ Estimated response function: ( -1.0665e+01, -1.3885e+01), ( -3.8490e+00, -6.4626e+00)
+ Amplitude of the estimated response function: 1.7508e+01, 7.5219e+00
+ Phase(deg.) of the estimated response function: -127.5, -120.8
+ Weighted residual power: 0.134361
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.75, Period(s): 1.33333
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( -2.1007e+01, 2.5791e+00), ( 1.6554e+01, 1.0975e+01)
+ Amplitude of the estimated response function: 2.1164e+01, 1.9862e+01
+ Phase(deg.) of the estimated response function: 173.0, 33.5
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 1.26013
+ Sum of weights: 42352.1
+ Squared coherence: 0
+ Estimated response function: ( -2.1390e+01, 6.2375e+00), ( 2.1976e+01, 1.2097e+01)
+ Amplitude of the estimated response function: 2.2281e+01, 2.5085e+01
+ Phase(deg.) of the estimated response function: 163.7, 28.8
+ Weighted residual power: 5.25165
+Iteration number = 1
+ Scale factor: 1.406
+ Sum of weights: 42283
+ Squared coherence: 0
+ Estimated response function: ( -2.0743e+01, 6.1785e+00), ( 2.1674e+01, 1.1687e+01)
+ Amplitude of the estimated response function: 2.1644e+01, 2.4624e+01
+ Phase(deg.) of the estimated response function: 163.4, 28.3
+ Weighted residual power: 4.97399
+Iteration number = 2
+ Scale factor: 1.38322
+ Sum of weights: 42298.4
+ Squared coherence: 0
+ Estimated response function: ( -2.0761e+01, 6.1442e+00), ( 2.1642e+01, 1.1682e+01)
+ Amplitude of the estimated response function: 2.1651e+01, 2.4594e+01
+ Phase(deg.) of the estimated response function: 163.5, 28.4
+ Weighted residual power: 4.97881
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 28051.8
+ Squared coherence: 0
+ Estimated response function: ( -1.8390e+01, -6.3793e+00), ( 2.1348e+01, 2.1292e+01)
+ Amplitude of the estimated response function: 1.9465e+01, 3.0151e+01
+ Phase(deg.) of the estimated response function: -160.9, 44.9
+ Weighted residual power: 1.11169
+Iteration number = 1
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 27139.4
+ Squared coherence: 0
+ Estimated response function: ( -1.3550e+01, -1.1726e+01), ( 1.5351e+01, 2.3291e+01)
+ Amplitude of the estimated response function: 1.7919e+01, 2.7895e+01
+ Phase(deg.) of the estimated response function: -139.1, 56.6
+ Weighted residual power: 0.733976
+Iteration number = 2
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 27965.4
+ Squared coherence: 0
+ Estimated response function: ( -1.3161e+01, -1.1265e+01), ( 1.3629e+01, 2.2692e+01)
+ Amplitude of the estimated response function: 1.7324e+01, 2.6470e+01
+ Phase(deg.) of the estimated response function: -139.4, 59.0
+ Weighted residual power: 0.780166
+Iteration number = 3
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 28464.5
+ Squared coherence: 0
+ Estimated response function: ( -1.3633e+01, -1.0610e+01), ( 1.3431e+01, 2.2749e+01)
+ Amplitude of the estimated response function: 1.7275e+01, 2.6418e+01
+ Phase(deg.) of the estimated response function: -142.1, 59.4
+ Weighted residual power: 0.854842
+Iteration number = 4
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 28487
+ Squared coherence: 0
+ Estimated response function: ( -1.3833e+01, -1.0441e+01), ( 1.3673e+01, 2.2901e+01)
+ Amplitude of the estimated response function: 1.7332e+01, 2.6673e+01
+ Phase(deg.) of the estimated response function: -143.0, 59.2
+ Weighted residual power: 0.869199
+Iteration number = 5
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 28404.2
+ Squared coherence: 0
+ Estimated response function: ( -1.3804e+01, -1.0485e+01), ( 1.3776e+01, 2.2929e+01)
+ Amplitude of the estimated response function: 1.7334e+01, 2.6749e+01
+ Phase(deg.) of the estimated response function: -142.8, 59.0
+ Weighted residual power: 0.858698
+Iteration number = 6
+ Scale factor: 1.38322
+ Parameter c: 2.66135
+ Sum of weights: 28382.5
+ Squared coherence: 0
+ Estimated response function: ( -1.3762e+01, -1.0515e+01), ( 1.3762e+01, 2.2909e+01)
+ Amplitude of the estimated response function: 1.7319e+01, 2.6725e+01
+ Phase(deg.) of the estimated response function: -142.6, 59.0
+ Weighted residual power: 0.853772
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( 4.6419e+00, -4.1036e+00), ( -1.1865e+01, -1.0362e+01)
+ Amplitude of the estimated response function: 6.1958e+00, 1.5753e+01
+ Phase(deg.) of the estimated response function: -41.5, -138.9
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 0.887056
+ Sum of weights: 42643.1
+ Squared coherence: 0
+ Estimated response function: ( 6.0624e+00, -5.0822e+00), ( -1.5007e+01, -1.1896e+01)
+ Amplitude of the estimated response function: 7.9108e+00, 1.9150e+01
+ Phase(deg.) of the estimated response function: -40.0, -141.6
+ Weighted residual power: 2.30498
+Iteration number = 1
+ Scale factor: 1.00498
+ Sum of weights: 42561.4
+ Squared coherence: 0
+ Estimated response function: ( 5.2540e+00, -5.4387e+00), ( -1.4979e+01, -1.0909e+01)
+ Amplitude of the estimated response function: 7.5620e+00, 1.8531e+01
+ Phase(deg.) of the estimated response function: -46.0, -143.9
+ Weighted residual power: 2.14692
+Iteration number = 2
+ Scale factor: 0.983764
+ Sum of weights: 42578.3
+ Squared coherence: 0
+ Estimated response function: ( 5.3811e+00, -5.4998e+00), ( -1.4975e+01, -1.0914e+01)
+ Amplitude of the estimated response function: 7.6944e+00, 1.8530e+01
+ Phase(deg.) of the estimated response function: -45.6, -143.9
+ Weighted residual power: 2.16148
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 0.983764
+ Parameter c: 2.66135
+ Sum of weights: 29005.5
+ Squared coherence: 0
+ Estimated response function: ( -5.7355e+00, -8.8745e-01), ( -9.5320e+00, -1.2645e+01)
+ Amplitude of the estimated response function: 5.8037e+00, 1.5835e+01
+ Phase(deg.) of the estimated response function: -171.2, -127.0
+ Weighted residual power: 0.554733
+Iteration number = 1
+ Scale factor: 0.983764
+ Parameter c: 2.66135
+ Sum of weights: 30815.8
+ Squared coherence: 0
+ Estimated response function: ( -6.1502e+00, -6.0600e+00), ( -5.1246e+00, -1.1874e+01)
+ Amplitude of the estimated response function: 8.6342e+00, 1.2932e+01
+ Phase(deg.) of the estimated response function: -135.4, -113.3
+ Weighted residual power: 0.450484
+Iteration number = 2
+ Scale factor: 0.983764
+ Parameter c: 2.66135
+ Sum of weights: 31610.2
+ Squared coherence: 0
+ Estimated response function: ( -4.8719e+00, -8.2765e+00), ( -3.7022e+00, -9.2094e+00)
+ Amplitude of the estimated response function: 9.6040e+00, 9.9257e+00
+ Phase(deg.) of the estimated response function: -120.5, -111.9
+ Weighted residual power: 0.399293
+Iteration number = 3
+ Scale factor: 0.983764
+ Parameter c: 2.66135
+ Sum of weights: 32704
+ Squared coherence: 0
+ Estimated response function: ( -4.2901e+00, -8.9273e+00), ( -5.4396e+00, -8.1713e+00)
+ Amplitude of the estimated response function: 9.9046e+00, 9.8163e+00
+ Phase(deg.) of the estimated response function: -115.7, -123.7
+ Weighted residual power: 0.455879
+Iteration number = 4
+ Scale factor: 0.983764
+ Parameter c: 2.66135
+ Sum of weights: 32621.4
+ Squared coherence: 0
+ Estimated response function: ( -4.4083e+00, -8.8343e+00), ( -6.6191e+00, -7.3481e+00)
+ Amplitude of the estimated response function: 9.8731e+00, 9.8898e+00
+ Phase(deg.) of the estimated response function: -116.5, -132.0
+ Weighted residual power: 0.447719
+Iteration number = 5
+ Scale factor: 0.983764
+ Parameter c: 2.66135
+ Sum of weights: 32603.7
+ Squared coherence: 0
+ Estimated response function: ( -4.2917e+00, -8.5306e+00), ( -7.4222e+00, -6.9884e+00)
+ Amplitude of the estimated response function: 9.5493e+00, 1.0194e+01
+ Phase(deg.) of the estimated response function: -116.7, -136.7
+ Weighted residual power: 0.445879
+Iteration using Tukey's biweights weight converged
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 1, Period(s): 1
+================================================================================
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 0
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( 1.1221e+01, 1.0270e+01), ( 2.1550e+01, -2.5333e+01)
+ Amplitude of the estimated response function: 1.5211e+01, 3.3259e+01
+ Phase(deg.) of the estimated response function: 42.5, -49.6
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 1.49203
+ Sum of weights: 42288.2
+ Squared coherence: 0
+ Estimated response function: ( 1.4983e+01, 7.4984e+00), ( 1.2376e+01, -2.6529e+01)
+ Amplitude of the estimated response function: 1.6755e+01, 2.9274e+01
+ Phase(deg.) of the estimated response function: 26.6, -65.0
+ Weighted residual power: 5.15193
+Iteration number = 1
+ Scale factor: 1.41619
+ Sum of weights: 42337.4
+ Squared coherence: 0
+ Estimated response function: ( 1.4879e+01, 6.6271e+00), ( 1.0962e+01, -2.6287e+01)
+ Amplitude of the estimated response function: 1.6288e+01, 2.8481e+01
+ Phase(deg.) of the estimated response function: 24.0, -67.4
+ Weighted residual power: 4.92398
+Iteration number = 2
+ Scale factor: 1.38763
+ Sum of weights: 42351.6
+ Squared coherence: 0
+ Estimated response function: ( 1.4863e+01, 6.6775e+00), ( 1.1056e+01, -2.6207e+01)
+ Amplitude of the estimated response function: 1.6294e+01, 2.8444e+01
+ Phase(deg.) of the estimated response function: 24.2, -67.1
+ Weighted residual power: 4.92551
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 28107.2
+ Squared coherence: 0
+ Estimated response function: ( 6.7594e+01, 3.6278e+00), ( -3.2167e+00, -1.2341e+02)
+ Amplitude of the estimated response function: 6.7692e+01, 1.2345e+02
+ Phase(deg.) of the estimated response function: 3.1, -91.5
+ Weighted residual power: 15.6297
+Iteration number = 1
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 16463.4
+ Squared coherence: 0
+ Estimated response function: ( -1.7109e+01, -1.4646e+01), ( 5.9694e+00, 9.2518e+01)
+ Amplitude of the estimated response function: 2.2522e+01, 9.2711e+01
+ Phase(deg.) of the estimated response function: -139.4, 86.3
+ Weighted residual power: 1.04341
+Iteration number = 2
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 19832.2
+ Squared coherence: 0
+ Estimated response function: ( 8.8412e+00, -1.1025e+00), ( -7.4878e+00, 4.2728e+01)
+ Amplitude of the estimated response function: 8.9097e+00, 4.3379e+01
+ Phase(deg.) of the estimated response function: -7.1, 99.9
+ Weighted residual power: 0.367189
+Iteration number = 3
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 25368.9
+ Squared coherence: 0
+ Estimated response function: ( 2.5536e+01, -2.6414e+01), ( -3.2464e+01, 1.3315e+02)
+ Amplitude of the estimated response function: 3.6740e+01, 1.3705e+02
+ Phase(deg.) of the estimated response function: -46.0, 103.7
+ Weighted residual power: 8.65379
+Iteration number = 4
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 16790.4
+ Squared coherence: 0
+ Estimated response function: ( 8.9621e+00, -9.8033e+00), ( 1.2525e+01, 6.3150e+01)
+ Amplitude of the estimated response function: 1.3283e+01, 6.4380e+01
+ Phase(deg.) of the estimated response function: -47.6, 78.8
+ Weighted residual power: 0.34843
+Iteration number = 5
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 22355.6
+ Squared coherence: 0
+ Estimated response function: ( 1.4553e+01, -1.2539e+01), ( 3.8589e+00, 6.4558e+01)
+ Amplitude of the estimated response function: 1.9210e+01, 6.4674e+01
+ Phase(deg.) of the estimated response function: -40.7, 86.6
+ Weighted residual power: 0.779038
+Iteration number = 6
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 22168.1
+ Squared coherence: 0
+ Estimated response function: ( 2.5982e+01, -7.3970e+00), ( -2.3741e+01, 9.8036e+01)
+ Amplitude of the estimated response function: 2.7014e+01, 1.0087e+02
+ Phase(deg.) of the estimated response function: -15.9, 103.6
+ Weighted residual power: 1.72513
+Iteration number = 7
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 19243.8
+ Squared coherence: 0
+ Estimated response function: ( 1.0013e+01, -7.7338e+00), ( 1.0924e+01, 6.1710e+01)
+ Amplitude of the estimated response function: 1.2652e+01, 6.2669e+01
+ Phase(deg.) of the estimated response function: -37.7, 80.0
+ Weighted residual power: 0.398859
+Iteration number = 8
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 22539.9
+ Squared coherence: 0
+ Estimated response function: ( 1.3997e+01, -1.1760e+01), ( 1.1347e+00, 6.2641e+01)
+ Amplitude of the estimated response function: 1.8281e+01, 6.2651e+01
+ Phase(deg.) of the estimated response function: -40.0, 89.0
+ Weighted residual power: 0.775522
+Iteration number = 9
+ Scale factor: 1.38763
+ Parameter c: 2.66135
+ Sum of weights: 22387.6
+ Squared coherence: 0
+ Estimated response function: ( 2.6026e+01, -9.5294e+00), ( -2.3714e+01, 9.6517e+01)
+ Amplitude of the estimated response function: 2.7715e+01, 9.9387e+01
+ Phase(deg.) of the estimated response function: -20.1, 103.8
+ Weighted residual power: 1.77157
+ Iteration using Tukey's biweights weight does not converge
+--------------------------------------------------------------------------------
+Calculate response functions for output variable 1
+--------------------------------------------------------------------------------
+Calculate response functions by the ordinary least square method
+ Sum of weights: 43199
+ Squared coherence: 0
+ Estimated response function: ( -1.1946e+01, -5.6520e+00), ( -2.0656e+01, -1.9537e+01)
+ Amplitude of the estimated response function: 1.3216e+01, 2.8432e+01
+ Phase(deg.) of the estimated response function: -154.7, -136.6
+Calculate response functions by iteratively reweighted remote reference using Huber weight
+Iteration number = 0
+ Scale factor: 1.30468
+ Sum of weights: 42325.6
+ Squared coherence: 0
+ Estimated response function: ( -1.3853e+01, -5.1899e+00), ( -1.2184e+01, -6.4621e+00)
+ Amplitude of the estimated response function: 1.4793e+01, 1.3792e+01
+ Phase(deg.) of the estimated response function: -159.5, -152.1
+ Weighted residual power: 2.13191
+Iteration number = 1
+ Scale factor: 0.976564
+ Sum of weights: 42535.1
+ Squared coherence: 0
+ Estimated response function: ( -1.5634e+01, -8.1530e+00), ( -1.3950e+01, -6.8908e+00)
+ Amplitude of the estimated response function: 1.7632e+01, 1.5559e+01
+ Phase(deg.) of the estimated response function: -152.5, -153.7
+ Weighted residual power: 2.76019
+Iteration number = 2
+ Scale factor: 1.07101
+ Sum of weights: 42453.6
+ Squared coherence: 0
+ Estimated response function: ( -1.5975e+01, -7.7011e+00), ( -1.3058e+01, -6.8235e+00)
+ Amplitude of the estimated response function: 1.7734e+01, 1.4733e+01
+ Phase(deg.) of the estimated response function: -154.3, -152.4
+ Weighted residual power: 2.6312
+Iteration number = 3
+ Scale factor: 1.05938
+ Sum of weights: 42472.3
+ Squared coherence: 0
+ Estimated response function: ( -1.6052e+01, -7.9389e+00), ( -1.3311e+01, -6.8264e+00)
+ Amplitude of the estimated response function: 1.7908e+01, 1.4959e+01
+ Phase(deg.) of the estimated response function: -153.7, -152.8
+ Weighted residual power: 2.69327
+Iteration number = 4
+ Scale factor: 1.06686
+ Sum of weights: 42463.8
+ Squared coherence: 0
+ Estimated response function: ( -1.6083e+01, -7.8747e+00), ( -1.3233e+01, -6.8082e+00)
+ Amplitude of the estimated response function: 1.7907e+01, 1.4882e+01
+ Phase(deg.) of the estimated response function: -153.9, -152.8
+ Weighted residual power: 2.67971
+Iteration using Huber weight converged
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight
+Iteration number = 0
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 28716.2
+ Squared coherence: 0
+ Estimated response function: ( -1.2142e+01, -7.5734e+00), ( -3.4025e+00, -6.5192e-01)
+ Amplitude of the estimated response function: 1.4310e+01, 3.4644e+00
+ Phase(deg.) of the estimated response function: -148.0, -169.2
+ Weighted residual power: 0.349296
+Iteration number = 1
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 33530.6
+ Squared coherence: 0
+ Estimated response function: ( -1.4746e+01, -6.4551e+00), ( -8.4020e-01, 2.0779e+00)
+ Amplitude of the estimated response function: 1.6097e+01, 2.2413e+00
+ Phase(deg.) of the estimated response function: -156.4, 112.0
+ Weighted residual power: 0.610527
+Iteration number = 2
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 32681.9
+ Squared coherence: 0
+ Estimated response function: ( -1.6438e+01, -5.8912e+00), ( 9.0023e-01, 6.4834e+00)
+ Amplitude of the estimated response function: 1.7462e+01, 6.5456e+00
+ Phase(deg.) of the estimated response function: -160.3, 82.1
+ Weighted residual power: 0.710637
+Iteration number = 3
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 31158.1
+ Squared coherence: 0
+ Estimated response function: ( -1.8141e+01, -4.8866e+00), ( 7.8586e+00, 1.1977e+01)
+ Amplitude of the estimated response function: 1.8788e+01, 1.4325e+01
+ Phase(deg.) of the estimated response function: -164.9, 56.7
+ Weighted residual power: 0.901353
+Iteration number = 4
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 28638
+ Squared coherence: 0
+ Estimated response function: ( -1.9969e+01, -1.7484e+00), ( 1.9546e+01, 4.5856e+00)
+ Amplitude of the estimated response function: 2.0045e+01, 2.0077e+01
+ Phase(deg.) of the estimated response function: -175.0, 13.2
+ Weighted residual power: 0.851249
+Iteration number = 5
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 26826.6
+ Squared coherence: 0
+ Estimated response function: ( -1.3861e+01, 1.0239e+00), ( 1.7565e+01, -1.6266e+01)
+ Amplitude of the estimated response function: 1.3899e+01, 2.3940e+01
+ Phase(deg.) of the estimated response function: 175.8, -42.8
+ Weighted residual power: 0.745024
+Iteration number = 6
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 27003.1
+ Squared coherence: 0
+ Estimated response function: ( -9.4145e+00, -7.9354e+00), ( -1.9777e+01, -2.9175e+00)
+ Amplitude of the estimated response function: 1.2313e+01, 1.9991e+01
+ Phase(deg.) of the estimated response function: -139.9, -171.6
+ Weighted residual power: 1.13915
+Iteration number = 7
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 28646.6
+ Squared coherence: 0
+ Estimated response function: ( -1.5411e+01, -4.9800e+00), ( 7.4761e+00, 1.6842e+01)
+ Amplitude of the estimated response function: 1.6195e+01, 1.8426e+01
+ Phase(deg.) of the estimated response function: -162.1, 66.1
+ Weighted residual power: 1.20402
+Iteration number = 8
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 28200.4
+ Squared coherence: 0
+ Estimated response function: ( -1.7984e+01, 5.4339e+00), ( 2.3078e+01, -7.9002e+00)
+ Amplitude of the estimated response function: 1.8787e+01, 2.4393e+01
+ Phase(deg.) of the estimated response function: 163.2, -18.9
+ Weighted residual power: 1.13709
+Iteration number = 9
+ Scale factor: 1.06686
+ Parameter c: 2.66135
+ Sum of weights: 25998.5
+ Squared coherence: 0
+ Estimated response function: ( -4.2807e+00, -7.6892e+00), ( -1.0323e+01, -3.3470e+01)
+ Amplitude of the estimated response function: 8.8005e+00, 3.5026e+01
+ Phase(deg.) of the estimated response function: -119.1, -107.1
+ Weighted residual power: 1.86695
+ Iteration using Tukey's biweights weight does not converge
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
diff --git a/Samples/OrdinaryRobustRemoteReference/TRACMT.log b/Samples/OrdinaryRobustRemoteReference/TRACMT.log
new file mode 100644
index 0000000..e233147
--- /dev/null
+++ b/Samples/OrdinaryRobustRemoteReference/TRACMT.log
@@ -0,0 +1,484 @@
+Start TRACMT Version v2.0
+Read parameters. ( 0 sec )
+================================================================================
+Summary of control parameters
+================================================================================
+Number of threads : 1
+Procedure type : ordinary remote reference
+The first M-estimator : Hubur
+ Threshould value for downweighting : 3
+ Maximum number of iteration : 10
+ Convergence criteria : 0.01
+The second M-estimator : Tukey's biweights
+ Maximum number of iteration : 10
+ Convergence criteria : 0.01
+Error estimation method : fixed-weights bootstrap
+Number or repetitions in bootstrap : 1000
+Number of output variables : 2
+Number of input variables : 2
+Number of remote reference variables : 2
+Sampling frequency (Hz) : 32
+Number of time-series sections : 1
+Ratio of overlapping part to whole segment length : 0.5
+Output level : 0
+Output apparent resistivity and phase to a seperate csv file
+Information about the segment lengths and frequencies :
+ Segment# Length Index Frequency(Hz) Period(sec)
+ 0 65536 3 1.464843750e-03 6.826666667e+02
+ 0 65536 4 1.953125000e-03 5.120000000e+02
+ 1 32768 3 2.929687500e-03 3.413333333e+02
+ 1 32768 4 3.906250000e-03 2.560000000e+02
+ 2 16384 3 5.859375000e-03 1.706666667e+02
+ 2 16384 4 7.812500000e-03 1.280000000e+02
+ 3 8192 3 1.171875000e-02 8.533333333e+01
+ 3 8192 4 1.562500000e-02 6.400000000e+01
+ 4 4096 3 2.343750000e-02 4.266666667e+01
+ 4 4096 4 3.125000000e-02 3.200000000e+01
+ 5 2048 3 4.687500000e-02 2.133333333e+01
+ 5 2048 4 6.250000000e-02 1.600000000e+01
+ 6 1024 3 9.375000000e-02 1.066666667e+01
+ 6 1024 4 1.250000000e-01 8.000000000e+00
+ 7 512 3 1.875000000e-01 5.333333333e+00
+ 7 512 4 2.500000000e-01 4.000000000e+00
+ 8 256 3 3.750000000e-01 2.666666667e+00
+ 8 256 4 5.000000000e-01 2.000000000e+00
+ 9 128 3 7.500000000e-01 1.333333333e+00
+ 9 128 4 1.000000000e+00 1.000000000e+00
+Information about the time-series data :
+ Section# Channel# Type NSkip NData File
+ 0 0 Out0 0 2764800 ../ex.txt
+ 0 1 Out1 0 2764800 ../ey.txt
+ 0 2 Inp0 0 2764800 ../hx.txt
+ 0 3 Inp1 0 2764800 ../hy.txt
+ 0 4 RR0 0 2764800 ../hrx.txt
+ 0 5 RR1 0 2764800 ../hry.txt
+Rotation angle (deg.) : 0
+ Channel# Type Azimuth(deg.)
+ 0 Out0 0
+ 1 Out1 90
+ 2 Inp0 0
+ 3 Inp1 90
+ 4 RR0 0
+ 5 RR1 90
+Parameters for robust prewhitening :
+ Least square estimator is used
+ Maximum degree of AR model: 10
+================================================================================
+Read data from ../ex.txt ( 0 sec )
+Read data from ../ey.txt ( 1 sec )
+Read data from ../hx.txt ( 1 sec )
+Read data from ../hy.txt ( 2 sec )
+Read data from ../hrx.txt ( 3 sec )
+Read data from ../hry.txt ( 4 sec )
+Perform preprocessing ( 5 sec )
+Secton 0, Channel 0 ( 5 sec )
+Subtract mean (-0.889991) ( 5 sec )
+Secton 0, Channel 1 ( 5 sec )
+Subtract mean (1.69968) ( 5 sec )
+Secton 0, Channel 2 ( 5 sec )
+Subtract mean (0.0092652) ( 5 sec )
+Secton 0, Channel 3 ( 5 sec )
+Subtract mean (1.30261) ( 5 sec )
+Secton 0, Channel 4 ( 5 sec )
+Subtract mean (0.0346805) ( 5 sec )
+Secton 0, Channel 5 ( 5 sec )
+Subtract mean (1.2857) ( 5 sec )
+Perform prewhitening for channel 0 ( 5 sec )
+Degree of AR model: 1, Sigma: 7.6076, AIC: 1.90665e+07 ( 5 sec )
+Degree of AR model: 2, Sigma: 7.60293, AIC: 1.90631e+07 ( 5 sec )
+Degree of AR model: 3, Sigma: 7.59862, AIC: 1.906e+07 ( 5 sec )
+Degree of AR model: 4, Sigma: 7.5946, AIC: 1.90571e+07 ( 5 sec )
+Degree of AR model: 5, Sigma: 7.59088, AIC: 1.90544e+07 ( 5 sec )
+Degree of AR model: 6, Sigma: 7.58783, AIC: 1.90521e+07 ( 5 sec )
+Degree of AR model: 7, Sigma: 7.58446, AIC: 1.90497e+07 ( 5 sec )
+Degree of AR model: 8, Sigma: 7.58162, AIC: 1.90476e+07 ( 5 sec )
+Degree of AR model: 9, Sigma: 7.57884, AIC: 1.90456e+07 ( 5 sec )
+Degree of AR model: 10, Sigma: 7.57665, AIC: 1.9044e+07 ( 5 sec )
+The AR model of 10 degress gives the minimum AIC (1.9044e+07) ( 5 sec )
+AR coefficients: 0.0320459 0.0276236 0.0274305 0.0273417 0.0271195 0.0250291 0.0274279 0.0257729 0.0263083 0.0240252 ( 5 sec )
+Perform prewhitening for channel 1 ( 5 sec )
+Degree of AR model: 1, Sigma: 7.54273, AIC: 1.90192e+07 ( 5 sec )
+Degree of AR model: 2, Sigma: 7.52209, AIC: 1.9004e+07 ( 5 sec )
+Degree of AR model: 3, Sigma: 7.50561, AIC: 1.89919e+07 ( 5 sec )
+Degree of AR model: 4, Sigma: 7.49133, AIC: 1.89814e+07 ( 5 sec )
+Degree of AR model: 5, Sigma: 7.47891, AIC: 1.89722e+07 ( 5 sec )
+Degree of AR model: 6, Sigma: 7.46782, AIC: 1.8964e+07 ( 5 sec )
+Degree of AR model: 7, Sigma: 7.45798, AIC: 1.89567e+07 ( 5 sec )
+Degree of AR model: 8, Sigma: 7.44899, AIC: 1.895e+07 ( 5 sec )
+Degree of AR model: 9, Sigma: 7.44151, AIC: 1.89444e+07 ( 5 sec )
+Degree of AR model: 10, Sigma: 7.43417, AIC: 1.8939e+07 ( 5 sec )
+The AR model of 10 degress gives the minimum AIC (1.8939e+07) ( 5 sec )
+AR coefficients: 0.0497931 0.0484711 0.0453945 0.0449254 0.0443603 0.0443792 0.0440958 0.0444201 0.0425092 0.0444076 ( 5 sec )
+Perform prewhitening for channel 2 ( 5 sec )
+Degree of AR model: 1, Sigma: 1.15041, AIC: 8.62097e+06 ( 5 sec )
+Degree of AR model: 2, Sigma: 0.999605, AIC: 7.84398e+06 ( 5 sec )
+Degree of AR model: 3, Sigma: 0.94325, AIC: 7.5231e+06 ( 5 sec )
+Degree of AR model: 4, Sigma: 0.913582, AIC: 7.34638e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.895124, AIC: 7.23352e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.882753, AIC: 7.15657e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.873879, AIC: 7.1007e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.867031, AIC: 7.0572e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.861586, AIC: 7.02236e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.857167, AIC: 6.99392e+06 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (6.99392e+06) ( 6 sec )
+AR coefficients: 0.100812 0.0994283 0.099345 0.0994338 0.100341 0.0991599 0.0983786 0.0996401 0.100555 0.101158 ( 6 sec )
+Perform prewhitening for channel 3 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.15933, AIC: 8.66365e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 1.01002, AIC: 7.90131e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.95364, AIC: 7.58368e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.923737, AIC: 7.40751e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.905428, AIC: 7.29681e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.892914, AIC: 7.21985e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.884029, AIC: 7.16455e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.877216, AIC: 7.12177e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.871841, AIC: 7.08779e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.867445, AIC: 7.05983e+06 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (7.05983e+06) ( 6 sec )
+AR coefficients: 0.0992426 0.0997661 0.0999695 0.100685 0.0994892 0.0998831 0.0983119 0.0990847 0.0994668 0.100303 ( 6 sec )
+Perform prewhitening for channel 4 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.16254, AIC: 8.67898e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 1.00903, AIC: 7.89586e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.952405, AIC: 7.57651e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.922235, AIC: 7.39851e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.90364, AIC: 7.28588e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.891244, AIC: 7.2095e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.882213, AIC: 7.15318e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.875262, AIC: 7.10944e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.869864, AIC: 7.07523e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.865547, AIC: 7.04772e+06 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (7.04772e+06) ( 6 sec )
+AR coefficients: 0.0989261 0.10121 0.0987917 0.100744 0.100552 0.0988028 0.0993482 0.100374 0.0999452 0.0995135 ( 6 sec )
+Perform prewhitening for channel 5 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.16036, AIC: 8.66857e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 1.01086, AIC: 7.90589e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.953982, AIC: 7.58566e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.924434, AIC: 7.41168e+06 ( 7 sec )
+Degree of AR model: 5, Sigma: 0.906107, AIC: 7.30095e+06 ( 7 sec )
+Degree of AR model: 6, Sigma: 0.893431, AIC: 7.22305e+06 ( 7 sec )
+Degree of AR model: 7, Sigma: 0.884431, AIC: 7.16707e+06 ( 7 sec )
+Degree of AR model: 8, Sigma: 0.877486, AIC: 7.12347e+06 ( 7 sec )
+Degree of AR model: 9, Sigma: 0.872098, AIC: 7.08941e+06 ( 7 sec )
+Degree of AR model: 10, Sigma: 0.867816, AIC: 7.0622e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.0622e+06) ( 7 sec )
+AR coefficients: 0.0995885 0.098903 0.101124 0.0988656 0.0991358 0.100713 0.0990429 0.100438 0.0997109 0.0989688 ( 7 sec )
+===============================================================================
+Perform analysis for segment length : 65536 ( 7 sec )
+Convert time-series data to frequency-domain ( 7 sec )
+Total number of segments : 83 ( 7 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00146484, Period(s): 682.667 ( 9 sec )
+Perform calibration correction ( 9 sec )
+Calculate rotated fields ( 9 sec )
+Calculate response functions by ordinary remote reference ( 9 sec )
+Calculate response functions for output variable 0 ( 9 sec )
+Calculate response functions by the ordinary least square method ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 9 sec )
+Calculate response functions for output variable 1 ( 9 sec )
+Calculate response functions by the ordinary least square method ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 9 sec )
+Estimate errors by fixed-weights bootstrap ( 9 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00195312, Period(s): 512 ( 9 sec )
+Perform calibration correction ( 9 sec )
+Calculate rotated fields ( 9 sec )
+Calculate response functions by ordinary remote reference ( 9 sec )
+Calculate response functions for output variable 0 ( 9 sec )
+Calculate response functions by the ordinary least square method ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 9 sec )
+Calculate response functions for output variable 1 ( 9 sec )
+Calculate response functions by the ordinary least square method ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 9 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 9 sec )
+Estimate errors by fixed-weights bootstrap ( 9 sec )
+===============================================================================
+Perform analysis for segment length : 32768 ( 9 sec )
+Convert time-series data to frequency-domain ( 9 sec )
+Total number of segments : 167 ( 9 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00292969, Period(s): 341.333 ( 11 sec )
+Perform calibration correction ( 11 sec )
+Calculate rotated fields ( 11 sec )
+Calculate response functions by ordinary remote reference ( 11 sec )
+Calculate response functions for output variable 0 ( 11 sec )
+Calculate response functions by the ordinary least square method ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 11 sec )
+Calculate response functions for output variable 1 ( 11 sec )
+Calculate response functions by the ordinary least square method ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 11 sec )
+Estimate errors by fixed-weights bootstrap ( 11 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00390625, Period(s): 256 ( 11 sec )
+Perform calibration correction ( 11 sec )
+Calculate rotated fields ( 11 sec )
+Calculate response functions by ordinary remote reference ( 11 sec )
+Calculate response functions for output variable 0 ( 11 sec )
+Calculate response functions by the ordinary least square method ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 11 sec )
+Calculate response functions for output variable 1 ( 11 sec )
+Calculate response functions by the ordinary least square method ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 11 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 11 sec )
+Estimate errors by fixed-weights bootstrap ( 11 sec )
+===============================================================================
+Perform analysis for segment length : 16384 ( 11 sec )
+Convert time-series data to frequency-domain ( 11 sec )
+Total number of segments : 336 ( 11 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00585938, Period(s): 170.667 ( 13 sec )
+Perform calibration correction ( 13 sec )
+Calculate rotated fields ( 13 sec )
+Calculate response functions by ordinary remote reference ( 13 sec )
+Calculate response functions for output variable 0 ( 13 sec )
+Calculate response functions by the ordinary least square method ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 13 sec )
+Calculate response functions for output variable 1 ( 13 sec )
+Calculate response functions by the ordinary least square method ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 13 sec )
+Estimate errors by fixed-weights bootstrap ( 13 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0078125, Period(s): 128 ( 13 sec )
+Perform calibration correction ( 13 sec )
+Calculate rotated fields ( 13 sec )
+Calculate response functions by ordinary remote reference ( 13 sec )
+Calculate response functions for output variable 0 ( 13 sec )
+Calculate response functions by the ordinary least square method ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 13 sec )
+Calculate response functions for output variable 1 ( 13 sec )
+Calculate response functions by the ordinary least square method ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 13 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 13 sec )
+Estimate errors by fixed-weights bootstrap ( 13 sec )
+===============================================================================
+Perform analysis for segment length : 8192 ( 13 sec )
+Convert time-series data to frequency-domain ( 13 sec )
+Total number of segments : 674 ( 13 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0117188, Period(s): 85.3333 ( 15 sec )
+Perform calibration correction ( 15 sec )
+Calculate rotated fields ( 15 sec )
+Calculate response functions by ordinary remote reference ( 15 sec )
+Calculate response functions for output variable 0 ( 15 sec )
+Calculate response functions by the ordinary least square method ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 15 sec )
+Calculate response functions for output variable 1 ( 15 sec )
+Calculate response functions by the ordinary least square method ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 15 sec )
+Estimate errors by fixed-weights bootstrap ( 15 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.015625, Period(s): 64 ( 15 sec )
+Perform calibration correction ( 15 sec )
+Calculate rotated fields ( 15 sec )
+Calculate response functions by ordinary remote reference ( 15 sec )
+Calculate response functions for output variable 0 ( 15 sec )
+Calculate response functions by the ordinary least square method ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 15 sec )
+Calculate response functions for output variable 1 ( 15 sec )
+Calculate response functions by the ordinary least square method ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 15 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 15 sec )
+Estimate errors by fixed-weights bootstrap ( 15 sec )
+===============================================================================
+Perform analysis for segment length : 4096 ( 15 sec )
+Convert time-series data to frequency-domain ( 15 sec )
+Total number of segments : 1349 ( 15 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0234375, Period(s): 42.6667 ( 17 sec )
+Perform calibration correction ( 17 sec )
+Calculate rotated fields ( 17 sec )
+Calculate response functions by ordinary remote reference ( 17 sec )
+Calculate response functions for output variable 0 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 17 sec )
+Calculate response functions for output variable 1 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 17 sec )
+Estimate errors by fixed-weights bootstrap ( 17 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.03125, Period(s): 32 ( 17 sec )
+Perform calibration correction ( 17 sec )
+Calculate rotated fields ( 17 sec )
+Calculate response functions by ordinary remote reference ( 17 sec )
+Calculate response functions for output variable 0 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 17 sec )
+Calculate response functions for output variable 1 ( 17 sec )
+Calculate response functions by the ordinary least square method ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 17 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 17 sec )
+Estimate errors by fixed-weights bootstrap ( 17 sec )
+===============================================================================
+Perform analysis for segment length : 2048 ( 17 sec )
+Convert time-series data to frequency-domain ( 17 sec )
+Total number of segments : 2699 ( 17 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.046875, Period(s): 21.3333 ( 18 sec )
+Perform calibration correction ( 18 sec )
+Calculate rotated fields ( 18 sec )
+Calculate response functions by ordinary remote reference ( 18 sec )
+Calculate response functions for output variable 0 ( 18 sec )
+Calculate response functions by the ordinary least square method ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 18 sec )
+Calculate response functions for output variable 1 ( 18 sec )
+Calculate response functions by the ordinary least square method ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 18 sec )
+Estimate errors by fixed-weights bootstrap ( 18 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0625, Period(s): 16 ( 18 sec )
+Perform calibration correction ( 18 sec )
+Calculate rotated fields ( 18 sec )
+Calculate response functions by ordinary remote reference ( 18 sec )
+Calculate response functions for output variable 0 ( 18 sec )
+Calculate response functions by the ordinary least square method ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 18 sec )
+Calculate response functions for output variable 1 ( 18 sec )
+Calculate response functions by the ordinary least square method ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 18 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 18 sec )
+Estimate errors by fixed-weights bootstrap ( 18 sec )
+===============================================================================
+Perform analysis for segment length : 1024 ( 19 sec )
+Convert time-series data to frequency-domain ( 19 sec )
+Total number of segments : 5399 ( 19 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.09375, Period(s): 10.6667 ( 20 sec )
+Perform calibration correction ( 20 sec )
+Calculate rotated fields ( 20 sec )
+Calculate response functions by ordinary remote reference ( 20 sec )
+Calculate response functions for output variable 0 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 20 sec )
+Calculate response functions for output variable 1 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 20 sec )
+Estimate errors by fixed-weights bootstrap ( 20 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.125, Period(s): 8 ( 20 sec )
+Perform calibration correction ( 20 sec )
+Calculate rotated fields ( 20 sec )
+Calculate response functions by ordinary remote reference ( 20 sec )
+Calculate response functions for output variable 0 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 20 sec )
+Calculate response functions for output variable 1 ( 20 sec )
+Calculate response functions by the ordinary least square method ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 20 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 20 sec )
+Estimate errors by fixed-weights bootstrap ( 20 sec )
+===============================================================================
+Perform analysis for segment length : 512 ( 20 sec )
+Convert time-series data to frequency-domain ( 20 sec )
+Total number of segments : 10799 ( 20 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.1875, Period(s): 5.33333 ( 22 sec )
+Perform calibration correction ( 22 sec )
+Calculate rotated fields ( 22 sec )
+Calculate response functions by ordinary remote reference ( 22 sec )
+Calculate response functions for output variable 0 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 22 sec )
+Calculate response functions for output variable 1 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 22 sec )
+Estimate errors by fixed-weights bootstrap ( 22 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.25, Period(s): 4 ( 22 sec )
+Perform calibration correction ( 22 sec )
+Calculate rotated fields ( 22 sec )
+Calculate response functions by ordinary remote reference ( 22 sec )
+Calculate response functions for output variable 0 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 22 sec )
+Calculate response functions for output variable 1 ( 22 sec )
+Calculate response functions by the ordinary least square method ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 22 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 22 sec )
+Estimate errors by fixed-weights bootstrap ( 22 sec )
+===============================================================================
+Perform analysis for segment length : 256 ( 23 sec )
+Convert time-series data to frequency-domain ( 23 sec )
+Total number of segments : 21599 ( 23 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.375, Period(s): 2.66667 ( 24 sec )
+Perform calibration correction ( 24 sec )
+Calculate rotated fields ( 24 sec )
+Calculate response functions by ordinary remote reference ( 24 sec )
+Calculate response functions for output variable 0 ( 24 sec )
+Calculate response functions by the ordinary least square method ( 24 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 24 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 24 sec )
+Calculate response functions for output variable 1 ( 24 sec )
+Calculate response functions by the ordinary least square method ( 24 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 24 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 24 sec )
+Estimate errors by fixed-weights bootstrap ( 24 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.5, Period(s): 2 ( 25 sec )
+Perform calibration correction ( 25 sec )
+Calculate rotated fields ( 25 sec )
+Calculate response functions by ordinary remote reference ( 25 sec )
+Calculate response functions for output variable 0 ( 25 sec )
+Calculate response functions by the ordinary least square method ( 25 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 25 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 25 sec )
+Calculate response functions for output variable 1 ( 25 sec )
+Calculate response functions by the ordinary least square method ( 25 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 25 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 25 sec )
+Estimate errors by fixed-weights bootstrap ( 25 sec )
+===============================================================================
+Perform analysis for segment length : 128 ( 26 sec )
+Convert time-series data to frequency-domain ( 26 sec )
+Total number of segments : 43199 ( 26 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.75, Period(s): 1.33333 ( 27 sec )
+Perform calibration correction ( 27 sec )
+Calculate rotated fields ( 27 sec )
+Calculate response functions by ordinary remote reference ( 27 sec )
+Calculate response functions for output variable 0 ( 27 sec )
+Calculate response functions by the ordinary least square method ( 27 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 27 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 27 sec )
+Calculate response functions for output variable 1 ( 27 sec )
+Calculate response functions by the ordinary least square method ( 27 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 27 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 27 sec )
+Estimate errors by fixed-weights bootstrap ( 28 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 1, Period(s): 1 ( 29 sec )
+Perform calibration correction ( 29 sec )
+Calculate rotated fields ( 29 sec )
+Calculate response functions by ordinary remote reference ( 29 sec )
+Calculate response functions for output variable 0 ( 29 sec )
+Calculate response functions by the ordinary least square method ( 29 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 29 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 29 sec )
+Calculate response functions for output variable 1 ( 29 sec )
+Calculate response functions by the ordinary least square method ( 29 sec )
+Calculate response functions by iteratively reweighted remote reference using Huber weight ( 29 sec )
+Calculate response functions by iteratively reweighted remote reference using Tukey's biweights weight ( 29 sec )
+Estimate errors by fixed-weights bootstrap ( 29 sec )
+End TRACMT ( 31 sec )
diff --git a/Samples/OrdinaryRobustRemoteReference/apparent_resistivity_and_phase.csv b/Samples/OrdinaryRobustRemoteReference/apparent_resistivity_and_phase.csv
new file mode 100644
index 0000000..96fa45b
--- /dev/null
+++ b/Samples/OrdinaryRobustRemoteReference/apparent_resistivity_and_phase.csv
@@ -0,0 +1,21 @@
+frequency,period,app_res_0_2,phase_0_2,app_res_0_3,phase_0_3,coherence_0_2+3,app_res_1_2,phase_1_2,app_res_1_3,phase_1_3,coherence_1_2+3,dapp_res_0_2,dphase_0_2,dapp_res_0_3,dphase_0_3,dapp_res_1_2,dphase_1_2,dapp_res_1_3,dphase_1_3
+1.4648437500e-03,6.8266666667e+02,4.3916578744e+01,5.0669393911e+01,3.9866612485e+01,5.4334231062e+01,9.3703783930e-01,1.5456339509e+02,-1.2900295429e+02,6.7884721742e+00,-1.3703647180e+02,9.6777102021e-01,2.4854563945e+00,1.6215422252e+00,2.3021754416e+00,1.6545583241e+00,4.4928675803e+00,8.3276966682e-01,1.0164047781e+00,4.2933252333e+00
+1.9531250000e-03,5.1200000000e+02,4.4602963314e+01,4.5868238738e+01,4.6150130862e+01,5.4009382035e+01,9.4713584089e-01,1.7149384900e+02,-1.2903509690e+02,7.3508615241e+00,-1.3422485420e+02,9.7812451678e-01,2.2780369087e+00,1.4633118644e+00,2.5641349832e+00,1.5919024849e+00,3.9269908759e+00,6.5601454740e-01,9.5544958395e-01,3.7262188383e+00
+2.9296875000e-03,3.4133333333e+02,4.1754396591e+01,5.0058719414e+01,5.3726794317e+01,5.5681889067e+01,8.9731712202e-01,1.7520883461e+02,-1.2568862112e+02,5.7317388697e+00,-1.2756902877e+02,9.5727358041e-01,1.9933856295e+00,1.3678012605e+00,2.6967321541e+00,1.4380868724e+00,3.8692138267e+00,6.3265681711e-01,8.9178474545e-01,4.4617507114e+00
+3.9062500000e-03,2.5600000000e+02,4.4488224389e+01,4.7185418176e+01,5.3161735598e+01,6.3901347854e+01,8.9070287796e-01,2.0099596093e+02,-1.2766359117e+02,7.6834484659e+00,-1.1971813064e+02,9.5726589115e-01,2.3522166693e+00,1.5148704265e+00,2.8846813478e+00,1.5546929428e+00,4.3757123205e+00,6.2368118823e-01,1.0391444974e+00,3.8774297740e+00
+5.8593750000e-03,1.7066666667e+02,5.1774203042e+01,4.7440771808e+01,5.7274837364e+01,5.9415047539e+01,8.3042293519e-01,2.0874810738e+02,-1.2927378961e+02,7.2436361994e+00,-1.2926015226e+02,9.3530975654e-01,2.1278502223e+00,1.1774726799e+00,2.8321419694e+00,1.4167331238e+00,4.1154772056e+00,5.6480342862e-01,9.8590342546e-01,3.9021698724e+00
+7.8125000000e-03,1.2800000000e+02,5.5708230210e+01,4.7388789482e+01,6.3769971191e+01,5.6154957202e+01,8.1516231821e-01,2.2069384348e+02,-1.2860895066e+02,8.1782369959e+00,-1.3171631924e+02,9.1372864287e-01,2.4787695806e+00,1.2748094265e+00,3.3817962657e+00,1.5194092278e+00,5.2323173096e+00,6.7921405477e-01,1.1557258299e+00,4.0518168610e+00
+1.1718750000e-02,8.5333333333e+01,5.7519638366e+01,4.2099297862e+01,7.6021780683e+01,5.8393300210e+01,7.4253979355e-01,2.5202113576e+02,-1.3002408914e+02,1.0370786127e+01,-1.2720068414e+02,8.6986047149e-01,2.2057474592e+00,1.0986488147e+00,3.3104603416e+00,1.2476055798e+00,5.0220784109e+00,5.7088199677e-01,1.2557059495e+00,3.4708397355e+00
+1.5625000000e-02,6.4000000000e+01,5.3160335157e+01,4.0800971837e+01,7.8407781210e+01,5.6752169437e+01,6.7359698857e-01,2.4433190941e+02,-1.3220276475e+02,9.3418269907e+00,-1.3223419171e+02,8.4011322251e-01,2.6379799873e+00,1.4217426524e+00,4.0306302763e+00,1.4728355757e+00,5.8978484044e+00,6.9153887278e-01,1.4171428922e+00,4.3500251295e+00
+2.3437500000e-02,4.2666666667e+01,5.3526011330e+01,3.9631077277e+01,9.2513383065e+01,5.5515373983e+01,5.2672472969e-01,2.4472877520e+02,-1.3409309138e+02,1.4828695660e+01,-1.2819306726e+02,7.4677283848e-01,2.3910983486e+00,1.2798565991e+00,4.4170162477e+00,1.3679125350e+00,5.7086443129e+00,6.6826763945e-01,1.8802928956e+00,3.6350180321e+00
+3.1250000000e-02,3.2000000000e+01,5.6226852546e+01,3.6900808411e+01,1.0923477535e+02,5.5374504809e+01,4.6888670969e-01,2.4484321789e+02,-1.3551876227e+02,1.1787860307e+01,-1.3116906830e+02,6.5115695393e-01,3.2526259988e+00,1.6574619476e+00,5.9337108895e+00,1.5563651908e+00,7.1377846836e+00,8.3518633732e-01,2.1092569673e+00,5.1329641925e+00
+4.6875000000e-02,2.1333333333e+01,6.7240460822e+01,3.1637647150e+01,1.0512648167e+02,5.8327222230e+01,2.4699526389e-01,2.4177992529e+02,-1.3856133764e+02,8.7472556149e+00,-1.2636959698e+02,4.4573046006e-01,4.0656329049e+00,1.7324323957e+00,6.4387704255e+00,1.7548958738e+00,8.2655879283e+00,9.7941623502e-01,1.9900071212e+00,6.5315535451e+00
+6.2500000000e-02,1.6000000000e+01,6.8975508029e+01,3.1744364808e+01,1.2889377981e+02,5.9897901848e+01,2.0815230286e-02,2.2650220665e+02,-1.3668558155e+02,1.2838265591e+01,-1.3616612124e+02,2.5481400477e-01,6.1779942597e+00,2.5667909928e+00,1.1322667525e+01,2.5173822753e+00,1.1757449660e+01,1.4872435644e+00,3.5154255507e+00,7.8691968575e+00
+9.3750000000e-02,1.0666666667e+01,4.1242878924e+01,2.8229573399e+01,1.5321293475e+02,5.7429532831e+01,0.0000000000e+00,2.0447526735e+02,-1.3493111906e+02,1.8394579599e+01,-1.2185553732e+02,8.5359546249e-02,5.7758846544e+00,4.0152974227e+00,1.4724714655e+01,2.7543008286e+00,1.1791546484e+01,1.6522768390e+00,5.0080100791e+00,7.8238130657e+00
+1.2500000000e-01,8.0000000000e+00,4.1154003574e+01,2.3444482821e+01,1.5551735286e+02,5.4024177622e+01,0.0000000000e+00,2.0396201683e+02,-1.3542646155e+02,1.0455630803e+01,-1.1214940902e+02,0.0000000000e+00,9.0346660991e+00,6.3018584616e+00,2.3427266406e+01,4.3196334146e+00,1.9082151459e+01,2.6811999052e+00,6.0039023899e+00,1.6685215222e+01
+1.8750000000e-01,5.3333333333e+00,2.7732078222e+01,3.0399714384e+01,1.9079198273e+02,5.6665962665e+01,0.0000000000e+00,2.0060698048e+02,-1.3316072972e+02,5.4153083214e-01,-8.1701954851e+01,0.0000000000e+00,9.6969453853e+00,1.0068919453e+01,3.2701304050e+01,4.9162122205e+00,2.4573022610e+01,3.5113738291e+00,1.5671365234e+00,3.6000000000e+02
+2.5000000000e-01,4.0000000000e+00,4.1447542662e+01,6.5869668461e+01,2.2152885208e+02,6.0238133196e+01,0.0000000000e+00,2.4614698806e+02,-1.4007961966e+02,1.3481589795e+00,-1.6572703095e+02,0.0000000000e+00,2.2817477713e+01,1.5977348392e+01,6.4292557409e+01,8.3437084287e+00,4.5673752551e+01,5.3234088635e+00,4.0015197356e+00,3.6000000000e+02
+3.7500000000e-01,2.6666666667e+00,2.4214693360e+01,1.6952132220e+01,2.5058694999e+02,4.9498566524e+01,0.0000000000e+00,1.5171275780e+02,-1.2996484645e+02,1.0101958322e+01,-1.1882962847e+02,0.0000000000e+00,2.2268619448e+01,2.7375251696e+01,1.1015695360e+02,1.2697160961e+01,7.7556221316e+01,1.4809269686e+01,3.2079816265e+01,3.6000000000e+02
+5.0000000000e-01,2.0000000000e+00,3.1774873271e+01,1.7466799702e+01,2.3335821884e+02,4.1684474445e+01,0.0000000000e+00,1.2261437653e+02,-1.2752779445e+02,2.2631887058e+01,-1.2077735089e+02,0.0000000000e+00,1.1320774225e+02,3.6000000000e+02,4.2753958524e+02,6.6356505890e+01,6.3232915320e+01,1.4942691670e+01,4.2322240537e+01,6.9230328501e+01
+7.5000000000e-01,1.3333333333e+00,7.9986506745e+01,-1.4261672608e+02,1.9045684514e+02,5.9005625149e+01,0.0000000000e+00,2.4317159411e+01,-1.1670695183e+02,2.7713923912e+01,-1.3672427061e+02,0.0000000000e+00,7.9383267970e+01,2.9750832711e+01,1.6885202180e+02,2.6313446952e+01,3.7409740250e+01,5.0282513485e+01,5.6969356722e+01,3.6000000000e+02
+1.0000000000e+00,1.0000000000e+00,1.5362764242e+02,-2.0110441186e+01,1.9755648893e+03,1.0380387118e+02,0.0000000000e+00,1.5489629805e+01,-1.1910561777e+02,2.4536022333e+02,-1.0714168640e+02,0.0000000000e+00,3.6085726080e+02,3.6000000000e+02,3.9174246578e+03,8.2510822215e+01,6.9969305568e+01,3.6000000000e+02,5.7738276480e+02,3.6000000000e+02
diff --git a/Samples/OrdinaryRobustRemoteReference/param.dat b/Samples/OrdinaryRobustRemoteReference/param.dat
new file mode 100644
index 0000000..1cbdcfc
--- /dev/null
+++ b/Samples/OrdinaryRobustRemoteReference/param.dat
@@ -0,0 +1,48 @@
+NUM_OUT
+2
+SAMPLING_FREQ
+32
+NUM_SECTION
+1
+SEGMENT
+10
+65536 2 3 4
+32768 2 3 4
+16384 2 3 4
+8192 2 3 4
+4096 2 3 4
+2048 2 3 4
+1024 2 3 4
+512 2 3 4
+256 2 3 4
+128 2 3 4
+ROTATION
+0.0
+AZIMUTH
+0.0 90.0
+0.0 90.0
+0.0 90.0
+OUTPUT_RHOA_PHS
+PREWHITENING
+0
+10
+5
+PROCEDURE
+0
+ERROR_ESTIMATION
+1
+DATA_FILES
+2764800
+../ex.txt
+0
+../ey.txt
+0
+../hx.txt
+0
+../hy.txt
+0
+../hrx.txt
+0
+../hry.txt
+0
+END
diff --git a/Samples/OrdinaryRobustRemoteReference/response_functions.csv b/Samples/OrdinaryRobustRemoteReference/response_functions.csv
new file mode 100644
index 0000000..97eb494
--- /dev/null
+++ b/Samples/OrdinaryRobustRemoteReference/response_functions.csv
@@ -0,0 +1,21 @@
+frequency,period,resp_real_0_2,resp_imag_0_2,resp_real_0_3,resp_imag_0_3,coherence_0_2+3,resp_real_1_2,resp_imag_1_2,resp_real_1_3,resp_imag_1_3,coherence_1_2+3,dresp_0_2,dresp_0_3,dresp_1_2,dresp_1_3
+1.4648437500e-03,6.8266666667e+02,3.5945384161e-01,4.3868846033e-01,3.1506164709e-01,4.3900791473e-01,9.3703783930e-01,-6.6962773524e-01,-8.2683421105e-01,-1.6317430404e-01,-1.5196842331e-01,9.6777102021e-01,1.6048799672e-02,1.5602148500e-02,1.5463968345e-02,1.6692882431e-02
+1.9531250000e-03,5.1200000000e+02,4.5955235266e-01,4.7369552329e-01,3.9450932921e-01,5.4318252997e-01,9.4713584089e-01,-8.1503153615e-01,-1.0052204804e+00,-1.8687380382e-01,-1.9199983989e-01,9.7812451678e-01,1.6853842289e-02,1.8649811281e-02,1.4816841815e-02,1.7412401829e-02
+2.9296875000e-03,3.4133333333e+02,5.0209196256e-01,5.9961681927e-01,5.0015692469e-01,7.3270501521e-01,8.9731712202e-01,-9.3459860610e-01,-1.3011768169e+00,-1.7667171011e-01,-2.2966960061e-01,9.5727358041e-01,1.8668347339e-02,2.2264246654e-02,1.7689289359e-02,2.2541483611e-02
+3.9062500000e-03,2.5600000000e+02,6.3351781168e-01,6.8378784347e-01,4.4826658939e-01,9.1508044085e-01,8.9070287796e-01,-1.2106456513e+00,-1.5684512963e+00,-1.9203986422e-01,-3.3643430770e-01,9.5726589115e-01,2.4642786300e-02,2.7646063085e-02,2.1567018977e-02,2.6195872905e-02
+5.8593750000e-03,1.7066666667e+02,8.3299066116e-01,9.0716531745e-01,6.5910222764e-01,1.1151493193e+00,8.3042293519e-01,-1.5654673858e+00,-1.9144135061e+00,-2.9153092108e-01,-3.5668701453e-01,9.3530975654e-01,2.5308417907e-02,3.2026814245e-02,2.4377523326e-02,3.1349939981e-02
+7.8125000000e-03,1.2800000000e+02,9.9871410827e-01,1.0856670173e+00,8.7902926960e-01,1.3108478336e+00,8.1516231821e-01,-1.8321493941e+00,-2.2943587031e+00,-3.7611505425e-01,-4.2190028279e-01,9.1372864287e-01,3.2819087269e-02,4.1849411148e-02,3.4805588888e-02,3.9936959277e-02
+1.1718750000e-02,8.5333333333e+01,1.3621605359e+00,1.2307761718e+00,1.1061061528e+00,1.7974788985e+00,7.4253979355e-01,-2.4713208784e+00,-2.9426920566e+00,-4.7130909956e-01,-6.2091141260e-01,8.6986047149e-01,3.5200056890e-02,4.5953121953e-02,3.8287821641e-02,4.7193019380e-02
+1.5625000000e-02,6.4000000000e+01,1.5426789538e+00,1.3316504157e+00,1.3569454780e+00,2.0698567285e+00,6.7359698857e-01,-2.9349241417e+00,-3.2364565044e+00,-5.7422915306e-01,-6.3252755941e-01,8.4011322251e-01,5.0564144158e-02,6.3614834278e-02,5.2731306343e-02,6.4798171717e-02
+2.3437500000e-02,4.2666666667e+01,1.9288933315e+00,1.5974823844e+00,1.8642379645e+00,2.7140429049e+00,5.2672472969e-01,-3.7263525497e+00,-3.8462254250e+00,-8.1508089006e-01,-1.0360409815e+00,7.4677283848e-01,5.5940410337e-02,7.8602681934e-02,6.2459875621e-02,8.3576595896e-02
+3.1250000000e-02,3.2000000000e+01,2.3702604133e+00,1.7796941545e+00,2.3474660392e+00,3.3996083368e+00,4.6888670969e-01,-4.4130191821e+00,-4.3338221575e+00,-8.9338828261e-01,-1.0216215294e+00,6.5115695393e-01,8.5731862694e-02,1.1220854724e-01,9.0156993571e-02,1.2142050069e-01
+4.6875000000e-02,2.1333333333e+01,3.3798364092e+00,2.0823517600e+00,2.6063139374e+00,4.2244700024e+00,2.4699526389e-01,-5.6432955740e+00,-4.9820061275e+00,-8.4906348936e-01,-1.1529220380e+00,4.4573046006e-01,1.2001581231e-01,1.5201012724e-01,1.2867354840e-01,1.6287122712e-01
+6.2500000000e-02,1.6000000000e+01,3.9481872939e+00,2.4426754495e+00,3.1830881100e+00,5.4906517168e+00,2.0815230286e-02,-6.1214458031e+00,-5.7714678253e+00,-1.4448565495e+00,-1.3872085454e+00,2.5481400477e-01,2.0791942319e-01,2.7875828914e-01,2.1835941617e-01,2.7423301734e-01
+9.3750000000e-02,1.0666666667e+01,3.8739171543e+00,2.0797512777e+00,4.5621773383e+00,7.1417855680e+00,0.0000000000e+00,-6.9143808667e+00,-6.9310258117e+00,-1.5497725809e+00,-2.4941259259e+00,8.5359546249e-02,3.0788226281e-01,4.0723004891e-01,2.8228709193e-01,3.9972462673e-01
+1.2500000000e-01,8.0000000000e+00,4.6529305755e+00,2.0177931741e+00,5.7915627945e+00,7.9784801771e+00,0.0000000000e+00,-8.0428179884e+00,-7.9239724461e+00,-9.6379153156e-01,-2.3676729367e+00,0.0000000000e+00,5.5669340220e-01,7.4257821051e-01,5.2815658970e-01,7.3395344993e-01
+1.8750000000e-01,5.3333333333e+00,4.3978873728e+00,2.5801957269e+00,7.3493444861e+00,1.1173836380e+01,0.0000000000e+00,-9.3809063444e+00,-1.0003381446e+01,1.0283266572e-01,-7.0506070518e-01,0.0000000000e+00,8.9145491519e-01,1.1461478750e+00,8.3992634269e-01,1.0309815199e+00
+2.5000000000e-01,4.0000000000e+00,2.9425901845e+00,6.5689109701e+00,8.2603547580e+00,1.4445677706e+01,0.0000000000e+00,-1.3452776410e+01,-1.1256400043e+01,-1.2580808829e+00,-3.2004877214e-01,0.0000000000e+00,1.9812681234e+00,2.4147410420e+00,1.6274004904e+00,1.9265461623e+00
+3.7500000000e-01,2.6666666667e+00,6.4453603275e+00,1.9646578068e+00,1.4077871566e+01,1.6482234782e+01,0.0000000000e+00,-1.0833316527e+01,-1.2926742587e+01,-2.0986340598e+00,-3.8127295913e+00,0.0000000000e+00,3.0983069919e+00,4.7643464239e+00,4.3109822052e+00,6.9103449406e+00
+5.0000000000e-01,2.0000000000e+00,8.5017961095e+00,2.6751908510e+00,1.8038340161e+01,1.6062808950e+01,0.0000000000e+00,-1.0665034205e+01,-1.3884991420e+01,-3.8490059806e+00,-6.4625746113e+00,0.0000000000e+00,1.5877211289e+01,2.2126095860e+01,4.5145297237e+00,7.0331240290e+00
+7.5000000000e-01,1.3333333333e+00,-1.3761574635e+01,-1.0515154011e+01,1.3762023456e+01,2.2908947590e+01,0.0000000000e+00,-4.2917220900e+00,-8.5305609015e+00,-7.4222183768e+00,-6.9884110525e+00,0.0000000000e+00,8.5942156423e+00,1.1846596878e+01,7.3453739429e+00,1.0477989132e+01
+1.0000000000e+00,1.0000000000e+00,2.6025548855e+01,-9.5293766268e+00,-2.3713704362e+01,9.6516758504e+01,0.0000000000e+00,-4.2807304557e+00,-7.6891804367e+00,-1.0323328544e+01,-3.3469837233e+01,0.0000000000e+00,3.2550358169e+01,9.8539421788e+01,1.9876597846e+01,4.1211340682e+01
diff --git a/Samples/RRMS/TRACMT.cvg b/Samples/RRMS/TRACMT.cvg
new file mode 100644
index 0000000..e35acf6
--- /dev/null
+++ b/Samples/RRMS/TRACMT.cvg
@@ -0,0 +1,520 @@
+================================================================================
+Now Frequency(Hz): 0.00146484, Period(s): 682.667
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.13035, Parameter c: 6.44795
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.00146484(Hz)
+Response functions:
+( 3.7058e-01, 4.1305e-01), ( 3.1084e-01, 3.6824e-01)
+( -6.6764e-01, -8.5137e-01), ( -1.4337e-01, -1.1723e-01)
+( 1.0083e+00, 1.1389e-02), ( -1.3077e-02, -7.4257e-03)
+( -1.0731e-02, -9.1421e-03), ( 8.8798e-01, -4.7033e-02)
+Scale: 0.00822998
+Covariance matrix without scale:
+ 7.0868e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 6.5392e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.1930e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.8088e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00195312, Period(s): 512
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.13035, Parameter c: 6.44795
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.00195312(Hz)
+Response functions:
+( 4.4820e-01, 4.7670e-01), ( 3.6621e-01, 4.4235e-01)
+( -8.0252e-01, -1.0317e+00), ( -1.6708e-01, -1.5485e-01)
+( 1.0140e+00, 1.5732e-02), ( -1.0886e-02, -9.5520e-03)
+( -1.1840e-02, -7.4501e-03), ( 8.7759e-01, -5.4934e-02)
+Scale: 0.0075017
+Covariance matrix without scale:
+ 8.2958e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 5.8926e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.4899e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.3730e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00292969, Period(s): 341.333
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.0742, Parameter c: 6.22496
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.00292969(Hz)
+Response functions:
+( 4.9932e-01, 6.0005e-01), ( 4.4578e-01, 5.8760e-01)
+( -9.1835e-01, -1.3259e+00), ( -1.6362e-01, -1.6386e-01)
+( 1.0029e+00, 1.7745e-02), ( -2.2270e-02, -1.7374e-02)
+( -1.6547e-02, -1.5790e-02), ( 8.5921e-01, -4.4379e-02)
+Scale: 0.0106855
+Covariance matrix without scale:
+ 6.3646e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 7.0234e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.5520e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.4414e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00390625, Period(s): 256
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.0742, Parameter c: 6.22496
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.00390625(Hz)
+Response functions:
+( 6.2870e-01, 7.0256e-01), ( 4.4481e-01, 7.1476e-01)
+( -1.1810e+00, -1.5725e+00), ( -1.6914e-01, -2.1374e-01)
+( 1.0088e+00, 2.5192e-02), ( -1.5339e-02, -1.6230e-02)
+( -1.7235e-02, -1.7612e-02), ( 8.4992e-01, -4.3911e-02)
+Scale: 0.0105011
+Covariance matrix without scale:
+ 7.1573e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 7.0459e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.7118e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.1584e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.00585938, Period(s): 170.667
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.04576, Parameter c: 6.11911
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.00585938(Hz)
+Response functions:
+( 8.2966e-01, 9.2566e-01), ( 5.7677e-01, 8.9138e-01)
+( -1.5316e+00, -1.9854e+00), ( -2.5108e-01, -2.2433e-01)
+( 1.0146e+00, 2.6705e-02), ( -1.4792e-02, -1.3108e-02)
+( -2.1491e-02, -2.8939e-02), ( 8.2930e-01, -3.5456e-02)
+Scale: 0.0154722
+Covariance matrix without scale:
+ 6.7019e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 6.5431e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.6974e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.3434e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0078125, Period(s): 128
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.04576, Parameter c: 6.11911
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.0078125(Hz)
+Response functions:
+( 9.7762e-01, 1.0646e+00), ( 6.9014e-01, 1.0247e+00)
+( -1.7969e+00, -2.3468e+00), ( -2.9436e-01, -2.3041e-01)
+( 1.0194e+00, 3.1520e-02), ( -2.5522e-02, -1.2464e-02)
+( -2.9621e-02, -3.5519e-02), ( 8.1093e-01, -2.6489e-02)
+Scale: 0.0149237
+Covariance matrix without scale:
+ 6.9002e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 6.3757e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.6616e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.3680e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0117188, Period(s): 85.3333
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.03151, Parameter c: 6.06788
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.0117188(Hz)
+Response functions:
+( 1.3680e+00, 1.2284e+00), ( 8.8052e-01, 1.3322e+00)
+( -2.3571e+00, -2.9889e+00), ( -3.3867e-01, -3.1967e-01)
+( 1.0184e+00, 3.6961e-02), ( -3.6054e-02, -1.9506e-02)
+( -4.0394e-02, -3.5835e-02), ( 7.9770e-01, -1.9685e-02)
+Scale: 0.0213775
+Covariance matrix without scale:
+ 6.7231e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 7.6178e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.5493e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.2603e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.015625, Period(s): 64
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.03151, Parameter c: 6.06788
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.015625(Hz)
+Response functions:
+( 1.5420e+00, 1.3539e+00), ( 1.0247e+00, 1.5430e+00)
+( -2.7998e+00, -3.3080e+00), ( -4.2295e-01, -2.5968e-01)
+( 9.9824e-01, 3.7950e-02), ( -4.1825e-02, -1.4152e-02)
+( -3.4571e-02, -3.3532e-02), ( 7.7444e-01, -5.8188e-03)
+Scale: 0.0211478
+Covariance matrix without scale:
+ 6.9401e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 7.9500e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.5330e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.1823e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0234375, Period(s): 42.6667
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.02439, Parameter c: 6.04266
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.0234375(Hz)
+Response functions:
+( 1.7683e+00, 1.3758e+00), ( 1.1824e+00, 1.7909e+00)
+( -3.4362e+00, -3.7891e+00), ( -4.0657e-01, -4.5945e-01)
+( 9.6281e-01, 3.2739e-02), ( -3.7156e-02, -1.9639e-02)
+( -5.3358e-02, -3.8313e-02), ( 7.0137e-01, 8.0755e-03)
+Scale: 0.030262
+Covariance matrix without scale:
+ 6.7592e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 8.6270e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.3999e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.2251e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.03125, Period(s): 32
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.02439, Parameter c: 6.04266
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.03125(Hz)
+Response functions:
+( 2.1049e+00, 1.4229e+00), ( 1.2594e+00, 2.0384e+00)
+( -3.8258e+00, -4.0601e+00), ( -4.0857e-01, -3.9035e-01)
+( 8.9655e-01, 4.5184e-02), ( -4.5584e-02, -2.1391e-02)
+( -4.7594e-02, -3.7817e-02), ( 6.3689e-01, 2.2577e-02)
+Scale: 0.0300554
+Covariance matrix without scale:
+ 7.1503e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 8.5113e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.3940e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.1787e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.046875, Period(s): 21.3333
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.02083, Parameter c: 6.03006
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.046875(Hz)
+Response functions:
+( 2.1337e+00, 1.1790e+00), ( 1.2440e+00, 2.2960e+00)
+( -3.9003e+00, -3.6418e+00), ( -4.6242e-01, -4.4726e-01)
+( 7.2944e-01, 1.7028e-02), ( -1.2928e-02, -1.5650e-02)
+( -7.8386e-02, -8.8658e-03), ( 5.3995e-01, 2.4729e-02)
+Scale: 0.0417988
+Covariance matrix without scale:
+ 7.3536e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 9.1494e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.3253e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.1214e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.0625, Period(s): 16
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.02083, Parameter c: 6.03006
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.0625(Hz)
+Response functions:
+( 1.8966e+00, 8.7189e-01), ( 1.2398e+00, 2.1257e+00)
+( -3.3450e+00, -3.1552e+00), ( -3.5709e-01, -1.9636e-01)
+( 5.6775e-01, -6.0974e-03), ( -3.7855e-02, -2.0796e-02)
+( -7.1993e-02, -2.5304e-03), ( 4.2134e-01, 1.4262e-02)
+Scale: 0.0404616
+Covariance matrix without scale:
+ 7.8033e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 9.7290e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.2780e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.0307e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.09375, Period(s): 10.6667
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.01906, Parameter c: 6.02377
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.09375(Hz)
+Response functions:
+( 1.1128e+00, 4.3977e-01), ( 1.0145e+00, 1.8175e+00)
+( -2.4990e+00, -2.3000e+00), ( -2.4585e-01, -3.0278e-01)
+( 3.6971e-01, -1.5093e-02), ( -3.0602e-02, -1.4935e-02)
+( -5.0005e-02, 9.7930e-03), ( 2.6507e-01, 1.2915e-02)
+Scale: 0.054374
+Covariance matrix without scale:
+ 8.0507e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.0058e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.2053e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.0245e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.125, Period(s): 8
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.01906, Parameter c: 6.02377
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.125(Hz)
+Response functions:
+( 9.4278e-01, 2.7535e-01), ( 8.8142e-01, 1.4381e+00)
+( -1.9821e+00, -1.6299e+00), ( -4.2897e-02, -2.6497e-01)
+( 2.3808e-01, -8.4785e-03), ( -1.3353e-02, 1.0955e-02)
+( -1.6764e-02, 7.4497e-03), ( 1.7746e-01, -1.8394e-03)
+Scale: 0.0525039
+Covariance matrix without scale:
+ 8.4938e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.0004e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.1078e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 1.0623e-01
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.1875, Period(s): 5.33333
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.01817, Parameter c: 6.02062
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.1875(Hz)
+Response functions:
+( 4.3333e-01, 6.8758e-02), ( 5.4982e-01, 9.6089e-01)
+( -1.1808e+00, -1.0910e+00), ( -3.1559e-02, -2.2284e-01)
+( 1.2338e-01, -8.7698e-03), ( 1.4252e-03, 1.2247e-02)
+( -1.1720e-02, -1.0667e-03), ( 9.3049e-02, 5.2977e-04)
+Scale: 0.0670486
+Covariance matrix without scale:
+ 9.0341e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.0842e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.0415e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 9.8028e-02
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.25, Period(s): 4
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.01817, Parameter c: 6.02062
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.25(Hz)
+Response functions:
+( 2.9440e-01, 5.2417e-02), ( 3.5283e-01, 8.1291e-01)
+( -8.9501e-01, -8.5269e-01), ( -4.3739e-02, -1.2720e-01)
+( 8.3164e-02, 2.4325e-03), ( -4.4410e-05, 3.7468e-03)
+( -2.1733e-02, -6.1390e-03), ( 5.5416e-02, 3.8864e-03)
+Scale: 0.0647303
+Covariance matrix without scale:
+ 9.3697e+00 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.0611e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 1.0222e-01 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 9.8399e-02
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.375, Period(s): 2.66667
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.01772, Parameter c: 6.01905
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.375(Hz)
+Response functions:
+( 1.6094e-01, 2.8796e-02), ( 3.0870e-01, 5.2132e-01)
+( -4.5150e-01, -5.4099e-01), ( -7.6817e-02, -6.0189e-02)
+( 4.0335e-02, 6.1953e-04), ( 2.4940e-03, -6.8454e-03)
+( -2.5296e-05, 4.9876e-03), ( 2.5261e-02, 9.7822e-03)
+Scale: 0.0834926
+Covariance matrix without scale:
+ 1.0375e+01 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.1508e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 9.2212e-02 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 9.0830e-02
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.5, Period(s): 2
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.01772, Parameter c: 6.01905
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.5(Hz)
+Response functions:
+( 1.6565e-01, 7.2379e-02), ( 2.1090e-01, 3.5859e-01)
+( -2.6607e-01, -3.7411e-01), ( -9.6821e-02, -7.4930e-02)
+( 2.4204e-02, -7.0460e-04), ( -2.4448e-03, -5.5413e-03)
+( -5.1778e-04, 3.3146e-03), ( 1.4180e-02, 1.0598e-02)
+Scale: 0.0813483
+Covariance matrix without scale:
+ 1.0669e+01 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.1458e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 9.1509e-02 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 8.9388e-02
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 0.75, Period(s): 1.33333
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.0175, Parameter c: 6.01826
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 0.75(Hz)
+Response functions:
+( 4.8550e-02, 3.2119e-02), ( 1.6104e-01, 2.4290e-01)
+( -1.9514e-01, -2.1037e-01), ( -1.1007e-02, -1.3957e-02)
+( 1.4124e-02, 1.4807e-03), ( -4.9226e-03, -2.0914e-03)
+( 7.1309e-03, -7.3635e-04), ( 8.8656e-03, 2.7065e-03)
+Scale: 0.107675
+Covariance matrix without scale:
+ 1.1363e+01 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.1904e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 8.6804e-02 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 8.5168e-02
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
+================================================================================
+Now Frequency(Hz): 1, Period(s): 1
+================================================================================
+Number of initial candidates: 100
+Number of candidates: 100
+--------------------------------------------------------------------------------
+Improve all candidates
+Parameter b: 3.0175, Parameter c: 6.01826
+--------------------------------------------------------------------------------
+Perform further improvements to the best 10 candidates
+--------------------------------------------------------------------------------
+Best estimator of frequency 1(Hz)
+Response functions:
+( -4.0422e-04, 1.7861e-02), ( 9.1192e-02, 1.5144e-01)
+( -1.2143e-01, -1.2261e-01), ( 4.5062e-03, 3.0887e-02)
+( 9.4648e-03, 2.4087e-03), ( -6.8454e-03, 3.2356e-03)
+( 3.0071e-03, -2.6903e-03), ( -2.1803e-03, 1.3900e-03)
+Scale: 0.105384
+Covariance matrix without scale:
+ 1.1353e+01 0.0000e+00 0.0000e+00 0.0000e+00
+ 0.0000e+00 1.1880e+01 0.0000e+00 0.0000e+00
+ 0.0000e+00 0.0000e+00 8.6785e-02 0.0000e+00
+ 0.0000e+00 0.0000e+00 0.0000e+00 8.5431e-02
+--------------------------------------------------------------------------------
+Estimate errors by fixed-weights bootstrap
+--------------------------------------------------------------------------------
diff --git a/Samples/RRMS/TRACMT.log b/Samples/RRMS/TRACMT.log
new file mode 100644
index 0000000..1f5ad74
--- /dev/null
+++ b/Samples/RRMS/TRACMT.log
@@ -0,0 +1,465 @@
+Start TRACMT Version v2.0
+Read parameters. ( 0 sec )
+================================================================================
+Summary of control parameters
+================================================================================
+Number of threads : 1
+Procedure type : multivariate regression (RRMS)
+At each frequency, initial candidates are selected by random sampling
+Maximum number of initial candidates: 100
+Maximum number of iteration of the first imporvements: 3
+Convegence criteria of the first imporvements: 0.05
+Maximum number of the candidates of the second imporvements: 10
+Maximum number of iteration of the second imporvements: 16
+Convegence criteria of the second imporvements: 0.01
+Time range for selecting intial candidates: 00:00:00 - 24:00:00
+Error estimation method : fixed-weights bootstrap
+Number or repetitions in bootstrap : 1000
+Number of output variables : 2
+Number of input variables : 2
+Number of remote reference variables : 2
+Sampling frequency (Hz) : 32
+Number of time-series sections : 1
+Ratio of overlapping part to whole segment length : 0.5
+Output level : 0
+Output apparent resistivity and phase to a seperate csv file
+Information about the segment lengths and frequencies :
+ Segment# Length Index Frequency(Hz) Period(sec)
+ 0 65536 3 1.464843750e-03 6.826666667e+02
+ 0 65536 4 1.953125000e-03 5.120000000e+02
+ 1 32768 3 2.929687500e-03 3.413333333e+02
+ 1 32768 4 3.906250000e-03 2.560000000e+02
+ 2 16384 3 5.859375000e-03 1.706666667e+02
+ 2 16384 4 7.812500000e-03 1.280000000e+02
+ 3 8192 3 1.171875000e-02 8.533333333e+01
+ 3 8192 4 1.562500000e-02 6.400000000e+01
+ 4 4096 3 2.343750000e-02 4.266666667e+01
+ 4 4096 4 3.125000000e-02 3.200000000e+01
+ 5 2048 3 4.687500000e-02 2.133333333e+01
+ 5 2048 4 6.250000000e-02 1.600000000e+01
+ 6 1024 3 9.375000000e-02 1.066666667e+01
+ 6 1024 4 1.250000000e-01 8.000000000e+00
+ 7 512 3 1.875000000e-01 5.333333333e+00
+ 7 512 4 2.500000000e-01 4.000000000e+00
+ 8 256 3 3.750000000e-01 2.666666667e+00
+ 8 256 4 5.000000000e-01 2.000000000e+00
+ 9 128 3 7.500000000e-01 1.333333333e+00
+ 9 128 4 1.000000000e+00 1.000000000e+00
+Information about the time-series data :
+ Section# Channel# Type NSkip NData File
+ 0 0 Out0 0 2764800 ../ex.txt
+ 0 1 Out1 0 2764800 ../ey.txt
+ 0 2 Inp0 0 2764800 ../hx.txt
+ 0 3 Inp1 0 2764800 ../hy.txt
+ 0 4 RR0 0 2764800 ../hrx.txt
+ 0 5 RR1 0 2764800 ../hry.txt
+Rotation angle (deg.) : 0
+ Channel# Type Azimuth(deg.)
+ 0 Out0 0
+ 1 Out1 90
+ 2 Inp0 0
+ 3 Inp1 90
+ 4 RR0 0
+ 5 RR1 90
+Parameters for robust prewhitening :
+ Least square estimator is used
+ Maximum degree of AR model: 10
+================================================================================
+Read data from ../ex.txt ( 0 sec )
+Read data from ../ey.txt ( 1 sec )
+Read data from ../hx.txt ( 2 sec )
+Read data from ../hy.txt ( 3 sec )
+Read data from ../hrx.txt ( 3 sec )
+Read data from ../hry.txt ( 4 sec )
+Perform preprocessing ( 5 sec )
+Secton 0, Channel 0 ( 5 sec )
+Subtract mean (-0.889991) ( 5 sec )
+Secton 0, Channel 1 ( 5 sec )
+Subtract mean (1.69968) ( 5 sec )
+Secton 0, Channel 2 ( 5 sec )
+Subtract mean (0.0092652) ( 5 sec )
+Secton 0, Channel 3 ( 5 sec )
+Subtract mean (1.30261) ( 5 sec )
+Secton 0, Channel 4 ( 5 sec )
+Subtract mean (0.0346805) ( 5 sec )
+Secton 0, Channel 5 ( 5 sec )
+Subtract mean (1.2857) ( 5 sec )
+Perform prewhitening for channel 0 ( 5 sec )
+Degree of AR model: 1, Sigma: 7.6076, AIC: 1.90665e+07 ( 5 sec )
+Degree of AR model: 2, Sigma: 7.60293, AIC: 1.90631e+07 ( 5 sec )
+Degree of AR model: 3, Sigma: 7.59862, AIC: 1.906e+07 ( 5 sec )
+Degree of AR model: 4, Sigma: 7.5946, AIC: 1.90571e+07 ( 5 sec )
+Degree of AR model: 5, Sigma: 7.59088, AIC: 1.90544e+07 ( 5 sec )
+Degree of AR model: 6, Sigma: 7.58783, AIC: 1.90521e+07 ( 5 sec )
+Degree of AR model: 7, Sigma: 7.58446, AIC: 1.90497e+07 ( 5 sec )
+Degree of AR model: 8, Sigma: 7.58162, AIC: 1.90476e+07 ( 5 sec )
+Degree of AR model: 9, Sigma: 7.57884, AIC: 1.90456e+07 ( 5 sec )
+Degree of AR model: 10, Sigma: 7.57665, AIC: 1.9044e+07 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (1.9044e+07) ( 6 sec )
+AR coefficients: 0.0320459 0.0276236 0.0274305 0.0273417 0.0271195 0.0250291 0.0274279 0.0257729 0.0263083 0.0240252 ( 6 sec )
+Perform prewhitening for channel 1 ( 6 sec )
+Degree of AR model: 1, Sigma: 7.54273, AIC: 1.90192e+07 ( 6 sec )
+Degree of AR model: 2, Sigma: 7.52209, AIC: 1.9004e+07 ( 6 sec )
+Degree of AR model: 3, Sigma: 7.50561, AIC: 1.89919e+07 ( 6 sec )
+Degree of AR model: 4, Sigma: 7.49133, AIC: 1.89814e+07 ( 6 sec )
+Degree of AR model: 5, Sigma: 7.47891, AIC: 1.89722e+07 ( 6 sec )
+Degree of AR model: 6, Sigma: 7.46782, AIC: 1.8964e+07 ( 6 sec )
+Degree of AR model: 7, Sigma: 7.45798, AIC: 1.89567e+07 ( 6 sec )
+Degree of AR model: 8, Sigma: 7.44899, AIC: 1.895e+07 ( 6 sec )
+Degree of AR model: 9, Sigma: 7.44151, AIC: 1.89444e+07 ( 6 sec )
+Degree of AR model: 10, Sigma: 7.43417, AIC: 1.8939e+07 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (1.8939e+07) ( 6 sec )
+AR coefficients: 0.0497931 0.0484711 0.0453945 0.0449254 0.0443603 0.0443792 0.0440958 0.0444201 0.0425092 0.0444076 ( 6 sec )
+Perform prewhitening for channel 2 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.15041, AIC: 8.62097e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 0.999605, AIC: 7.84398e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.94325, AIC: 7.5231e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.913582, AIC: 7.34638e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.895124, AIC: 7.23352e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.882753, AIC: 7.15657e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.873879, AIC: 7.1007e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.867031, AIC: 7.0572e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.861586, AIC: 7.02236e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.857167, AIC: 6.99392e+06 ( 6 sec )
+The AR model of 10 degress gives the minimum AIC (6.99392e+06) ( 6 sec )
+AR coefficients: 0.100812 0.0994283 0.099345 0.0994338 0.100341 0.0991599 0.0983786 0.0996401 0.100555 0.101158 ( 6 sec )
+Perform prewhitening for channel 3 ( 6 sec )
+Degree of AR model: 1, Sigma: 1.15933, AIC: 8.66365e+06 ( 6 sec )
+Degree of AR model: 2, Sigma: 1.01002, AIC: 7.90131e+06 ( 6 sec )
+Degree of AR model: 3, Sigma: 0.95364, AIC: 7.58368e+06 ( 6 sec )
+Degree of AR model: 4, Sigma: 0.923737, AIC: 7.40751e+06 ( 6 sec )
+Degree of AR model: 5, Sigma: 0.905428, AIC: 7.29681e+06 ( 6 sec )
+Degree of AR model: 6, Sigma: 0.892914, AIC: 7.21985e+06 ( 6 sec )
+Degree of AR model: 7, Sigma: 0.884029, AIC: 7.16455e+06 ( 6 sec )
+Degree of AR model: 8, Sigma: 0.877216, AIC: 7.12177e+06 ( 6 sec )
+Degree of AR model: 9, Sigma: 0.871841, AIC: 7.08779e+06 ( 6 sec )
+Degree of AR model: 10, Sigma: 0.867445, AIC: 7.05983e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.05983e+06) ( 7 sec )
+AR coefficients: 0.0992426 0.0997661 0.0999695 0.100685 0.0994892 0.0998831 0.0983119 0.0990847 0.0994668 0.100303 ( 7 sec )
+Perform prewhitening for channel 4 ( 7 sec )
+Degree of AR model: 1, Sigma: 1.16254, AIC: 8.67898e+06 ( 7 sec )
+Degree of AR model: 2, Sigma: 1.00903, AIC: 7.89586e+06 ( 7 sec )
+Degree of AR model: 3, Sigma: 0.952405, AIC: 7.57651e+06 ( 7 sec )
+Degree of AR model: 4, Sigma: 0.922235, AIC: 7.39851e+06 ( 7 sec )
+Degree of AR model: 5, Sigma: 0.90364, AIC: 7.28588e+06 ( 7 sec )
+Degree of AR model: 6, Sigma: 0.891244, AIC: 7.2095e+06 ( 7 sec )
+Degree of AR model: 7, Sigma: 0.882213, AIC: 7.15318e+06 ( 7 sec )
+Degree of AR model: 8, Sigma: 0.875262, AIC: 7.10944e+06 ( 7 sec )
+Degree of AR model: 9, Sigma: 0.869864, AIC: 7.07523e+06 ( 7 sec )
+Degree of AR model: 10, Sigma: 0.865547, AIC: 7.04772e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.04772e+06) ( 7 sec )
+AR coefficients: 0.0989261 0.10121 0.0987917 0.100744 0.100552 0.0988028 0.0993482 0.100374 0.0999452 0.0995135 ( 7 sec )
+Perform prewhitening for channel 5 ( 7 sec )
+Degree of AR model: 1, Sigma: 1.16036, AIC: 8.66857e+06 ( 7 sec )
+Degree of AR model: 2, Sigma: 1.01086, AIC: 7.90589e+06 ( 7 sec )
+Degree of AR model: 3, Sigma: 0.953982, AIC: 7.58566e+06 ( 7 sec )
+Degree of AR model: 4, Sigma: 0.924434, AIC: 7.41168e+06 ( 7 sec )
+Degree of AR model: 5, Sigma: 0.906107, AIC: 7.30095e+06 ( 7 sec )
+Degree of AR model: 6, Sigma: 0.893431, AIC: 7.22305e+06 ( 7 sec )
+Degree of AR model: 7, Sigma: 0.884431, AIC: 7.16707e+06 ( 7 sec )
+Degree of AR model: 8, Sigma: 0.877486, AIC: 7.12347e+06 ( 7 sec )
+Degree of AR model: 9, Sigma: 0.872098, AIC: 7.08941e+06 ( 7 sec )
+Degree of AR model: 10, Sigma: 0.867816, AIC: 7.0622e+06 ( 7 sec )
+The AR model of 10 degress gives the minimum AIC (7.0622e+06) ( 7 sec )
+AR coefficients: 0.0995885 0.098903 0.101124 0.0988656 0.0991358 0.100713 0.0990429 0.100438 0.0997109 0.0989688 ( 7 sec )
+===============================================================================
+Perform analysis for segment length : 65536 ( 7 sec )
+Convert time-series data to frequency-domain ( 7 sec )
+Total number of segments : 83 ( 7 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00146484, Period(s): 682.667 ( 9 sec )
+Perform calibration correction ( 9 sec )
+Calculate rotated fields ( 9 sec )
+Calculate response functions by multivariate regression ( 9 sec )
+Determine candicates ( 9 sec )
+Number of initial candidates: 100 ( 9 sec )
+Number of candidates: 100 ( 9 sec )
+Improve all candidates ( 9 sec )
+Detetermine the best improved candidates ( 10 sec )
+Perform further improvements to the best 10 candidates ( 10 sec )
+Select the response with the smallest scale ( 10 sec )
+Estimate errors by fixed-weights bootstrap ( 10 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00195312, Period(s): 512 ( 10 sec )
+Perform calibration correction ( 10 sec )
+Calculate rotated fields ( 10 sec )
+Calculate response functions by multivariate regression ( 10 sec )
+Determine candicates ( 10 sec )
+Number of initial candidates: 100 ( 10 sec )
+Number of candidates: 100 ( 10 sec )
+Improve all candidates ( 10 sec )
+Detetermine the best improved candidates ( 10 sec )
+Perform further improvements to the best 10 candidates ( 10 sec )
+Select the response with the smallest scale ( 10 sec )
+Estimate errors by fixed-weights bootstrap ( 10 sec )
+===============================================================================
+Perform analysis for segment length : 32768 ( 10 sec )
+Convert time-series data to frequency-domain ( 10 sec )
+Total number of segments : 167 ( 10 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00292969, Period(s): 341.333 ( 12 sec )
+Perform calibration correction ( 12 sec )
+Calculate rotated fields ( 12 sec )
+Calculate response functions by multivariate regression ( 12 sec )
+Determine candicates ( 12 sec )
+Number of initial candidates: 100 ( 12 sec )
+Number of candidates: 100 ( 12 sec )
+Improve all candidates ( 12 sec )
+Detetermine the best improved candidates ( 12 sec )
+Perform further improvements to the best 10 candidates ( 12 sec )
+Select the response with the smallest scale ( 12 sec )
+Estimate errors by fixed-weights bootstrap ( 12 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00390625, Period(s): 256 ( 12 sec )
+Perform calibration correction ( 12 sec )
+Calculate rotated fields ( 12 sec )
+Calculate response functions by multivariate regression ( 12 sec )
+Determine candicates ( 12 sec )
+Number of initial candidates: 100 ( 12 sec )
+Number of candidates: 100 ( 12 sec )
+Improve all candidates ( 12 sec )
+Detetermine the best improved candidates ( 12 sec )
+Perform further improvements to the best 10 candidates ( 12 sec )
+Select the response with the smallest scale ( 12 sec )
+Estimate errors by fixed-weights bootstrap ( 12 sec )
+===============================================================================
+Perform analysis for segment length : 16384 ( 12 sec )
+Convert time-series data to frequency-domain ( 12 sec )
+Total number of segments : 336 ( 12 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.00585938, Period(s): 170.667 ( 14 sec )
+Perform calibration correction ( 14 sec )
+Calculate rotated fields ( 14 sec )
+Calculate response functions by multivariate regression ( 14 sec )
+Determine candicates ( 14 sec )
+Number of initial candidates: 100 ( 14 sec )
+Number of candidates: 100 ( 14 sec )
+Improve all candidates ( 14 sec )
+Detetermine the best improved candidates ( 14 sec )
+Perform further improvements to the best 10 candidates ( 14 sec )
+Select the response with the smallest scale ( 14 sec )
+Estimate errors by fixed-weights bootstrap ( 14 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0078125, Period(s): 128 ( 14 sec )
+Perform calibration correction ( 14 sec )
+Calculate rotated fields ( 14 sec )
+Calculate response functions by multivariate regression ( 14 sec )
+Determine candicates ( 14 sec )
+Number of initial candidates: 100 ( 14 sec )
+Number of candidates: 100 ( 14 sec )
+Improve all candidates ( 14 sec )
+Detetermine the best improved candidates ( 14 sec )
+Perform further improvements to the best 10 candidates ( 14 sec )
+Select the response with the smallest scale ( 14 sec )
+Estimate errors by fixed-weights bootstrap ( 14 sec )
+===============================================================================
+Perform analysis for segment length : 8192 ( 14 sec )
+Convert time-series data to frequency-domain ( 14 sec )
+Total number of segments : 674 ( 14 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0117188, Period(s): 85.3333 ( 16 sec )
+Perform calibration correction ( 16 sec )
+Calculate rotated fields ( 16 sec )
+Calculate response functions by multivariate regression ( 16 sec )
+Determine candicates ( 16 sec )
+Number of initial candidates: 100 ( 16 sec )
+Number of candidates: 100 ( 16 sec )
+Improve all candidates ( 16 sec )
+Detetermine the best improved candidates ( 16 sec )
+Perform further improvements to the best 10 candidates ( 16 sec )
+Select the response with the smallest scale ( 16 sec )
+Estimate errors by fixed-weights bootstrap ( 16 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.015625, Period(s): 64 ( 16 sec )
+Perform calibration correction ( 16 sec )
+Calculate rotated fields ( 16 sec )
+Calculate response functions by multivariate regression ( 16 sec )
+Determine candicates ( 16 sec )
+Number of initial candidates: 100 ( 16 sec )
+Number of candidates: 100 ( 16 sec )
+Improve all candidates ( 16 sec )
+Detetermine the best improved candidates ( 16 sec )
+Perform further improvements to the best 10 candidates ( 16 sec )
+Select the response with the smallest scale ( 16 sec )
+Estimate errors by fixed-weights bootstrap ( 16 sec )
+===============================================================================
+Perform analysis for segment length : 4096 ( 16 sec )
+Convert time-series data to frequency-domain ( 16 sec )
+Total number of segments : 1349 ( 16 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0234375, Period(s): 42.6667 ( 18 sec )
+Perform calibration correction ( 18 sec )
+Calculate rotated fields ( 18 sec )
+Calculate response functions by multivariate regression ( 18 sec )
+Determine candicates ( 18 sec )
+Number of initial candidates: 100 ( 18 sec )
+Number of candidates: 100 ( 18 sec )
+Improve all candidates ( 18 sec )
+Detetermine the best improved candidates ( 18 sec )
+Perform further improvements to the best 10 candidates ( 18 sec )
+Select the response with the smallest scale ( 19 sec )
+Estimate errors by fixed-weights bootstrap ( 19 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.03125, Period(s): 32 ( 19 sec )
+Perform calibration correction ( 19 sec )
+Calculate rotated fields ( 19 sec )
+Calculate response functions by multivariate regression ( 19 sec )
+Determine candicates ( 19 sec )
+Number of initial candidates: 100 ( 19 sec )
+Number of candidates: 100 ( 19 sec )
+Improve all candidates ( 19 sec )
+Detetermine the best improved candidates ( 19 sec )
+Perform further improvements to the best 10 candidates ( 19 sec )
+Select the response with the smallest scale ( 19 sec )
+Estimate errors by fixed-weights bootstrap ( 19 sec )
+===============================================================================
+Perform analysis for segment length : 2048 ( 19 sec )
+Convert time-series data to frequency-domain ( 19 sec )
+Total number of segments : 2699 ( 19 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.046875, Period(s): 21.3333 ( 21 sec )
+Perform calibration correction ( 21 sec )
+Calculate rotated fields ( 21 sec )
+Calculate response functions by multivariate regression ( 21 sec )
+Determine candicates ( 21 sec )
+Number of initial candidates: 100 ( 21 sec )
+Number of candidates: 100 ( 21 sec )
+Improve all candidates ( 21 sec )
+Detetermine the best improved candidates ( 21 sec )
+Perform further improvements to the best 10 candidates ( 21 sec )
+Select the response with the smallest scale ( 21 sec )
+Estimate errors by fixed-weights bootstrap ( 21 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.0625, Period(s): 16 ( 22 sec )
+Perform calibration correction ( 22 sec )
+Calculate rotated fields ( 22 sec )
+Calculate response functions by multivariate regression ( 22 sec )
+Determine candicates ( 22 sec )
+Number of initial candidates: 100 ( 22 sec )
+Number of candidates: 100 ( 22 sec )
+Improve all candidates ( 22 sec )
+Detetermine the best improved candidates ( 22 sec )
+Perform further improvements to the best 10 candidates ( 22 sec )
+Select the response with the smallest scale ( 22 sec )
+Estimate errors by fixed-weights bootstrap ( 22 sec )
+===============================================================================
+Perform analysis for segment length : 1024 ( 23 sec )
+Convert time-series data to frequency-domain ( 23 sec )
+Total number of segments : 5399 ( 23 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.09375, Period(s): 10.6667 ( 24 sec )
+Perform calibration correction ( 24 sec )
+Calculate rotated fields ( 24 sec )
+Calculate response functions by multivariate regression ( 24 sec )
+Determine candicates ( 24 sec )
+Number of initial candidates: 100 ( 24 sec )
+Number of candidates: 100 ( 24 sec )
+Improve all candidates ( 24 sec )
+Detetermine the best improved candidates ( 26 sec )
+Perform further improvements to the best 10 candidates ( 26 sec )
+Select the response with the smallest scale ( 26 sec )
+Estimate errors by fixed-weights bootstrap ( 26 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.125, Period(s): 8 ( 26 sec )
+Perform calibration correction ( 26 sec )
+Calculate rotated fields ( 26 sec )
+Calculate response functions by multivariate regression ( 26 sec )
+Determine candicates ( 26 sec )
+Number of initial candidates: 100 ( 26 sec )
+Number of candidates: 100 ( 26 sec )
+Improve all candidates ( 26 sec )
+Detetermine the best improved candidates ( 28 sec )
+Perform further improvements to the best 10 candidates ( 28 sec )
+Select the response with the smallest scale ( 28 sec )
+Estimate errors by fixed-weights bootstrap ( 28 sec )
+===============================================================================
+Perform analysis for segment length : 512 ( 28 sec )
+Convert time-series data to frequency-domain ( 28 sec )
+Total number of segments : 10799 ( 28 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.1875, Period(s): 5.33333 ( 30 sec )
+Perform calibration correction ( 30 sec )
+Calculate rotated fields ( 30 sec )
+Calculate response functions by multivariate regression ( 30 sec )
+Determine candicates ( 30 sec )
+Number of initial candidates: 100 ( 30 sec )
+Number of candidates: 100 ( 30 sec )
+Improve all candidates ( 30 sec )
+Detetermine the best improved candidates ( 33 sec )
+Perform further improvements to the best 10 candidates ( 33 sec )
+Select the response with the smallest scale ( 34 sec )
+Estimate errors by fixed-weights bootstrap ( 34 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.25, Period(s): 4 ( 34 sec )
+Perform calibration correction ( 34 sec )
+Calculate rotated fields ( 34 sec )
+Calculate response functions by multivariate regression ( 34 sec )
+Determine candicates ( 34 sec )
+Number of initial candidates: 100 ( 34 sec )
+Number of candidates: 100 ( 34 sec )
+Improve all candidates ( 34 sec )
+Detetermine the best improved candidates ( 37 sec )
+Perform further improvements to the best 10 candidates ( 38 sec )
+Select the response with the smallest scale ( 38 sec )
+Estimate errors by fixed-weights bootstrap ( 38 sec )
+===============================================================================
+Perform analysis for segment length : 256 ( 38 sec )
+Convert time-series data to frequency-domain ( 38 sec )
+Total number of segments : 21599 ( 38 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.375, Period(s): 2.66667 ( 40 sec )
+Perform calibration correction ( 40 sec )
+Calculate rotated fields ( 40 sec )
+Calculate response functions by multivariate regression ( 40 sec )
+Determine candicates ( 40 sec )
+Number of initial candidates: 100 ( 40 sec )
+Number of candidates: 100 ( 40 sec )
+Improve all candidates ( 40 sec )
+Detetermine the best improved candidates ( 47 sec )
+Perform further improvements to the best 10 candidates ( 47 sec )
+Select the response with the smallest scale ( 48 sec )
+Estimate errors by fixed-weights bootstrap ( 48 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.5, Period(s): 2 ( 49 sec )
+Perform calibration correction ( 49 sec )
+Calculate rotated fields ( 49 sec )
+Calculate response functions by multivariate regression ( 49 sec )
+Determine candicates ( 49 sec )
+Number of initial candidates: 100 ( 49 sec )
+Number of candidates: 100 ( 49 sec )
+Improve all candidates ( 49 sec )
+Detetermine the best improved candidates ( 56 sec )
+Perform further improvements to the best 10 candidates ( 56 sec )
+Select the response with the smallest scale ( 57 sec )
+Estimate errors by fixed-weights bootstrap ( 57 sec )
+===============================================================================
+Perform analysis for segment length : 128 ( 59 sec )
+Convert time-series data to frequency-domain ( 59 sec )
+Total number of segments : 43199 ( 59 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 0.75, Period(s): 1.33333 ( 60 sec )
+Perform calibration correction ( 60 sec )
+Calculate rotated fields ( 60 sec )
+Calculate response functions by multivariate regression ( 60 sec )
+Determine candicates ( 60 sec )
+Number of initial candidates: 100 ( 60 sec )
+Number of candidates: 100 ( 60 sec )
+Improve all candidates ( 60 sec )
+Detetermine the best improved candidates ( 74 sec )
+Perform further improvements to the best 10 candidates ( 75 sec )
+Select the response with the smallest scale ( 77 sec )
+Estimate errors by fixed-weights bootstrap ( 77 sec )
+-------------------------------------------------------------------------------
+Now Frequency(Hz): 1, Period(s): 1 ( 80 sec )
+Perform calibration correction ( 80 sec )
+Calculate rotated fields ( 80 sec )
+Calculate response functions by multivariate regression ( 80 sec )
+Determine candicates ( 80 sec )
+Number of initial candidates: 100 ( 80 sec )
+Number of candidates: 100 ( 80 sec )
+Improve all candidates ( 80 sec )
+Detetermine the best improved candidates ( 93 sec )
+Perform further improvements to the best 10 candidates ( 95 sec )
+Select the response with the smallest scale ( 97 sec )
+Estimate errors by fixed-weights bootstrap ( 97 sec )
+End TRACMT ( 99 sec )
diff --git a/Samples/RRMS/apparent_resistivity_and_phase.csv b/Samples/RRMS/apparent_resistivity_and_phase.csv
new file mode 100644
index 0000000..8d818a8
--- /dev/null
+++ b/Samples/RRMS/apparent_resistivity_and_phase.csv
@@ -0,0 +1,21 @@
+frequency,period,app_res_0_2,phase_0_2,app_res_0_3,phase_0_3,coherence_0_2+3,app_res_1_2,phase_1_2,app_res_1_3,phase_1_3,coherence_1_2+3,dapp_res_0_2,dphase_0_2,dapp_res_0_3,dphase_0_3,dapp_res_1_2,dphase_1_2,dapp_res_1_3,dphase_1_3
+1.4648437500e-03,6.8266666667e+02,4.2168886420e+01,4.8022056661e+01,4.1340512817e+01,5.3319419010e+01,8.9973917276e-01,1.5794724150e+02,-1.2865818972e+02,6.7403069362e+00,-1.3457562207e+02,9.5233260437e-01,3.1073627735e+00,2.1114984689e+00,3.0281598128e+00,2.0989046392e+00,5.6655525723e+00,1.0276521864e+00,1.1674152903e+00,4.9680123869e+00
+1.9531250000e-03,5.1200000000e+02,4.3564597655e+01,4.6390553781e+01,4.4830923973e+01,5.4525018856e+01,9.0762085300e-01,1.7097600483e+02,-1.2868474783e+02,7.6490661368e+00,-1.3018648634e+02,9.6762206017e-01,2.9479943515e+00,1.9389583213e+00,3.3836954645e+00,2.1627651164e+00,4.5403323711e+00,7.6077788522e-01,1.2675251362e+00,4.7526841939e+00
+2.9296875000e-03,3.4133333333e+02,4.2733401792e+01,5.0335908713e+01,5.2692186912e+01,5.6754047095e+01,8.7725934040e-01,1.7760075640e+02,-1.2554997667e+02,6.4548704970e+00,-1.2472151967e+02,9.4176032684e-01,2.4448036538e+00,1.6391866265e+00,3.1308984849e+00,1.7024693740e+00,4.4291696053e+00,7.1446571271e-01,1.1663941392e+00,5.1837383710e+00
+3.9062500000e-03,2.5600000000e+02,4.5922557831e+01,4.8027962255e+01,5.2154354090e+01,6.1902804894e+01,8.5732632366e-01,1.9550851034e+02,-1.2813428751e+02,6.5365207374e+00,-1.1938995875e+02,9.3463939198e-01,2.9148856176e+00,1.8186997932e+00,3.5792471021e+00,1.9664323534e+00,5.3454839210e+00,7.8329891687e-01,1.1908118666e+00,5.2262665539e+00
+5.8593750000e-03,1.7066666667e+02,5.2880914162e+01,4.8563234411e+01,5.8043409512e+01,6.0252520232e+01,7.8685932594e-01,2.1004200837e+02,-1.2887160208e+02,6.7669962064e+00,-1.2986454583e+02,9.0661227178e-01,2.6455403173e+00,1.4333536856e+00,3.3869925812e+00,1.6719204213e+00,4.9908997363e+00,6.8073101359e-01,1.1762289054e+00,4.9858222570e+00
+7.8125000000e-03,1.2800000000e+02,5.4031076641e+01,4.8131918926e+01,6.3188640137e+01,5.8486935159e+01,7.6301287094e-01,2.1762526110e+02,-1.2887235377e+02,7.5692482270e+00,-1.3327791478e+02,8.9042963299e-01,2.9555564319e+00,1.5672649881e+00,4.0009495261e+00,1.8142171754e+00,6.0655335313e+00,7.9848432966e-01,1.2721803920e+00,4.8205998718e+00
+1.1718750000e-02,8.5333333333e+01,5.9358145327e+01,4.2743685642e+01,7.4840212945e+01,5.8611890978e+01,7.0568344865e-01,2.4183856944e+02,-1.2992422141e+02,9.6020683702e+00,-1.2670477300e+02,8.3234334691e-01,2.6382117200e+00,1.2733790843e+00,3.9528469430e+00,1.5132758942e+00,5.9927750718e+00,7.0991468737e-01,1.5025599390e+00,4.4874926656e+00
+1.5625000000e-02,6.4000000000e+01,5.7394006151e+01,4.1943056890e+01,8.0773573381e+01,5.7045642999e+01,6.3151710006e-01,2.4463749503e+02,-1.3210244199e+02,9.3997023175e+00,-1.3840676112e+02,7.7865956962e-01,3.2202482370e+00,1.6075793941e+00,4.8426116123e+00,1.7177819817e+00,7.2980438250e+00,8.5465765751e-01,1.7871987618e+00,5.4551631057e+00
+2.3437500000e-02,4.2666666667e+01,5.1633535806e+01,4.0069471518e+01,8.7611476461e+01,5.6425674438e+01,5.1676899773e-01,2.4596402093e+02,-1.3357402405e+02,1.1734941367e+01,-1.2531057719e+02,6.9813188573e-01,2.5965177182e+00,1.4407805346e+00,4.5851243259e+00,1.4994511738e+00,6.2573253002e+00,7.2882204079e-01,1.8441505613e+00,4.5066724729e+00
+3.1250000000e-02,3.2000000000e+01,5.6513262228e+01,3.5732461211e+01,1.0211148188e+02,5.6413030019e+01,4.4535065602e-01,2.5257613567e+02,-1.3561840051e+02,1.1679347670e+01,-1.2912532506e+02,6.2510658343e-01,3.5031029310e+00,1.7760889521e+00,6.3088942012e+00,1.7702736415e+00,8.0248801145e+00,9.1024257302e-01,2.3310671358e+00,5.7273316112e+00
+4.6875000000e-02,2.1333333333e+01,6.1065446320e+01,3.2488891062e+01,1.0512598799e+02,5.9524981611e+01,3.1049538562e-01,2.3744477188e+02,-1.3803063881e+02,8.2696066296e+00,-1.2992682674e+02,4.2061086650e-01,3.7918963404e+00,1.7791942094e+00,6.3681228233e+00,1.7356429997e+00,8.1443452845e+00,9.8266953975e-01,1.9557788832e+00,6.7911748646e+00
+6.2500000000e-02,1.6000000000e+01,6.0621323721e+01,3.1358260770e+01,1.2632810857e+02,5.7835967317e+01,2.1119255836e-01,2.2105819282e+02,-1.3590011340e+02,9.0950131491e+00,-1.3256296162e+02,2.6854473703e-01,5.3921814093e+00,2.5490302527e+00,1.0350422678e+01,2.3478604428e+00,1.1233845315e+01,1.4559994279e+00,2.9754839773e+00,9.4146243233e+00
+9.3750000000e-02,1.0666666667e+01,3.9603097417e+01,3.0438422556e+01,1.5034144676e+02,5.7752536033e+01,1.0806514363e-01,1.9429047294e+02,-1.3489892412e+02,1.5013595513e+01,-1.2269722451e+02,1.1000148190e-01,4.7489007736e+00,3.4372974651e+00,1.2649972609e+01,2.4111914410e+00,1.1416348883e+01,1.6835687701e+00,4.4177549858e+00,8.4603613564e+00
+1.2500000000e-01,8.0000000000e+00,3.7463475544e+01,2.0756375865e+01,1.4808960043e+02,5.6355234280e+01,4.7239197846e-02,1.9087428843e+02,-1.3871629002e+02,6.4597303390e+00,-1.2987559360e+02,4.7239197846e-02,7.2376619930e+00,5.5432004023e+00,1.9519439536e+01,3.7787686491e+00,1.6134676445e+01,2.4223386087e+00,4.1668647292e+00,1.8815768544e+01
+1.8750000000e-01,5.3333333333e+00,1.9584904684e+01,2.5028522642e+01,1.4172201875e+02,5.7792497193e+01,1.7617568989e-02,1.8499160388e+02,-1.3322297563e+02,3.4867331457e+00,-1.4440260121e+02,1.7617568989e-02,6.1507909811e+00,9.0344831802e+00,2.2587377678e+01,4.5706908467e+00,2.0524084328e+01,3.1800020527e+00,3.7257066954e+00,3.2294348747e+01
+2.5000000000e-01,4.0000000000e+00,3.4804617614e+01,4.5085997151e+01,1.9970647211e+02,6.1017427630e+01,7.5452420080e-03,1.9030275297e+02,-1.3754893906e+02,3.6704792101e+00,-1.3840778697e+02,7.5452420080e-03,1.5359698070e+01,1.2747568188e+01,5.1161851510e+01,7.3593861399e+00,3.2935235911e+01,4.9642294331e+00,6.2912088835e+00,5.8981507398e+01
+3.7500000000e-01,2.6666666667e+00,1.9811145761e+01,-1.5192713621e+01,3.0006978275e+02,4.0496483285e+01,2.0282928584e-03,1.6939822452e+02,-1.3203074227e+02,9.9913471627e+00,-8.9358360316e+01,2.0282928584e-03,1.6756584952e+01,2.5018319717e+01,9.6805854108e+01,9.2826842340e+00,3.8993666523e+01,6.6090856717e+00,1.4065510381e+01,4.4739501173e+01
+5.0000000000e-01,2.0000000000e+00,3.1078209375e+01,9.7750421526e-01,2.8072073624e+02,2.3630845293e+01,9.4692383969e-04,1.4226306311e+02,-1.2803054508e+02,4.1720991574e+01,-1.4050409799e+02,9.4692383969e-04,3.5150092832e+01,3.4437732519e+01,1.5068632777e+02,1.5568596247e+01,5.9895366204e+01,1.2152194119e+01,4.4339110949e+01,3.2098508259e+01
+7.5000000000e-01,1.3333333333e+00,2.2202358119e+01,-1.5105060212e+02,1.8297081679e+02,4.0381278587e+01,4.8556897195e-04,5.9609382797e+01,-1.3661518416e+02,2.9360847370e+01,-1.3322492493e+02,4.8556897195e-04,2.6756826605e+01,3.7053983647e+01,1.0306264369e+02,1.6357920486e+01,2.9732060571e+01,1.4441464439e+01,2.6328428830e+01,2.6638478853e+01
+1.0000000000e+00,1.0000000000e+00,2.0141313837e+02,-3.9642468829e+01,1.2450119453e+03,-1.6642143834e+02,8.3444887217e-05,4.1321240276e+01,1.2388481787e+02,5.7793087565e+02,-5.2634102076e+01,8.3444887217e-05,4.2392885822e+02,3.6000000000e+02,2.2428379410e+03,6.4254121306e+01,1.5342552971e+02,3.6000000000e+02,1.1618730174e+03,3.6000000000e+02
diff --git a/Samples/RRMS/param.dat b/Samples/RRMS/param.dat
new file mode 100644
index 0000000..51a5faa
--- /dev/null
+++ b/Samples/RRMS/param.dat
@@ -0,0 +1,48 @@
+NUM_OUT
+2
+SAMPLING_FREQ
+32
+NUM_SECTION
+1
+SEGMENT
+10
+65536 2 3 4
+32768 2 3 4
+16384 2 3 4
+8192 2 3 4
+4096 2 3 4
+2048 2 3 4
+1024 2 3 4
+512 2 3 4
+256 2 3 4
+128 2 3 4
+ROTATION
+0.0
+AZIMUTH
+0.0 90.0
+0.0 90.0
+0.0 90.0
+OUTPUT_RHOA_PHS
+PREWHITENING
+0
+10
+5
+PROCEDURE
+1
+ERROR_ESTIMATION
+1
+DATA_FILES
+2764800
+../ex.txt
+0
+../ey.txt
+0
+../hx.txt
+0
+../hy.txt
+0
+../hrx.txt
+0
+../hry.txt
+0
+END
diff --git a/Samples/RRMS/response_functions.csv b/Samples/RRMS/response_functions.csv
new file mode 100644
index 0000000..3f5b253
--- /dev/null
+++ b/Samples/RRMS/response_functions.csv
@@ -0,0 +1,21 @@
+frequency,period,resp_real_0_2,resp_imag_0_2,resp_real_0_3,resp_imag_0_3,coherence_0_2+3,resp_real_1_2,resp_imag_1_2,resp_real_1_3,resp_imag_1_3,coherence_1_2+3,dresp_0_2,dresp_0_3,dresp_1_2,dresp_1_3
+1.4648437500e-03,6.8266666667e+02,3.7170796163e-01,4.1314324373e-01,3.2870014945e-01,4.4129714577e-01,8.9973917276e-01,-6.7187642587e-01,-8.3989416958e-01,-1.5594261737e-01,-1.5826996724e-01,9.5233260437e-01,2.0476067380e-02,2.0153084204e-02,1.9290207924e-02,1.9241379181e-02
+1.9531250000e-03,5.1200000000e+02,4.4988510272e-01,4.7226996340e-01,3.8399619001e-01,5.3884034554e-01,9.0762085300e-01,-8.0764751289e-01,-1.0086590317e+00,-1.7636027481e-01,-2.0879407310e-01,9.6762206017e-01,2.2068855922e-02,2.4970224693e-02,1.7156950165e-02,2.2645003835e-02
+2.9296875000e-03,3.4133333333e+02,5.0500346283e-01,6.0905588236e-01,4.8165364720e-01,7.3475708289e-01,8.7725934040e-01,-9.3778371126e-01,-1.3123015244e+00,-1.7514609390e-01,-2.5274020819e-01,9.4176032684e-01,2.2632154980e-02,2.6101263448e-02,2.0112477022e-02,2.7782237369e-02
+3.9062500000e-03,2.5600000000e+02,6.3336409438e-01,7.0411283299e-01,4.7533779502e-01,8.9033348187e-01,8.5732632366e-01,-1.2066727908e+00,-1.5370316746e+00,-1.7534750487e-01,-3.1131924641e-01,9.3463939198e-01,3.0056852933e-02,3.4632306809e-02,2.6714018234e-02,3.2546542262e-02
+5.8593750000e-03,1.7066666667e+02,8.2372516745e-01,9.3312506160e-01,6.4703069797e-01,1.1321845207e+00,7.8685932594e-01,-1.5567931963e+00,-1.9313128716e+00,-2.8539710697e-01,-3.4176063746e-01,9.0661227178e-01,3.1134762749e-02,3.8046826777e-02,2.9471783455e-02,3.8696753830e-02
+7.8125000000e-03,1.2800000000e+02,9.6961564692e-01,1.0818661787e+00,8.2119478794e-01,1.3393824605e+00,7.6301287094e-01,-1.8298223717e+00,-2.2699640636e+00,-3.7276727742e-01,-3.9587664209e-01,8.9042963299e-01,3.9734473874e-02,4.9738603749e-02,4.0631642345e-02,4.5695385483e-02
+1.1718750000e-02,8.5333333333e+01,1.3696099030e+00,1.2657744828e+00,1.0906645861e+00,1.7876295724e+00,7.0568344865e-01,-2.4158528204e+00,-2.8868466929e+00,-4.4831724068e-01,-6.0135916495e-01,8.3234334691e-01,4.1444331150e-02,5.5301656768e-02,4.6640247476e-02,5.8687425702e-02
+1.5625000000e-02,6.4000000000e+01,1.5750342011e+00,1.4153352946e+00,1.3664861022e+00,2.1078783535e+00,6.3151710006e-01,-2.9310839653e+00,-3.2436169762e+00,-6.4088766373e-01,-5.6887146705e-01,7.7865956962e-01,5.9404740172e-02,7.5302606759e-02,6.5209365722e-02,8.1466831280e-02
+2.3437500000e-02,4.2666666667e+01,1.8824269968e+00,1.5834372672e+00,1.7719873403e+00,2.6696499328e+00,5.1676899773e-01,-3.7006596458e+00,-3.8896049785e+00,-6.7782122777e-01,-9.5694661536e-01,6.9813188573e-01,6.1849473428e-02,8.3845790860e-02,6.8291018558e-02,9.2143894119e-02
+3.1250000000e-02,3.2000000000e+01,2.4121759935e+00,1.7353974183e+00,2.2096888999e+00,3.3274906477e+00,4.4535065602e-01,-4.4898138524e+00,-4.3939268051e+00,-8.5243560071e-01,-1.0479750093e+00,6.2510658343e-01,9.2099596351e-02,1.2339454824e-01,9.9798132210e-02,1.3481105444e-01
+4.6875000000e-02,2.1333333333e+01,3.1910692923e+00,2.0320656370e+00,2.5174330933e+00,4.2780175380e+00,3.1049538562e-01,-5.5465049161e+00,-4.9887274554e+00,-8.9351882813e-01,-1.0676203246e+00,4.2061086650e-01,1.1745846893e-01,1.5034259177e-01,1.2793828320e-01,1.6462772392e-01
+6.2500000000e-02,1.6000000000e+01,3.7167217626e+00,2.2649818988e+00,3.3447846899e+00,5.3188296932e+00,2.1119255836e-01,-5.9687031811e+00,-5.7840528689e+00,-1.1403292528e+00,-1.2417088242e+00,2.6854473703e-01,1.9357390099e-01,2.5739677645e-01,2.1118844238e-01,2.7577250591e-01
+9.3750000000e-02,1.0666666667e+01,3.7147552433e+00,2.1827838639e+00,4.4792692664e+00,7.0999084505e+00,1.0806514363e-01,-6.7361833599e+00,-6.7599920806e+00,-1.4330693869e+00,-2.2324728506e+00,1.1000148190e-01,2.5832662080e-01,3.5317574278e-01,2.8037683201e-01,3.9030122539e-01
+1.2500000000e-01,8.0000000000e+00,4.5248078117e+00,1.7148721474e+00,5.3302195115e+00,8.0090424041e+00,4.7239197846e-02,-8.2075743408e+00,-7.2063967218e+00,-1.2882151817e+00,-1.5420224083e+00,4.7239197846e-02,4.6741675676e-01,6.3403769126e-01,4.6163269310e-01,6.4805552956e-01
+1.8750000000e-01,5.3333333333e+00,3.8825870402e+00,1.8128336980e+00,6.1435724504e+00,9.7529949310e+00,1.7617568989e-02,-9.0188334027e+00,-9.5963676820e+00,-1.4701223363e+00,-1.0524032689e+00,1.7617568989e-02,6.7286181123e-01,9.1854997818e-01,7.3053903070e-01,9.6595067357e-01
+2.5000000000e-01,4.0000000000e+00,4.6569933261e+00,4.6709940246e+00,7.6556823753e+00,1.3821129386e+01,7.5452420080e-03,-1.1380151653e+01,-1.0410119575e+01,-1.6019654290e+00,-1.4219021686e+00,7.5452420080e-03,1.4554230752e+00,2.0238354267e+00,1.3346372869e+00,1.8356831929e+00
+3.7500000000e-01,2.6666666667e+00,5.8817311740e+00,-1.5972278172e+00,1.8037653855e+01,1.5403697156e+01,2.0282928584e-03,-1.1932312433e+01,-1.3237884687e+01,4.8469904838e-02,-4.3279818159e+00,2.0282928584e-03,2.5775159198e+00,3.8261424007e+00,2.0512107625e+00,3.0465906946e+00
+5.0000000000e-01,2.0000000000e+00,8.8132236485e+00,1.5037406383e-01,2.4270149278e+01,1.0618930956e+01,9.4692383969e-04,-1.1618611763e+01,-1.4854814657e+01,-7.8809573017e+00,-6.4956132077e+00,9.4692383969e-04,4.9846938608e+00,7.1101147657e+00,3.9699693656e+00,5.4268732534e+00
+7.5000000000e-01,1.3333333333e+00,-7.9844835846e+00,-4.4166576540e+00,1.9953497599e+01,1.6970518452e+01,4.8556897195e-04,-1.0865807590e+01,-1.0269830131e+01,-7.1862838138e+00,-7.6459468076e+00,4.8556897195e-04,5.4982019907e+00,7.3772755176e+00,3.7286647286e+00,4.7046388276e+00
+1.0000000000e+00,1.0000000000e+00,2.4436696847e+01,-2.0246321618e+01,-7.6693733746e+01,-1.8523793629e+01,8.3444887217e-05,-8.0137565169e+00,1.1932556636e+01,3.2624372311e+01,-4.2723584934e+01,8.3444887217e-05,3.3396741085e+01,7.1066698734e+01,2.6684923591e+01,5.4035070700e+01
diff --git a/Samples/ex.txt.gz b/Samples/ex.txt.gz
new file mode 100644
index 0000000..4030e2d
Binary files /dev/null and b/Samples/ex.txt.gz differ
diff --git a/Samples/ey.txt.gz b/Samples/ey.txt.gz
new file mode 100644
index 0000000..d12e10f
Binary files /dev/null and b/Samples/ey.txt.gz differ
diff --git a/Samples/hrx.txt.gz b/Samples/hrx.txt.gz
new file mode 100644
index 0000000..a58ee18
Binary files /dev/null and b/Samples/hrx.txt.gz differ
diff --git a/Samples/hry.txt.gz b/Samples/hry.txt.gz
new file mode 100644
index 0000000..8626e53
Binary files /dev/null and b/Samples/hry.txt.gz differ
diff --git a/Samples/hx.txt.gz b/Samples/hx.txt.gz
new file mode 100644
index 0000000..a4e58e8
Binary files /dev/null and b/Samples/hx.txt.gz differ
diff --git a/Samples/hy.txt.gz b/Samples/hy.txt.gz
new file mode 100644
index 0000000..d438815
Binary files /dev/null and b/Samples/hy.txt.gz differ
diff --git a/THIRD_PARTY_NOTICES b/THIRD_PARTY_NOTICES
new file mode 100644
index 0000000..fbae47e
--- /dev/null
+++ b/THIRD_PARTY_NOTICES
@@ -0,0 +1,103 @@
+The source codes of TRACMT use the following third parties.
+ 1. CLAPACK
+ 2. MT19937-64 (2004/9/29 version).
+
+The license terms of those third parties are desribed below.
+
+--------------------------------------------------------------------------------
+CLAPACK
+https://www.netlib.org/clapack/
+
+Copyright (c) 1992-2008 The University of Tennessee. All rights reserved.
+
+$COPYRIGHT$
+
+Additional copyrights may follow
+
+$HEADER$
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer listed
+ in this license in the documentation and/or other materials
+ provided with the distribution.
+
+- Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+ MT19937-64 (2004/9/29 version).
+ http://math.sci.hiroshima-u.ac.jp/m-mat/MT/mt64.html
+
+ A C-program for MT19937-64 (2004/9/29 version).
+ Coded by Takuji Nishimura and Makoto Matsumoto.
+
+ This is a 64-bit version of Mersenne Twister pseudorandom number
+ generator.
+
+ Before using, initialize the state by using init_genrand64(seed)
+ or init_by_array64(init_key, key_length).
+
+ Copyright (C) 2004, Makoto Matsumoto and Takuji Nishimura,
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ 3. The names of its contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ References:
+ T. Nishimura, ``Tables of 64-bit Mersenne Twisters''
+ ACM Transactions on Modeling and
+ Computer Simulation 10. (2000) 348--357.
+ M. Matsumoto and T. Nishimura,
+ ``Mersenne Twister: a 623-dimensionally equidistributed
+ uniform pseudorandom number generator''
+ ACM Transactions on Modeling and
+ Computer Simulation 8. (Jan. 1998) 3--30.
+
+ Any feedback is very welcome.
+ http://www.math.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove spaces)
+--------------------------------------------------------------------------------
diff --git a/docs/Manual_Of_TRACMT.pdf b/docs/Manual_Of_TRACMT.pdf
new file mode 100644
index 0000000..dc419cb
Binary files /dev/null and b/docs/Manual_Of_TRACMT.pdf differ
diff --git a/src/Analysis.cpp b/src/Analysis.cpp
new file mode 100644
index 0000000..d673d23
--- /dev/null
+++ b/src/Analysis.cpp
@@ -0,0 +1,3820 @@
+//--------------------------------------------------------------------------
+// Copyright(c) 2024, Yoshiya Usui
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met :
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and /or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//--------------------------------------------------------------------------
+#include "Analysis.h"
+#include "Control.h"
+#include "OutputFiles.h"
+#include "Util.h"
+#include "UtilRobust.h"
+#include "TableOfTukeysBiweightParameters.h"
+#include "Ats.h"
+#ifdef _MTH5
+#include "MTH5.h"
+#endif
+#include "ElogDual.h"
+#include "ElogMT.h"
+#include "RobustWeightTukeysBiweights.h"
+#include "RobustWeightHuber.h"
+#include "RobustWeightThomson.h"
+#include "RobustPrewhitening.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#ifdef _MERSENNE_TWISTER_ORIGINAL
+#else
+#include
+#endif
+
+#ifdef _MERSENNE_TWISTER_ORIGINAL
+#include "mt64.h"
+#endif
+
+#ifdef _USE_OMP
+#include
+#endif
+
+// Default constructer
+Analysis::Analysis():
+ m_calibrationFunctions(NULL),
+ m_coefficientsOfARModel(NULL)
+{
+ for( int i = 0; i < 2; ++i ){
+ m_robustWeight[i] = NULL;
+ }
+}
+
+// Destructer
+Analysis::~Analysis()
+{
+ if( m_calibrationFunctions != NULL ){
+ delete [] m_calibrationFunctions;
+ }
+
+ if( m_coefficientsOfARModel != NULL ){
+ delete [] m_coefficientsOfARModel;
+ }
+
+ for( int i = 0; i < 2; ++i ){
+ if( m_robustWeight[i] != NULL ){
+ delete m_robustWeight[i];
+ }
+ }
+}
+
+// Run analysis
+void Analysis::run( std::vector& dataFileSets ){
+
+ const Control* const ptrControl = Control::getInstance();
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+
+ std::vector freqAll = ptrControl->getFrequenciesAllWithoutDuplications();
+ readTimeSeriesData(dataFileSets);
+
+ // Merge sections
+ mergeSections(dataFileSets);
+
+ if (ptrControl->doesPeformEOFBasedDenoising() && ptrControl->getTimingEOFBasedDenoising() == Control::BEFORE_DECIMATION) {
+ // Modify time-series data based on the EOF analysis
+ modifyTimeSeriesBasedOnEOFAnalysis(dataFileSets);
+ }
+
+ // Apply decimation
+ decimation(dataFileSets);
+
+ // Read calibration files for main analysis
+ readCalibrationFiles(freqAll);
+
+ // Prior evaluation before preprocessing
+ if( ptrControl->doesOutputTimeSeriesToCsv() ){
+ outputTimeSeriesData( dataFileSets, false );
+ }
+
+ if (ptrControl->doesOutputCalibratedTimeSeriesToCsv() ) {
+ outputCalibratedTimeSeriesData(dataFileSets);
+ }
+
+ // Prior evaluation before preprocessing
+ if( ptrControl->getParamsForTimeDomainEvaluation().doEvaluation ){
+ const Control::ParamsForTimeDomainEvaluation params = ptrControl->getParamsForTimeDomainEvaluation();
+ priorEvaluationOfTimeSeriesData( params.timeSeriesInterval, dataFileSets, false );
+ }
+ if( ptrControl->getParamsForFreqDomainEvaluation().doEvaluation ){
+ priorEvaluationOfFrequencyDataFromAllData( dataFileSets, false );
+ }
+
+ // Pre-processings
+ preprocessing(dataFileSets);
+
+ // Prior evaluation after preprocessing
+ if (ptrControl->doesOutputTimeSeriesToCsv()) {
+ outputTimeSeriesData(dataFileSets, true);
+ }
+
+ // Prior evaluation after preprocessing
+ if( ptrControl->getParamsForTimeDomainEvaluation().doEvaluation ){
+ const Control::ParamsForTimeDomainEvaluation params = ptrControl->getParamsForTimeDomainEvaluation();
+ priorEvaluationOfTimeSeriesData( params.timeSeriesInterval, dataFileSets, true );
+ }
+ if( ptrControl->getParamsForFreqDomainEvaluation().doEvaluation ){
+ priorEvaluationOfFrequencyDataFromAllData( dataFileSets, true );
+ }
+
+ std::ofstream ofsResp;
+ const std::string fileNameResp = "response_functions.csv";
+ ofsResp.open( fileNameResp.c_str(), std::ios::out );
+ if( ofsResp.fail() ){
+ ptrOutputFiles->writeErrorMessage( "File open error : " + fileNameResp );
+ }
+ writeHeaderToOutputFileForResponseFunctions(ofsResp);
+
+ std::ofstream ofsRhoaPhs;
+ if( ptrControl->doesOutputApparentResistivityAndPhase() ){
+ const std::string fileNameRhoaPhs = "apparent_resistivity_and_phase.csv";
+ ofsRhoaPhs.open( fileNameRhoaPhs.c_str(), std::ios::out );
+ if( ofsRhoaPhs.fail() ){
+ ptrOutputFiles->writeErrorMessage( "File open error : " + fileNameRhoaPhs );
+ }
+ writeHeaderToOutputFileForApparentResistivityAndPhase(ofsRhoaPhs);
+ }
+
+ const int numChannels = ptrControl->getNumberOfChannels();
+ const double samplingFreq = ptrControl->getSamplingFrequency();
+ const int numSegmentLengths = ptrControl->getNumSegmentLengths();
+ for( int iSegLen = 0; iSegLen < numSegmentLengths; ++iSegLen ){
+ const int segmentLength = ptrControl->getSegmentLength(iSegLen);
+ ptrOutputFiles->writeLogMessage("===============================================================================",false);
+ ptrOutputFiles->writeLogMessage("Perform analysis for segment length : " + Util::toString(segmentLength));
+
+ // Fourier transform of data
+ std::complex*** cdata = new std::complex**[numChannels];
+ int numSegmentsTotal(0);
+ std::vector< std::pair > timesOrg;
+ std::vector* meanSquares = new std::vector[numChannels];
+ convertToFrequencyData(segmentLength, dataFileSets, numSegmentsTotal, cdata, timesOrg, meanSquares);
+
+ // Select segments to be excluded
+ std::vector remainingSegments;
+ remainingSegments.reserve(numSegmentsTotal);
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ // Initially all segments are to be used
+ remainingSegments.push_back(true);
+ }
+
+ std::ostringstream fileName;
+ selectSegmentsToBeExcludedByMeanSquareCriteria(numSegmentsTotal, meanSquares, timesOrg, remainingSegments);
+
+ // Loop of frequency at which response function is estimated
+ const int numTargetFreqsInSegment = ptrControl->getNumTargetFrequencyInSegment(iSegLen);
+ for( int iFreq = 0; iFreq < numTargetFreqsInSegment; ++iFreq ){
+ ptrOutputFiles->writeLogMessage("-------------------------------------------------------------------------------",false);
+ const int freqDegree = ptrControl->getTargetFrequencyDegreesInSegment(iSegLen, iFreq);
+ const double freq = samplingFreq * static_cast(freqDegree) / static_cast(segmentLength);
+ ptrOutputFiles->writeLogMessage("Now Frequency(Hz): " + Util::toString(freq) + ", Period(s): " + Util::toString(1.0/freq));
+ const double timeLength = static_cast(segmentLength) / samplingFreq;
+
+ // Copy the array because it will be overwrited in the selection using square coherence criteria
+ std::vector remainingSegmentsForThisFrequency = remainingSegments;
+
+ // Copy Fourier transformed values
+ std::complex** ftvalOrg = new std::complex*[numChannels];
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ ftvalOrg[iChan] = new std::complex[numSegmentsTotal];
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ assert(freqDegree > 0);
+ ftvalOrg[iChan][iSeg] = cdata[iChan][iSeg][freqDegree];
+ }
+ }
+
+ calibrationCorrectionAllChannels(numChannels, numSegmentsTotal, freq, ftvalOrg );
+ calculateRotatedFields(numSegmentsTotal, ftvalOrg);
+
+ // Prior evaluation of data segments
+ if( ptrControl->getParamsForDataSegmentEvaluation().doEvaluation ){
+ std::ostringstream fileName;
+ fileName << "segm" << iSegLen << "_index" << freqDegree << ".csv";
+ priorEvaluationOfDataSegments( numSegmentsTotal, ftvalOrg, timesOrg, timeLength, fileName.str() );
+ }
+
+ // Select segments to be excluded by square coherence criteria
+ if( ptrControl->getParamsForSquareCoherenceCriteria().applySquareCoherenceCriteria ){
+ selectSegmentsToBeExcludedBySquareCoherenceCriteria( numSegmentsTotal, ftvalOrg, remainingSegmentsForThisFrequency );
+ }
+
+ // Select segments to be excluded by square coherence criteria with random sampling
+ if( ptrControl->getParamsForSquareCoherenceCriteriaWithRandomSampling().applySquareCoherenceCriteria ){
+ selectSegmentsToBeExcludedBySquareCoherenceCriteriaWithRandomSampling( numSegmentsTotal, ftvalOrg, remainingSegmentsForThisFrequency );
+ }
+
+ // Select segments to be excluded by magnetic polarization diretion criteria
+ if( ptrControl->getParamsForMagneticPolarizatitonDirectionCriteria().applyMagneticPolarizatitonDirectionCriteria ){
+ selectSegmentsToBeExcludedByMagneticPolarizatitonDirectionCriteria( numSegmentsTotal, ftvalOrg, remainingSegmentsForThisFrequency );
+ }
+
+ // Select segments to be excluded by degree of magnetic polarization criteria
+ if( ptrControl->getParamsForDegreeOfMagneticPolarizationCriteria().applyDegreeOfMagneticPolarizationCriteria ){
+ selectSegmentsToBeExcludedByDegreeOfMagneticPolarizationCriteria( numSegmentsTotal, ftvalOrg, remainingSegmentsForThisFrequency );
+ }
+
+ int numOfRemainingSegments(0);
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ if(remainingSegmentsForThisFrequency[iSeg]){
+ ++numOfRemainingSegments;
+ }
+ }
+ if( numOfRemainingSegments <= 0 ){
+ ptrOutputFiles->writeErrorMessage("Number of remaining segments is too small: " + Util::toString(numOfRemainingSegments));
+ }
+
+#ifdef _DEBUG_WRITE
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ for( int iChan = 0; iChan < ptrControl->getNumberOfChannels(); ++iChan ){
+ std::cout << ftvalOrg[iChan][iSeg] << " ";
+ }
+ std::cout << std::endl;
+ }
+#endif
+ // Make data excluding some segments
+ std::complex** ftval = new std::complex*[numChannels];
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ ftval[iChan] = new std::complex[numOfRemainingSegments];
+ int icount(0);
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ if(remainingSegmentsForThisFrequency[iSeg]){
+ ftval[iChan][icount] = ftvalOrg[iChan][iSeg];
+ ++icount;
+ }
+ }
+ assert( icount == numOfRemainingSegments );
+ }
+#ifdef _DEBUG_WRITE
+ for( int iSeg = 0; iSeg < numOfRemainingSegments; ++iSeg ){
+ for( int iChan = 0; iChan < ptrControl->getNumberOfChannels(); ++iChan ){
+ std::cout << ftval[iChan][iSeg] << " ";
+ }
+ std::cout << std::endl;
+ }
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ std::cout << timesOrg[iSeg].first << " " << timesOrg[iSeg].second << " " << std::endl;
+ }
+#endif
+
+ std::vector< std::pair > times;
+ times.reserve(numOfRemainingSegments);
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ if(remainingSegmentsForThisFrequency[iSeg]){
+ times.push_back(timesOrg[iSeg]);
+ }
+ }
+#ifdef _DEBUG_WRITE
+ for( int iSeg = 0; iSeg < numOfRemainingSegments; ++iSeg ){
+ std::cout << times[iSeg].first << " " << times[iSeg].second << " " << std::endl;
+ }
+#endif
+ assert( times.size() == numOfRemainingSegments );
+
+ if( ptrControl->doesOutputFreqDomainDataToCsv() ){
+ outputFrequencyDomainData( iSegLen, freqDegree, numOfRemainingSegments, ftval );
+ }
+ // Calculate response functions
+ calculateResponseFunctions( iSegLen, freqDegree, timeLength, freq, numOfRemainingSegments, ftval, times, ofsResp, ofsRhoaPhs );
+
+ // Delete arrays
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ delete [] ftvalOrg[iChan];
+ }
+ delete [] ftvalOrg;
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ delete [] ftval[iChan];
+ }
+ delete [] ftval;
+ }
+
+ // Delete arrays
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ delete [] cdata[iChan][iSeg];
+ }
+ delete [] cdata[iChan];
+ }
+ delete [] cdata;
+ delete [] meanSquares;
+ }
+
+}
+
+// Set object of M-estimator with Huber weight
+void Analysis::setRobustWeightHuber( const int index, const RobustWeightHuber* const ptrRobustWeight ){
+
+ if( m_robustWeight[index] != NULL ){
+ delete m_robustWeight[index];
+ }
+
+ m_robustWeight[index] = new RobustWeightHuber(*ptrRobustWeight);
+
+}
+
+// Set object of M-estimator with Thomson weight
+void Analysis::setRobustWeightThomson( const int index, const RobustWeightThomson* const ptrRobustWeight ){
+
+ if( m_robustWeight[index] != NULL ){
+ delete m_robustWeight[index];
+ }
+
+ m_robustWeight[index] = new RobustWeightThomson(*ptrRobustWeight);
+
+}
+
+// Set object of M-estimator with Tukey's biweights
+void Analysis::setRobustWeightTukeysBiweights( const int index, const RobustWeightTukeysBiweights* const ptrRobustWeight ){
+
+ if( m_robustWeight[index] != NULL ){
+ delete m_robustWeight[index];
+ }
+
+ m_robustWeight[index] = new RobustWeightTukeysBiweights(*ptrRobustWeight);
+
+}
+
+// Test function
+void Analysis::test() const{
+
+ const std::string fileName = "KrafftPoint.txt";
+ std::ifstream ifs(fileName.c_str(), std::ios::in);
+ int numOfData(0);
+ ifs >> numOfData;
+ double* x = new double[numOfData];
+ double* y = new double[numOfData];
+ for (int iData = 0; iData < numOfData; ++iData) {
+ ifs >> y[iData] >> x[iData];
+ }
+ ifs.close();
+ std::vector< std::pair > candidatesOfPairsInit;
+ const int numOfCandidatesOfPairsAll = (numOfData * numOfData - numOfData) / 2;
+ for (int i1 = 0; i1 < numOfData; ++i1) {
+ for (int i2 = i1 + 1; i2 < numOfData; ++i2) {
+ candidatesOfPairsInit.push_back(std::make_pair(i1, i2));
+ }
+ }
+ double slope(0.0);
+ double intercept(0.0);
+ double* weights = new double[numOfData];
+ for (int iData = 0; iData < numOfData; ++iData) {
+ weights[iData] = 1.0;
+ }
+ const int numOfCandidates = candidatesOfPairsInit.size() + 1;
+ double* slopeCandidates = new double[numOfCandidates];
+ double* interceptCandidates = new double[numOfCandidates];
+ int icount(0);
+ // Least square solution
+ Util::calculateRegressionCoefficientsByWLSWithIntercept(numOfData, y, x, weights, slope, intercept);
+ slopeCandidates[icount] = slope;
+ interceptCandidates[icount] = intercept;
+ ++icount;
+ std::cout << "OLS " << slope << " " << intercept << std::endl;
+ for (std::vector< std::pair >::const_iterator itr = candidatesOfPairsInit.begin(); itr != candidatesOfPairsInit.end(); ++itr, ++icount) {
+ const int i1 = itr->first;
+ const int i2 = itr->second;
+ slope = (y[i2] - y[i1]) / (x[i2] - x[i1]);
+ intercept = y[i1] - slope * x[i1];
+ slopeCandidates[icount] = slope;
+ interceptCandidates[icount] = intercept;
+ std::cout << icount << " " << i1 << " " << i2 << " " << slope << " " << intercept << std::endl;
+ }
+ double scale(0.0);
+ UtilRobust::computeSEstimatorForUnivariateLinearRegressionWithIntercept(numOfData, numOfCandidates,
+ y, x, slopeCandidates, interceptCandidates, scale, slope, intercept);
+ std::cout << "S-estimate " << slope << " " << intercept << " " <& dataFileSets ){
+
+ //const Control* const ptrControl = Control::getInstance();
+
+ //for( int i = 1; i < 10000; ++i ){
+ // const double dsec = static_cast(i) * 0.5;
+ // std::cout << std::setw(10) << dsec << " " << ptrControl->getTimeFromStartTimeOfEachSection(0, dsec) << std::endl;
+ //}
+ //for( int i = 1; i < 10000; ++i ){
+ // const double dsec = static_cast(i) * 0.5;
+ // std::cout << std::setw(10) << dsec << " " << ptrControl->getTimeFromStartTimeOfEachSection(1, dsec) << std::endl;
+ //}
+
+ readTimeSeriesData(dataFileSets);
+
+ //const int numChannels = m_numOutputVariables + 2 + 2 * m_numRemoteReferenceStations;
+ const int numChannels = 5;
+ for( std::vector::const_iterator itr = dataFileSets.begin(); itr != dataFileSets.end(); ++itr ){
+ const int numData = itr->numDataPoints;
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ std::cout << "Var = " << iChan << std::endl;
+ std::ostringstream fileName;
+ fileName << "var_" << iChan <<".csv";
+ std::ofstream ofs;
+ ofs.open( fileName.str().c_str(), std::ios::out );
+ if( ofs.fail() ){
+ std::cerr << "File open error !! : " << fileName.str() << std::endl;
+ exit(1);
+ }
+ std::complex* cdata = new std::complex[numData];
+ for( int i = 0; i < numData; ++i ){
+ cdata[i] = std::complex(itr->dataFile[iChan].data[i], 0.0);
+ }
+ Util::fourierTransform(numData, cdata);
+ const double samplingFrequency = Control::getInstance()->getSamplingFrequency();
+ const double dt = 1.0 / samplingFrequency;
+ const double T = static_cast(numData) * dt;
+ ofs << "i" << "," << "freq"
+ << "," << "amp" << "," << "amp*T/2"
+ << "," << "phs"
+ << "," << "power" << "," << "power*T"
+ << std::endl;
+ for( int i = 0; i < numData / 2 + 1; ++i ){
+ const double freq = static_cast(i) / static_cast(numData) * samplingFrequency;
+ const double A = 2.0 * cdata[i].real();
+ const double B = - 2.0 * cdata[i].imag();
+ const double amp = hypot(A, B);
+ const double phs = atan2(-B, A) * CommonParameters::RAD2DEG;
+ double power = 2.0 * std::norm(cdata[i]);
+ if( i == 0 || i == 8 ){
+ power *= 0.5;
+ }
+ ofs << i << "," << freq
+ << "," << amp << "," << amp * 0.5 * T
+ << "," << phs
+ << "," << power << "," << power * T
+ << std::endl;
+ }
+ ofs.close();
+ delete [] cdata;
+ }
+ }
+
+}
+
+// Test function 3
+void Analysis::test3() const{
+
+ std::ostringstream fileName;
+ fileName << "temp.csv";
+ std::ofstream ofs;
+ ofs.open( fileName.str().c_str(), std::ios::out );
+ if( ofs.fail() ){
+ std::cerr << "File open error !! : " << fileName.str() << std::endl;
+ exit(1);
+ }
+
+ const int numData = 4096;
+ double data[4096];
+ for( int iTime = 0; iTime < numData; ++iTime ){
+ data[iTime] = 0.0;
+ }
+ const double samplingFreq = 32;
+ const double dt = 1.0 / samplingFreq;
+ for( int iFreq = 0; iFreq < 1000; ++iFreq ){
+ const double freq = static_cast(iFreq+1) / static_cast(1000) * samplingFreq;
+ double omega = 2.0 * CommonParameters::PI * freq;
+ const double phase = static_cast(iFreq*rand()) / static_cast(RAND_MAX) * CommonParameters::DEG2RAD;
+ for( int iTime = 0; iTime < numData; ++iTime ){
+ const double t = static_cast(iTime) * dt;
+ data[iTime] += 2.0 * cos(omega*t + phase);
+ }
+ }
+ std::complex cdata[numData];
+ for( int i = 0; i < numData; ++i ){
+ cdata[i] = std::complex(data[i], 0.0);
+ }
+ for( int i = 0; i < numData; ++i ){
+ const double t = static_cast(i) * dt;
+ ofs << std::setw(15) << t << "," << std::setw(15) << cdata[i].real() << "," << std::setw(15) << cdata[i].imag() << std::endl;
+ }
+ ofs << std::endl;
+
+ Util::fourierTransform(numData, cdata);
+ ofs << "i" << "," << "freq"
+ << "," << "amp" << "," << "amp*T/2"
+ << "," << "phs"
+ << "," << "power" << "," << "power*T"
+ << std::endl;
+ const double T = numData * dt;
+ for( int i = 0; i < numData / 2 + 1; ++i ){
+ const double freq = static_cast(i) / static_cast(numData) * samplingFreq;
+ const double A = 2.0 * cdata[i].real();
+ const double B = - 2.0 * cdata[i].imag();
+ const double amp = hypot(A, B);
+ const double phs = atan2(-B, A) * CommonParameters::RAD2DEG;
+ double power = 2.0 * std::norm(cdata[i]);
+ if( i == 0 || i == 8 ){
+ power *= 0.5;
+ }
+ ofs << i << "," << freq
+ << "," << amp << "," << amp * 0.5 * T
+ << "," << phs
+ << "," << power << "," << power * T
+ << std::endl;
+ };
+ ofs << std::endl;
+
+ const int numh = 200;
+ double h[201];
+ Util::calculateFIRFilterCoeffsByLeastSquare( numh, true, samplingFreq, 0.4, 0.5, 100.0, 1.0, h );
+
+ for( int i = numh; i < numData; ++i ){
+ cdata[i] = 0.0;
+ for( int k = 0; k <= numh; ++k ){
+ cdata[i] += h[k] * std::complex(data[i-k], 0.0);
+ }
+ }
+ for( int i = 0; i < numData; ++i ){
+ ofs << i << "," << std::setw(15) << cdata[i].real() << "," << std::setw(15) << cdata[i].imag() << std::endl;
+ }
+ ofs << std::endl;
+
+ Util::fourierTransform(numData, cdata);
+ ofs << "i" << "," << "freq"
+ << "," << "amp" << "," << "amp*T/2"
+ << "," << "phs"
+ << "," << "power" << "," << "power*T"
+ << std::endl;
+ for( int i = 0; i < numData / 2 + 1; ++i ){
+ const double freq = static_cast(i) / static_cast(numData) * samplingFreq;
+ const double A = 2.0 * cdata[i].real();
+ const double B = - 2.0 * cdata[i].imag();
+ const double amp = hypot(A, B);
+ const double phs = atan2(-B, A) * CommonParameters::RAD2DEG;
+ double power = 2.0 * std::norm(cdata[i]);
+ if( i == 0 || i == 8 ){
+ power *= 0.5;
+ }
+ ofs << i << "," << freq
+ << "," << amp << "," << amp * 0.5 * T
+ << "," << phs
+ << "," << power << "," << power * T
+ << std::endl;
+ };
+ ofs << std::endl;
+
+ ofs.close();
+
+ return;
+}
+
+// Decimation
+void Analysis::decimation( std::vector& dataFileSets ) const{
+
+ Control* ptrControl = Control::getInstance();
+ const Control::ParamsForDecimation params = ptrControl->getParamsForDecimation();
+ if(!params.applyDecimation){
+ return;
+ }
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeLogMessage("Decimation");
+
+ double* coeff = new double[params.filterLength + 1];
+ const double samplingFreq = ptrControl->getSamplingFrequency();
+ const double freqStop = 0.5 * samplingFreq / static_cast(params.decimationInterval);
+ const double freqPass = freqStop / pow(10.0, params.transitionBandWidthInLogarithmicScale);
+ Util::calculateFIRFilterCoeffsByLeastSquare( params.filterLength, true, samplingFreq, freqPass, freqStop, 1.0, 1.0, coeff );
+
+ std::string fileName = "lpf_for_decimation.csv";
+ std::ofstream ofs;
+ ofs.open( fileName.c_str(), std::ios::out );
+ if( ofs.fail() ){
+ ptrOutputFiles->writeErrorMessage("File open error : " + fileName );
+ }
+ const double freqNyquist = 0.5 * samplingFreq;
+ const int numFreq = 100000;
+ for( int i = 0; i < numFreq; ++i ){
+ const double freq = freqNyquist * static_cast(i+1) / static_cast(numFreq);
+ const std::complex Hfreq = Util::calculateFrequencyCharacteristicsOfFIRFilter(
+ params.filterLength, samplingFreq, freq, coeff );
+ const double angle = atan2( Hfreq.imag(), Hfreq.real() ) * CommonParameters::RAD2DEG;
+ ofs << std::setw(20) << std::setprecision(12) << freq << ","
+ << std::setw(20) << std::setprecision(12) << std::abs(Hfreq) << ","
+ << std::setw(20) << std::setprecision(12) << angle << std::endl;
+ }
+ ofs.close();
+
+ const int numChannels = ptrControl->getNumberOfChannels();
+ for( std::vector::iterator itr = dataFileSets.begin(); itr != dataFileSets.end(); ++itr ){
+ const int numDataOrg = itr->numDataPoints;
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ double* dataOrg = new double[numDataOrg];
+ for( int i = 0; i < numDataOrg; ++i ){
+ dataOrg[i] = itr->dataFile[iChan].data[i];
+ }
+ const int numDataMod = numDataOrg - params.filterLength;
+ double* dataMod = new double[numDataMod];
+ for( int i = params.filterLength; i < numDataOrg; ++i ){
+ double dbuf(0.0);
+ for( int k = 0; k <= params.filterLength; ++k ){
+ dbuf += coeff[k] * dataOrg[i-k];
+ }
+ dataMod[i - params.filterLength] = dbuf;
+ }
+ delete [] dataOrg;
+ int numDataAfterDecimation(0);
+ for( int i = 0; i < numDataMod; i += params.decimationInterval, ++numDataAfterDecimation ){
+ itr->dataFile[iChan].data[numDataAfterDecimation] = dataMod[i];
+ }
+ for( int i = numDataAfterDecimation; i < numDataOrg; ++i ){
+ itr->dataFile[iChan].data[i] = 0.0;
+ }
+ itr->numDataPoints = numDataAfterDecimation;
+ delete [] dataMod;
+ }
+ }
+
+ delete [] coeff;
+
+ ptrControl->setSamplingFrequency(samplingFreq / static_cast(params.decimationInterval));
+
+}
+
+// Read time-series data
+void Analysis::readTimeSeriesData( std::vector& dataFileSets ){
+
+ const Control* const ptrControl = Control::getInstance();
+ const int numTimeSeriesSections = ptrControl->getNumTimeSeriesSections();
+ const int numChannels = ptrControl->getNumberOfChannels();
+
+ for( int iSect = 0; iSect < numTimeSeriesSections; ++iSect ){
+ const int numDataPoints = dataFileSets[iSect].numDataPoints;
+ std::vector& dataFileList = dataFileSets[iSect].dataFile;
+ int iChan = 0;
+ if (ptrControl->doesReadElogDualBinary()) {
+ // Read ELOG binary data as channel 0 and 1
+ ElogDual* ptrElogDual = ElogDual::getInstance();
+ const std::string fileName = dataFileList[0].fileName;
+ const int numSkipData = dataFileList[0].numSkipData;
+ iChan = 2;
+ for (int ch = 0; ch < iChan; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogDual->readElogBinaryFilesUnderADirectory(directoryName, numSkipData, numDataPoints, dataFileList[0].data, dataFileList[1].data);
+ }
+ else{
+ int counter(0);
+ ptrElogDual->readElogBinaryFile(fileName, numSkipData, numDataPoints, counter, dataFileList[0].data, dataFileList[1].data);
+ }
+ }
+
+ if( ptrControl->doesReadElogMTBinary() ){
+ // Read ELOG binary data as channel 0 and 1
+ ElogMT* ptrElogMT = ElogMT::getInstance();
+ const std::string fileName = dataFileList[0].fileName;
+ const int numSkipData = dataFileList[0].numSkipData;
+ const int elogMTReadingOption = ptrControl->getElogMTReadingOption();
+ if (elogMTReadingOption == Control::READ_EX_EY_HX_HY_HZ_FROM_ELOGMT_DATA ||
+ elogMTReadingOption == Control::READ_EX_EY_HX_HY_HZ_HRX_HRY_FROM_ELOGMT_DATA) {
+ {
+ iChan = 5;
+ for (int ch = 0; ch < iChan; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectory(directoryName, numSkipData, numDataPoints, dataFileList[0].data, dataFileList[1].data, dataFileList[2].data, dataFileList[3].data, dataFileList[4].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFile(fileName, numSkipData, numDataPoints, counter, dataFileList[0].data, dataFileList[1].data, dataFileList[2].data, dataFileList[3].data, dataFileList[4].data);
+ }
+ }
+ if (elogMTReadingOption == Control::READ_EX_EY_HX_HY_HZ_HRX_HRY_FROM_ELOGMT_DATA) {
+ const std::string fileName = dataFileList[iChan].fileName;
+ const int numSkipDataR= dataFileList[iChan].numSkipData;
+ for (int ch = iChan; ch < iChan + 2; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[iChan].data, dataFileList[iChan+1].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[iChan].data, dataFileList[iChan+1].data);
+ }
+ iChan += 2;
+ }
+ }
+ else if (elogMTReadingOption == Control::READ_EX_EY_HX_HY_FROM_ELOGMT_DATA ||
+ elogMTReadingOption == Control::READ_EX_EY_HX_HY_HRX_HRY_FROM_ELOGMT_DATA) {
+ {
+ iChan = 4;
+ for (int ch = 0; ch < iChan; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryExEyHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[0].data, dataFileList[1].data, dataFileList[2].data, dataFileList[3].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileExEyHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[0].data, dataFileList[1].data, dataFileList[2].data, dataFileList[3].data);
+ }
+ }
+ if (elogMTReadingOption == Control::READ_EX_EY_HX_HY_HRX_HRY_FROM_ELOGMT_DATA) {
+ const std::string fileName = dataFileList[iChan].fileName;
+ const int numSkipData = dataFileList[iChan].numSkipData;
+ for (int ch = iChan; ch < iChan + 2; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ iChan += 2;
+ }
+ }
+ else if (elogMTReadingOption == Control::READ_HZ_HX_HY_FROM_ELOGMT_DATA ||
+ elogMTReadingOption == Control::READ_HZ_HX_HY_HRX_HRY_FROM_ELOGMT_DATA) {
+ {
+ iChan = 3;
+ for (int ch = 0; ch < iChan; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryHzHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[0].data, dataFileList[1].data, dataFileList[2].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileHzHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[0].data, dataFileList[1].data, dataFileList[2].data);
+ }
+ }
+ if (elogMTReadingOption == Control::READ_HZ_HX_HY_HRX_HRY_FROM_ELOGMT_DATA) {
+ const std::string fileName = dataFileList[iChan].fileName;
+ const int numSkipData = dataFileList[iChan].numSkipData;
+ for (int ch = iChan; ch < iChan + 2; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ iChan += 2;
+ }
+ }
+ else if (elogMTReadingOption == Control::READ_EX_EY_FROM_ELOGMT_DATA) {
+ iChan = 2;
+ for (int ch = 0; ch < iChan; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryExEyOnly(directoryName, numSkipData, numDataPoints, dataFileList[0].data, dataFileList[1].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileExEyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[0].data, dataFileList[1].data);
+ }
+ }
+ else if (elogMTReadingOption == Control::READ_HX_HY_HRX_HRY_FROM_ELOGMT_DATA ||
+ elogMTReadingOption == Control::READ_HX_HY_FROM_ELOGMT_DATA) {
+ {// Hx, Hy
+ const std::string fileName = dataFileList[iChan].fileName;
+ const int numSkipData = dataFileList[iChan].numSkipData;
+ for (int ch = iChan; ch < iChan + 2; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ iChan += 2;
+ }
+ if(elogMTReadingOption == Control::READ_HX_HY_HRX_HRY_FROM_ELOGMT_DATA){
+ // Hrx, Hry
+ const std::string fileName = dataFileList[iChan].fileName;
+ const int numSkipData = dataFileList[iChan].numSkipData;
+ for (int ch = iChan; ch < iChan + 2; ++ch) {
+ dataFileList[ch].data = new double[numDataPoints];
+ }
+ if (fileName.find("*.dat") != std::string::npos) {
+ const int directoryNameLength = fileName.find_last_of("\\") + 1;
+ const std::string directoryName = fileName.substr(0, directoryNameLength);
+ ptrElogMT->readElogBinaryFilesUnderADirectoryHxHyOnly(directoryName, numSkipData, numDataPoints, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ else {
+ int counter(0);
+ ptrElogMT->readElogBinaryFileHxHyOnly(fileName, numSkipData, numDataPoints, counter, dataFileList[iChan].data, dataFileList[iChan + 1].data);
+ }
+ iChan += 2;
+ }
+ }
+ else{
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeErrorMessage("Unsupported type of ELOG-MT reading option: " + Util::toString(ptrControl->getElogMTReadingOption()));
+ }
+ }
+ for( ; iChan < numChannels; ++iChan ){
+ const std::string fileName = dataFileList[iChan].fileName;
+ const int numSkipData = dataFileList[iChan].numSkipData;
+ dataFileList[iChan].data = new double[numDataPoints];
+ if (ptrControl->doesReadAtsBinary() && Util::extractExtensionOfFileName(fileName).find("ats") != std::string::npos) {
+ Ats* ptrAts = Ats::getInstance();
+ ptrAts->readAtsFile(fileName, numSkipData, numDataPoints, dataFileList[iChan].data);
+ }
+#ifdef _MTH5
+ else if (ptrControl->doesReadMTH5() && Util::extractExtensionOfFileName(fileName).find("mth5") != std::string::npos) {
+ MTH5* ptrMTH5 = MTH5::getInstance();
+ ptrMTH5->readMTH5File(fileName, dataFileList[iChan].mth5GroupName, numSkipData, numDataPoints, dataFileList[iChan].data);
+ }
+#endif
+ else{
+ readOneTimeSeriesData( fileName, numSkipData, numDataPoints, dataFileList[iChan].data );
+ }
+ }
+ }
+
+}
+
+// Read calibration files
+void Analysis::readCalibrationFiles( const std::vector& freq ){
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ const Control* const ptrControl = Control::getInstance();
+
+ if (ptrControl->doesMakeCalibrationFileForMFS()) {
+ const int numFile = ptrControl->getNumCalibrationFilesForMFS();
+ if (numFile > 0) {
+ assert(numFile == ptrControl->getNumberOfChannels());
+ }
+ for (int iFile = 0; iFile < numFile; ++iFile) {
+ const std::string fileName = ptrControl->getCalibrationFileNameForMFS(iFile);
+ const Ats* ptrAts = Ats::getInstance();
+ ptrAts->makeCalibrationFile(fileName, iFile, freq);
+ }
+ }
+
+ if( ptrControl->doesMakeCalibrationFileForElogDual() ){
+ const Control::ParamsForElogCalibration params = ptrControl->getParamsForElogDualCalibration();
+ ElogDual* ptrElogDual = ElogDual::getInstance();
+ if (ptrControl->doesMakeCalibrationFileForMFS()) {
+ double dbuf(0.0);
+ std::istringstream issX(ptrControl->getCalibrationFileNameForMFS(0));
+ issX >> dbuf;
+ const double dipoleLengthX = dbuf;
+ std::istringstream issY(ptrControl->getCalibrationFileNameForMFS(1));
+ issY >> dbuf;
+ const double dipoleLengthY = dbuf;
+ ptrElogDual->makeCalibrationFile(params.fileName, params.unitGroupDelay, 0, 1, dipoleLengthX, dipoleLengthY, freq);
+ }
+ }
+
+ if (ptrControl->doesMakeCalibrationFileForElogMT()) {
+ const Control::ParamsForElogCalibration params = ptrControl->getParamsForElogMTCalibration();
+ ElogMT* ptrElogMT = ElogMT::getInstance();
+ if (ptrControl->doesMakeCalibrationFileForMFS()) {
+ double dbuf(0.0);
+ std::istringstream issX(ptrControl->getCalibrationFileNameForMFS(0));
+ issX >> dbuf;
+ const double dipoleLengthX = dbuf;
+ std::istringstream issY(ptrControl->getCalibrationFileNameForMFS(1));
+ issY >> dbuf;
+ const double dipoleLengthY = dbuf;
+ std::vector channelIndexes;
+ channelIndexes.push_back(0);
+ channelIndexes.push_back(1);
+ ptrElogMT->makeCalibrationFile(params.fileName, params.unitGroupDelay, channelIndexes, dipoleLengthX, dipoleLengthY, freq);
+ }
+ }
+
+ const int numCalFile = ptrControl->getNumCalibrationFiles();
+ if( numCalFile > 0 ){
+ assert( numCalFile == ptrControl->getNumberOfChannels() );
+ }
+ if( m_calibrationFunctions != NULL ){
+ delete [] m_calibrationFunctions;
+ }
+ m_calibrationFunctions = new CalibrationFunction[numCalFile];
+ for( int iFile = 0; iFile < numCalFile; ++iFile ){
+ m_calibrationFunctions[iFile].readCalibrationFunction(ptrControl->getCalibrationFileName(iFile));
+ }
+
+}
+
+// Read one time-series data
+void Analysis::readOneTimeSeriesData( const std::string& fileName, const int numSkipData, const int numDataPoints, double* data ){
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeLogMessage("Read data from "+fileName);
+
+ std::ifstream ifs( fileName.c_str(), std::ios::in );
+ if( ifs.fail() ){
+ ptrOutputFiles->writeErrorMessage("File open error : " + fileName);
+ }
+
+ for( int i = 0; i < numSkipData; ++i ){
+ double dbuf(0.0);
+ ifs >> dbuf;
+ }
+
+ for( int i = 0; i < numDataPoints; ++i ){
+ if( ifs.eof() ){
+ ptrOutputFiles->writeErrorMessage("End of file appears before reading all data points");
+ }
+ ifs >> data[i];
+ }
+
+ ifs.close();
+
+}
+
+// Perform preprocessing
+void Analysis::preprocessing( std::vector& dataFileSets ){
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeLogMessage("Perform preprocessing");
+
+ const Control* const ptrControl = Control::getInstance();
+ const double samplingFrequency = ptrControl->getSamplingFrequency();
+
+ const int numChannels = ptrControl->getNumberOfChannels();
+ int iSection(0);
+ for( std::vector::iterator itr = dataFileSets.begin(); itr != dataFileSets.end(); ++itr, ++iSection ){
+ const int numData = itr->numDataPoints;
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ ptrOutputFiles->writeLogMessage("Secton " + Util::toString(iSection) + ", Channel " + Util::toString(iChan) );
+ // Hampel filter
+ const Control::ParamsForHampelFilter paramsHampelFilter = ptrControl->getParamsForHampelFilter();
+ if( paramsHampelFilter.applyHampelFilter ){
+ const int numModifiedPoints = Util::hampelFilter( numData, paramsHampelFilter.numNeighborsOnEitherSide, paramsHampelFilter.nsigma, itr->dataFile[iChan].data );
+ ptrOutputFiles->writeLogMessage("Number of the points modified by Hampel filter: " + Util::toString(numModifiedPoints) );
+ }
+
+ // Make new data records by subtracting mean
+ const double mean = Util::calculateMeanValue(numData, itr->dataFile[iChan].data);
+ ptrOutputFiles->writeLogMessage("Subtract mean (" + Util::toString(mean) + ")");
+ for (int i = 0; i < numData; ++i) {
+ itr->dataFile[iChan].data[i] -= mean;
+ }
+#ifdef _DEBUG_WRITE
+ std::ostringstream oss;
+ oss << "ts_sect_" << iSection << "_chan_" << iChan << "_mean.csv";
+ std::ofstream ofs;
+ ofs.open(oss.str().c_str(), std::ios::out);
+ if (ofs.fail()) {
+ ptrOutputFiles->writeLogMessage("File open error !! : " + oss.str());
+ }
+ for (int i = 0; i < numData; ++i) {
+ const double elapsedTime = static_cast(i) / samplingFrequency;
+ ofs << ptrControl->getTimeFromStartTimeOfEachSection(iSection, elapsedTime) << ","
+ << std::setprecision(12) << std::scientific << itr->dataFile[iChan].data[i] << std::endl;
+ }
+ ofs.close();
+#endif
+
+ // Apply high-pass filter
+ if( ptrControl->doesApplyIIRHighPassFilter() ){
+ ptrOutputFiles->writeLogMessage("Apply high-pass filter");
+ Util::applyIIRHighPassFilter(samplingFrequency, ptrControl->getCutoffFrequencyForIIRHighPassFilter(),
+ numData, itr->dataFile[iChan].data);
+ std::string fileName = "highpass.csv";
+ std::ofstream ofs;
+ ofs.open( fileName.c_str(), std::ios::out );
+ if( ofs.fail() ){
+ ptrOutputFiles->writeErrorMessage("File open error : " + fileName );
+ }
+ const double freqNyquist = 0.5 * samplingFrequency;
+ const int numFreq = 100000;
+ for( int i = 0; i < numFreq; ++i ){
+ const double freq = freqNyquist * static_cast(i+1) / static_cast(numFreq);
+ const std::complex Hfreq = Util::calculateFrequencyCharacteristicsOfIIRHighPassFilter( freq,
+ samplingFrequency, ptrControl->getCutoffFrequencyForIIRHighPassFilter() );
+ const double angle = atan2( Hfreq.imag(), Hfreq.real() ) * CommonParameters::RAD2DEG;
+ ofs << std::setw(20) << std::setprecision(12) << freq << ","
+ << std::setw(20) << std::setprecision(12) << std::abs(Hfreq) << ","
+ << std::setw(20) << std::setprecision(12) << angle << std::endl;
+ }
+ ofs.close();
+ }
+
+ // Apply low-pass filter
+ if( ptrControl->doesApplyIIRLowPassFilter() ){
+ ptrOutputFiles->writeLogMessage("Apply low-pass filter");
+ Util::applyIIRLowPassFilter( samplingFrequency, ptrControl->getCutoffFrequencyForIIRLowPassFilter(),
+ numData, itr->dataFile[iChan].data );
+ std::string fileName = "lowpass.csv";
+ std::ofstream ofs;
+ ofs.open( fileName.c_str(), std::ios::out );
+ if( ofs.fail() ){
+ ptrOutputFiles->writeErrorMessage("File open error : " + fileName );
+ }
+ const double freqNyquist = 0.5 * samplingFrequency;
+ const int numFreq = 100000;
+ for( int i = 0; i < numFreq; ++i ){
+ const double freq = freqNyquist * static_cast(i+1) / static_cast(numFreq);
+ const std::complex Hfreq = Util::calculateFrequencyCharacteristicsOfIIRLowPassFilter( freq,
+ samplingFrequency, ptrControl->getCutoffFrequencyForIIRLowPassFilter() );
+ const double angle = atan2( Hfreq.imag(), Hfreq.real() ) * CommonParameters::RAD2DEG;
+ ofs << std::setw(20) << std::setprecision(12) << freq << ","
+ << std::setw(20) << std::setprecision(12) << std::abs(Hfreq) << ","
+ << std::setw(20) << std::setprecision(12) << angle << std::endl;
+ }
+ ofs.close();
+ }
+
+ // Apply notch filter
+ if( ptrControl->getNumberOfCutoffFrequenciesForNotchFilter() > 0 ){
+ ptrOutputFiles->writeLogMessage("Apply notch filter");
+ const std::vector cutoffFreqsForNotchFilter = ptrControl->getCutoffFrequenciesForNotchFilter();
+ for( std::vector::const_iterator itrCutoffFreq = cutoffFreqsForNotchFilter.begin();
+ itrCutoffFreq != cutoffFreqsForNotchFilter.end(); ++itrCutoffFreq ){
+ Util::applyNotchFilter(ptrControl->getParameterQForNotchFilter(), samplingFrequency, *itrCutoffFreq,
+ numData, itr->dataFile[iChan].data);
+ }
+ std::string fileName = "notch.csv";
+ std::ofstream ofs;
+ ofs.open( fileName.c_str(), std::ios::out );
+ if( ofs.fail() ){
+ ptrOutputFiles->writeErrorMessage("File open error : " + fileName );
+ }
+ const double freqNyquist = 0.5 * samplingFrequency;
+ const int numFreq = 100000;
+ for( int i = 0; i < numFreq; ++i ){
+ const double freq = freqNyquist * static_cast(i+1) / static_cast(numFreq);
+ std::complex Hfreq = 1.0;
+ for( std::vector::const_iterator itrCutoffFreq = cutoffFreqsForNotchFilter.begin();
+ itrCutoffFreq != cutoffFreqsForNotchFilter.end(); ++itrCutoffFreq ){
+ Hfreq *= Util::calculateFrequencyCharacteristicsOfNotchFilter( freq, ptrControl->getParameterQForNotchFilter(),
+ samplingFrequency, *itrCutoffFreq );
+ }
+ const double angle = atan2( Hfreq.imag(), Hfreq.real() ) * CommonParameters::RAD2DEG;
+ ofs << std::setw(20) << std::setprecision(12) << freq << ","
+ << std::setw(20) << std::setprecision(12) << std::abs(Hfreq) << ","
+ << std::setw(20) << std::setprecision(12) << angle << std::endl;
+ }
+ ofs.close();
+ }
+ }
+ }
+
+ if (ptrControl->doesPeformEOFBasedDenoising() && ptrControl->getTimingEOFBasedDenoising() == Control::AFTER_DEGITAL_FILTERS) {
+ // Modify time-series data based on the EOF analysis
+ modifyTimeSeriesBasedOnEOFAnalysis(dataFileSets);
+ }
+
+ if( (ptrControl->getParamsForPrewhitening()).applyPrewhitening ){
+ m_coefficientsOfARModel = new std::vector[numChannels];
+ const Control::ParamsForPrewhitening params = ptrControl->getParamsForPrewhitening();
+ if( params.typeOfEstimator == Control::MANUAL_INPUTS_AR_COEFFICIENTS_FOR_PREWHITENING ){
+ ( RobustPrewhitening::getInstance() )->prewhiteningUsingUserDefinedARCoeffs(dataFileSets, m_coefficientsOfARModel);
+ }else{
+ ( RobustPrewhitening::getInstance() )->robustPrewhitening(dataFileSets, m_coefficientsOfARModel);
+ }
+ }
+
+}
+
+// Convert time-series data to frequency-domain data
+void Analysis::convertToFrequencyData( const int segmentLength, const std::vector& dataFileSets,
+ int& numSegmentsTotal, std::complex*** cdata, std::vector< std::pair >& times, std::vector* meanSquares ){
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeLogMessage("Convert time-series data to frequency-domain");
+
+ const Control* const ptrControl = Control::getInstance();
+
+ const int numChannels = ptrControl->getNumberOfChannels();
+ const double overlappingRatio = ptrControl->getOverlappingRatio();
+ const int shiftLength = static_cast( (1.0 - overlappingRatio) * segmentLength );
+
+ // Count total number of segments
+ numSegmentsTotal = 0;
+ for( std::vector::const_iterator itr = dataFileSets.begin(); itr != dataFileSets.end(); ++itr ){
+ if( itr->numDataPoints < segmentLength ){
+ numSegmentsTotal += 1;
+ }else{
+ numSegmentsTotal += ( itr->numDataPoints - segmentLength ) / shiftLength + 1;
+ }
+ }
+ if( numSegmentsTotal < 1 ){
+ ptrOutputFiles->writeErrorMessage("Total number of segments is less than 1");
+ }
+ ptrOutputFiles->writeLogMessage("Total number of segments : " + Util::toString(numSegmentsTotal));
+
+ times.reserve(numSegmentsTotal);
+
+ // Make array of data segmetns
+ const double samplingFrequency = ptrControl->getSamplingFrequency();
+ double*** dataSegments = new double**[numChannels];
+ for( int i = 0; i < numChannels; ++i ){
+ dataSegments[i] = new double*[numSegmentsTotal];
+ }
+ int section(0);
+ int counterSegment(0);
+ for( std::vector::const_iterator itr = dataFileSets.begin(); itr != dataFileSets.end(); ++itr, ++section ){
+ const int numSegments = itr->numDataPoints < segmentLength ? 1 : ( itr->numDataPoints - segmentLength ) / shiftLength + 1;
+ for( int iSeg = 0; iSeg < numSegments; ++iSeg, ++counterSegment ){
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ dataSegments[iChan][counterSegment] = new double[segmentLength];
+ const int index = iSeg * shiftLength;
+ if( itr->numDataPoints < segmentLength ){
+ memcpy(dataSegments[iChan][counterSegment], &(itr->dataFile[iChan].data[index]), sizeof(double)*itr->numDataPoints);
+ for( int i = itr->numDataPoints; i < segmentLength; ++i ){
+ dataSegments[iChan][counterSegment][i] = 0.0;
+ }
+ }else{
+ memcpy(dataSegments[iChan][counterSegment], &(itr->dataFile[iChan].data[index]), sizeof(double)*segmentLength);
+ }
+//#ifdef _DEBUG_WRITE
+// std::ostringstream oss;
+// oss << "sect_" << section << "_seg_" << counterSegment << "_chan_" << iChan << ".csv";
+// std::ofstream ofs;
+// ofs.open( oss.str().c_str(), std::ios::out );
+// if( ofs.fail() ){
+// ptrOutputFiles->writeLogMessage("File open error !! : " + oss.str());
+// }
+// for( int i = 0; i < segmentLength; ++i ){
+// ofs << std::setprecision(12) << std::scientific << dataSegments[iChan][counterSegment][i] << std::endl;
+// }
+// ofs.close();
+//#endif
+ }
+ // Start time
+ const int index1 = iSeg * shiftLength;
+ const double elapsedTime1 = static_cast(index1) / samplingFrequency;
+ std::string time1 = ptrControl->getTimeFromStartTimeOfEachSection(section, elapsedTime1);
+ // End time
+ const int index2 = index1 + segmentLength;
+ const double elapsedTime2 = static_cast(index2) / samplingFrequency;
+ std::string time2 = ptrControl->getTimeFromStartTimeOfEachSection(section, elapsedTime2);
+ // Insert
+ times.push_back( std::make_pair(time1, time2) );
+ }
+ }
+ assert( times.size() == numSegmentsTotal );
+
+ // Calculate mean squares
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ meanSquares[iChan].reserve(numSegmentsTotal);
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ const double meanSquare = Util::calculateMeanSquareValue(segmentLength, dataSegments[iChan][iSeg]);
+ meanSquares[iChan].push_back(meanSquare);
+ }
+ }
+
+ // Apply hanning window
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ Util::hanningWindow(segmentLength, dataSegments[iChan][iSeg]);
+//#ifdef _DEBUG_WRITE
+// std::ostringstream oss;
+// oss << "seg_" << iSeg << "_chan_" << iChan << "_hanning.csv";
+// std::ofstream ofs;
+// ofs.open( oss.str().c_str(), std::ios::out );
+// if( ofs.fail() ){
+// ptrOutputFiles->writeLogMessage("File open error !! : " + oss.str());
+// }
+// for( int i = 0; i < segmentLength; ++i ){
+// ofs << std::setprecision(12) << std::scientific << dataSegments[iChan][iSeg][i] << std::endl;
+// }
+// ofs.close();
+//#endif
+ }
+ }
+
+ // Fourier transform
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ cdata[iChan] = new std::complex*[numSegmentsTotal];
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ cdata[iChan][iSeg] = new std::complex[segmentLength];
+ for( int i = 0; i < segmentLength; ++i ){
+ cdata[iChan][iSeg][i] = std::complex(dataSegments[iChan][iSeg][i], 0.0);
+ }
+ Util::fourierTransform(segmentLength, cdata[iChan][iSeg]);
+ }
+ }
+
+ // Delete arrays
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ delete [] dataSegments[iChan][iSeg];
+ }
+ delete [] dataSegments[iChan];
+ }
+ delete [] dataSegments;
+
+}
+
+// Perform calibration correction for all channels
+void Analysis::calibrationCorrectionAllChannels( const int numChannels, const int numSegmentsTotal,
+ const double freq, std::complex** ftval ) const{
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeLogMessage("Perform calibration correction");
+
+ // Calibration correction
+ for( int iChan = 0; iChan < numChannels; ++iChan ){
+ calibrationCorrection(iChan, numSegmentsTotal, freq, ftval[iChan], true, true);
+ }
+
+}
+
+// Perform calibration correction
+void Analysis::calibrationCorrection(const int iChan, const int numSegmentsTotal, const double freq, std::complex* ftval, const bool afterPreprocessing, const bool afterTapering) const {
+
+ const Control* const ptrControl = Control::getInstance();
+
+ // Interpolate calibration function
+ std::complex calCorrFunc(1.0, 0.0);
+ if( ptrControl->getNumCalibrationFiles() == 0 ){
+ // Calibration function is not used
+ }else{
+ calCorrFunc *= m_calibrationFunctions[iChan].calculateCalibrationFunction(freq);
+ }
+
+ if(ptrControl->getParamsForDecimation().applyDecimation){
+ const Control::ParamsForDecimation params = ptrControl->getParamsForDecimation();
+ double* coeff = new double[params.filterLength + 1];
+ const double samplingFreqAfterDecimation = ptrControl->getSamplingFrequency();
+ const double samplingFreqBeforeDecimation = ptrControl->getSamplingFrequencyOrg();
+ const double freqStop = 0.5 * samplingFreqBeforeDecimation;
+ const double freqPass = freqStop / pow(10.0, params.transitionBandWidthInLogarithmicScale);
+ Util::calculateFIRFilterCoeffsByLeastSquare( params.filterLength, true, samplingFreqBeforeDecimation, freqPass, freqStop, 1.0, 1.0, coeff );
+ const std::complex Hfreq = Util::calculateFrequencyCharacteristicsOfFIRFilter( params.filterLength, samplingFreqBeforeDecimation, freq, coeff );
+ calCorrFunc /= Hfreq;
+ delete [] coeff;
+ }
+
+ if (afterTapering) {
+ // Adjust the scaling factor for the loss due to the Hanning tapering
+ calCorrFunc *= sqrt(8.0 / 3.0);
+ }
+
+ if(afterPreprocessing){
+ // Adjust the influences of preprocessing
+ const double samplingFrequency = ptrControl->getSamplingFrequency();
+
+ // Adjust the effect of high-pass filter
+ if( ptrControl->doesApplyIIRHighPassFilter() ){
+ std::complex Hfreq = Util::calculateFrequencyCharacteristicsOfIIRHighPassFilter( freq, samplingFrequency,
+ ptrControl->getCutoffFrequencyForIIRHighPassFilter() );
+ calCorrFunc /= Hfreq;
+ }
+
+ // Adjust the effect of low-pass filter
+ if( ptrControl->doesApplyIIRLowPassFilter() ){
+ const double Q = 1.0/sqrt(2.0);
+ std::complex Hfreq = Util::calculateFrequencyCharacteristicsOfIIRLowPassFilter( freq, samplingFrequency,
+ ptrControl->getCutoffFrequencyForIIRLowPassFilter() );
+ calCorrFunc /= Hfreq;
+ }
+
+ // Adjust the effect of notch filter
+ if( ptrControl->getNumberOfCutoffFrequenciesForNotchFilter() > 0 ){
+ const std::vector cutoffFreqsForNotchFilter = ptrControl->getCutoffFrequenciesForNotchFilter();
+ std::complex Hfreq = std::complex(1.0, 0.0);
+ for( std::vector::const_iterator itrCutoffFreq = cutoffFreqsForNotchFilter.begin();
+ itrCutoffFreq != cutoffFreqsForNotchFilter.end(); ++itrCutoffFreq ){
+ Hfreq *= Util::calculateFrequencyCharacteristicsOfNotchFilter( freq, ptrControl->getParameterQForNotchFilter(),
+ samplingFrequency, *itrCutoffFreq );
+ }
+ if( std::abs(Hfreq) > CommonParameters::EPS ){
+ calCorrFunc /= Hfreq;
+ }
+ }
+
+ // Adjust prewhitening
+ if( ptrControl->getParamsForPrewhitening().applyPrewhitening && m_coefficientsOfARModel != NULL ){
+ const std::vector& coeffs = m_coefficientsOfARModel[iChan];
+ const double omega = 2.0 * CommonParameters::PI * freq / samplingFrequency;
+ std::complex H = std::complex(1.0, 0.0);// Initialize 1
+ int iAR = 1;// From 1
+ for( std::vector::const_iterator itr = coeffs.begin(); itr != coeffs.end(); ++itr, ++iAR ){
+ const double coeff = *itr;
+ const double arg = - static_cast(iAR) * omega;
+ // 1.0 - c1 * exp(-i*omega*1) - c2 * exp(-i*omega*2) - ... - ck * exp(-i*omega*k) - ...
+ H -= std::complex( cos(arg), sin(arg) ) * coeff;
+ }
+ calCorrFunc /= H;
+ }
+ }
+
+ for( int iSeg = 0; iSeg < numSegmentsTotal; ++iSeg ){
+ ftval[iSeg] *= calCorrFunc;
+ }
+
+}
+
+// Calculate apparent resistivity
+double Analysis::calcApparentResistivity( const double freq, const std::complex& Z ) const{
+
+ return 0.2 * std::norm(Z) / freq;
+
+}
+
+// Calculate error of apparent resistivity
+double Analysis::calcApparentResistivityError( const double freq, const std::complex& Z, const double dZ ) const{
+
+ return 0.4 * std::abs(Z) * dZ / freq;
+
+}
+
+// Calculate diagonal components of hat matrix
+double Analysis::calculateDiagonalComponentsOfHatMatrix( const int numSegments, const int channelX, const int channelY,
+ std::complex** data, const double* const weights, double* hatDiagonals ) const{
+
+ double GxxMean(0.0);
+ double GyyMean(0.0);
+ std::complex GxyMean(0.0, 0.0);
+ double sumWeights(0.0);
+ for( int i = 0; i < numSegments; ++i ){
+ GxxMean += std::norm(data[channelX][i]) * weights[i];
+ GyyMean += std::norm(data[channelY][i]) * weights[i];
+ GxyMean += data[channelX][i] * std::conj(data[channelY][i]) * weights[i];
+ sumWeights += weights[i];
+ }
+ GxxMean /= sumWeights;
+ GyyMean /= sumWeights;
+ GxyMean /= sumWeights;
+ const double coh = std::norm(GxyMean)/GxxMean/GyyMean;
+ const double coh2 = coh * coh;
+
+ double maxHatDiagonal(0.0);
+ for( int i = 0; i < numSegments; ++i ){
+ const double Gxx = std::norm(data[channelX][i]) * weights[i];
+ const double Gyy = std::norm(data[channelY][i]) * weights[i];
+ const std::complex Gxy = data[channelX][i] * std::conj(data[channelY][i]) * weights[i];
+ const double term0 = Gxx / GxxMean + Gyy / GyyMean;
+ const double term1 = 2.0 * coh2 * (Gxy/GxyMean).real();
+ hatDiagonals[i] = ( term0 - term1 ) / sumWeights / (1.0 - coh2);
+ if( hatDiagonals[i] > maxHatDiagonal ){
+ maxHatDiagonal = hatDiagonals[i];
+ }
+#ifdef _DEBUG_WRITE
+ std::cout << "Gxx Gyy Gxy term0 term1 hatDiagonals maxHatDiagonal: " <<
+ Gxx << " " << Gyy << " " << Gxy << " " << term0 << " " << term1 << " " << hatDiagonals[i] << " " << maxHatDiagonal << std::endl;
+#endif
+ }
+
+ return maxHatDiagonal;
+
+}
+
+// Calculate phase
+double Analysis::calcPhase( const std::complex& Z ) const{
+
+ return std::arg(Z) * CommonParameters::RAD2DEG;
+
+}
+
+// Calculate error of phase
+double Analysis::calcPhaseError( const std::complex& Z, const double dZ ) const{
+
+ const double ratio = dZ / std::abs(Z);
+ if( ratio < 1.0 ){
+ return asin(ratio) * CommonParameters::RAD2DEG;
+ }else{
+ return 360.0;
+ }
+
+}
+
+// Calculate response functions by iteratively reweighted least squares
+void Analysis::calculateResponseFunctionsByIRWLS( const int iRobustWeight, const std::complex* const out, const std::complex* const in0,
+ const std::complex* const in1, const int numSegments, const bool fixScale, double& scale, const double* const weightsPrior,
+ double* weights, std::complex* residuals, std::complex& resp0, std::complex& resp1, double& coherence,
+ std::vector& titles, std::vector* outputValues, const bool priorityOnFirst ) const{
+
+ RobustWeight* const robustWeightCur = getPointerToRobustWeight(iRobustWeight);
+ if (robustWeightCur == NULL) {
+ return;
+ }
+ const std::string nameOfRobustWeight = robustWeightCur->getNameOfRobustWeight();
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeCvgAndLogMessage("Calculate response functions by iteratively reweighted least squares using " + nameOfRobustWeight + " weight");
+
+ const int numIterationMax = robustWeightCur->getNumIterationMax();
+ const double convergenceCriteria = robustWeightCur->getConvergenceCriteria();
+ double GresPre(0.0);
+ bool converge(false);
+ for( int iter = 0; iter < numIterationMax; ++iter ){
+ ptrOutputFiles->writeCvgMessage("Iteration number = " + Util::toString(iter));
+ if (!fixScale) {
+ // Calcuate scale
+ scale = robustWeightCur->calculateScale(numSegments, residuals, scale);
+ }
+ // Calcuate weights
+ const double sumOfWeights = robustWeightCur->calculateWeights(numSegments, residuals, scale, weightsPrior, weights);
+ if( sumOfWeights < CommonParameters::EPS ){
+ ptrOutputFiles->writeCvgMessage(" Sum of weights (" + Util::toString(sumOfWeights) + ") is too small");
+ ptrOutputFiles->writeWarningMessage("Sum of weights (" + Util::toString(sumOfWeights) + ") is too small");
+ break;
+ }
+ if( outputValues != NULL ){
+ titles.push_back(nameOfRobustWeight + "_" + Util::toString(iter));
+ for( int iSeg = 0 ; iSeg < numSegments; ++iSeg){
+ outputValues[iSeg].push_back(residuals[iSeg].real());
+ outputValues[iSeg].push_back(residuals[iSeg].imag());
+ outputValues[iSeg].push_back(weights[iSeg]);
+ }
+ }
+ const double Gres = calculateResponseFunctionByWLS( out, in0, in1, numSegments, weights, residuals, resp0, resp1, coherence, priorityOnFirst );
+ ptrOutputFiles->writeCvgMessage(" Weighted residual power: " + Util::toString(Gres));
+ if( Gres < CommonParameters::EPS ){
+ ptrOutputFiles->writeCvgMessage(" Weighted residual power is too small (" + Util::toString(Gres) + ")");
+ ptrOutputFiles->writeWarningMessage("Weighted residual power is too small (" + Util::toString(Gres) + ")");
+ break;
+ }
+ if( fabs(Gres-GresPre) / fabs(GresPre) < convergenceCriteria ){
+ // Converged
+ ptrOutputFiles->writeCvgMessage("Iteration using " + nameOfRobustWeight + " weight converged");
+ converge = true;
+ break;
+ }
+ GresPre = Gres;
+ }
+
+ if(!converge){
+ ptrOutputFiles->writeCvgMessage(" Iteration using " + nameOfRobustWeight + " weight does not converge");
+ }
+
+}
+
+// Calculate response functions by iteratively reweighted remote reference
+void Analysis::calculateResponseFunctionsByIRWLSRemoteReference(const int iRobustWeight, const std::complex* const out,
+ const std::complex* const in0, const std::complex* const in1,
+ const std::complex* const rr0, const std::complex* const rr1,
+ const int numSegments, const bool fixScale, double& scale, const double* const weightsPrior,
+ double* weights, std::complex* residuals, std::complex& resp0, std::complex& resp1, double& coherence,
+ std::vector& titles, std::vector* outputValues) const {
+
+ RobustWeight* const robustWeightCur = getPointerToRobustWeight(iRobustWeight);
+ if (robustWeightCur == NULL) {
+ return;
+ }
+ const std::string nameOfRobustWeight = robustWeightCur->getNameOfRobustWeight();
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeCvgAndLogMessage("Calculate response functions by iteratively reweighted remote reference using " + nameOfRobustWeight + " weight");
+
+ const int numIterationMax = robustWeightCur->getNumIterationMax();
+ const double convergenceCriteria = robustWeightCur->getConvergenceCriteria();
+ double GresPre(0.0);
+ bool converge(false);
+ for (int iter = 0; iter < numIterationMax; ++iter) {
+ ptrOutputFiles->writeCvgMessage("Iteration number = " + Util::toString(iter));
+ if (!fixScale) {
+ // Calcuate scale
+ scale = robustWeightCur->calculateScale(numSegments, residuals, scale);
+ }
+ // Calcuate weights
+ const double sumOfWeights = robustWeightCur->calculateWeights(numSegments, residuals, scale, weightsPrior, weights);
+ if (sumOfWeights < CommonParameters::EPS) {
+ ptrOutputFiles->writeCvgMessage(" Sum of weights (" + Util::toString(sumOfWeights) + ") is too small");
+ ptrOutputFiles->writeWarningMessage("Sum of weights (" + Util::toString(sumOfWeights) + ") is too small");
+ break;
+ }
+ if (outputValues != NULL) {
+ titles.push_back(nameOfRobustWeight + "_" + Util::toString(iter));
+ for (int iSeg = 0; iSeg < numSegments; ++iSeg) {
+ outputValues[iSeg].push_back(residuals[iSeg].real());
+ outputValues[iSeg].push_back(residuals[iSeg].imag());
+ outputValues[iSeg].push_back(weights[iSeg]);
+ }
+ }
+ const double Gres = calculateResponseFunctionByWLSRemoteReference(out, in0, in1, rr0, rr1, numSegments, weights, residuals, resp0, resp1, coherence);
+ ptrOutputFiles->writeCvgMessage(" Weighted residual power: " + Util::toString(Gres));
+ if (Gres < CommonParameters::EPS) {
+ ptrOutputFiles->writeCvgMessage(" Weighted residual power is too small (" + Util::toString(Gres) + ")");
+ ptrOutputFiles->writeWarningMessage("Weighted residual power is too small (" + Util::toString(Gres) + ")");
+ break;
+ }
+ if (fabs(Gres - GresPre) / fabs(GresPre) < convergenceCriteria) {
+ // Converged
+ ptrOutputFiles->writeCvgMessage("Iteration using " + nameOfRobustWeight + " weight converged");
+ converge = true;
+ break;
+ }
+ GresPre = Gres;
+ }
+
+ if (!converge) {
+ ptrOutputFiles->writeCvgMessage(" Iteration using " + nameOfRobustWeight + " weight does not converge");
+ }
+}
+
+// Calculate response function by the ordinary remote reference method
+double Analysis::calculateResponseFunctionByOrdinaryRemoteReference( const int numSegments, const std::complex* const out,
+ const std::complex* const in1, const std::complex* const in2,
+ const std::complex* const rr1, const std::complex* const rr2,
+ std::complex& resp1, std::complex& resp2 ) const{
+
+ double* weights = new double[numSegments];
+ for (int iSeg = 0; iSeg < numSegments; ++iSeg) {
+ weights[iSeg] = 1.0;
+ }
+ calculateResponseFunctionByWLSRemoteReferenceAux(numSegments, out, in1, in2, rr1, rr2, weights, resp1, resp2);
+ delete[] weights;
+
+ double Gvar(0.0);
+ double Gsyn(0.0);
+ double Gres(0.0);
+ for( int i = 0; i < numSegments; ++i ){
+ Gvar += std::norm(out[i]);
+ const std::complex outSyn = resp1 * in1[i] + resp2 * in2[i];
+ Gsyn += std::norm(outSyn);
+ const std::complex residual = out[i] - outSyn;
+ Gres += std::norm(residual);
+ }
+
+ double coherence = 1.0 - Gres / Gvar;
+ if( coherence > 1.0 ){
+ coherence = 1.0;
+ }else if( coherence < 0.0 ){
+ coherence = 0.0;
+ }
+ return coherence;
+
+}
+
+// Calculate response function by the ordinary weighted square method
+double Analysis::calculateResponseFunctionByWLS( const std::complex* const out, const std::complex* const in0,
+ const std::complex* const in1, const int numSegments, const double* const weights, std::complex* residuals,
+ std::complex& resp0, std::complex& resp1, double& coherence, const bool priorityOnFirst ) const{
+
+ const Control* const ptrControl = Control::getInstance();
+ calculateResponseFunctionByWLSAux( numSegments, out, in0, in1, weights, resp0, resp1, priorityOnFirst );
+ double Gvar(0.0);
+ double Gsyn(0.0);
+ double Gres(0.0);
+ double sumWeights(0.0);
+
+#ifdef _USE_OMP
+ int numThreads(1);
+ #pragma omp parallel
+ {
+ numThreads = omp_get_num_threads();
+ }
+ double* GvarThread = new double[numThreads];
+ double* GsynThread = new double[numThreads];
+ double* GresThread = new double[numThreads];
+ double* sumWeightsThread = new double[numThreads];
+ for( int iThread = 0; iThread < numThreads; ++iThread ){
+ // Zero clear
+ GvarThread[iThread] = 0.0;
+ GsynThread[iThread] = 0.0;
+ GresThread[iThread] = 0.0;
+ sumWeightsThread[iThread] = 0.0;
+ }
+ int i(0);
+ int iThread(0);
+ std::complex outSyn(0.0, 0.0);
+ #pragma omp parallel default(shared) private(i, iThread, outSyn)
+ {
+ iThread = omp_get_thread_num();
+ #pragma omp for
+ for( i = 0; i < numSegments; ++i ){
+ GvarThread[iThread] += std::norm(out[i]) * weights[i];
+ outSyn = resp0 * in0[i] + resp1 * in1[i];
+ GsynThread[iThread] += std::norm(outSyn) * weights[i];
+ residuals[i] = out[i] - outSyn;
+ GresThread[iThread] += std::norm(residuals[i]) * weights[i];
+ sumWeightsThread[iThread] += weights[i];
+ }
+ }
+ for( int iThread = 0; iThread < numThreads; ++iThread ){
+ Gvar += GvarThread[iThread];
+ Gsyn += GsynThread[iThread];
+ Gres += GresThread[iThread];
+ sumWeights += sumWeightsThread[iThread];
+ }
+ delete [] GvarThread;
+ delete [] GsynThread;
+ delete [] GresThread;
+ delete [] sumWeightsThread;
+#ifdef _DEBUG_WRITE
+ for( int i = 0; i < numSegments; ++i ){
+ std::cout << "iSeg weights residuals: "
+ << i << " " << weights[i] << " " << residuals[i] << std::endl;
+ }
+#endif
+#else
+ for( int i = 0; i < numSegments; ++i ){
+ Gvar += std::norm(out[i]) * weights[i];
+ const std::complex outSyn = resp0 * in0[i] + resp1 * in1[i];
+ Gsyn += std::norm(outSyn) * weights[i];
+ residuals[i] = out[i] - outSyn;
+ Gres += std::norm(residuals[i]) * weights[i];
+#ifdef _DEBUG_WRITE
+ std::cout << "iSeg outSyn weights Gvar residuals Gres: "
+ << i << " " << outSyn << " " << weights[i] << " " < 1.0) {
+ coherence = 1.0;
+ }
+ else if (coherence < 0.0) {
+ coherence = 0.0;
+ }
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeCvgMessage(" Sum of weights: " + Util::toString(sumWeights) );
+ ptrOutputFiles->writeCvgMessage(" Squared coherence: " + Util::toString(coherence) );
+ std::ostringstream msg1;
+ msg1 << " Estimated response function: ";
+ msg1 << "(" << std::setw(12) << std::setprecision(4) << std::scientific << resp0.real() << ","
+ << std::setw(12) << std::setprecision(4) << std::scientific << resp0.imag() << ")";
+ msg1 << ", (" << std::setw(12) << std::setprecision(4) << std::scientific << resp1.real() << ","
+ << std::setw(12) << std::setprecision(4) << std::scientific << resp1.imag() << ")";
+ ptrOutputFiles->writeCvgMessage(msg1.str());
+ std::ostringstream msg2;
+ msg2 << " Amplitude of the estimated response function:";
+ msg2 << std::setw(12) << std::setprecision(4) << std::scientific << std::abs(resp0) << ","
+ << std::setw(12) << std::setprecision(4) << std::scientific << std::abs(resp1);
+ ptrOutputFiles->writeCvgMessage(msg2.str());
+ std::ostringstream msg3;
+ msg3 << " Phase(deg.) of the estimated response function:";
+ msg3 << std::setw(7) << std::setprecision(1) << std::fixed << std::arg(resp0)*CommonParameters::RAD2DEG << ","
+ << std::setw(7) << std::setprecision(1) << std::fixed << std::arg(resp1)*CommonParameters::RAD2DEG;
+ ptrOutputFiles->writeCvgMessage(msg3.str());
+
+ return Gres;
+
+}
+
+// Auxiliary function for calculating response function by the weighted leaset square method
+void Analysis::calculateResponseFunctionByWLSAux( const int numSegments, const std::complex* const out,
+ const std::complex* const in1, const std::complex* const in2, const double* const weights,
+ std::complex& resp1, std::complex& resp2, const bool priorityOnFirst ) const{
+
+ std::complex out_in1(0.0, 0.0);
+ std::complex out_in2(0.0, 0.0);
+ std::complex in2_in1(0.0, 0.0);
+ std::complex in1_in1(0.0, 0.0);
+ std::complex in2_in2(0.0, 0.0);
+#ifdef _USE_OMP
+ int numThreads(1);
+ #pragma omp parallel
+ {
+ numThreads = omp_get_num_threads();
+ }
+ std::complex* out_in1Thread = new std::complex[numThreads];
+ std::complex* out_in2Thread = new std::complex[numThreads];
+ std::complex* in2_in1Thread = new std::complex[numThreads];
+ std::complex* in1_in1Thread = new std::complex[numThreads];
+ std::complex* in2_in2Thread = new std::complex[numThreads];
+ const std::complex czero = std::complex(0.0,0.0);
+ for( int iThread = 0; iThread < numThreads; ++iThread ){
+ // Zero clear
+ out_in1Thread[iThread] = czero;
+ out_in2Thread[iThread] = czero;
+ in2_in1Thread[iThread] = czero;
+ in1_in1Thread[iThread] = czero;
+ in2_in2Thread[iThread] = czero;
+ }
+ int i(0);
+ int iThread(0);
+ #pragma omp parallel default(shared) private(i, iThread)
+ {
+ iThread = omp_get_thread_num();
+ #pragma omp for
+ for( i = 0; i < numSegments; ++i ){
+ out_in1Thread[iThread] += out[i] * std::conj(in1[i]) * weights[i];
+ out_in2Thread[iThread] += out[i] * std::conj(in2[i]) * weights[i];
+ in2_in1Thread[iThread] += in2[i] * std::conj(in1[i]) * weights[i];
+ in1_in1Thread[iThread] += in1[i] * std::conj(in1[i]) * weights[i];
+ in2_in2Thread[iThread] += in2[i] * std::conj(in2[i]) * weights[i];
+ }
+ }
+ for( int iThread = 0; iThread < numThreads; ++iThread ){
+ out_in1 += out_in1Thread[iThread];
+ out_in2 += out_in2Thread[iThread];
+ in2_in1 += in2_in1Thread[iThread];
+ in1_in1 += in1_in1Thread[iThread];
+ in2_in2 += in2_in2Thread[iThread];
+ }
+ delete [] out_in1Thread;
+ delete [] out_in2Thread;
+ delete [] in2_in1Thread;
+ delete [] in1_in1Thread;
+ delete [] in2_in2Thread;
+#else
+ for( int i = 0; i < numSegments; ++i ){
+ out_in1 += out[i] * std::conj(in1[i]) * weights[i];
+ out_in2 += out[i] * std::conj(in2[i]) * weights[i];
+ in2_in1 += in2[i] * std::conj(in1[i]) * weights[i];
+ in1_in1 += in1[i] * std::conj(in1[i]) * weights[i];
+ in2_in2 += in2[i] * std::conj(in2[i]) * weights[i];
+ }
+#endif
+
+ const double coherence12 = std::norm(in2_in1)/Util::calculateAbsoluteValue(in1_in1)/Util::calculateAbsoluteValue(in2_in2);
+ if( coherence12 > 1.0 - CommonParameters::EPS ){
+ if( priorityOnFirst ){
+ resp1 = out_in1 / in1_in1;
+ resp2 = std::complex(0.0,0.0);
+ }else{
+ resp1 = std::complex(0.0,0.0);
+ resp2 = out_in2 / in2_in2;
+ }
+ return;
+ }
+
+ const std::complex in1_in2 = std::conj(in2_in1);
+ const std::complex det = in1_in1 * in2_in2 - in1_in2 * in2_in1;
+
+ resp1 = ( out_in1 * in2_in2 - out_in2 * in2_in1 ) / det;
+ resp2 = ( out_in2 * in1_in1 - out_in1 * in1_in2 ) / det;
+
+}
+
+// Calculate response function by the weighted leaset square method for bootstrap
+void Analysis::calculateResponseFunctionByWLSForBootstrap( const int numSegments, const int* const segmentIndexes,
+ const std::complex* const out, const std::complex* const in1, const std::complex* const in2,
+ const double* const weights, std::complex& resp1, std::complex& resp2, const bool priorityOnFirst ) const{
+
+ std::complex out_in1(0.0, 0.0);
+ std::complex out_in2(0.0, 0.0);
+ std::complex in2_in1(0.0, 0.0);
+ std::complex in1_in1(0.0, 0.0);
+ std::complex in2_in2(0.0, 0.0);
+
+#ifdef _USE_OMP
+ int numThreads(1);
+ #pragma omp parallel
+ {
+ numThreads = omp_get_num_threads();
+ }
+ std::complex* out_in1Thread = new std::complex[numThreads];
+ std::complex* out_in2Thread = new std::complex[numThreads];
+ std::complex* in2_in1Thread = new std::complex[numThreads];
+ std::complex* in1_in1Thread = new std::complex[numThreads];
+ std::complex* in2_in2Thread = new std::complex[numThreads];
+ const std::complex czero = std::complex(0.0,0.0);
+ for( int iThread = 0; iThread < numThreads; ++iThread ){
+ // Zero clear
+ out_in1Thread[iThread] = czero;
+ out_in2Thread[iThread] = czero;
+ in2_in1Thread[iThread] = czero;
+ in1_in1Thread[iThread] = czero;
+ in2_in2Thread[iThread] = czero;
+ }
+ int icount(0);
+ int iThread(0);
+ int iSeg(0);
+ #pragma omp parallel default(shared) private(icount, iThread, iSeg)
+ {
+ iThread = omp_get_thread_num();
+ #pragma omp for
+ for( icount = 0; icount < numSegments; ++icount ){
+ iSeg = segmentIndexes[icount];
+ out_in1Thread[iThread] += out[iSeg] * std::conj(in1[iSeg]) * weights[iSeg];
+ out_in2Thread[iThread] += out[iSeg] * std::conj(in2[iSeg]) * weights[iSeg];
+ in2_in1Thread[iThread] += in2[iSeg] * std::conj(in1[iSeg]) * weights[iSeg];
+ in1_in1Thread[iThread] += in1[iSeg] * std::conj(in1[iSeg]) * weights[iSeg];
+ in2_in2Thread[iThread] += in2[iSeg] * std::conj(in2[iSeg]) * weights[iSeg];
+ }
+ }
+ for( int iThread = 0; iThread < numThreads; ++iThread ){
+ out_in1 += out_in1Thread[iThread];
+ out_in2 += out_in2Thread[iThread];
+ in2_in1 += in2_in1Thread[iThread];
+ in1_in1 += in1_in1Thread[iThread];
+ in2_in2 += in2_in2Thread[iThread];
+ }
+ delete [] out_in1Thread;
+ delete [] out_in2Thread;
+ delete [] in2_in1Thread;
+ delete [] in1_in1Thread;
+ delete [] in2_in2Thread;
+#else
+ for( int icount = 0; icount < numSegments; ++icount ){
+ const int iSeg = segmentIndexes[icount];
+ out_in1 += out[iSeg] * std::conj(in1[iSeg]) * weights[iSeg];
+ out_in2 += out[iSeg] * std::conj(in2[iSeg]) * weights[iSeg];
+ in2_in1 += in2[iSeg] * std::conj(in1[iSeg]) * weights[iSeg];
+ in1_in1 += in1[iSeg] * std::conj(in1[iSeg]) * weights[iSeg];
+ in2_in2 += in2[iSeg] * std::conj(in2[iSeg]) * weights[iSeg];
+ }
+#endif
+
+ const double coherence12 = std::norm(in2_in1)/Util::calculateAbsoluteValue(in1_in1)/Util::calculateAbsoluteValue(in2_in2);
+ if( coherence12 > 1.0 - CommonParameters::EPS ){
+ if( priorityOnFirst ){
+ resp1 = out_in1 / in1_in1;
+ resp2 = std::complex(0.0,0.0);
+ }else{
+ resp1 = std::complex(0.0,0.0);
+ resp2 = out_in2 / in2_in2;
+ }
+ return;
+ }
+
+ const std::complex in1_in2 = std::conj(in2_in1);
+ const std::complex det = in1_in1 * in2_in2 - in1_in2 * in2_in1;
+
+ resp1 = ( out_in1 * in2_in2 - out_in2 * in2_in1 ) / det;
+ resp2 = ( out_in2 * in1_in1 - out_in1 * in1_in2 ) / det;
+
+}
+
+// Calculate response function by the weighted remote reference method
+double Analysis::calculateResponseFunctionByWLSRemoteReference(const std::complex* const out,
+ const std::complex* const in1, const std::complex* const in2,
+ const std::complex* const rr1, const std::complex* const rr2,
+ const int numSegments, const double* const weights, std::complex* residuals,
+ std::complex& resp1, std::complex& resp2, double& coherence) const {
+
+ const Control* const ptrControl = Control::getInstance();
+ calculateResponseFunctionByWLSRemoteReferenceAux(numSegments, out, in1, in2, rr1, rr2, weights, resp1, resp2);
+ double Gvar(0.0);
+ double Gsyn(0.0);
+ double Gres(0.0);
+ double sumWeights(0.0);
+
+#ifdef _USE_OMP
+ int numThreads(1);
+#pragma omp parallel
+ {
+ numThreads = omp_get_num_threads();
+ }
+ double* GvarThread = new double[numThreads];
+ double* GsynThread = new double[numThreads];
+ double* GresThread = new double[numThreads];
+ double* sumWeightsThread = new double[numThreads];
+ for (int iThread = 0; iThread < numThreads; ++iThread) {
+ // Zero clear
+ GvarThread[iThread] = 0.0;
+ GsynThread[iThread] = 0.0;
+ GresThread[iThread] = 0.0;
+ sumWeightsThread[iThread] = 0.0;
+ }
+ int i(0);
+ int iThread(0);
+ std::complex outSyn(0.0, 0.0);
+#pragma omp parallel default(shared) private(i, iThread, outSyn)
+ {
+ iThread = omp_get_thread_num();
+#pragma omp for
+ for (i = 0; i < numSegments; ++i) {
+ GvarThread[iThread] += std::norm(out[i]) * weights[i];
+ outSyn = resp1 * in1[i] + resp2 * in2[i];
+ GsynThread[iThread] += std::norm(outSyn) * weights[i];
+ residuals[i] = out[i] - outSyn;
+ GresThread[iThread] += std::norm(residuals[i]) * weights[i];
+ sumWeightsThread[iThread] += weights[i];
+ }
+ }
+ for (int iThread = 0; iThread < numThreads; ++iThread) {
+ Gvar += GvarThread[iThread];
+ Gsyn += GsynThread[iThread];
+ Gres += GresThread[iThread];
+ sumWeights += sumWeightsThread[iThread];
+ }
+ delete[] GvarThread;
+ delete[] GsynThread;
+ delete[] GresThread;
+ delete[] sumWeightsThread;
+#ifdef _DEBUG_WRITE
+ for (int i = 0; i < numSegments; ++i) {
+ std::cout << "iSeg weights residuals: "
+ << i << " " << weights[i] << " " << residuals[i] << std::endl;
+ }
+#endif
+#else
+ for (int i = 0; i < numSegments; ++i) {
+ Gvar += std::norm(out[i]) * weights[i];
+ const std::complex outSyn = resp1 * in1[i] + resp2 * in2[i];
+ Gsyn += std::norm(outSyn) * weights[i];
+ residuals[i] = out[i] - outSyn;
+ Gres += std::norm(residuals[i]) * weights[i];
+#ifdef _DEBUG_WRITE
+ std::cout << "iSeg outSyn weights Gvar residuals Gres: "
+ << i << " " << outSyn << " " << weights[i] << " " << Gvar << " " << residuals[i] << " " << Gres << std::endl;
+#endif
+ sumWeights += weights[i];
+ }
+#endif
+
+ if (sumWeights < CommonParameters::EPS) {
+ Gvar = 0.0;
+ Gsyn = 0.0;
+ Gres = 0.0;
+ coherence = 0.0;
+ }
+ else {
+ Gvar /= sumWeights;
+ Gsyn /= sumWeights;
+ Gres /= sumWeights;
+ coherence = 1.0 - Gres / Gvar;
+#ifdef _DEBUG_WRITE
+ std::cout << "coherence : " << coherence << " " << 1.0 - Gres / Gvar << std::endl;
+#endif
+ }
+
+ if (coherence > 1.0) {
+ coherence = 1.0;
+ }
+ else if (coherence < 0.0) {
+ coherence = 0.0;
+ }
+
+ OutputFiles* ptrOutputFiles = OutputFiles::getInstance();
+ ptrOutputFiles->writeCvgMessage(" Sum of weights: " + Util::toString(sumWeights));
+ ptrOutputFiles->writeCvgMessage(" Squared coherence: " + Util::toString(coherence));
+ std::ostringstream msg1;
+ msg1 << " Estimated response function: ";
+ msg1 << "(" << std::setw(12) << std::setprecision(4) << std::scientific << resp1.real() << ","
+ << std::setw(12) << std::setprecision(4) << std::scientific << resp1.imag() << ")";
+ msg1 << ", (" << std::setw(12) << std::setprecision(4) << std::scientific << resp2.real() << ","
+ << std::setw(12) << std::setprecision(4) << std::scientific << resp2.imag() << ")";
+ ptrOutputFiles->writeCvgMessage(msg1.str());
+ std::ostringstream msg2;
+ msg2 << " Amplitude of the estimated response function:";
+ msg2 << std::setw(12) << std::setprecision(4) << std::scientific << std::abs(resp1) << ","
+ << std::setw(12) << std::setprecision(4) << std::scientific << std::abs(resp2);
+ ptrOutputFiles->writeCvgMessage(msg2.str());
+ std::ostringstream msg3;
+ msg3 << " Phase(deg.) of the estimated response function:";
+ msg3 << std::setw(7) << std::setprecision(1) << std::fixed << std::arg(resp1) * CommonParameters::RAD2DEG << ","
+ << std::setw(7) << std::setprecision(1) << std::fixed << std::arg(resp2) * CommonParameters::RAD2DEG;
+ ptrOutputFiles->writeCvgMessage(msg3.str());
+
+ return Gres;
+}
+
+// Auxiliary function for calculating response function by the weighted remote reference method
+void Analysis::calculateResponseFunctionByWLSRemoteReferenceAux(const int numSegments, const std::complex* const out,
+ const std::complex* const in1, const std::complex* const in2,
+ const std::complex* const rr1, const std::complex* const rr2,
+ const double* const weights, std::complex& resp1, std::complex& resp2) const {
+
+ std::complex out_rr1(0.0, 0.0);
+ std::complex out_rr2(0.0, 0.0);
+ std::complex in2_rr1(0.0, 0.0);
+ std::complex in1_rr1(0.0, 0.0);
+ std::complex in2_rr2(0.0, 0.0);
+ std::complex in1_rr2(0.0, 0.0);
+
+#ifdef _USE_OMP
+ int numThreads(1);
+#pragma omp parallel
+ {
+ numThreads = omp_get_num_threads();
+ }
+ std::complex* out_rr1Thread = new std::complex[numThreads];
+ std::complex* out_rr2Thread = new std::complex[numThreads];
+ std::complex* in2_rr1Thread = new std::complex[numThreads];
+ std::complex* in1_rr1Thread = new std::complex[numThreads];
+ std::complex* in2_rr2Thread = new std::complex[numThreads];
+ std::complex* in1_rr2Thread = new std::complex[numThreads];
+
+ const std::complex czero = std::complex(0.0, 0.0);
+ for (int iThread = 0; iThread < numThreads; ++iThread) {
+ // Zero clear
+ out_rr1Thread[iThread] = czero;
+ out_rr2Thread[iThread] = czero;
+ in2_rr1Thread[iThread] = czero;
+ in1_rr1Thread[iThread] = czero;
+ in2_rr2Thread[iThread] = czero;
+ in1_rr2Thread[iThread] = czero;
+ }
+ int i(0);
+ int iThread(0);
+#pragma omp parallel default(shared) private(i, iThread)
+ {
+ iThread = omp_get_thread_num();
+#pragma omp for
+ for (i = 0; i < numSegments; ++i) {
+ out_rr1Thread[iThread] += out[i] * std::conj(rr1[i]) * weights[i];
+ out_rr2Thread[iThread] += out[i] * std::conj(rr2[i]) * weights[i];
+ in2_rr1Thread[iThread] += in2[i] * std::conj(rr1[i]) * weights[i];
+ in1_rr1Thread[iThread] += in1[i] * std::conj(rr1[i]) * weights[i];
+ in2_rr2Thread[iThread] += in2[i] * std::conj(rr2[i]) * weights[i];
+ in1_rr2Thread[iThread] += in1[i] * std::conj(rr2[i]) * weights[i];
+ }
+ }
+ for (int iThread = 0; iThread < numThreads; ++iThread) {
+ out_rr1 += out_rr1Thread[iThread];
+ out_rr2 += out_rr2Thread[iThread];
+ in2_rr1 += in2_rr1Thread[iThread];
+ in1_rr1 += in1_rr1Thread[iThread];
+ in2_rr2 += in2_rr2Thread[iThread];
+ in1_rr2 += in1_rr2Thread[iThread];
+ }
+ delete[] out_rr1Thread;
+ delete[] out_rr2Thread;
+ delete[] in2_rr1Thread;
+ delete[] in1_rr1Thread;
+ delete[] in2_rr2Thread;
+ delete[] in1_rr2Thread;
+#else
+ for (int i = 0; i < numSegments; ++i) {
+ out_rr1 += out[i] * std::conj(rr1[i]) * weights[i];
+ out_rr2 += out[i] * std::conj(rr2[i]) * weights[i];
+ in2_rr1 += in2[i] * std::conj(rr1[i]) * weights[i];
+ in1_rr1 += in1[i] * std::conj(rr1[i]) * weights[i];
+ in2_rr2 += in2[i] * std::conj(rr2[i]) * weights[i];
+ in1_rr2 += in1[i] * std::conj(rr2[i]) * weights[i];
+ }
+#endif
+
+ const std::complex det = in1_rr1 * in2_rr2 - in1_rr2 * in2_rr1;
+
+ resp1 = (out_rr1 * in2_rr2 - out_rr2 * in2_rr1) / det;
+ resp2 = (out_rr2 * in1_rr1 - out_rr1 * in1_rr2) / det;
+
+ //double Gvar(0.0);
+ //double Gsyn(0.0);
+ //for (int i = 0; i < numSegments; ++i) {
+ // Gvar += std::norm(out[i]) * weights[i];
+ // const std::complex outSyn = resp1 * in1[i] + resp2 * in2[i];
+ // Gsyn += std::norm(outSyn) * weights[i];
+ //}
+
+ //double coherence = Gsyn / Gvar;
+ //if (coherence > 1.0) {
+ // coherence = 1.0;
+ //}
+ //else if (coherence < 0.0) {
+ // coherence = 0.0;
+ //}
+ //return coherence;
+
+}
+
+// Calculate response function by the weighted remote reference method for bootstrap
+void Analysis::calculateResponseFunctionByWLSRemoteReferenceForBootstrap(const int numSegments, const int* const segmentIndexes,
+ const std::complex* const out,
+ const std::complex* const in1, const std::complex* const in2,
+ const std::complex* const rr1, const std::complex* const rr2,
+ const double* const weights, std::complex& resp1, std::complex& resp2) const {
+
+
+ std::complex out_rr1(0.0, 0.0);
+ std::complex out_rr2(0.0, 0.0);
+ std::complex in2_rr1(0.0, 0.0);
+ std::complex in1_rr1(0.0, 0.0);
+ std::complex in2_rr2(0.0, 0.0);
+ std::complex