ソースを参照

remove extra W scaling, attenuate signal so match existing A2B recording

Fernando Pablo Lopez-Lezcano 10 年 前
親
コミット
afbcf5d060
1 ファイル変更、9 行追加、3 行削除
  1. 9 3
      sphear_a2b_soundfile.m

+ 9 - 3
sphear_a2b_soundfile.m

@@ -3,9 +3,15 @@
 %% sphear_a2b_soundfile: read in A format soundfiles and render B format outputs
 %%
 %% usage:
-%%   [] = sphear_a2b_soundfile(FIR)
+%%   [] = sphear_a2b_soundfile(FIR, ifile, ofile, start, duration, Fs, Nfft)
 %%
 %% FIR: A2B matrix of FIR filters
+%% ifile: input soundfile (first four channels are the A-format signal)
+%% ofile: output soundfile, currently ignored
+%% start: start time in seconds from the beginning of the file
+%% duration: duration in seconds of processed segment
+%% Fs: sampling rate
+%% Nfft: size of the FFT used to do the filtering
 %%
 %% Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
 %% nando@ccrma.stanford.edu
@@ -48,7 +54,7 @@ function [BF] = sphear_a2b_soundfile(FIR, ifile, ofile, start, duration, Fs, Nff
   y4 = fftfilt(reshape(FIR(3,4,:), 1, [])', AF(:,4), Nfft);
   z4 = fftfilt(reshape(FIR(4,4,:), 1, [])', AF(:,4), Nfft);
 
-  wc = (w1 + w2 + w3 + w4) ./ (2 * sqrt(2)/2);
+  wc = (w1 + w2 + w3 + w4) ./ (sqrt(2)/2);
   xc = (x1 + x2 + x3 + x4);
   yc = (y1 + y2 + y3 + y4);
   zc = (z1 + z2 + z3 + z4);
@@ -58,7 +64,7 @@ function [BF] = sphear_a2b_soundfile(FIR, ifile, ofile, start, duration, Fs, Nff
   BF(:,3) = yc;
   BF(:,4) = zc;
 
-  att = 0.01;
+  att = 0.005;
   wavwrite(BF * att, Fs, 32, ["mattness-b-format-w.wav"]);
   
 end