AH6

6x6 Almost Hadamard matrix
Author: Smashed Transistors
License: LGPL
Github: tiar/FDN/AH6.axo

Inlets

frac32buffer in0

frac32buffer in1

frac32buffer in2

frac32buffer in3

frac32buffer in4

frac32buffer in5

Outlets

frac32buffer out0

frac32buffer out1

frac32buffer out2

frac32buffer out3

frac32buffer out4

frac32buffer out5

Declaration
// 1/3sqrt2

// -1  2  2   -1  2  2
//  2 -1  2    2 -1  2
//  2  2 -1    2  2 -1

// -1  2  2    1 -2 -2
//  2 -1  2   -2  1 -2
//  2  2 -1   -2 -2  1

// -0.2357
//  0.4714
// 16+ 8*
void AH6(int32_t x0, int32_t x1, int32_t x2, int32_t x3, int32_t x4, int32_t x5,
         int32_t &y0, int32_t &y1, int32_t &y2, int32_t &y3, int32_t &y4,
         int32_t &y5) {
  int32_t yA = ___SMMUL(x0 + x1 + x2, 1431655765) << 1; // 2/3
  int32_t yB = ___SMMUL(x3 + x4 + x5, 1431655765) << 1;
  // coef = (2^31)/sqrt(2)
  int32_t coef = 1518500249;

  int32_t a = yA - x0;
  int32_t b = yB - x3;
  y0 = ___SMMUL(a + b, coef) << 1;
  y3 = ___SMMUL(a - b, coef) << 1;

  a = yA - x1;
  b = yB - x4;
  y1 = ___SMMUL(a + b, coef) << 1;
  y4 = ___SMMUL(a - b, coef) << 1;

  a = yA - x2;
  b = yB - x5;
  y2 = ___SMMUL(a + b, coef) << 1;
  y5 = ___SMMUL(a - b, coef) << 1;
}
Audio Rate
AH6(inlet_in0, inlet_in1, inlet_in2, inlet_in3, inlet_in4, inlet_in5,
    outlet_out0, outlet_out1, outlet_out2, outlet_out3, outlet_out4,
    outlet_out5);

Privacy

© 2024 Zrna Research