|
@@ -28,7 +28,10 @@
|
|
|
%% You should have received a copy of the GNU General Public License
|
|
%% You should have received a copy of the GNU General Public License
|
|
|
%% along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
%% 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
|
|
%% the measurement from the reference microphone is processed through
|
|
|
%% DRC (Digital Room Correction) to create a convolution kernel that is
|
|
%% DRC (Digital Room Correction) to create a convolution kernel that is
|
|
|
%% used to equalize the measurements
|
|
%% used to equalize the measurements
|
|
@@ -62,11 +65,11 @@ function [] = sphear_af_calibrate(measurements, keep, fade);
|
|
|
%% read in capsule signal and normalize it
|
|
%% read in capsule signal and normalize it
|
|
|
for c = 1:4
|
|
for c = 1:4
|
|
|
printf("processing capsule %d\n", c);
|
|
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);
|
|
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);
|
|
printf("end capsule %d\n", c);
|
|
|
end
|
|
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
|
|
|
end
|
|
end
|