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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../../img/favicon.ico">
<title> hoa - Faust Libraries</title>
<link href="../../css/bootstrap.min.css" rel="stylesheet">
<link href="../../css/font-awesome.min.css" rel="stylesheet">
<link href="../../css/base.css" rel="stylesheet">
<link rel="stylesheet" href="/usr/share/javascript/highlight.js/styles/github.css">
<link href="../../css/extra.css" rel="stylesheet">
<script src="../../js/jquery-3.6.0.min.js" defer></script>
<script src="../../js/bootstrap.min.js" defer></script>
<script src="/usr/share/javascript/highlight.js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="../.."><img src="../../img/faustText.svg" width="150px"> </a>
<!-- Expander button -->
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Expanded navigation -->
<div id="navbar-collapse" class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="../../organization/" class="dropdown-item"> Organization </a>
</li>
<li>
<a href="../../standardFunctions/" class="dropdown-item"> Standard Functions </a>
</li>
<li>
<a href="../../contributing/" class="dropdown-item"> Contributing </a>
</li>
<li>
<a href="../../community/" class="dropdown-item"> Community </a>
</li>
<li>
<a href="../../about/" class="dropdown-item"> Copyright/License </a>
</li>
</ul>
</li>
<li class="navitem">
<a href="../" class="nav-link">Index</a>
</li>
<li class="dropdown active">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Libraries <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="../aanl/" class="dropdown-item"> antialiased </a>
</li>
<li>
<a href="../analyzers/" class="dropdown-item"> analyzers </a>
</li>
<li>
<a href="../basics/" class="dropdown-item"> basics </a>
</li>
<li>
<a href="../compressors/" class="dropdown-item"> compressors </a>
</li>
<li>
<a href="../delays/" class="dropdown-item"> delays </a>
</li>
<li>
<a href="../demos/" class="dropdown-item"> demos </a>
</li>
<li>
<a href="../dx7/" class="dropdown-item"> dx7 </a>
</li>
<li>
<a href="../envelopes/" class="dropdown-item"> envelopes </a>
</li>
<li>
<a href="../fds/" class="dropdown-item"> fds </a>
</li>
<li>
<a href="../filters/" class="dropdown-item"> filters </a>
</li>
<li>
<a href="./" class="dropdown-item active"> hoa </a>
</li>
<li>
<a href="../interpolators/" class="dropdown-item"> interpolators </a>
</li>
<li>
<a href="../linearalgebra/" class="dropdown-item"> linearalgebra </a>
</li>
<li>
<a href="../maths/" class="dropdown-item"> maths </a>
</li>
<li>
<a href="../mi/" class="dropdown-item"> mi </a>
</li>
<li>
<a href="../misceffects/" class="dropdown-item"> misceffects </a>
</li>
<li>
<a href="../noises/" class="dropdown-item"> noises </a>
</li>
<li>
<a href="../oscillators/" class="dropdown-item"> oscillators </a>
</li>
<li>
<a href="../phaflangers/" class="dropdown-item"> phaflangers </a>
</li>
<li>
<a href="../physmodels/" class="dropdown-item"> physmodels </a>
</li>
<li>
<a href="../quantizers/" class="dropdown-item"> quantizers </a>
</li>
<li>
<a href="../reducemaps/" class="dropdown-item"> reducemaps </a>
</li>
<li>
<a href="../reverbs/" class="dropdown-item"> reverbs </a>
</li>
<li>
<a href="../routes/" class="dropdown-item"> routes </a>
</li>
<li>
<a href="../signals/" class="dropdown-item"> signals </a>
</li>
<li>
<a href="../soundfiles/" class="dropdown-item"> soundfiles </a>
</li>
<li>
<a href="../spats/" class="dropdown-item"> spats </a>
</li>
<li>
<a href="../synths/" class="dropdown-item"> synths </a>
</li>
<li>
<a href="../vaeffects/" class="dropdown-item"> vaeffects </a>
</li>
<li>
<a href="../version/" class="dropdown-item"> version </a>
</li>
<li>
<a href="../wdmodels/" class="dropdown-item"> wdmodels </a>
</li>
<li>
<a href="../webaudio/" class="dropdown-item"> webaudio </a>
</li>
</ul>
</li>
<li class="navitem">
<a href="../../about/" class="nav-link">About</a>
</li>
</ul>
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a href="#" class="nav-link" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fa fa-search"></i> Search
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row"><div class="col-md-3"><div class="navbar-light navbar-expand-md bs-sidebar hidden-print affix" role="complementary">
<div class="navbar-header">
<button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#toc-collapse" title="Table of Contents">
<span class="fa fa-angle-down"></span>
</button>
</div>
<div id="toc-collapse" class="navbar-collapse collapse card bg-secondary">
<ul class="nav flex-column">
<li class="nav-item" data-level="1"><a href="#hoalib" class="nav-link">hoa.lib</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="2"><a href="#encodingdecoding-functions" class="nav-link">Encoding/decoding Functions</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#hoencoder" class="nav-link">(ho.)encoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#horencoder" class="nav-link">(ho.)rEncoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hostereoencoder" class="nav-link">(ho.)stereoEncoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#homultiencoder" class="nav-link">(ho.)multiEncoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hodecoder" class="nav-link">(ho.)decoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hodecoderstereo" class="nav-link">(ho.)decoderStereo</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hoibasicdecoder" class="nav-link">(ho.)iBasicDecoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hocircularscaledvbap" class="nav-link">(ho.)circularScaledVBAP</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hoimlsdecoder" class="nav-link">(ho.)imlsDecoder</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hoidecoder" class="nav-link">(ho.)iDecoder</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#optimization-functions" class="nav-link">Optimization Functions</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#hooptimbasic" class="nav-link">(ho.)optimBasic</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptimmaxre" class="nav-link">(ho.)optimMaxRe</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptiminphase" class="nav-link">(ho.)optimInPhase</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptim" class="nav-link">(ho.)optim</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#howider" class="nav-link">(ho.)wider</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#homirror" class="nav-link">(ho.)mirror</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#homap" class="nav-link">(ho.)map</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#horotate" class="nav-link">(ho.)rotate</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hoscope" class="nav-link">(ho.)scope</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#spatial-sound-processes" class="nav-link">Spatial Sound Processes</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#hofxdecorrelation" class="nav-link">(ho.).fxDecorrelation</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hosyndecorrelation" class="nav-link">(ho.).synDecorrelation</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hofxringmod" class="nav-link">(ho.).fxRingMod</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hosynringmod" class="nav-link">(ho.).synRingMod</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#3d-functions" class="nav-link">3D Functions</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#hoencoder3d" class="nav-link">(ho.)encoder3D</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#horencoder3d" class="nav-link">(ho.)rEncoder3D</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptimbasic3d" class="nav-link">(ho.)optimBasic3D</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptimmaxre3d" class="nav-link">(ho.)optimMaxRe3D</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptiminphase3d" class="nav-link">(ho.)optimInPhase3D</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#hooptim3d" class="nav-link">(ho.)optim3D</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div></div>
<div class="col-md-9 main-container" role="main">
<h1 id="hoalib">hoa.lib</h1>
<p>Faust library for high order ambisonic. Its official prefix is <code>ho</code>.</p>
<h4 id="references">References</h4>
<ul>
<li><a href="https://github.com/grame-cncm/faustlibraries/blob/master/hoa.lib">https://github.com/grame-cncm/faustlibraries/blob/master/hoa.lib</a></li>
</ul>
<h2 id="encodingdecoding-functions">Encoding/decoding Functions</h2>
<hr />
<h3 id="hoencoder"><code>(ho.)encoder</code></h3>
<p>Ambisonic encoder. Encodes a signal in the circular harmonics domain
depending on an order of decomposition and an angle.</p>
<h4 id="usage">Usage</h4>
<pre><code>encoder(N, x, a) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>x</code>: the signal</li>
<li><code>a</code>: the angle</li>
</ul>
<hr />
<h3 id="horencoder"><code>(ho.)rEncoder</code></h3>
<p>Ambisonic encoder in 2D including source rotation. A mono signal is encoded at a certain ambisonic order
with two possible modes: either rotation with an angular speed, or static with a fixed angle (when speed is zero).</p>
<h4 id="usage_1">Usage</h4>
<pre><code>_ : rEncoder(N, sp, a, it) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>sp</code>: the azimuth speed expressed as angular speed (2PI/sec), positive or negative</li>
<li><code>a</code>: the fixed azimuth when the rotation stops (sp = 0) in radians</li>
<li><code>it</code> : interpolation time (in milliseconds) between the rotation and the fixed modes</li>
</ul>
<hr />
<h3 id="hostereoencoder"><code>(ho.)stereoEncoder</code></h3>
<p>Encoding of a stereo pair of channels with symetric angles (a/2, -a/2).</p>
<h4 id="usage_2">Usage</h4>
<pre><code>_,_ : stereoEncoder(N, a) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>a</code> : opening angle in radians, left channel at a/2 angle, right channel at -a/2 angle</li>
</ul>
<hr />
<h3 id="homultiencoder"><code>(ho.)multiEncoder</code></h3>
<p>Encoding of a set of P signals distributed on the unit circle according to a list of P speeds and P angles.</p>
<h4 id="usage_3">Usage</h4>
<pre><code>_,_, ... : multiEncoder(N, lspeed, langle, it) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>lspeed</code> : a list of P speeds in turns by second (one speed per input signal, positive or negative)</li>
<li><code>langle</code> : a list of P angles in radians on the unit circle to localize the sources (one angle per input signal)</li>
<li><code>it</code> : interpolation time (in milliseconds) between the rotation and the fixed modes.</li>
</ul>
<hr />
<h3 id="hodecoder"><code>(ho.)decoder</code></h3>
<p>Decodes an ambisonics sound field for a circular array of loudspeakers.</p>
<h4 id="usage_4">Usage</h4>
<pre><code>_ : decoder(N, P) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>P</code>: the number of speakers (constant numerical expression)</li>
</ul>
<h4 id="note">Note</h4>
<p>The number of loudspeakers must be greater or equal to 2n+1.
It's preferable to use 2n+2 loudspeakers.</p>
<hr />
<h3 id="hodecoderstereo"><code>(ho.)decoderStereo</code></h3>
<p>Decodes an ambisonic sound field for stereophonic configuration.
An "home made" ambisonic decoder for stereophonic restitution
(30° - 330°): Sound field lose energy around 180°. You should
use <code>inPhase</code> optimization with ponctual sources.</p>
<h4 id="usage_5">Usage</h4>
<pre><code>_ : decoderStereo(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hoibasicdecoder"><code>(ho.)iBasicDecoder</code></h3>
<p>The irregular basic decoder is a simple decoder that projects the incoming ambisonic situation
to the loudspeaker situation (P loudspeakers) whatever it is, without compensation.
When there is a strong irregularity, there can be some discontinuity in the sound field.</p>
<h4 id="usage_6">Usage</h4>
<pre><code>_,_, ... : iBasicDecoder(N,la, direct, shift) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (there are 2*N+1 inputs to this function)</li>
<li><code>la</code> : the list of P angles in degrees, for instance (0, 85, 182, 263) for four loudspeakers</li>
<li><code>direct</code>: 1 for direct mode, -1 for the indirect mode (changes the rotation direction)</li>
<li><code>shift</code> : angular shift in degrees to easily adjust angles</li>
</ul>
<hr />
<h3 id="hocircularscaledvbap"><code>(ho.)circularScaledVBAP</code></h3>
<p>The function provides a circular scaled VBAP with all loudspeakers and the virtual source on the unit-circle.</p>
<h4 id="usage_7">Usage</h4>
<pre><code>_ : circularScaledVBAP(l, t) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>l</code> : the list of angles of the loudspeakers in degrees, for instance (0, 85, 182, 263) for four loudspeakers</li>
<li><code>t</code> : the current angle of the virtual source in degrees</li>
</ul>
<hr />
<h3 id="hoimlsdecoder"><code>(ho.)imlsDecoder</code></h3>
<p>Irregular decoder in 2D for an irregular configuration of P loudspeakers
using 2D VBAP for compensation.</p>
<h4 id="usage_8">Usage</h4>
<pre><code>_,_, ... : imlsDecoder(N,la, direct, shift) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>la</code> : the list of P angles in degrees, for instance (0, 85, 182, 263) for four loudspeakers</li>
<li><code>direct</code>: 1 for direct mode, -1 for the indirect mode (changes the rotation direction)</li>
<li><code>shift</code> : angular shift in degrees to easily adjust angles</li>
</ul>
<hr />
<h3 id="hoidecoder"><code>(ho.)iDecoder</code></h3>
<p>General decoder in 2D enabling an irregular multi-loudspeaker configuration
and to switch between multi-channel and stereo.</p>
<h4 id="usage_9">Usage</h4>
<pre><code>_,_, ... : iDecoder(N, la, direct, st, g) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>la</code>: the list of angles in degrees</li>
<li><code>direct</code>: 1 for direct mode, -1 for the indirect mode (changes the rotation direction)</li>
<li><code>shift</code> : angular shift in degrees to easily adjust angles</li>
<li><code>st</code>: 1 for stereo, 0 for multi-loudspeaker configuration. When 1, stereo sounds goes through the first two channels</li>
<li><code>g</code> : gain between 0 and 1</li>
</ul>
<h2 id="optimization-functions">Optimization Functions</h2>
<p>Functions to weight the circular harmonics signals depending to the
ambisonics optimization.
It can be <code>basic</code> for no optimization, <code>maxRe</code> or <code>inPhase</code>.</p>
<hr />
<h3 id="hooptimbasic"><code>(ho.)optimBasic</code></h3>
<p>The basic optimization has no effect and should be used for a perfect
circle of loudspeakers with one listener at the perfect center loudspeakers
array.</p>
<h4 id="usage_10">Usage</h4>
<pre><code>_ : optimBasic(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hooptimmaxre"><code>(ho.)optimMaxRe</code></h3>
<p>The maxRe optimization optimizes energy vector. It should be used for an
auditory confined in the center of the loudspeakers array.</p>
<h4 id="usage_11">Usage</h4>
<pre><code>_ : optimMaxRe(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hooptiminphase"><code>(ho.)optimInPhase</code></h3>
<p>The inPhase optimization optimizes energy vector and put all loudspeakers signals
in phase. It should be used for an auditory.</p>
<h4 id="usage_12">Usage</h4>
<pre><code>_ : optimInPhase(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hooptim"><code>(ho.)optim</code></h3>
<p>Ambisonic optimizer including the three elementary optimizers:
<code>(ho).optimBasic</code>, <code>(ho).optimMaxRe</code> and <code>(ho.)optimInPhase</code>.</p>
<h4 id="usage_13">Usage</h4>
<pre><code>_,_, ... : optim(N, ot) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>ot</code> : optimization type (0 for <code>optimBasic</code>, 1 for <code>optimMaxRe</code>, 2 for <code>optimInPhase</code>)</li>
</ul>
<hr />
<h3 id="howider"><code>(ho.)wider</code></h3>
<p>Can be used to wide the diffusion of a localized sound. The order
depending signals are weighted and appear in a logarithmic way to
have linear changes.</p>
<h4 id="usage_14">Usage</h4>
<pre><code>_ : wider(N,w) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>w</code>: the width value between 0 - 1</li>
</ul>
<hr />
<h3 id="homirror"><code>(ho.)mirror</code></h3>
<p>Mirroring effect on the sound field.</p>
<h4 id="usage_15">Usage</h4>
<pre><code>_,_, ... : mirror(N, fa) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>fa</code> : mirroring type (1 = original sound field, 0 = original+mirrored sound field, -1 = mirrored sound field)</li>
</ul>
<hr />
<h3 id="homap"><code>(ho.)map</code></h3>
<p>It simulates the distance of the source by applying a gain
on the signal and a wider processing on the soundfield.</p>
<h4 id="usage_16">Usage</h4>
<pre><code>map(N, x, r, a)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>x</code>: the signal</li>
<li><code>r</code>: the radius</li>
<li><code>a</code>: the angle in radian</li>
</ul>
<hr />
<h3 id="horotate"><code>(ho.)rotate</code></h3>
<p>Rotates the sound field.</p>
<h4 id="usage_17">Usage</h4>
<pre><code>_ : rotate(N, a) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>a</code>: the angle in radian</li>
</ul>
<hr />
<h3 id="hoscope"><code>(ho.)scope</code></h3>
<p>Produces an XY pair of signals representing the ambisonic sound field.</p>
<h4 id="usage_18">Usage</h4>
<pre><code>_,_, ... : scope(N, rt) : _,_
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>rt</code> : refreshment time in milliseconds</li>
</ul>
<h2 id="spatial-sound-processes">Spatial Sound Processes</h2>
<p>We propose implementations of processes intricated to the ambisonic model.
The process is implemented using as many instances as the number of harmonics at at certain order.
The key control parameters of these instances are computed thanks to distribution functions
(th functions below) and to a global driving factor.</p>
<hr />
<h3 id="hofxdecorrelation"><code>(ho.).fxDecorrelation</code></h3>
<p>Spatial ambisonic decorrelation in fx mode.</p>
<p><code>fxDecorrelation</code> applies decorrelations to spatial components already created.
The decorrelation is defined for each #i spatial component among P=2*N+1 at the ambisonic order <code>N</code>
as a delay of 0 if factor <code>fa</code> is under a certain value 1-(i+1)/P and d*F((i+1)/p) in the contrary case,
where <code>d</code> is the maximum delay applied (in samples) and F is a distribution function for durations.
The user can choose this delay time distribution among 22 different ones.
The delay increases according to the index of ambisonic components.
But it increases at each step and it is modulated by a threshold.
Therefore, delays are progressively revealed when the factor increases:</p>
<ul>
<li>when the factor is close to 0, only upper components are delayed;</li>
<li>when the factor increases, more and more components are delayed.</li>
</ul>
<h4 id="usage_19">Usage</h4>
<pre><code>_,_, ... : fxDecorrelation(N, d, wf, fa, fd, tf) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>d</code>: the maximum delay applied (in samples)</li>
<li><code>wf</code>: window frequency (in Hz) for the overlapped delay</li>
<li><code>fa</code>: decorrelation factor (between 0 and 1)</li>
<li><code>fd</code>: feedback / level of reinjection (between 0 and 1)</li>
<li><code>tf</code>: type of function of delay distribution (integer, between 0 and 21)</li>
</ul>
<hr />
<h3 id="hosyndecorrelation"><code>(ho.).synDecorrelation</code></h3>
<p>Spatial ambisonic decorrelation in syn mode.</p>
<p><code>synDecorrelation</code> generates spatial decorrelated components in ambisonics from one mono signal.
The decorrelation is defined for each #i spatial component among P=2*N+1 at the ambisonic order <code>N</code>
as a delay of 0 if factor <code>fa</code> is under a certain value 1-(i+1)/P and d*F((i+1)/p) in the contrary case,
where <code>d</code> is the maximum delay applied (in samples) and F is a distribution function for durations.
The user can choose this delay time distribution among 22 different ones.
The delay increases according to the index of ambisonic components.
But it increases at each step and it is modulated by a threshold.
Therefore, delays are progressively revealed when the factor increases:</p>
<ul>
<li>when the factor is close to 0, only upper components are delayed;</li>
<li>when the factor increases, more and more components are delayed.</li>
</ul>
<p>When the factor is between [0; 1/P], upper harmonics are progressively faded and the level of the H0 component is compensated
to avoid source localization and to produce a large mono.</p>
<h4 id="usage_20">Usage</h4>
<pre><code>_,_, ... : synDecorrelation(N, d, wf, fa, fd, tf) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>d</code>: the maximum delay applied (in samples)</li>
<li><code>wf</code>: window frequency (in Hz) for the overlapped delay</li>
<li><code>fa</code>: decorrelation factor (between 0 and 1)</li>
<li><code>fd</code>: feedback / level of reinjection (between 0 and 1)</li>
<li><code>tf</code>: type of function of delay distribution (integer, between 0 and 21)</li>
</ul>
<hr />
<h3 id="hofxringmod"><code>(ho.).fxRingMod</code></h3>
<p>Spatial ring modulation in syn mode.</p>
<p><code>fxRingMod</code> applies ring modulation to spatial components already created.
The ring modulation is defined for each spatial component among P=2*n+1 at the ambisonic order <code>N</code>.
For each spatial component #i, the result is either the original signal or a ring modulated signal
according to a threshold that is i/P.</p>
<p>The general process is drive by a factor <code>fa</code> between 0 and 1 and a modulation frequency <code>f0</code>.
If <code>fa</code> is greater than theshold (P-i-1)/P, the ith ring modulator is on with carrier frequency of f0*(i+1)/P.
On the contrary, it provides the original signal.</p>
<p>Therefore ring modulators are progressively revealed when <code>fa</code> increases.</p>
<h4 id="usage_21">Usage</h4>
<pre><code>_,_, ... : fxRingMod(N, f0, fa, tf) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>f0</code>: the maximum delay applied (in samples)</li>
<li><code>fa</code>: decorrelation factor (between 0 and 1)</li>
<li><code>tf</code>: type of function of delay distribution (integer, between 0 and 21)</li>
</ul>
<hr />
<h3 id="hosynringmod"><code>(ho.).synRingMod</code></h3>
<p>Spatial ring modulation in syn mode.</p>
<p><code>synRingMod</code> generates spatial components in ambisonics from one mono signal thanks to ring modulation.
The ring modulation is defined for each spatial component among P=2*n+1 at the ambisonic order <code>N</code>.
For each spatial component #i, the result is either the original signal or a ring modulated signal
according to a threshold that is i/P.</p>
<p>The general process is drive by a factor <code>fa</code> between 0 and 1 and a modulation frequency <code>f0</code>.
If <code>fa</code> is greater than theshold (P-i-1)/P, the ith ring modulator is on with carrier frequency of f0*(i+1)/P.
On the contrary, it provides the original signal.</p>
<p>Therefore ring modulators are progressively revealed when <code>fa</code> increases.
When the factor is between [0; 1/P], upper harmonics are progressively faded and the level of the H0 component is compensated
to avoid source localization and to produce a large mono.</p>
<h4 id="usage_22">Usage</h4>
<pre><code>_,_, ... : synRingMod(N, f0, fa, tf) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>f0</code>: the maximum delay applied (in samples)</li>
<li><code>fa</code>: decorrelation factor (between 0 and 1)</li>
<li><code>tf</code>: type of function of delay distribution (integer, between 0 and 21)</li>
</ul>
<h2 id="3d-functions">3D Functions</h2>
<hr />
<h3 id="hoencoder3d"><code>(ho.)encoder3D</code></h3>
<p>Ambisonic encoder. Encodes a signal in the circular harmonics domain
depending on an order of decomposition, an angle and an elevation.</p>
<h4 id="usage_23">Usage</h4>
<pre><code>encoder3D(N, x, a, e) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>x</code>: the signal</li>
<li><code>a</code>: the angle</li>
<li><code>e</code>: the elevation</li>
</ul>
<hr />
<h3 id="horencoder3d"><code>(ho.)rEncoder3D</code></h3>
<p>Ambisonic encoder in 3D including source rotation. A mono signal is encoded at at certain ambisonic order
with two possible modes: either rotation with 2 angular speeds (azimuth and elevation), or static with a fixed pair of angles.</p>
<p><code>rEncoder3D</code> is a standard Faust function.</p>
<h4 id="usage_24">Usage</h4>
<pre><code>_ : rEncoder3D(N, azsp, elsp, az, el, it) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>azsp</code>: the azimuth speed expressed as angular speed (2PI/sec), positive or negative</li>
<li><code>elsp</code>: the elevation speed expressed as angular speed (2PI/sec), positive or negative</li>
<li><code>az</code>: the fixed azimuth when the azimuth rotation stops (azsp = 0) in radians</li>
<li><code>el</code>: the fixed elevation when the elevation rotation stops (elsp = 0) in radians</li>
<li><code>it</code> : interpolation time (in milliseconds) between the rotation and the fixed modes</li>
</ul>
<hr />
<h3 id="hooptimbasic3d"><code>(ho.)optimBasic3D</code></h3>
<p>The basic optimization has no effect and should be used for a perfect
sphere of loudspeakers with one listener at the perfect center loudspeakers
array.</p>
<h4 id="usage_25">Usage</h4>
<pre><code>_ : optimBasic3D(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hooptimmaxre3d"><code>(ho.)optimMaxRe3D</code></h3>
<p>The maxRe optimization optimize energy vector. It should be used for an
auditory confined in the center of the loudspeakers array.</p>
<h4 id="usage_26">Usage</h4>
<pre><code>_ : optimMaxRe3D(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hooptiminphase3d"><code>(ho.)optimInPhase3D</code></h3>
<p>The inPhase Optimization optimizes energy vector and put all loudspeakers signals
in phase. It should be used for an auditory.</p>
<h4 id="usage_27">Usage</h4>
<pre><code>_ : optimInPhase3D(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
</ul>
<hr />
<h3 id="hooptim3d"><code>(ho.)optim3D</code></h3>
<p>Ambisonic optimizer including the three elementary optimizers:
<code>(ho).optimBasic3D</code>, <code>(ho).optimMaxRe3D</code> and <code>(ho.)optimInPhase3D</code>.</p>
<h4 id="usage_28">Usage</h4>
<pre><code>_,_, ... : optim3D(N, ot) : _,_, ...
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the ambisonic order (constant numerical expression)</li>
<li><code>ot</code> : optimization type (0 for optimBasic, 1 for optimMaxRe, 2 for optimInPhase)</li>
</ul></div>
</div>
</div>
<footer class="col-md-12">
<hr>
<p>Copyright © 2019-2025 <a href="https://www.grame.fr">Grame-CNCM</a></p>
</footer>
<script>
var base_url = "../..",
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
</script>
<script src="../../js/base.js" defer></script>
<script src="/usr/share/javascript/mathjax/MathJax.js" defer></script>
<script src="../../search/main.js" defer></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="searchModalLabel">Search</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<p>From here you can search these documents. Enter your search terms below.</p>
<form>
<div class="form-group">
<input type="search" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results" data-no-results-text="No results found"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>
|