Skip to content

Instantly share code, notes, and snippets.

@joslloand
Created May 14, 2018 19:10
Show Gist options
  • Save joslloand/542c5134265008c3441f4cf677748f16 to your computer and use it in GitHub Desktop.
Save joslloand/542c5134265008c3441f4cf677748f16 to your computer and use it in GitHub Desktop.
Mode Matching Decoder - pseudo-inverse test

/* Mode Matching decoder - 3D beam (multiple)

normalization: soundfield pressure (amplitude), energy, rms

*/

/* NOTE:

Pseudo-inverse is VERY slow for order > 1, to the point of being unusable in practice.

This suggests we need another solution for Mode Matching decoders. Could be that PINV can be provided by BOOST. In reviewing the BOOST documentation, it isn't immediately clear how this would be done.

*/

// 3.20.5 t-design (platonic solid) from "http://neilsloane.com/sphdesigns/dim3/des.3.20.5.txt" ~directions = [ [ 0.78539816339745, 0.61547970867039 ], [ 0.78539816339745, -0.61547970867039 ], [ -0.78539816339745, 0.61547970867039 ], [ 2.3561944901923, 0.61547970867039 ], [ -0.78539816339745, -0.61547970867039 ], [ 2.3561944901923, -0.61547970867039 ], [ -2.3561944901923, 0.61547970867039 ], [ -2.3561944901923, -0.61547970867039 ], [ 1.5707963267949, 1.2059324986814 ], [ -1.5707963267949, 1.2059324986814 ], [ 1.5707963267949, -1.2059324986814 ], [ -1.5707963267949, -1.2059324986814 ], [ 0.0, 0.36486382811348 ], [ 0.0, -0.36486382811348 ], [ 3.1415926535898, 0.36486382811348 ], [ 3.1415926535898, -0.36486382811348 ], [ 1.2059324986814, 0.0 ], [ 1.9356601549084, 0.0 ], [ -1.2059324986814, 0.0 ], [ -1.9356601549084, 0.0 ], ]

// choose one: ~k = \basic ~k = \energy ~k = \controlled

// choose one: ~match = \amp ~match = \energy ~match = \rms

// choose one: ~order = 1 ~order = 2 ~order = 3 ~order = 5

// test ( a = HoaDecoderMatrix.newModeMatch( directions: ~directions, k: ~k, match: ~match, order: ~order ) )

// 1st order, "quick" // 2nd order, start: 4:56pm; finish: 5:20pm // 3rd order, start: 5:23pm; finish: [still computing, 11:00am, four days later]

// inspect a.matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment