Home > SUpDEq-v5.0.0 > supdeq_fliege.m

supdeq_fliege

PURPOSE ^

% SUpDEq - Spatial Upsampling by Directional Equalization

SYNOPSIS ^

function [gridData, Npoints, Nmax] = supdeq_fliege(N)

DESCRIPTION ^

% SUpDEq - Spatial Upsampling by Directional Equalization

 function [gridData, Npoints, Nmax] = supdeq_fliege(N)

 This function returns a Fliege sampling grid with azimuth and elevation
 in degree plus the respective sampling weights.

 Output:
 gridData      - Q x 3 matrix where the first column holds the azimuth, the 
                 second the elevation, and the third the sampling weights.
 Npoints       - Total number of sampling points / nodes [(N+1)^2]
 Nmax          - Highest stable grid order  

 Input:
 N             - Spatial order of the Fliege grid. 

 Dependencies: -

 (C) 2018 by JMA, Johannes M. Arend
             TH Köln - University of Applied Sciences
             Institute of Communications Engineering
             Department of Acoustics and Audio Signal Processing

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% SUpDEq - Spatial Upsampling by Directional Equalization
0002 %
0003 % function [gridData, Npoints, Nmax] = supdeq_fliege(N)
0004 %
0005 % This function returns a Fliege sampling grid with azimuth and elevation
0006 % in degree plus the respective sampling weights.
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 % Npoints       - Total number of sampling points / nodes [(N+1)^2]
0012 % Nmax          - Highest stable grid order
0013 %
0014 % Input:
0015 % N             - Spatial order of the Fliege grid.
0016 %
0017 % Dependencies: -
0018 %
0019 % (C) 2018 by JMA, Johannes M. Arend
0020 %             TH Köln - University of Applied Sciences
0021 %             Institute of Communications Engineering
0022 %             Department of Acoustics and Audio Signal Processing
0023 
0024 function [gridData, Npoints, Nmax] = supdeq_fliege(N)
0025 
0026 if nargin == 0
0027     error('Please specify the desired spatial order N!');
0028 elseif N <= 0
0029     error('Sorry, but N >= 1 is mandatory');
0030 elseif N > 29
0031     error('Sorry, but we only have Fliege grids up to N = 29');
0032 else
0033     % Load nodes from materials
0034     % Nodes copied from "Spherical Harmonic Transform Library" by Archontis
0035     % Politis, http://research.spa.aalto.fi/projects/sht-lib/sht.html
0036     load('fliegeMaierNodes_1_30.mat');
0037     
0038     cartCoord = fliegeNodes{N+1}(:,1:3);
0039     [gridData(:,1), gridData(:,2)] = cart2sph(cartCoord(:,1), cartCoord(:,2), cartCoord(:,3));
0040     %Weights
0041     w = fliegeNodes{N+1}(:,4);
0042     w = w/sum(w);
0043     gridData(:,3) = w;
0044     
0045     %Convert from rad 2 deg
0046     gridData(:,1:2) = gridData(:,1:2)*180/pi;
0047     
0048     %Transform to SUpDEq coordinate system
0049     az = gridData(:,1);
0050     az(az<0)=az(az<0)+360;
0051     gridData(:,1) = az;
0052     gridData(:,2) = 90-gridData(:,2);
0053     
0054     %Write other variables
0055     Npoints = size(gridData,1);
0056     Nmax = N;
0057     
0058 end
0059 
0060 end
0061

Generated on Wed 30-Nov-2022 14:15:00 by m2html © 2005