Improving i/o var handling of ita HOA A format to B format converter, now...

Improving i/o var handling of ita HOA A format to B format converter, now accepting 4 single channels both as in and out variables
parent 12e9daac
function [bformat] = ita_hoa_a2bFormat(varargin)
%ITA_HOA_A2BFORMAT Converts an A-Format recording to B-Format
%FLU,FRD,BLD,BRU
% Detailed explanation goes here
function [ varargout ] = ita_hoa_a2bFormat(varargin)
%ITA_HOA_A2BFORMAT Converts an A-Format recording to B-Format
%
% Input and requested output can be four-track multi-channel itaAudio or 4 single-channel
% itaAudio objects.
%
% Channel assignment incoming: FLU, FRD, BLD, BRU
% Back Right Up (BRU);
% Front Left Up (FLU);
% Front Right Down (FRD);
% Back Left Down (BLD);
%
% Channel assignment outgoing: W, X, Y, Z
%
if nargin == 4
FLU=varargin{1};
FRD=varargin{2};
......@@ -16,6 +22,7 @@ elseif nargin == 1
FRD=varargin{1}.ch(2);
BLD=varargin{1}.ch(3);
BRU=varargin{1}.ch(4);
assert( varargin{1}.nChannels == 4 )
else
error('Need 4 channel input or 4 inputs');
end
......@@ -36,6 +43,12 @@ switch type
Z = -FLD+FRU+BLU-BRD;
end
bformat = ita_merge(W,X,Y,Z);
if nargout == 1
varargout{ 1 } = ita_merge(W,X,Y,Z);
else
varargout{ 1 } = W;
varargout{ 2 } = X;
varargout{ 3 } = Y;
varargout{ 4 } = Z;
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment