Home > atmlab > randomize > iaaft > surrogate_1d_1d.m

surrogate_1d_1d

PURPOSE ^

surrogate_1d_1d

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 surrogate_1d_1d

 This is the main program of the (Stochastic) Iterative Amplitude Adapted Fourier
 Transform (IAAFT or SIAAFT) method to make surrogate fields. This version makes 1D
 time series based on the statistical properties of 1D time series.

 The IAAFT method was developped by Schreiber and Schmitz (see e.g. Phys. 
 Rev Lett. 77, pp. 635-, 1996) for statistical non-linearity tests for time series.
 This method makes fields that have a specified amplitude distribution and
 power spectral coefficients. It works by iteratively adaptation the amplitude 
 distribution and the Fourier coefficients (the phases are not changed in this 
 step). 
 The SIAAFT algorithm was developped by me (Victor Venema). The main
 difference is just one line of code, where only a fraction of the values
 is adapted in the amplitude adaptation, instead of all values. This makes
 the algorithm more accurate, i.e. the power spectra of template and
 surrogate correspond closer. For the rest the result should be identical.
 See my homepage for more details.
 
 Do not use this program without understanding the function
 iaaft_loop_1d and siaaft_1d and tuning its variables to your needs.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

surrogate_1d_1d.m

SOURCE CODE ^

0001 % surrogate_1d_1d
0002 %
0003 % This is the main program of the (Stochastic) Iterative Amplitude Adapted Fourier
0004 % Transform (IAAFT or SIAAFT) method to make surrogate fields. This version makes 1D
0005 % time series based on the statistical properties of 1D time series.
0006 %
0007 % The IAAFT method was developped by Schreiber and Schmitz (see e.g. Phys.
0008 % Rev Lett. 77, pp. 635-, 1996) for statistical non-linearity tests for time series.
0009 % This method makes fields that have a specified amplitude distribution and
0010 % power spectral coefficients. It works by iteratively adaptation the amplitude
0011 % distribution and the Fourier coefficients (the phases are not changed in this
0012 % step).
0013 % The SIAAFT algorithm was developped by me (Victor Venema). The main
0014 % difference is just one line of code, where only a fraction of the values
0015 % is adapted in the amplitude adaptation, instead of all values. This makes
0016 % the algorithm more accurate, i.e. the power spectra of template and
0017 % surrogate correspond closer. For the rest the result should be identical.
0018 % See my homepage for more details.
0019 %
0020 % Do not use this program without understanding the function
0021 % iaaft_loop_1d and siaaft_1d and tuning its variables to your needs.
0022 
0023 % This Matlab version was written by Victor Venema,
0024 % Victor.Venema@uni-bonn.de, http:\\www.meteo.uni-bonn.de\victor, or
0025 % http:\\www.meteo.uni-bonn.de\victor\themes\surrogates\iaaft\
0026 % for the generation of surrogate cloud fields.
0027 % First version:  May 2003.
0028 % IAAFT version:  November 2003.
0029 % SIAAFT version: October 2004.
0030 
0031 % Copyright (C) 2003 and 2004 Victor Venema
0032 % This program is free software; you can redistribute it and/or
0033 % modify it under the terms of the GNU General Public License
0034 % as published by the Free Software Foundation; version 2
0035 % of the License.
0036 %
0037 % This program is distributed in the hope that it will be useful,
0038 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0039 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0040 % GNU General Public License for more details.
0041 %
0042 % To get a copy of the GNU General Public License look on internet
0043 % or write to the Free Software Foundation, Inc., 59 Temple Place -
0044 % Suite 330, Boston, MA  02111-1307, USA.
0045 
0046 algorithmVersion = 2; % 1: IAAFT, 2: SIAAFT
0047 
0048 [fourierCoeff, sortedValues, x, template, meanValue, noValues] = load_1d_data(1);
0049 
0050 switch algorithmVersion
0051     case 1
0052         [surrogate, errorAmplitude, errorSpec] = iaaft_loop_1d(fourierCoeff, sortedValues);
0053         errorAmplitude
0054         errorSpec
0055     case 2
0056         counterThresshold = 100; % This iteration threshold is set to 100 to make the first run fast, a better value is 1000 or 10.000.
0057         [surrogate, spectralDiff] = siaaft_1d(fourierCoeff, sortedValues, counterThresshold);
0058         spectralDiff
0059 end
0060         
0061 surrogate = surrogate + meanValue;
0062 
0063 plot_1d_surrogate(x, template,  'template')
0064 plot_1d_surrogate(x, surrogate, 'surrogate')

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005