1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
/*############################################################################*/
/*# #*/
/*# Ambisonic C++ Library #*/
/*# CAmbisonicSpeaker - Ambisonic Speaker #*/
/*# Copyright © 2017 Videolabs #*/
/*# #*/
/*# Filename: AmbisonicSpeaker.cpp #*/
/*# Version: 0.1 #*/
/*# Date: March 2017 #*/
/*# Author(s): Peter Stitt #*/
/*# Licence: LGPL (+ Proprietary) #*/
/*# #*/
/*############################################################################*/
#include <cstdint>
const int16_t first_order_3D[][101] =
{
{3,3,3,3,3,3,3,3,3,3,3,2,2,1,0,-1,-3,-5,-7,-10,-13,-17,-21,-25,-30,-35,-41,-47,-54,-60,-67,-75,-82,-90,-97,-105,-113,-120,-127,-134,-141,-147,-153,-158,-163,-167,-170,-173,-175,-176,23040,-176,-175,-173,-170,-167,-163,-158,-153,-147,-141,-134,-127,-120,-113,-105,-97,-90,-82,-75,-67,-60,-54,-47,-41,-35,-30,-25,-21,-17,-13,-10,-7,-5,-3,-1,0,1,2,2,3,3,3,3,3,3,3,3,3,3,3},
{-2,-2,-2,-2,-2,-2,-2,-3,-2,-2,-2,-2,-2,-1,-1,0,1,2,3,5,7,9,11,14,16,19,23,26,30,34,38,42,46,51,55,60,64,68,73,77,80,84,87,90,93,95,97,99,100,101,13438,101,100,99,97,95,93,90,87,84,80,77,73,68,64,60,55,51,46,42,38,34,30,26,23,19,16,14,11,9,7,5,3,2,1,0,-1,-1,-2,-2,-2,-2,-2,-3,-2,-2,-2,-2,-2,-2,-2}
};
const int16_t second_order_3D[][101] =
{
{-5,-5,-6,-6,-7,-7,-7,-7,-7,-6,-5,-3,-1,2,6,10,15,21,26,32,38,44,49,53,55,56,54,50,42,32,19,2,-19,-43,-70,-100,-133,-167,-203,-241,-278,-315,-350,-384,-414,-442,-465,-484,-497,-506,25438,-506,-497,-484,-465,-442,-414,-384,-350,-315,-278,-241,-203,-167,-133,-100,-70,-43,-19,2,19,32,42,50,54,56,55,53,49,44,38,32,26,21,15,10,6,2,-1,-3,-5,-6,-7,-7,-7,-7,-7,-6,-6,-5,-5},
{-2,-2,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2,-1,0,2,4,6,8,10,12,15,17,19,20,21,21,21,19,16,12,7,0,-8,-17,-27,-39,-52,-65,-79,-94,-108,-123,-136,-149,-161,-172,-181,-188,-194,-197,19884,-197,-194,-188,-181,-172,-161,-149,-136,-123,-108,-94,-79,-65,-52,-39,-27,-17,-8,0,7,12,16,19,21,21,21,20,19,17,15,12,10,8,6,4,2,0,-1,-2,-2,-3,-3,-3,-3,-3,-3,-3,-3,-2,-2},
{2,3,3,3,3,4,4,4,4,3,2,1,0,-2,-4,-7,-10,-14,-17,-21,-25,-28,-31,-34,-35,-36,-35,-32,-27,-21,-12,-2,11,26,43,62,82,104,127,150,173,196,219,240,259,276,290,302,311,316,10659,316,311,302,290,276,259,240,219,196,173,150,127,104,82,62,43,26,11,-2,-12,-21,-27,-32,-35,-36,-35,-34,-31,-28,-25,-21,-17,-14,-10,-7,-4,-2,0,1,2,3,4,4,4,4,3,3,3,3,2}
};
const int16_t third_order_3D[][101] =
{
{1,3,4,5,6,8,8,8,8,7,5,1,-3,-8,-15,-21,-28,-34,-38,-41,-41,-38,-31,-20,-5,13,33,56,78,99,117,130,136,133,120,95,57,8,-54,-126,-206,-294,-384,-476,-564,-646,-718,-778,-823,-850,26604,-850,-823,-778,-718,-646,-564,-476,-384,-294,-206,-126,-54,8,57,95,120,133,136,130,117,99,78,56,33,13,-5,-20,-31,-38,-41,-41,-38,-34,-28,-21,-15,-8,-3,1,5,7,8,8,8,8,6,5,4,3,1},
{1,2,2,3,4,5,5,5,5,4,3,1,-2,-6,-10,-14,-18,-22,-25,-27,-27,-25,-20,-13,-4,8,22,36,51,65,77,85,89,87,78,62,37,5,-35,-82,-135,-192,-252,-311,-369,-423,-470,-509,-538,-556,23082,-556,-538,-509,-470,-423,-369,-311,-252,-192,-135,-82,-35,5,37,62,78,87,89,85,77,65,51,36,22,8,-4,-13,-20,-25,-27,-27,-25,-22,-18,-14,-10,-6,-2,1,3,4,5,5,5,5,4,3,2,2,1},
{0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2,-2,-1,-1,0,1,1,2,3,4,4,4,4,4,3,1,0,-2,-5,-8,-11,-14,-17,-20,-23,-25,-27,-29,-30,16773,-30,-29,-27,-25,-23,-20,-17,-14,-11,-8,-5,-2,0,1,3,4,4,4,4,4,3,2,1,1,0,-1,-1,-2,-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0},
{-2,-3,-4,-5,-6,-6,-7,-7,-7,-6,-4,-2,1,5,10,15,19,24,27,29,29,27,22,14,3,-10,-25,-42,-58,-74,-87,-96,-101,-98,-88,-70,-43,-7,38,91,150,214,280,347,412,472,525,568,601,621,8977,621,601,568,525,472,412,347,280,214,150,91,38,-7,-43,-70,-88,-98,-101,-96,-87,-74,-58,-42,-25,-10,3,14,22,27,29,29,27,24,19,15,10,5,1,-2,-4,-6,-7,-7,-7,-6,-6,-5,-4,-3,-2}
};
const int16_t first_order_2D[][101] =
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,-1,-2,-3,-4,-5,-7,-9,-10,-13,-15,-18,-21,-24,-27,-30,-34,-37,-41,-45,-49,-52,-56,-60,-63,-67,-70,-73,-76,-79,-81,-83,-85,-86,-87,-88,19968,-88,-87,-86,-85,-83,-81,-79,-76,-73,-70,-67,-63,-60,-56,-52,-49,-45,-41,-37,-34,-30,-27,-24,-21,-18,-15,-13,-10,-9,-7,-5,-4,-3,-2,-1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1},
{-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,0,1,1,2,4,5,7,8,10,12,15,17,20,23,26,29,32,35,39,42,46,49,52,55,58,61,64,67,69,71,73,74,76,76,77,14259,77,76,76,74,73,71,69,67,64,61,58,55,52,49,46,42,39,35,32,29,26,23,20,17,15,12,10,8,7,5,4,2,1,1,0,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2}
};
const int16_t second_order_2D[][101] =
{
{-3,-3,-3,-3,-4,-4,-4,-4,-4,-3,-3,-2,-1,1,3,5,7,10,13,16,19,22,24,26,27,28,27,25,21,16,9,1,-10,-22,-35,-50,-67,-84,-102,-121,-139,-158,-176,-192,-208,-222,-233,-243,-249,-254,20905,-254,-249,-243,-233,-222,-208,-192,-176,-158,-139,-121,-102,-84,-67,-50,-35,-22,-10,1,9,16,21,25,27,28,27,26,24,22,19,16,13,10,7,5,3,1,-1,-2,-3,-3,-4,-4,-4,-4,-4,-3,-3,-3,-3},
{-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1,-1,0,1,2,3,4,5,6,8,9,10,10,11,11,11,10,8,6,3,0,-4,-9,-15,-21,-28,-35,-42,-50,-58,-65,-72,-79,-86,-91,-96,-100,-103,-104,18220,-104,-103,-100,-96,-91,-86,-79,-72,-65,-58,-50,-42,-35,-28,-21,-15,-9,-4,0,3,6,8,10,11,11,11,10,10,9,8,6,5,4,3,2,1,0,-1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-1,-1},
{2,2,3,3,3,3,4,4,3,3,2,1,0,-2,-4,-7,-10,-13,-17,-20,-24,-27,-30,-33,-34,-34,-33,-31,-26,-20,-12,-2,11,25,41,59,79,100,122,144,166,189,210,230,249,265,279,290,298,303,10885,303,298,290,279,265,249,230,210,189,166,144,122,100,79,59,41,25,11,-2,-12,-20,-26,-31,-33,-34,-34,-33,-30,-27,-24,-20,-17,-13,-10,-7,-4,-2,0,1,2,3,3,4,4,3,3,3,3,2,2}
};
const int16_t third_order_2D[][101] =
{
{0,1,2,2,3,3,4,4,4,3,2,0,-2,-4,-7,-10,-13,-16,-18,-20,-20,-18,-15,-10,-3,6,16,26,37,47,56,62,64,63,57,45,27,3,-26,-60,-98,-140,-183,-226,-268,-307,-342,-370,-391,-404,21262,-404,-391,-370,-342,-307,-268,-226,-183,-140,-98,-60,-26,3,27,45,57,63,64,62,56,47,37,26,16,6,-3,-10,-15,-18,-20,-20,-18,-16,-13,-10,-7,-4,-2,0,2,3,4,4,4,3,3,2,2,1,0},
{0,1,1,1,2,2,2,2,2,2,1,0,-1,-3,-5,-7,-9,-11,-13,-14,-14,-13,-10,-7,-2,4,10,18,25,32,38,42,44,43,39,30,18,2,-18,-41,-68,-96,-126,-155,-184,-211,-234,-254,-268,-277,19741,-277,-268,-254,-234,-211,-184,-155,-126,-96,-68,-41,-18,2,18,30,39,43,44,42,38,32,25,18,10,4,-2,-7,-10,-13,-14,-14,-13,-11,-9,-7,-5,-3,-1,0,1,2,2,2,2,2,2,1,1,1,0},
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,1,2,2,3,3,4,4,3,3,1,0,-2,-4,-6,-8,-10,-12,-14,-14,-14,-12,-10,-6,-1,5,12,20,29,38,47,56,64,71,77,82,84,15409,84,82,77,71,64,56,47,38,29,20,12,5,-1,-6,-10,-12,-14,-14,-14,-12,-10,-8,-6,-4,-2,0,1,3,3,4,4,3,3,2,2,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{-2,-3,-4,-5,-6,-6,-7,-7,-7,-6,-4,-2,1,5,10,15,20,24,27,29,29,27,22,14,3,-10,-25,-42,-58,-74,-87,-97,-101,-99,-89,-71,-43,-7,39,92,151,215,282,350,415,475,528,572,605,625,8926,625,605,572,528,475,415,350,282,215,151,92,39,-7,-43,-71,-89,-99,-101,-97,-87,-74,-58,-42,-25,-10,3,14,22,27,29,29,27,24,20,15,10,5,1,-2,-4,-6,-7,-7,-7,-6,-6,-5,-4,-3,-2},
};
|