% SUpDEq - Spatial Upsampling by Directional Equalization function gridData = supdeq_uniform(numOfSP) This function returns a uniform sampling grid based on a random normal distribution of 'numOfSP' directions Output: gridData - Q x 3 matrix where the first column holds the azimuth, the second the elevation, and the third the sampling weights. Input: numOfSP - Number of sampling points / nodes. Call supdeq_lebedev() to get a list of valid numbers. 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 gridData = supdeq_uniform(numOfSP) 0004 % 0005 % This function returns a uniform sampling grid based on a random normal 0006 % distribution of 'numOfSP' directions 0007 % 0008 % Output: 0009 % gridData - Q x 3 matrix where the first column holds the azimuth, the 0010 % second the elevation, and the third the sampling weights. 0011 % 0012 % Input: 0013 % numOfSP - Number of sampling points / nodes. 0014 % Call supdeq_lebedev() to get a list of valid numbers. 0015 % 0016 % Dependencies: - 0017 % 0018 % (C) 2020 by JMA, Johannes M. Arend 0019 % TH Köln - University of Applied Sciences 0020 % Institute of Communications Engineering 0021 % Department of Acoustics and Audio Signal Processing 0022 0023 function gridData = supdeq_uniform(numOfSP) 0024 0025 sp = randn(numOfSP,3); 0026 sp = bsxfun(@rdivide,sp,sqrt(sum(sp.^2,2))); 0027 0028 [az,el,~] = cart2sph(sp(:,1),sp(:,2),sp(:,3)); 0029 az = az/pi*180; az = mod(az,360); 0030 el = el/pi*180; el = 90-el; 0031 w = ones(numOfSP,1)*(1/numOfSP); 0032 gridData = [az,el,w]; 0033 0034 end 0035