diff --git a/dataProcessing/LTSAs/longTermSpectra_GoMex2018.asv b/dataProcessing/LTSAs/longTermSpectra_GoMex2018.asv deleted file mode 100644 index 85c58d6..0000000 --- a/dataProcessing/LTSAs/longTermSpectra_GoMex2018.asv +++ /dev/null @@ -1,122 +0,0 @@ -% script modified by J. Haxel May 2015 to calculate the long-term time -% averaged spectra of acoustic signals at NRS -% system response = (preAmp + instResp) is removed and energy values are -% normalized to dB re 1uPa @ 1m -% -% CF2 data - need to use *CF2*.m for all subroutines -% -% data info -%c -if (1) - datadir = 'E:\sg639\wav\sg639-1kHz\'; - locname = 'GoMex'; - fnums = 1:49999; - chan = 1; - frameSize = 1000; - fdates = 'E:\sg639\wav\sg639-1kHz\file_dates-sg639_GoMex_May18-1kHz.txt'; - sRate = 1000; -elseif(0) - -end - % -% Parameters for time averaging and start/stop times -period = 1/86400; %5/1440 %1/24 %5/1440 %hourly =1/24 %600/(60*60*24); % 600 sec in days -baseyear = 'auto'; % auto means get it from first day of data -zeroPad = 0; % zero-pad the signal -nOverlap = 0; % overlap data points -% -%%%%%%%%%%%%%%%%%%%%%%% Configure data Grab %%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -hIndex = readHarufileDateIndex(fdates); -if (0) %change for the old format of datafile - fn0 = sprintf('%sdatafile.%03d', datadir, fnums(1)); - fn1 = sprintf('%sdatafile.%03d', datadir, fnums(end)); -elseif (0) - fn0 = sprintf('%s%08d.DAT', datadir, fnums(1)); - fn1 = sprintf('%s%08d.DAT', datadir, fnums(end)); -else - fn0 = [datadir hIndex.hname{1}(3:end)]; - fn1 = [datadir hIndex.hname{end}(3:end)]; -end -% NOT NEEDED FOR WORKING WITH WAV FILES -% [dtv0,yr,jd,hr,mn,sc,sRate,t,y]=readCF2hdr(fn0,0); -% [dtv1,yr,jd,hr,mn,sc,sRate,t,y]=readCF2hdr(fn1,0); -dtv0 = hIndex.time(1); -dtv1 = hIndex.time(end); -% -if (ischar(baseyear) && strcmp(baseyear, 'auto')) -% baseyear = sub(datevec(dtv0), 1); % new dt encoding from soundIn -baseyear = sub(datevec(hIndex.time(1)), 1); -end -% -% Get start and stop times that include only whole intervals. -dt0 = ceil(dtv0/period) * period; % get start of first whole period -dt1 = floor(dtv1/period) * period; % get end of last whole period -% -% get the system response to subtract out of power vaues later -%[SR] = get_sys_response(PA_rev,gain,filt_sw,sRate,frameSize); -%[SR] = get_sys_response(9,0,4,double(sRate),frameSize); - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% %%%%%%%%%%%%%%%%% Start the loop for calculating LTSpect %%%%%%%%%%%%%% -% -if (1) - gram = zeros((frameSize+zeroPad)/2, round((dt1-dt0)/period)); - fRate = sRate / (frameSize - nOverlap); - printf('%d dots:', nCols(gram)) - for i = 1 : nCols(gram) - fprintf(1,'.%s', iff(mod(i,60) == 0, char(10), '')); - dt = dt0 + (i-1) * period; -% Do around 1 million samples at a time. - t0 = dt; - gSum = zeros((frameSize+zeroPad)/2, 1); - ng = 0; -% while (t0 < dt + period) - %t1 = min([dt+period double(t0+1e6/sRate/24/60/60)]); %for big AVG's - t1 = dt + period; - %xt = haruSoundAtTime_CF2_2channel([t0 t1], hIndex, datadir, chan); -% xt = haruSoundAtTime_CF2([t0 t1], hIndex, datadir); %note - calling CF2 specific routine - xt = haruSoundAtTime([t0 t1], hIndex, datadir); - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %xt_2 = xt{1}; %xt_3 = xt_2(:,1); %extra step do to 2 channel data - %x_mn = xt_3 - mean(xt_3); %have to do this in 2 steps now because 2 channel data - x_mn = xt{1} - mean(xt{1}); %remove the sample mean from the chunk of data for 16bit - x = (2.5/(2^16)).*x_mn; % convert to Volts by (Voltrange/bitrange)- for 16bit - %x = (4/(2^12)).*x_mn; %convert to Volts -12bit - g = joespect_LTacoustic(x, frameSize, nOverlap, zeroPad, 'hann', sRate); %5000 for sample rate - -% [g,f,t] = spectrogram(x,hann(frameSize),nOverlap,frameSize,sRate); -% g = abs(g(2:end)); - % last input on line above is sample rate - if (nCols(g) == 0), break; end % skip partial frame at end of day - gSum = gSum + mean(g,2); % sum up the energy - will divide later - ng = ng + nCols(g); - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - %t0 = t0 + nCols(g)/.9765624 / 24/60/60; %have to change this to make it run m10 hickup - - t0 = t0 + nCols(g) / fRate / 24/60/60; %change back to this - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% end - grm = 10*log10(gSum); %to convert power to dB - % - %GRAM = grm - SR'; - % - %gram(:,i) = GRAM; %must add this in to get system response removed - gram(:,i) = grm; - % -% - end - fprintf(1, '\n'); -end -% remove the system gain from the spectra -%LTgram = gram - repmat(SR',1,length(gram(1,:))); -% -%cd E:\ROSS_SEA-2014 -%cd C:\haxel\OCEAN_NOISE\YAQ_HEAD\ -%cd C:\haxel\LAU_BASIN\ANALYSIS\MATAS -%% -cd C:\Users\haver\Documents\NRS\NRS10\LTSA - -save NRS10_20162017_5minAvgSpect_cal070118 gram dt0 dt1 frameSize sRate - -% \ No newline at end of file diff --git a/fileExchange/arrow3/arrow3_examples.m b/fileExchange/arrow3/arrow3_examples.m new file mode 100644 index 0000000..4db1126 --- /dev/null +++ b/fileExchange/arrow3/arrow3_examples.m @@ -0,0 +1,81 @@ + % 2D vectors + arrow3([0 0],[1 3]) + arrow3([0 0],[1 2],'-.e') + arrow3([0 0],[10 10],'--x2',1) + arrow3(zeros(10,2),50*rand(10,2),'x',1,3) + arrow3(zeros(10,2),[10*rand(10,1),500*rand(10,1)],'u') + arrow3(10*rand(10,2),50*rand(10,2),'x',1,[],1) + + % 3D vectors + arrow3([0 0 0],[1 1 1]) + arrow3(zeros(20,3),50*rand(20,3),'--x1.5',2) + arrow3(zeros(100,3),50*rand(100,3),'x',1,3) + arrow3(zeros(10,3),[10*rand(10,1),500*rand(10,1),50*rand(10,1)],'a') + arrow3(10*rand(10,3),50*rand(10,3),'x',[],[],0) + + % Just for fun + arrow3(zeros(100,3),50*rand(100,3),'x',10,3,[],0.95) + light('Position',[-10 -10 -10],'Style','local') + light('Position',[60,60,60]), lighting gouraud + + % ColorOrder variable, color code prefixes, and Beta + global ColorOrder, ColorOrder='^ui^e_hq^v'; + theta=[0:pi/22:pi/2]'; + arrow3(zeros(12,2),[cos(theta),sin(theta)],'1.5o',0.1,[],[],[],0.5) + + % ColorOrder property, LineStyleOrder, and LineWidthOrder + global ColorOrder, ColorOrder=[]; + set(gca,'ColorOrder',[1,0,0;0,0,1;0.25,0.75,0.25;0,0,0]) + set(gca,'LineStyleOrder',{'-','--','-.',':'}) + global LineWidthOrder, LineWidthOrder=[1,2,4,8]; + w=[5,10,15,20]; h=[20,40,30,40]; + arrow3(zeros(4,2),[10*rand(4,1),500*rand(4,1)],'o*/',w,h,10) + + % Magnitude coloring + colormap spring + arrow3(20*randn(20,3),50*randn(20,3),'|',[],[],0) + set(gca,'color',0.7*[1,1,1]) + set(gcf,'color',0.5*[1,1,1]), grid on, colorbar + pause % change the colormap and update colors + colormap hot + arrow3('update','colors') + + % LogLog plot + set(gca,'xscale','log','yscale','log'); + axis([1e2,1e8,1e-2,1e-1]); hold on + p1=repmat([1e3,2e-2],15,1); + q1=[1e7,1e6,1e5,1e4,1e3,1e7,1e7,1e7,1e7,1e7,1e7,1e6,1e5,1e4,1e3]; + q2=1e-2*[9,9,9,9,9,7,5,4,3,2,1,1,1,1,1]; p2=[q1',q2']; + global ColorOrder, ColorOrder=[]; + set(gca,'ColorOrder',rand(15,3)) + arrow3(p1,p2,'o'), grid on, hold off + + % SemiLogX plot + set(gca,'xscale','log','yscale','linear'); + axis([1e2,1e8,1e-2,1e-1]); hold on + p1=repmat([1e3,0.05],15,1); + q1=[1e7,1e6,1e5,1e4,1e3,1e7,1e7,1e7,1e7,1e7,1e7,1e6,1e5,1e4,1e3]; + q2=1e-2*[9,9,9,9,9,7,5,4,3,2,1,1,1,1,1]; p2=[q1',q2']; + arrow3(p1,p2,'x'), grid on, hold off + + % SemiLogY plot + set(gca,'xscale','linear','yscale','log'); + axis([2,8,1e-2,1e-1]); hold on + p1=repmat([3,2e-2],17,1); + q1=[7,6,5,4,3,7,7,7,7,7,7,7,7,6,5,4,3]; + q2=1e-2*[9,9,9,9,9,8,7,6,5,4,3,2,1,1,1,1,1]; p2=[q1',q2']; + set(gca,'LineStyleOrder',{'-','--','-.',':'}) + arrow3(p1,p2,'*',1,[],0), grid on, hold off + + % Color tables + arrow3('colors') % default color table + arrow3('colors',0.3) % low contrast color table + arrow3('colors',0.5) % high contrast color table + + % Update initial point markers and arrowheads + arrow3('update') % redraw same size + arrow3('update',2) % redraw double size + arrow3('update',0.5) % redraw half size + arrow3('update',[0.5,2,1]) % redraw W half size, + % H double size, and + % IP same size diff --git a/fileExchange/export_fig/export_fig-3.19/.ignore/ghostscript.txt b/fileExchange/export_fig/export_fig-3.19/.ignore/ghostscript.txt new file mode 100644 index 0000000..b2a0a0c --- /dev/null +++ b/fileExchange/export_fig/export_fig-3.19/.ignore/ghostscript.txt @@ -0,0 +1 @@ +C:\Program Files\gs\gs9.55.0\bin\gswin64c.exe \ No newline at end of file diff --git a/fileExchange/export_fig/export_fig-3.19/.ignore/gs_font_path.txt b/fileExchange/export_fig/export_fig-3.19/.ignore/gs_font_path.txt new file mode 100644 index 0000000..f580200 --- /dev/null +++ b/fileExchange/export_fig/export_fig-3.19/.ignore/gs_font_path.txt @@ -0,0 +1 @@ +C:\Windows\Fonts \ No newline at end of file diff --git a/fileExchange/export_fig/export_fig-3.19/.ignore/pdftops.txt b/fileExchange/export_fig/export_fig-3.19/.ignore/pdftops.txt new file mode 100644 index 0000000..1b4a898 --- /dev/null +++ b/fileExchange/export_fig/export_fig-3.19/.ignore/pdftops.txt @@ -0,0 +1 @@ +C:\Program Files (x86)\xpdf-tools-win-4.03\bin64\pdftops.exe \ No newline at end of file