Home > atmlab > randomize > iaaft > plot_1d_surrogate.m

plot_1d_surrogate

PURPOSE ^

SYNOPSIS ^

function plot_1d_surrogate(x, surrogate, variableStr)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

plot_1d_surrogate.m

SOURCE CODE ^

0001 function plot_1d_surrogate(x, surrogate, variableStr)
0002 
0003 if ( length(surrogate) > 1 )
0004     % Plot the surrogate time series (and template)
0005     figure
0006     plot(x, surrogate, 'r-')
0007     title([variableStr ' time series'])
0008     axis tight
0009     
0010     % Plot histogram / amplitude distribution of surrogate (and template)
0011     figure
0012     [hist_surrogate, bins] = hist(surrogate, length(surrogate)/4);    
0013     barh(bins, hist_surrogate', 0.5)
0014     title(['Histogram ' variableStr])
0015         
0016     % Plot power spectrum of surrogate (and template)
0017     figure
0018     no_values = length(surrogate);
0019     k = (2:no_values/2)*(1/(no_values));
0020     fourier_coeff_surrogate = fft(surrogate);
0021     loglog(k, 1e4*abs(fourier_coeff_surrogate(2:no_values/2)).^2, 'r-')
0022     title(['Power spectrum ' variableStr])
0023     xlabel('k')
0024     ylabel('Power')    
0025     axis tight
0026 end

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