Parcourir la source

calibration: read calibrated A format files instead of original files

Fernando Pablo Lopez-Lezcano il y a 9 ans
Parent
commit
1ec5a8ceea

+ 3 - 2
calibration/src/sphear_af_power.m

@@ -1,3 +1,4 @@
+%% -*- mode: octave -*-
 %%
 %% *SpHEAR Project
 %%
@@ -52,8 +53,8 @@ function [R Fs] = sphear_af_power(measurements, fmin, fmax, Nfft)
       %% this is only valid for the frequency range covered by the test speaker,
       %% anything outside is undefined
       %%
-      capsule = wavread(["../data/current/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
-      equalized = fft(capsule, Nfft) ./ ref_fft;
+      capsule = wavread(["../data/current/af/a-format-cal-" sprintf("%03d", m) "-" char(capnames(c)) ".wav"]);
+      equalized = fft(capsule, Nfft);
       
       %% 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));

+ 3 - 3
calibration/src/sphear_common.m

@@ -25,7 +25,7 @@
 
 pkg load signal;
 
-%% Render a capsule impulse response through the FIR filter A2B matrix
+%% Render a calibrated capsule impulse response through the FIR filter A2B matrix
 %%
 %% m: number of measurement to render
 %% FIR: matrix of A2B FIR filters
@@ -33,9 +33,9 @@ pkg load signal;
 
 function [bf] = sphear_a_to_b(m, FIR, Nfft);
   capnames = cellstr(['LF'; 'RF'; 'LB'; 'RB']);
-  %% read in capsule signals and apply FIR filter
+  %% read in calibrated capsule signals and apply FIR filter
   for c = 1:4
-    cs(c,:) = wavread(["../data/current/af/a-format-0" sprintf("%02.0f", m) "-" char(capnames(c)) ".wav"]);
+    cs(c,:) = wavread(["../data/current/af/a-format-cal-" sprintf("%03d", m) "-" char(capnames(c)) ".wav"]);
     for b = 1:4
       %% we add trailing zeros to let the filter ring
       bs(c,b,:) = fftfilt(reshape(FIR(b,c,:), 1, [])', cat(1, cs(c,:)', zeros(2*size(FIR(1,1,:))(3),1))', Nfft);

+ 0 - 3
calibration/src/sphear_fir_design.m

@@ -233,9 +233,6 @@ function [FIR] = sphear_fir_design(F, A2BF, n, maxboost, Fs, Fl, plot_on, W, X,
       fl = [0 F(1:dlast-1)']' ./ (Fs/2);
       rl = [A2BF(1,c,b) A2BF(1:dlast-1,c,b)']';
 
-%%      fh = [F(dlast:end)' Fs/2]' ./ (Fs/2);
-%%      rh = [A2BF(dlast:end,c,b)' A2BF(end,c,b)]';
-
       %% concatenate low and high frequency arrays
       fi = cat(1, fl, fh(istart:end));
       ri = cat(1, rl, rh(istart:end));