|
@@ -3,9 +3,15 @@
|
|
|
%% sphear_a2b_soundfile: read in A format soundfiles and render B format outputs
|
|
%% sphear_a2b_soundfile: read in A format soundfiles and render B format outputs
|
|
|
%%
|
|
%%
|
|
|
%% usage:
|
|
%% usage:
|
|
|
-%% [] = sphear_a2b_soundfile(FIR)
|
|
|
|
|
|
|
+%% [] = sphear_a2b_soundfile(FIR, ifile, ofile, start, duration, Fs, Nfft)
|
|
|
%%
|
|
%%
|
|
|
%% FIR: A2B matrix of FIR filters
|
|
%% 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
|
|
%% Copyright 2016, Fernando Lopez-Lezcano, All Rights Reserved
|
|
|
%% nando@ccrma.stanford.edu
|
|
%% 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);
|
|
y4 = fftfilt(reshape(FIR(3,4,:), 1, [])', AF(:,4), Nfft);
|
|
|
z4 = fftfilt(reshape(FIR(4,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);
|
|
xc = (x1 + x2 + x3 + x4);
|
|
|
yc = (y1 + y2 + y3 + y4);
|
|
yc = (y1 + y2 + y3 + y4);
|
|
|
zc = (z1 + z2 + z3 + z4);
|
|
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(:,3) = yc;
|
|
|
BF(:,4) = zc;
|
|
BF(:,4) = zc;
|
|
|
|
|
|
|
|
- att = 0.01;
|
|
|
|
|
|
|
+ att = 0.005;
|
|
|
wavwrite(BF * att, Fs, 32, ["mattness-b-format-w.wav"]);
|
|
wavwrite(BF * att, Fs, 32, ["mattness-b-format-w.wav"]);
|
|
|
|
|
|
|
|
end
|
|
end
|