Home > reduc > analyzeNoiseEvents.m

analyzeNoiseEvents

PURPOSE ^

%%%%%%%%%%%%

SYNOPSIS ^

function [noise_alpha noise_fknee noise_white stdev times errorFlags]=analyzeNoiseEvents(d,doplot,plotbad)

DESCRIPTION ^

%%%%%%%%%%%%

 Compute, and optionally plot, statistics for all the noise events in the
 data chunk.

$$$$$$$$$$$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [noise_alpha noise_fknee noise_white stdev times errorFlags]=analyzeNoiseEvents(d,doplot,plotbad)
0002 
0003 %%%%%%%%%%%%%
0004 %
0005 % Compute, and optionally plot, statistics for all the noise events in the
0006 % data chunk.
0007 %
0008 %$$$$$$$$$$$
0009 
0010 if (nargin<2)
0011     doplot=0;
0012 end
0013 if (nargin<3)
0014     plotbad=0;
0015 end
0016 noiseEndpoints=flagEndpoints(d.index.noise.fast);
0017 nChunks = size(noiseEndpoints,1);
0018 sampling_frequency = 100.0;
0019 noise_white=zeros(1,nChunks);
0020 noise_alpha=zeros(1,nChunks);
0021 noise_fknee=zeros(1,nChunks);
0022 times=zeros(1,nChunks);
0023 stdev=zeros(1,nChunks);
0024 errorFlags=zeros(1,nChunks);
0025 for i=1:nChunks,
0026 
0027     noise_start_index = noiseEndpoints(i,1);
0028     noise_end_index = noiseEndpoints(i,2);
0029     
0030     noise_range  = noise_start_index+1:noise_end_index;
0031     noise  = d.antenna0.receiver.data(noise_range,1);
0032 
0033     [alphan fkneen whiten fn measuredn fittedn errorFlag] = fitOneOverF(sampling_frequency,noise);
0034     
0035     noise_white(i) = whiten;
0036     noise_alpha(i) = alphan;
0037     noise_fknee(i) = fkneen;
0038     errorFlags(i) = errorFlag;
0039     
0040     stdev(i) = std(noise,1);
0041     midpoint = round((noise_range(1)+noise_range(end))/2);
0042     times(i)=d.antenna0.receiver.utc(midpoint);
0043     if (doplot>0)
0044         figure()
0045         loglog(fn,measuredn,'k-',fn,fittedn,'r-');
0046     end
0047     if (plotbad>0 && errorFlag==0)
0048         figure()
0049         loglog(fn,measuredn,'k-',fn,fittedn,'r-');
0050         bad_start_time=d.antenna0.receiver.utc(noise_start_index);
0051         title(mjd2string(bad_start_time));           
0052     end
0053         
0054 end
0055 end
0056 
0057

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005