% SUpDEq - Spatial Upsampling by Directional Equalization function ild = supdeq_calcILD( hrir ) This function calculates the ILD (Interaural Level Difference) of a HRIR Output: ild - ILD of the HRIR in dB Input: hrir - [N x 2] HRIR with N samples and 2 channels Dependencies: - (C) 2020 by JMA, Johannes M. Arend TH Köln - University of Applied Sciences Institute of Communications Engineering Department of Acoustics and Audio Signal Processing
0001 %% SUpDEq - Spatial Upsampling by Directional Equalization 0002 % 0003 % function ild = supdeq_calcILD( hrir ) 0004 % 0005 % This function calculates the ILD (Interaural Level Difference) of a HRIR 0006 % 0007 % Output: 0008 % ild - ILD of the HRIR in dB 0009 % 0010 % Input: 0011 % hrir - [N x 2] HRIR with N samples and 2 channels 0012 % 0013 % Dependencies: - 0014 % 0015 % 0016 % (C) 2020 by JMA, Johannes M. Arend 0017 % TH Köln - University of Applied Sciences 0018 % Institute of Communications Engineering 0019 % Department of Acoustics and Audio Signal Processing 0020 0021 function ild = supdeq_calcILD( hrir ) 0022 0023 %Check type of array 0024 if size(hrir,2) > size(hrir,1) 0025 hrir = hrir.'; 0026 end 0027 0028 %Calculate ILD 0029 ild = 10*log10(sum(abs(hrir(:,1).^2))/sum(abs(hrir(:,2).^2))); 0030 0031 end