Skip to content

Instantly share code, notes, and snippets.

@joslloand
joslloand / atk_kernelDelay_test.scd
Created July 13, 2016 18:09
sc3-atk: Testing / Validation for Kernel Encoder & Decoder delay

/*

Testing / Validation for

Update Help to include note on kernel delay #15

Author: J Anderson

*/

/*
compare a decoder matrix to the pseudoinverse of an encoder matrix
of the same dimensions.
*/
~cart = [
[1, 1, 1],
[-1, 1, 1],
[-1, -1, 1],
[1, -1, 1],
// Icosahedron
// see:
"http://neilsloane.com/sphdesigns/dim3/des.3.12.5.txt".openOS
// Matrix Author: Ambisonic Toolkit
// --J Anderson
"http://www.ambisonictoolkit.net".openOS
/*
// Dodecahedron
// see:
"http://neilsloane.com/sphdesigns/dim3/des.3.20.5.txt".openOS
// Matrix Author: Ambisonic Toolkit
// --J Anderson
"http://www.ambisonictoolkit.net".openOS
/*

/*

Example code illustrating matrices suitable for decomposing a soundfield into two parts:

a) beam b) residual, aka null

Three classic Ambisonic beam patterns are available:

  1. planewave

/*

Example code exploring specification of phase in SC3.

  1. Array: phasor.cos, phasor.sin
  2. Signal *sineFill
  3. Signal -ifft
  4. SinOsc
  5. SinOsc & Hilbert
  6. SinOsc & HilbertFIR

/*

Example code exploring magnitude response of Hilbert implementation in SC3.

Test Magnitude response in the time domain with Quadrature sweeps.

  • Unit response
  • Hilbert response
  • System response
SSB {} // for viewing class with shortcut
// a 12 pole (6 per side) Hilbert IIR filter
// based on Sean Costello and Bernie Hutchins
// created by jl anderson - 7 jan 2001
HilbertIIR {
*ar {
arg in, // input signal
@joslloand
joslloand / modeMatchDecodeExample.scd
Created May 14, 2018 19:10
Mode Matching Decoder - pseudo-inverse test

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

normalization: soundfield pressure (amplitude), energy, rms

*/

/* NOTE:

@joslloand
joslloand / radialDecTest.scd
Created June 22, 2019 01:00
Test: magnitude design for multi-band decoding filters with focalisation

/* define:

~meanE ~matchWeight */

// meanE from degree weights (