فهرست منبع

calibration: add code to process several horizontal layers of measurements

Fernando Pablo Lopez-Lezcano 8 سال پیش
والد
کامیت
64907233f5
1فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 7 4
      calibration/src/sphear_af_calibrate.m

+ 7 - 4
calibration/src/sphear_af_calibrate.m

@@ -28,7 +28,10 @@
 %%  You should have received a copy of the GNU General Public License
 %%  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-function [] = sphear_af_calibrate(measurements, keep, fade);
+function [] = sphear_af_calibrate(measurements, keep, fade, suffix);
+  if (! exist("suffix"))
+    suffix = "";
+  end
   %% the measurement from the reference microphone is processed through
   %% DRC (Digital Room Correction) to create a convolution kernel that is
   %% used to equalize the measurements
@@ -62,11 +65,11 @@ function [] = sphear_af_calibrate(measurements, keep, fade);
     %% read in capsule signal and normalize it
     for c = 1:4
       printf("processing capsule %d\n", c);
-      sig = wavread(["../data/current/af/a-format-" sprintf("%03d", m) "-" char(capnames(c)) ".wav"]);
+      sig = wavread(["../data/current/af/a-format-" sprintf("%s%03d", suffix, m) "-" char(capnames(c)) ".wav"]);
       cal_sig(:,c) = conv(trunc, sig);
-      wavwrite(cal_sig(:,c), Fs, ["../data/current/af/a-format-cal-" sprintf("%03d", m) "-" char(capnames(c)) ".wav"]);
+      wavwrite(cal_sig(:,c), Fs, ["../data/current/af/a-format-cal-" sprintf("%s%03d", suffix, m) "-" char(capnames(c)) ".wav"]);
       printf("end capsule %d\n", c);
     end
-    wavwrite(cal_sig, Fs, ["../data/current/af/a-format-cal-" sprintf("%03d", m) ".wav"]);
+    wavwrite(cal_sig, Fs, ["../data/current/af/a-format-cal-" sprintf("%s%03d", suffix, m) ".wav"]);
   end
 end