Commit 6fcc3f82 authored by Jouni Paulus's avatar Jouni Paulus
Browse files

update parambin binary table creation to omit dependency from external sofa...

update parambin binary table creation to omit dependency from external sofa reader and use interally provided cldfb coefficients: remove explicit cldfb_prototype.mat, separate get_cldfb_filter() from fir_to_cldfb_fir.m and use that instead, expose internal data needed by the parambin conversion routines from hrtf_library_loader. update copyright header year.
parent f1810bde
Loading
Loading
Loading
Loading
+0 −133
Original line number Diff line number Diff line
@@ -169,136 +169,3 @@ set(gca,'xlim',[1,num_samples])
fprintf('SNR: %.1f dB \n', 10*log10(sum(y1.^2)/sum((y1-y2).^2)));
legend('time domain','CLDFB domain','difference')
title('Filtered noise')

function [h, D, S, L] = get_cldfb_filter()
% const float LDQMF_60[] in \lib_com\rom_com.c, line 5219 
S = 60; % stride
L = 60; % frequency bands
D = 240 + S - 1; % system delay
h = [
   0.0000953076,  0.0001230230,  0.0001279964,  0.0001260533,  0.0001211219 
   0.0001122123,  0.0001010860,  0.0000876540,  0.0000719883,  0.0000545472 
   0.0000352143,  0.0000145686, -0.0000074264, -0.0000303788, -0.0000539205 
  -0.0000782743, -0.0001028838, -0.0001275374, -0.0001520015, -0.0001760167 
  -0.0001997108, -0.0002226708, -0.0002446725, -0.0002655797, -0.0002852145 
  -0.0003034996, -0.0003203036, -0.0003356283, -0.0003493345, -0.0003614030 
  -0.0003719004, -0.0003807641, -0.0003881051, -0.0003939842, -0.0003985357 
  -0.0004019095, -0.0004041938, -0.0004056677, -0.0004065430, -0.0004069925 
  -0.0004072535, -0.0004075877, -0.0004083676, -0.0004098394, -0.0004122990 
  -0.0004160839, -0.0004214063, -0.0004285777, -0.0004378651, -0.0004495422 
  -0.0004637682, -0.0004806494, -0.0005003878, -0.0005231378, -0.0005489803 
  -0.0005777747, -0.0006095612, -0.0006443121, -0.0006813223, -0.0007226231 
  -0.0007722576, -0.0008268412, -0.0008839625, -0.0009417336, -0.0010004630 
  -0.0010601623, -0.0011206097, -0.0011817788, -0.0012432419, -0.0013045983 
  -0.0013656860, -0.0014260965, -0.0014855355, -0.0015435946, -0.0015999591 
  -0.0016543545, -0.0017062968, -0.0017554691, -0.0018015467, -0.0018441341 
  -0.0018829798, -0.0019177221, -0.0019480695, -0.0019736972, -0.0019943134 
  -0.0020097434, -0.0020197174, -0.0020240925, -0.0020226294, -0.0020152442 
  -0.0020017736, -0.0019820682, -0.0019561697, -0.0019240153, -0.0018855907 
  -0.0018409232, -0.0017900462, -0.0017330211, -0.0016699535, -0.0016009507 
  -0.0015261442, -0.0014456788, -0.0013597424, -0.0012685407, -0.0011722331 
  -0.0010710671, -0.0009652392, -0.0008549765, -0.0007405236, -0.0006221444 
  -0.0005001140, -0.0003745670, -0.0002458634, -0.0001142541,  0.0000199491 
   0.0001564174,  0.0002949402,  0.0004350246,  0.0005769439,  0.0007203126 
  -0.0008803223, -0.0010328424, -0.0011841310, -0.0013346316, -0.0014848098 
  -0.0016343417, -0.0017832819, -0.0019316213, -0.0020790498, -0.0022252349 
  -0.0023701149, -0.0025136294, -0.0026556554, -0.0027960713, -0.0029348312 
  -0.0030717771, -0.0032068293, -0.0033399195, -0.0034709862, -0.0035999804 
  -0.0037267797, -0.0038513308, -0.0039736414, -0.0040935921, -0.0042111278 
  -0.0043262239, -0.0044388464, -0.0045489701, -0.0046565188, -0.0047614835 
  -0.0048637423, -0.0049632201, -0.0050599808, -0.0051539382, -0.0052450863 
  -0.0053333500, -0.0054187514, -0.0055012843, -0.0055808770, -0.0056575472 
  -0.0057313135, -0.0058021732, -0.0058701355, -0.0059352517, -0.0059975707 
  -0.0060571772, -0.0061141332, -0.0061685541, -0.0062205540, -0.0062703062 
  -0.0063179093, -0.0063635921, -0.0064075105, -0.0064498796, -0.0064908965 
  -0.0065308069, -0.0065698619, -0.0066083665, -0.0066466411, -0.0066849431 
  -0.0067233290, -0.0067621553, -0.0068021296, -0.0068436749, -0.0068870094 
  -0.0069324085, -0.0069801519, -0.0070305937, -0.0070840055, -0.0071406048 
  -0.0072006541, -0.0072644479, -0.0073321410, -0.0074039386, -0.0074799177 
  -0.0075602704, -0.0076450342, -0.0077342330, -0.0078278277, -0.0079257628 
  -0.0080279401, -0.0081341872, -0.0082442267, -0.0083577875, -0.0084744738 
  -0.0085938899, -0.0087156557, -0.0088391500, -0.0089637861, -0.0090888245 
  -0.0092134504, -0.0093367994, -0.0094579896, -0.0095760096, -0.0096898535 
  -0.0097982995, -0.0099003557, -0.0099947909, -0.0100801717, -0.0101551116 
  -0.0102182031, -0.0102678994, -0.0103026126, -0.0103207529, -0.0103206923 
  -0.0103006857, -0.0102590285, -0.0101939747, -0.0101036867, -0.0099863587 
  -0.0098401112, -0.0096632261, -0.0094537362, -0.0092098210, -0.0089295702 
  -0.0086111929, -0.0082527259, -0.0078523541, -0.0074084769, -0.0069190590 
   0.0063841688,  0.0057985946,  0.0051621343,  0.0044734711,  0.0037309236 
   0.0029329660,  0.0020781513,  0.0011651339,  0.0001925042, -0.0008409545 
  -0.0019364181, -0.0030950012, -0.0043176264, -0.0056051607, -0.0069584334 
  -0.0083780792, -0.0098646237, -0.0114185056, -0.0130400723, -0.0147295250 
  -0.0164868534, -0.0183120724, -0.0202049762, -0.0221651513, -0.0241921283 
  -0.0262852497, -0.0284437388, -0.0306666382, -0.0329528190, -0.0353010744 
  -0.0377098918, -0.0401776619, -0.0427025780, -0.0452826768, -0.0479161367 
  -0.0506004691, -0.0533332452, -0.0561118126, -0.0589331910, -0.0617944039 
  -0.0646922663, -0.0676232576, -0.0705836788, -0.0735698044, -0.0765774846 
  -0.0796026587, -0.0826408863, -0.0856874809, -0.0887378305, -0.0917868018 
  -0.0948293805, -0.0978601947, -0.1008738130, -0.1038645208, -0.1068264544 
  -0.1097536832, -0.1126400903, -0.1154794544, -0.1182654947, -0.1209914312 
  -0.1236500666, -0.1262341589, -0.1287376434, -0.1311538219, -0.1334753036 
  -0.1356947273, -0.1378047168, -0.1397978216, -0.1416664869, -0.1434033662 
  -0.1450008005, -0.1464512348, -0.1477471888, -0.1488809884, -0.1498452872 
  -0.1506324410, -0.1512351334, -0.1516460329, -0.1518578976, -0.1518635303 
  -0.1516559124, -0.1512281001, -0.1505732536, -0.1496847868, -0.1485562176 
  -0.1471813470, -0.1455538720, -0.1436681300, -0.1415183097, -0.1390990764 
  -0.1364052594, -0.1334318966, -0.1301742792, -0.1266280264, -0.1227891371 
  -0.1186537445, -0.1142183766, -0.1094799563, -0.1044355705, -0.0990828425 
  -0.0934195668, -0.0874440819, -0.0811550021, -0.0745511875, -0.0676321834 
  -0.0603975877, -0.0528475679, -0.0449828543, -0.0368040986, -0.0283128861 
  -0.0195108838, -0.0104003223, -0.0009837818,  0.0087356847,  0.0187546927 
   0.0290693250,  0.0396753438,  0.0505682528,  0.0617432520,  0.0731955394 
  -0.0849232078, -0.0969054326, -0.1091460735, -0.1216373071, -0.1343720406 
  -0.1473424733, -0.1605402082, -0.1739567965, -0.1875831038, -0.2014097124 
  -0.2154271752, -0.2296251506, -0.2439934313, -0.2585212290, -0.2731975317 
  -0.2880111337, -0.3029502928, -0.3180032372, -0.3331578076, -0.3484017253 
  -0.3637222052, -0.3791064322, -0.3945416212, -0.4100143015, -0.4255111217 
  -0.4410185516, -0.4565227628, -0.4720100164, -0.4874662757, -0.5028775334 
  -0.5182296634, -0.5335084200, -0.5486994982, -0.5637886524, -0.5787616372 
  -0.5936041474, -0.6083019376, -0.6228409410, -0.6372069120, -0.6513859630 
  -0.6653640866, -0.6791275144, -0.6926627755, -0.7059561610, -0.7189947963 
  -0.7317654490, -0.7442554235, -0.7564523220, -0.7683438063, -0.7799182534 
  -0.7911639810, -0.8020697832, -0.8126249313, -0.8228194118, -0.8326428533 
  -0.8420860767, -0.8511404991, -0.8597975969, -0.8680517077, -0.8758881092 
  -0.8832823634, -0.8902196884, -0.8967157602, -0.9027729034, -0.9083824754 
  -0.9135394692, -0.9182395935, -0.9224776030, -0.9262499809, -0.9295535684 
  -0.9323854446, -0.9347436428, -0.9366261959, -0.9380323887, -0.9389615655 
  -0.9394137263, -0.9393896461, -0.9388904572, -0.9379178882, -0.9364743829 
  -0.9345626831, -0.9321863055, -0.9293491840, -0.9260557890, -0.9223110080 
  -0.9181203246, -0.9134896994, -0.9084255695, -0.9029349089, -0.8970250487 
  -0.8907034993, -0.8839784265, -0.8768582940, -0.8693521619, -0.8614694476 
  -0.8532197475, -0.8446131349, -0.8356599212, -0.8263708353, -0.8167568445 
  -0.8068289757, -0.7965991497, -0.7860788107, -0.7752800584, -0.7642148733 
  -0.7528960109, -0.7413358092, -0.7295469642, -0.7175422311, -0.7053351402 
  -0.6929380894, -0.6803644896, -0.6676273942, -0.6547405124, -0.6417166591 
  -0.6285686493, -0.6153115034, -0.6019562483, -0.5885198116, -0.5750215650 
   0.5615197420,  0.5478612781,  0.5341838002,  0.5204906464,  0.5067980289 
   0.4931168854,  0.4794588387,  0.4658361673,  0.4522601366,  0.4387422502 
   0.4252935350,  0.4119254053,  0.3986486793,  0.3854739666,  0.3724119067 
   0.3594728410,  0.3466667533,  0.3340034485,  0.3214924335,  0.3091430366 
   0.2969639599,  0.2849639654,  0.2731511295,  0.2615332901,  0.2501178682 
   0.2389119864,  0.2279221565,  0.2171545923,  0.2066148520,  0.1963084787 
   0.1862401515,  0.1764142811,  0.1668347418,  0.1575049609,  0.1484276950 
   0.1396053135,  0.1310400218,  0.1227331311,  0.1146853194,  0.1068974212 
   0.0993694067,  0.0921007246,  0.0850901082,  0.0783365741,  0.0718384907 
   0.0655927584,  0.0595967993,  0.0538481586,  0.0483424664,  0.0430756323 
   0.0380428955,  0.0332404599,  0.0286619961,  0.0242999699,  0.0201510899 
   0.0162059069,  0.0124559226,  0.0088928537,  0.0054926532,  0.0023052765 
  -0.0005515143, -0.0030201224, -0.0052712574, -0.0073737046, -0.0093160523 
  -0.0111072771, -0.0127562135, -0.0142635731, -0.0156361461, -0.0168790054 
  -0.0179969221, -0.0189934950, -0.0198726747, -0.0206398536, -0.0212980714 
  -0.0218509119, -0.0223025978, -0.0226570386, -0.0229178313, -0.0230882075 
  -0.0231725387, -0.0231746566, -0.0230979007, -0.0229462404, -0.0227237809 
  -0.0224345829, -0.0220820960, -0.0216706358, -0.0212045144, -0.0206875466 
  -0.0201238506, -0.0195175279, -0.0188730918, -0.0181944817, -0.0174855441 
  -0.0167510118, -0.0159947462, -0.0152208358, -0.0144332750, -0.0136361914 
  -0.0128338682, -0.0120294262, -0.0112272501, -0.0104311826, -0.0096443929 
  -0.0088709844, -0.0081134979, -0.0073764324, -0.0066623385, -0.0059733889 
  -0.0053142183, -0.0046856776, -0.0040914025, -0.0035321070, -0.0030089030 
  -0.0025271603, -0.0020749648, -0.0016621647, -0.0012705614, -0.0008115423
];
h = h.';
h = h(:);
h(1*120+(1:120)) = -h(1*120+(1:120));
h(3*120+(1:120)) = -h(3*120+(1:120));
h(:) = h(end:-1:1);
 No newline at end of file
