Menu

Tree [625439] aes-paper /
 History

HTTPS access


File Date Author Commit
 data 2020-10-12 Aaron Heller Aaron Heller [f6fce4] fixed a bug in appending speakers arrays and in...
 examples 2019-12-26 Aaron Heller Aaron Heller [710b4c] Updated examples and Makefile
 faust 2021-02-12 Aaron Heller Aaron Heller [c6f374] more Faust stuff
 notebooks 2021-05-09 Aaron Heller Aaron Heller [13d102] wide-scale mods to support evaluation of mixed-...
 AUTHORS.md 2019-09-23 Aaron Heller Aaron Heller [d09c93] added LICENSE and AUTHORS files
 AllRad_V2R.py 2020-09-16 Aaron Heller Aaron Heller [43e614] PyCharm reformatting
 Decoder.py 2021-05-26 Aaron Heller Aaron Heller [644dc9] much more code cleanup
 LICENSE.md 2019-09-23 Aaron Heller Aaron Heller [d09c93] added LICENSE and AUTHORS files
 Makefile 2021-03-05 Aaron Heller Aaron Heller [c9b9dd] add .phony targets to Makefile
 README.md 2021-05-29 Aaron Heller Aaron Heller [625439] updates to README.md for colab execution
 Timer.py 2020-08-30 Aaron Heller Aaron Heller [d55680] tinker with objective fn to keep all the speake...
 acn_order.py 2020-09-16 Aaron Heller Aaron Heller [43e614] PyCharm reformatting
 adt_scmd.py 2020-09-16 Aaron Heller Aaron Heller [43e614] PyCharm reformatting
 aes_examples.py 2021-05-26 Aaron Heller Aaron Heller [b3e195] still more clean up
 aes_examples_2band.py 2021-05-26 Aaron Heller Aaron Heller [c91ec8] More PEP8
 ambi-decoder_preamble2.dsp 2021-05-18 Aaron Heller Aaron Heller [4d2170] write vienna decoders
 basic_decoders.py 2021-05-26 Aaron Heller Aaron Heller [644dc9] much more code cleanup
 complex_spherical_harmonics_unit_tests.py 2020-09-16 Aaron Heller Aaron Heller [43e614] PyCharm reformatting
 example_speaker_arrays.py 2021-05-29 Aaron Heller Aaron Heller [f69c61] Changed name of stage array.
 g_max.py 2019-12-02 Aaron Heller Aaron Heller [96f6bb] lots of tinkering, trying to find the right rep...
 grid_plot.py 2019-09-23 Aaron Heller Aaron Heller [a6492c] AllRad_V2R, acn_order, grid_plot, rVrE, spheric...
 localization_models.py 2021-05-26 Aaron Heller Aaron Heller [c93fa3] Many improvements to plotting.
 loudspeaker_layout.py 2021-05-26 Aaron Heller Aaron Heller [c93fa3] Many improvements to plotting.
 mixed_order_max_rE.py 2021-02-12 Aaron Heller Aaron Heller [e54f1b] fixed bug in mixed order calculation in channel...
 nando_examples_2band.py 2021-05-29 Aaron Heller Aaron Heller [f69c61] Changed name of stage array.
 optimize_decoder_matrix.py 2021-05-27 Aaron Heller Aaron Heller [273702] get rid of unused imports
 optimize_dome.py 2021-05-26 Aaron Heller Aaron Heller [93edab] removed +/-1 bounds and upped tikhonov to 0.01 ...
 plot_utils.py 2021-05-26 Aaron Heller Aaron Heller [c93fa3] Many improvements to plotting.
 plotly_image.py 2019-12-26 Aaron Heller Aaron Heller [ee1fa1] many updates to plotly_image.py and rVrE.py
 program_channels.py 2021-05-26 Aaron Heller Aaron Heller [c91ec8] More PEP8
 rVrE.py 2021-05-25 Aaron Heller Aaron Heller [10b061] change rVrE.py to do Stage2017
 ray_triangle_intersection.py 2020-09-16 Aaron Heller Aaron Heller [43e614] PyCharm reformatting
 real_spherical_harmonics.py 2021-05-26 Aaron Heller Aaron Heller [c91ec8] More PEP8
 reports.py 2021-05-27 Aaron Heller Aaron Heller [1a8b78] put reports in ./reports directory
 requirements.txt 2021-02-12 Aaron Heller Aaron Heller [e54f1b] fixed bug in mixed order calculation in channel...
 run_tests.py 2021-05-26 Aaron Heller Aaron Heller [644dc9] much more code cleanup
 shelf.py 2021-05-19 Aaron Heller Aaron Heller [ccfa00] added gamma0() to match the LF and HF matrices ...
 slider.py 2018-09-09 Aaron Heller Aaron Heller [f6ba20] added reference to the plotly docs
 spherical_data.py 2021-05-26 Aaron Heller Aaron Heller [644dc9] much more code cleanup
 spherical_grids.py 2021-05-26 Aaron Heller Aaron Heller [977f2d] imported sph2cart and friends into spherical_grids
 spherical_plot.py 2019-09-23 Aaron Heller Aaron Heller [a6492c] AllRad_V2R, acn_order, grid_plot, rVrE, spheric...
 spkr_array_analysis_scores.py 2020-09-16 Aaron Heller Aaron Heller [43e614] PyCharm reformatting
 stage.csv 2020-08-26 Aaron Heller Aaron Heller [b529e3] added a column for real/imag speaker
 write_faust_decoder.py 2021-05-26 Aaron Heller Aaron Heller [b3e195] still more clean up

