Parcourir la source

store calibration data in ../data instead of ../cal, change to latest calibration run for second prototype

Fernando Pablo Lopez-Lezcano il y a 10 ans
Parent
commit
4a250aac0e

+ 2 - 2
capsule_polar_response.m

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

+ 1 - 1
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(["../cal/2016.04.20/export/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+    [cs(c,:) Fs] = wavread(["../data/2016.08.03/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
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, ["../cal/2016.04.20/export/b-format-" sprintf("%02.0f", m) ".wav"]);
+    wavwrite(reshape(bf(m,:,:),4,[])' / 256, srate, 32, ["../data/2016.08.03/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
   end
 
 end

+ 3 - 2
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('../cal/2016.04.20/export/reference-001-1.wav');
+  [ref, Fs] = wavread('../data/2016.08.03/ref/reference-001-1.wav');
   [peaks, locs] = findpeaks(abs(ref));
   [~, index] = max(peaks);
   start = locs(index) - Npre;
@@ -57,11 +57,12 @@ 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(["../cal/2016.04.20/export/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+      capsule = wavread(["../data/2016.08.03/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
       R(i, c) = sqrt(sum(equalized(imin:imax).*conj(equalized(imin:imax)))/size(equalized(imin:imax),1));
+
     end
     i = i + 1;
   end

+ 1 - 1
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(["../cal/2016.04.20/export/b-format-" sprintf("%02.0f", m) ".wav"]);
+    bsignal = wavread(["../data/2016.08.03/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
     bfft = fft(bsignal, N);
     if (plotz == 0)
       %% calculate a forward facing cardiod

+ 1 - 1
sphear_bf_power_fons.m

@@ -30,7 +30,7 @@ function [B] = sphear_bf_power_fons(fmin, fmax, N, Fs, plotz)
   %% all measurements
   for m = 1:16
     %% all b format components, 4 channel soundfile
-    bsignal = wavread(["../cal/2016.04.20/export/b-format-fons-rendered-" sprintf("%03.0f", m) "-16.wav"]);
+    bsignal = wavread(["../cal/2016.08.03/fons/b-format-rendered-" sprintf("%03.0f", m) "-16.wav"]);
 
     %% transform from FUMA to SN3D (the encoder is outputing FUMA)
     %% bsignal(:,1) = bsignal(:,1) * (sqrt(2)/2);

+ 2 - 2
sphear_capsule_power.m

@@ -41,9 +41,9 @@ function [RS Fs] = sphear_capsule_power(measurements, fmin, fmax, N, Npre)
     %% orientation
     for o = [1, 2]
 
-      printf("%s\n", ["../cal/2016.07.26/export/capsule-" sprintf("%02.0f", m) "-" char(onames(o)) "-1.wav"]);
+      printf("%s\n", ["../data/2016.07.26/export/capsule-" sprintf("%02.0f", m) "-" char(onames(o)) "-1.wav"]);
       
-      [capsule, Fs] = wavread(["../cal/2016.07.26/export/capsule-" sprintf("%02.0f", m) "-"  char(onames(o)) "-1.wav"]);
+      [capsule, Fs] = wavread(["../data/2016.07.26/export/capsule-" sprintf("%02.0f", m) "-"  char(onames(o)) "-1.wav"]);
 
       %% indexes in array for frequency bins
       imin = round((N/2) * fmin / (Fs/2));

+ 1 - 1
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(["../cal/2016.04.20/export/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+    cs(c,:) = wavread(["../data/2016.08.03/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);

+ 2 - 2
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('../cal/2016.04.20/export/reference-001-1.wav');
+  [ref, Fs] = wavread('../data/2016.08.03/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, ["../cal/2016.04.20/export/b-format-" sprintf("%02.0f", m) ".wav"]);
+    wavwrite(reshape(bf(m,:,:),4,[])' / 256, Fs, 32, ["../data/2016.08.03/bf/b-format-" sprintf("%02.0f", m) ".wav"]);
 
     %% plot if requested
     if (plot_on != 0)

+ 1 - 1
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('../cal/2016.04.20/export/reference-001-1.wav');
+  [ref, Fs] = wavread('../data/2016.08.03/ref/reference-001-1.wav');
   %% find highest peak location and define sample range
   [index, value] = findmaxpeak(ref);
   r_start = index - Npre;