+163 −0
Original line number Diff line number Diff line
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%   (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
%   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
%   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
%   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
%   contributors to this repository. All Rights Reserved.
%
%   This software is protected by copyright law and by international treaties.
%   The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
%   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
%   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
%   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
%   contributors to this repository retain full ownership rights in their respective contributions in
%   the software. This notice grants no license of any kind, including but not limited to patent
%   license, nor is any license granted by implication, estoppel or otherwise.
%
%   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
%   contributions.
%
%   This software is provided "AS IS", without any express or implied warranties. The software is in the
%   development stage. It is intended exclusively for experts who have experience with such software and
%   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
%   and fitness for a particular purpose are hereby disclaimed and excluded.
%
%   Any dispute, controversy or claim arising under or in relation to providing this software shall be
%   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
%   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
%   the United Nations Convention on Contracts on the International Sales of Goods.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [h, D, S, L] = get_cldfb_filter()
% const float LDQMF_60[] in \lib_com\rom_com.c, line 5219
S = 60; % stride
L = 60; % frequency bands
D = 240 + S - 1; % system delay
h = [
   0.0000953076,  0.0001230230,  0.0001279964,  0.0001260533,  0.0001211219
   0.0001122123,  0.0001010860,  0.0000876540,  0.0000719883,  0.0000545472
   0.0000352143,  0.0000145686, -0.0000074264, -0.0000303788, -0.0000539205
  -0.0000782743, -0.0001028838, -0.0001275374, -0.0001520015, -0.0001760167
  -0.0001997108, -0.0002226708, -0.0002446725, -0.0002655797, -0.0002852145
  -0.0003034996, -0.0003203036, -0.0003356283, -0.0003493345, -0.0003614030
  -0.0003719004, -0.0003807641, -0.0003881051, -0.0003939842, -0.0003985357
  -0.0004019095, -0.0004041938, -0.0004056677, -0.0004065430, -0.0004069925
  -0.0004072535, -0.0004075877, -0.0004083676, -0.0004098394, -0.0004122990
  -0.0004160839, -0.0004214063, -0.0004285777, -0.0004378651, -0.0004495422
  -0.0004637682, -0.0004806494, -0.0005003878, -0.0005231378, -0.0005489803
  -0.0005777747, -0.0006095612, -0.0006443121, -0.0006813223, -0.0007226231
  -0.0007722576, -0.0008268412, -0.0008839625, -0.0009417336, -0.0010004630
  -0.0010601623, -0.0011206097, -0.0011817788, -0.0012432419, -0.0013045983
  -0.0013656860, -0.0014260965, -0.0014855355, -0.0015435946, -0.0015999591
  -0.0016543545, -0.0017062968, -0.0017554691, -0.0018015467, -0.0018441341
  -0.0018829798, -0.0019177221, -0.0019480695, -0.0019736972, -0.0019943134
  -0.0020097434, -0.0020197174, -0.0020240925, -0.0020226294, -0.0020152442
  -0.0020017736, -0.0019820682, -0.0019561697, -0.0019240153, -0.0018855907
  -0.0018409232, -0.0017900462, -0.0017330211, -0.0016699535, -0.0016009507
  -0.0015261442, -0.0014456788, -0.0013597424, -0.0012685407, -0.0011722331
  -0.0010710671, -0.0009652392, -0.0008549765, -0.0007405236, -0.0006221444
  -0.0005001140, -0.0003745670, -0.0002458634, -0.0001142541,  0.0000199491
   0.0001564174,  0.0002949402,  0.0004350246,  0.0005769439,  0.0007203126
  -0.0008803223, -0.0010328424, -0.0011841310, -0.0013346316, -0.0014848098
  -0.0016343417, -0.0017832819, -0.0019316213, -0.0020790498, -0.0022252349
  -0.0023701149, -0.0025136294, -0.0026556554, -0.0027960713, -0.0029348312
  -0.0030717771, -0.0032068293, -0.0033399195, -0.0034709862, -0.0035999804
  -0.0037267797, -0.0038513308, -0.0039736414, -0.0040935921, -0.0042111278
  -0.0043262239, -0.0044388464, -0.0045489701, -0.0046565188, -0.0047614835
  -0.0048637423, -0.0049632201, -0.0050599808, -0.0051539382, -0.0052450863
  -0.0053333500, -0.0054187514, -0.0055012843, -0.0055808770, -0.0056575472
  -0.0057313135, -0.0058021732, -0.0058701355, -0.0059352517, -0.0059975707
  -0.0060571772, -0.0061141332, -0.0061685541, -0.0062205540, -0.0062703062
  -0.0063179093, -0.0063635921, -0.0064075105, -0.0064498796, -0.0064908965
  -0.0065308069, -0.0065698619, -0.0066083665, -0.0066466411, -0.0066849431
  -0.0067233290, -0.0067621553, -0.0068021296, -0.0068436749, -0.0068870094
  -0.0069324085, -0.0069801519, -0.0070305937, -0.0070840055, -0.0071406048
  -0.0072006541, -0.0072644479, -0.0073321410, -0.0074039386, -0.0074799177
  -0.0075602704, -0.0076450342, -0.0077342330, -0.0078278277, -0.0079257628
  -0.0080279401, -0.0081341872, -0.0082442267, -0.0083577875, -0.0084744738
  -0.0085938899, -0.0087156557, -0.0088391500, -0.0089637861, -0.0090888245
  -0.0092134504, -0.0093367994, -0.0094579896, -0.0095760096, -0.0096898535
  -0.0097982995, -0.0099003557, -0.0099947909, -0.0100801717, -0.0101551116
  -0.0102182031, -0.0102678994, -0.0103026126, -0.0103207529, -0.0103206923
  -0.0103006857, -0.0102590285, -0.0101939747, -0.0101036867, -0.0099863587
  -0.0098401112, -0.0096632261, -0.0094537362, -0.0092098210, -0.0089295702
  -0.0086111929, -0.0082527259, -0.0078523541, -0.0074084769, -0.0069190590
   0.0063841688,  0.0057985946,  0.0051621343,  0.0044734711,  0.0037309236
   0.0029329660,  0.0020781513,  0.0011651339,  0.0001925042, -0.0008409545
  -0.0019364181, -0.0030950012, -0.0043176264, -0.0056051607, -0.0069584334
  -0.0083780792, -0.0098646237, -0.0114185056, -0.0130400723, -0.0147295250
  -0.0164868534, -0.0183120724, -0.0202049762, -0.0221651513, -0.0241921283
  -0.0262852497, -0.0284437388, -0.0306666382, -0.0329528190, -0.0353010744
  -0.0377098918, -0.0401776619, -0.0427025780, -0.0452826768, -0.0479161367
  -0.0506004691, -0.0533332452, -0.0561118126, -0.0589331910, -0.0617944039
  -0.0646922663, -0.0676232576, -0.0705836788, -0.0735698044, -0.0765774846
  -0.0796026587, -0.0826408863, -0.0856874809, -0.0887378305, -0.0917868018
  -0.0948293805, -0.0978601947, -0.1008738130, -0.1038645208, -0.1068264544
  -0.1097536832, -0.1126400903, -0.1154794544, -0.1182654947, -0.1209914312
  -0.1236500666, -0.1262341589, -0.1287376434, -0.1311538219, -0.1334753036
  -0.1356947273, -0.1378047168, -0.1397978216, -0.1416664869, -0.1434033662
  -0.1450008005, -0.1464512348, -0.1477471888, -0.1488809884, -0.1498452872
  -0.1506324410, -0.1512351334, -0.1516460329, -0.1518578976, -0.1518635303
  -0.1516559124, -0.1512281001, -0.1505732536, -0.1496847868, -0.1485562176
  -0.1471813470, -0.1455538720, -0.1436681300, -0.1415183097, -0.1390990764
  -0.1364052594, -0.1334318966, -0.1301742792, -0.1266280264, -0.1227891371
  -0.1186537445, -0.1142183766, -0.1094799563, -0.1044355705, -0.0990828425
  -0.0934195668, -0.0874440819, -0.0811550021, -0.0745511875, -0.0676321834
  -0.0603975877, -0.0528475679, -0.0449828543, -0.0368040986, -0.0283128861
  -0.0195108838, -0.0104003223, -0.0009837818,  0.0087356847,  0.0187546927
   0.0290693250,  0.0396753438,  0.0505682528,  0.0617432520,  0.0731955394
  -0.0849232078, -0.0969054326, -0.1091460735, -0.1216373071, -0.1343720406
  -0.1473424733, -0.1605402082, -0.1739567965, -0.1875831038, -0.2014097124
  -0.2154271752, -0.2296251506, -0.2439934313, -0.2585212290, -0.2731975317
  -0.2880111337, -0.3029502928, -0.3180032372, -0.3331578076, -0.3484017253
  -0.3637222052, -0.3791064322, -0.3945416212, -0.4100143015, -0.4255111217
  -0.4410185516, -0.4565227628, -0.4720100164, -0.4874662757, -0.5028775334
  -0.5182296634, -0.5335084200, -0.5486994982, -0.5637886524, -0.5787616372
  -0.5936041474, -0.6083019376, -0.6228409410, -0.6372069120, -0.6513859630
  -0.6653640866, -0.6791275144, -0.6926627755, -0.7059561610, -0.7189947963
  -0.7317654490, -0.7442554235, -0.7564523220, -0.7683438063, -0.7799182534
  -0.7911639810, -0.8020697832, -0.8126249313, -0.8228194118, -0.8326428533
  -0.8420860767, -0.8511404991, -0.8597975969, -0.8680517077, -0.8758881092
  -0.8832823634, -0.8902196884, -0.8967157602, -0.9027729034, -0.9083824754
  -0.9135394692, -0.9182395935, -0.9224776030, -0.9262499809, -0.9295535684
  -0.9323854446, -0.9347436428, -0.9366261959, -0.9380323887, -0.9389615655
  -0.9394137263, -0.9393896461, -0.9388904572, -0.9379178882, -0.9364743829
  -0.9345626831, -0.9321863055, -0.9293491840, -0.9260557890, -0.9223110080
  -0.9181203246, -0.9134896994, -0.9084255695, -0.9029349089, -0.8970250487
  -0.8907034993, -0.8839784265, -0.8768582940, -0.8693521619, -0.8614694476
  -0.8532197475, -0.8446131349, -0.8356599212, -0.8263708353, -0.8167568445
  -0.8068289757, -0.7965991497, -0.7860788107, -0.7752800584, -0.7642148733
  -0.7528960109, -0.7413358092, -0.7295469642, -0.7175422311, -0.7053351402
  -0.6929380894, -0.6803644896, -0.6676273942, -0.6547405124, -0.6417166591
  -0.6285686493, -0.6153115034, -0.6019562483, -0.5885198116, -0.5750215650
   0.5615197420,  0.5478612781,  0.5341838002,  0.5204906464,  0.5067980289
   0.4931168854,  0.4794588387,  0.4658361673,  0.4522601366,  0.4387422502
   0.4252935350,  0.4119254053,  0.3986486793,  0.3854739666,  0.3724119067
   0.3594728410,  0.3466667533,  0.3340034485,  0.3214924335,  0.3091430366
   0.2969639599,  0.2849639654,  0.2731511295,  0.2615332901,  0.2501178682
   0.2389119864,  0.2279221565,  0.2171545923,  0.2066148520,  0.1963084787
   0.1862401515,  0.1764142811,  0.1668347418,  0.1575049609,  0.1484276950
   0.1396053135,  0.1310400218,  0.1227331311,  0.1146853194,  0.1068974212
   0.0993694067,  0.0921007246,  0.0850901082,  0.0783365741,  0.0718384907
   0.0655927584,  0.0595967993,  0.0538481586,  0.0483424664,  0.0430756323
   0.0380428955,  0.0332404599,  0.0286619961,  0.0242999699,  0.0201510899
   0.0162059069,  0.0124559226,  0.0088928537,  0.0054926532,  0.0023052765
  -0.0005515143, -0.0030201224, -0.0052712574, -0.0073737046, -0.0093160523
  -0.0111072771, -0.0127562135, -0.0142635731, -0.0156361461, -0.0168790054
  -0.0179969221, -0.0189934950, -0.0198726747, -0.0206398536, -0.0212980714
  -0.0218509119, -0.0223025978, -0.0226570386, -0.0229178313, -0.0230882075
  -0.0231725387, -0.0231746566, -0.0230979007, -0.0229462404, -0.0227237809
  -0.0224345829, -0.0220820960, -0.0216706358, -0.0212045144, -0.0206875466
  -0.0201238506, -0.0195175279, -0.0188730918, -0.0181944817, -0.0174855441
  -0.0167510118, -0.0159947462, -0.0152208358, -0.0144332750, -0.0136361914
  -0.0128338682, -0.0120294262, -0.0112272501, -0.0104311826, -0.0096443929
  -0.0088709844, -0.0081134979, -0.0073764324, -0.0066623385, -0.0059733889
  -0.0053142183, -0.0046856776, -0.0040914025, -0.0035321070, -0.0030089030
  -0.0025271603, -0.0020749648, -0.0016621647, -0.0012705614, -0.0008115423
];
h = h.';
h = h(:);
h(1*120+(1:120)) = -h(1*120+(1:120));
h(3*120+(1:120)) = -h(3*120+(1:120));
h(:) = h(end:-1:1);
+8 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ classdef hrtf_library_loader < handle
        SourceRadius = []; % The source distance for HRTFs in this library 
        PlaybackRadius = []; % The radius for HRTFs during playback
        Info = {''}; % A cell array of strings with info about this library
        PosSpherical = []; % source positiona in spherical representation (rads, meters)
        Data = [];
    end
    properties (Access=protected)        
        % Define the set of uni-vectors for the HRTF directions in a discrete Library
@@ -100,6 +102,7 @@ classdef hrtf_library_loader < handle
            if strcmpi(Units{2},'degree'), Pos(2,:)=Pos(2,:)*pi/180; end
            assert( any(strcmpi(Units{3}, {'metre','meter','inch'})), 'Unknown units');
            if strcmpi(Units{3},'inch'  ), Pos(3,:)=Pos(3,:)*0.0254; end
            PosSpherical = Pos;
            Pos = Pos(3,:) .* ...
              [cos(Pos(2,:)).*[cos(Pos(1,:));sin(Pos(1,:))];sin(Pos(2,:))];
            
@@ -146,6 +149,7 @@ classdef hrtf_library_loader < handle
            H.UnitVectors   = XYZ;
            H.HRTF_L        = HRTF_L;
            H.HRTF_R        = HRTF_R;
            H.PosSpherical  = PosSpherical;
            
            [~,NameRoot,~]      = fileparts(Lib_Name);
            H.Info.Name         = NameRoot;
@@ -154,6 +158,8 @@ classdef hrtf_library_loader < handle
            H.Info.FilterSize   = sprintf('%d-tap FIR',IRLen);
            H.Info.Scaling      = 'Normalised to unity gain at 1kHz';

            H.Data = Data;

            obj.process_lib(H, Data.SamplingRate);
        end
        
@@ -212,6 +218,8 @@ classdef hrtf_library_loader < handle
            obj.buildGDMag();
            obj.Last_UV=[];
            obj.setLen(512);
            obj.PosSpherical = hrtf_lib.PosSpherical;
            obj.Data = hrtf_lib.Data;
        end
        
        function setLen(obj,Len)
+0 −3
Original line number Diff line number Diff line
version https://git-lfs.github.com/spec/v1
oid sha256:386bbd3a02c3b95280fff7bd8f5240ee60f8858889cad0f6147e930f5f2aa7e2
size 1246
+6 −7
Original line number Diff line number Diff line
%
%   (C) 2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
%   (C) 2022-2023 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
%   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
%   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
%   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
@@ -35,11 +35,10 @@ function [T60, lateEnes, earlyEnes] = generate_BRIR_in_SHD_CLDFB_PARAMETRIC(brir
% First parameter is the name with path to BRIR file in SOFA format
% Second parameter is the HRIR set in SHD created before.
% Return value contains the tables derived from BRIR set.
% Note: it is assumed that SOFAstart has been called as prerequisite


%% Load BRIR input file
sofaData = SOFAload(brir_inputfile);
sofaData = hrtf_library_loader();
sofaData.readSOFA(brir_inputfile);

%% Get data and format it for us
% Input VRIR data from SOFA. After permuation, in order (response, ear, dirIndex)
@@ -53,12 +52,12 @@ end

% Measurement directions for responses. We discard the distance but there should
% be solution that uses only measurements from same distance.
BRIRanglesDeg = sofaData.SourcePosition(:, 1:2);
brirAziRad = sofaData.PosSpherical(1, :).';
brirEleRad = sofaData.PosSpherical(2, :).';

% Determine nearest subset corresponding to 5.0 layout.
% All BRIR related parameters are determined based on them
brirAziRad = BRIRanglesDeg(:, 1)*pi/180;
brirEleRad = BRIRanglesDeg(:, 2)*pi/180;

refAnglesRad = [30 0 -30 110 -110]' * pi/180;
refVectors = [cos(refAnglesRad) sin(refAnglesRad) zeros(size(refAnglesRad))];
sofaVectors = [cos(brirAziRad).*cos(brirEleRad) sin(brirAziRad).*cos(brirEleRad) sin(brirEleRad)];
Loading