Selaa lähdekoodia

calibration: remove dependencies on dates for measured data, replace with 'current' which should be a link to the current set

Fernando Pablo Lopez-Lezcano 9 vuotta sitten
vanhempi
sitoutus
45711bc7b1

+ 1 - 1
calibration/src/sphear_a_to_b_hf.m

@@ -32,7 +32,7 @@ function [bf Fs] = sphear_a_to_b_hf(m, A2B, N, Npre);
   capnames = cellstr(['LF'; 'RF'; 'LB'; 'RB']);
   %% read in capsule signals and apply FIR filter
   for c = 1:4
-    [cs(c,:) Fs] = wavread(["../data/2016.08.03/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+    [cs(c,:) Fs] = wavread(["../data/current/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
     if (c == 1)
       %% find highest peak location and define sample range
       [index, value] = findmaxpeak(cs(c,:)');

+ 1 - 1
calibration/src/sphear_a_to_b_hf_render.m

@@ -34,7 +34,7 @@ function [BFF] = sphear_a_to_b_hf_render(A2B, N, Npre)
     %% if we write a 32 bit soundfile we need to scale by 256
     %% if we want the same amplitude as when writing a 16 bit
     %% per sample soundfile, otherwise we get nasty clipping
-    wavwrite(reshape(bf(m,:,:),4,[])' / 256, srate, 32, ["../data/2016.08.03/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
+    wavwrite(reshape(bf(m,:,:),4,[])' / 256, srate, 32, ["../data/current/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
   end
 
 end

+ 2 - 2
calibration/src/sphear_af_power.m

@@ -34,7 +34,7 @@ function [R Fs] = sphear_af_power(measurements, fmin, fmax, N, Npre)
   pkg load signal;
 
   %% read in reference microphone, select samples to process
-  [ref, Fs] = wavread('../data/2016.08.03/ref/reference-001-1.wav');
+  [ref, Fs] = wavread('../data/current/ref/reference-001-1.wav');
   [peaks, locs] = findpeaks(abs(ref));
   [~, index] = max(peaks);
   start = locs(index) - Npre;
@@ -57,7 +57,7 @@ function [R Fs] = sphear_af_power(measurements, fmin, fmax, N, Npre)
       %% this is only valid for the frequency range covered by the test speaker,
       %% anything outside is undefined
       %%
-      capsule = wavread(["../data/2016.08.03/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+      capsule = wavread(["../data/current/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
       equalized = fft(capsule(range), N) ./ ref_fft;
       
       %% return total power of signal in frequency range

+ 1 - 1
calibration/src/sphear_bf_power.m

@@ -39,7 +39,7 @@ function [B] = sphear_bf_power(fmin, fmax, N, Fs, plotz)
   %% all measurements
   for m = 1:16
     %% all b format components, 4 channel soundfile
-    bsignal = wavread(["../data/2016.08.03/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
+    bsignal = wavread(["../data/current/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
     bfft = fft(bsignal, N);
     if (plotz == 0)
       %% calculate a forward facing cardiod

+ 1 - 1
calibration/src/sphear_common.m

@@ -35,7 +35,7 @@ function [bf] = sphear_a_to_b(m, FIR, range, Nfft);
   capnames = cellstr(['LF'; 'RF'; 'LB'; 'RB']);
   %% read in capsule signals and apply FIR filter
   for c = 1:4
-    cs(c,:) = wavread(["../data/2016.08.03/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+    cs(c,:) = wavread(["../data/current/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
     cr(c,:) = tukeywin(size(range)(2), 0.0) .* cs(c,:)'(range);
     for b = 1:4
       bs(c,b,:) = fftfilt(reshape(FIR(b,c,:), 1, [])', cr(c,:), Nfft);

+ 5 - 5
calibration/src/sphear_fir_design.m

@@ -265,22 +265,22 @@ function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, plot_on, W, X,
 				reshape(FIR(b, 3, :), 1, [])',
 				reshape(FIR(b, 4, :), 1, [])');
   end
-  wavwrite(TETRA, Fs, 'calibration/tetraproc_matrix.wav');
+  wavwrite(TETRA, Fs, '../data/current/cal/tetraproc_matrix.wav');
   
   if (plot_on != 0)
     l = legend([wh, zh, xyh], {'W', 'XY', 'Z'});
     legend(l, 'location', 'west');
     if (exist("W") == 1)
       if (strcmp(plot_on, 'eps') || strcmp(plot_on, 'epsc') || plot_on == 1)
-	print(fig, '-deps','-tight',copt,["figures/wxyz_filter_ff" cext ".eps"]);
+	print(fig, '-deps','-tight',copt,["../data/current/figures/wxyz_filter_ff" cext ".eps"]);
       else
-	print(fig, '-dpng',copt,["figures/wxyz_filter_ff" cext ".png"]);
+	print(fig, '-dpng',copt,["../data/current/figures/wxyz_filter_ff" cext ".png"]);
       end
     else
       if (strcmp(plot_on, 'eps') || strcmp(plot_on, 'epsc') || plot_on == 1)
-	print(fig, '-deps','-tight',copt,["figures/wxyz_filter_lf" cext ".eps"]);
+	print(fig, '-deps','-tight',copt,["../data/current/figures/wxyz_filter_lf" cext ".eps"]);
       else
-	print(fig, '-dpng',copt,["figures/wxyz_filter_lf" cext ".png"]);
+	print(fig, '-dpng',copt,["../data/current/figures/wxyz_filter_lf" cext ".png"]);
       end
     end
   end

+ 4 - 4
calibration/src/sphear_fir_render.m

@@ -49,7 +49,7 @@ function [BFF] = sphear_fir_render(FIR, fmin, fmax, ymin, ymax, N, Npre, Nfft, p
     end
   end
 
-  [ref, Fs] = wavread('../data/2016.08.03/ref/reference-001-1.wav');
+  [ref, Fs] = wavread('../data/current/ref/reference-001-1.wav');
   %% find highest peak location and define sample range
   [index, value] = findmaxpeak(ref);
   r_start = index - Npre;
@@ -77,7 +77,7 @@ function [BFF] = sphear_fir_render(FIR, fmin, fmax, ymin, ymax, N, Npre, Nfft, p
     %% if we write a 32 bit soundfile we need to scale by 256
     %% if we want the same amplitude as when writing a 16 bit
     %% per sample soundfile, otherwise we get nasty clipping
-    wavwrite(reshape(bf(m,:,:),4,[])' / 256, Fs, 32, ["../data/2016.08.03/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
+    wavwrite(reshape(bf(m,:,:),4,[])' / 256, Fs, 32, ["../data/current/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
 
     %% plot if requested
     if (plot_on != 0)
@@ -119,9 +119,9 @@ function [BFF] = sphear_fir_render(FIR, fmin, fmax, ymin, ymax, N, Npre, Nfft, p
       legend(l, 'location', 'west');
       hold off;
       if (strcmp(plot_on, 'eps') || strcmp(plot_on, 'epsc') || plot_on == 1)
-	print(f, '-deps', '-tight', copt, ["figures/sphear_bf_azimuth_" sprintf("%03.0f", angle) cext ".eps"]);
+	print(f, '-deps', '-tight', copt, ["../data/current/figures/sphear_bf_azimuth_" sprintf("%03.0f", angle) cext ".eps"]);
       else
-	print(f, '-dpng', copt, ["figures/sphear_bf_azimuth_" sprintf("%03.0f", angle) cext ".png"]);
+	print(f, '-dpng', copt, ["../data/current/figures/sphear_bf_azimuth_" sprintf("%03.0f", angle) cext ".png"]);
       end
     end
   end

+ 1 - 1
calibration/src/sphear_fir_render_directions.m

@@ -47,7 +47,7 @@ function [BFF] = sphear_fir_render_directions(FIR, fmin, fmax, N, Npre, Nfft, pl
     end
   end
 
-  [ref, Fs] = wavread('../data/2016.08.03/ref/reference-001-1.wav');
+  [ref, Fs] = wavread('../data/current/ref/reference-001-1.wav');
   %% find highest peak location and define sample range
   [index, value] = findmaxpeak(ref);
   r_start = index - Npre;