Commit 45b44ebb authored by emerit's avatar emerit
Browse files

add support old version of matlab

parent c44545cd
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@ classdef data_SOFA < handle

        function obj = get_hrf_itd(obj)
            % Load the SOFA file
            if verLessThan('matlab', '10.0')
                meas = SOFAload(fullfile(obj.info.folderNameOnset,'..',obj.info.fileNameHrf));
            else
                netcdf.inqLibVers;
                sf = py.sofar.read_sofa(fullfile(obj.info.folderNameOnset,'..',obj.info.fileNameHrf));
                meas.ListenerPosition = double(py.array.array('d', py.numpy.nditer(sf.ListenerPosition)));
@@ -92,6 +95,7 @@ classdef data_SOFA < handle
                dim = double(py.array.array('d', sf.Data_IR.shape));
                data = double(py.array.array('d', py.numpy.nditer(sf.Data_IR))); 
                meas.Data.IR = permute(reshape(data,fliplr(dim)), [3 2 1]);
            end
            
            obj.info.listenerPosition = meas.ListenerPosition;
            obj.info.listenerView = meas.ListenerView;