Read Me

ADT_Evaluation

Introduction

This is my latest sandbox for a Python/NumPy/SciPy/SymPy/Jax
implementation of the Ambisonic Decoder Toolbox (ADT). It is a work in progress, so use at your own risk.

There are two code-bases here: Decoder generation and producing
evaluation plots of decoders generated by the MATLAB ADT. They will be integrated at some point.

Making Decoders

To make decoders, take a look at the files:

  • aes_examples_2band.py
  • nando_examples_2band.py

These will reproduce the figures from our AES150 paper. See section "Running in the Cloud" to run these in Google Colab.

Ploty Performance Plots

To make interactive Plotly plots of decoder performance:

  1. Save the results from a MATLAB ADT run to a json "SCMD" file. For an
    example of how to do this see

       adt/examples/run_brh_spring2017.m
    
  2. run rErV.py to make the 3D speaker layout sphere plots

  3. run plotly_image.py to make the 2D performance plots

Installation

This code is tested with Python3.8, although I think it should run
in version 3.6 or newer as it uses f-strings. The core code also
needs:

  • NumPy

  • SciPy

  • SymPy

  • Pandas

  • Matplotlib

These are all available with the Anaconda distribution of Python

The optimizer needs:

The fancy 3D graphics need:
* Plotly, pip install plotly

  • Plotly, pip install plotly

Running in the Cloud on Google Research Colab

The code has been tested in Google's Colaboratory ( https://colab.research.google.com/notebooks/intro.ipynb ).
At this time, we are seeing differences when executing in a Runtime VM with a GPU, so we suggest not using a GPU until we can resolve this. Excution without a GPU is the default configuration in Colab.

To reporduce the plots from our AES150 Paper:

  1. Goto https://colab.research.google.com/ and select "New Notebook" at the bottom of the menu.

  2. Paste the following into the first cell and press "Run Cell" (the "play" icon on the left)

%pip install backports.cached-property dominate
%cd /content
!rm -rf adt_evaluation/
!git clone https://bitbucket.org/ambidecodertoolbox/adt_evaluation.git
%cd /content/adt_evaluation/
!git checkout aes-paper
  1. Create a new cell by selecting "+ Code", enter and run
%run aes_examples_2band.py
  1. Create a new cell by selecting "+ Code", enter and run
%run nando_examples_2band.py
  1. This creates HTML reports of the decoder performance in the subdirectrory "reports". To view, download this directory to your computer and open with a browser. Unfortunately there's no way to view these directly from the Colab VM.

License

The code in this package is licensed under the GNU Affero Public
License. The Faust code generated by the toolbox is covered by the
BSD 3-Clause License, so that it may be combined with other code
without restriction. If these terms are an impediment to your use of
the toolbox, please contact me with details of your application.

Notation

I've been trying to clean up the notation I used in the MATLAB
ADT. I've been starting unit vector and components of unit vectors
with 'u', so [ux, uy, uz] and using a suffix of 0 to indicate a
flattened (ravel'ed) variable.

Unit Tests

One of my goals with this is to
have everything include unit tests both for pedagogical reasons and so you
can convince yourself that the code is doing the correct thing. In
some cases, like real_spherical_harmonics.py the unit tests are longer
than the implementation itself.

NumPy representation of vectors and collections of vectors

Consistency is the last refuge of the unimaginative. -- Oscar Wilde

I've struggled with the question of how to represent vectors and
arrays that are a collection of vectors. By linear algebra convention,
vectors in an N-dimensional space are written as Nx1 column vectors,
for 3-D often written in inline text as [x y z]^T (the transpose of a
row vector). By extension, a collection of M 3-D coordinates is
written as an [3 x M] array. Transforming those coordinates into
spherical harmonics results in a [rank(Y) x M] array, where rank(Y) is
the number of spherical harmonics in the basis.

In MATLAB, there are no 1-D arrays, so a column vector is a 3x1 array
and a row vector is 1x3. NumPy on the other hand, has 1-D arrays, but
if we make a list of M of them, and then turn that in into an nd-array
with numpy.array, we get an Mx3 array. numpy.column_stack gives the
desired result, but the printing is awkward, as it shows row-major.

In[107]: v1 = (1,2,3); v2=(10,20,30)

In[108]: np.array((v1, v2))
Out[108]:
array([[ 1,  2,  3],
       [10, 20, 30]])

In[109]: np.column_stack((v1, v2))
Out[109]:
array([[ 1, 10],
       [ 2, 20],
       [ 3, 30]])

The use of [N x 1] arrays for vectors is consistent with NumPy and
SciPy linear algebra writeups, such as:

There is a NumPy matrix object that has the semantics of MATLAB's 2-D
arrays, however its use is discouraged, and it may be removed in the
future.

So far so good... but now when we look at some SciPy functions that
take collections of vectors as their input, like those found in
scipy.spatial, we see that they use row vectors, hence must be called
with the transpose of the arrays we construct above. See
scipy.Delaunay, for example:

 points : ndarray of floats, shape (npoints, ndim)
          Coordinates of points to triangulate

Sigh...

Aaron Heller heller@ai.sri.com
23 Sept 2019

3 Jan 2020 Addendum:

I recently found a good discussion of this on Stack Exchange:
https://stats.stackexchange.com/questions/284995/are-1-dimensional-numpy-arrays-equivalent-to-vectors



Coverity Scan Build Status

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.