Understanding hadamard matrices in reverb

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hello,

I'm currently making my own little reverb based on some schematics I've found. These schematics include the use of a hadamard mixing matrix in the mixing matrix section of this for example: http://www.music.mcgill.ca/~gary/618/week3/img9.gif

Basically it's an FDN. I understand how to make the FDN and all that but I truly do not understand the hadamard matrix. I can calculate how it should look with 1s and -1s but the implementation of them is completely beyond my understanding. At this point I've looked and read many different papers that have different methods but none of them that I understand. Quite a few refer to the "butterfly diagram" method and then just simply add and substract the signals together such as here in figure 5: http://www.music.mcgill.ca/~nils/classe ... UMT614.pdf

Others mention the sinus and cosinus of phi, but once again my understanding is limited. Does the phi in this case represent the golden ratio, the incoming signals?

My original plan was going to be an 8x8 hadamard matrix to mix my signals but I also want everything to run fast therefore I'm more than willing to do a 4x4 especially to understand the concept. I would REALLY appreciate it if someone could explain this concept to me. I've used way too many hours looking these things up.

If it makes any influence, I'm programming in Csound but I also understand MaxMSP and some Python.

Thank you!

Post

So if you can build up the matrix like you say from -1's and 1's, then all you need to do to get your fdn working is to multiply every delay feedback line with every feedback line according to the rows in the matrix.

So for a matrix of
1 | 1 | 1 | 1
1 |-1 | 1 |-1
1 | 1 |-1 |-1
1 |-1 |-1 | 1

And your delay lines: a, b, c, d

Your first(a) feedback line will be: 1*a + 1*b + 1*c + 1*d
The 2nd (b) is: 1*a + -1*b + 1*c + -1*d
The 3rd (c): 1*a + 1*b + -1*c + -1*d
... and you can guess the fourth?

Oh, and you need to scale them down with multiplying every feedback line with 1/sqrt(4) [four beeing the number of rows here]
Now you have a lossless fdn.
Then you need to add loss to it or it will decay on forever.

The addition and subtraction stuff you were getting lost on is called Fast Walsh–Hadamard transform. This does the same thing as the above but limits the amount of calculations to a more manageable amount, and only adds and subs, no multiplications. Wikipedia has a very good explanation of it: http://en.wikipedia.org/wiki/Hadamard_transform
www.mkdr.net

MophoEd - the BEST DSI Mopho Editor VSTi

Post

And if you don't know how to create Hadamard matrices, or have done it wrong for some reason, no worry. Thery are very simple to construct. Just take a 2nd order Hadamard matrix:
A =
1 1
1 -1

And make a new matrix:
B =
A A
A -A

Write that open and you end up with:
1 | 1 | 1 | 1
1 |-1 | 1 |-1
1 | 1 |-1 |-1
1 |-1 |-1 | 1


Ps.
C =
B B
B -B
www.mkdr.net

MophoEd - the BEST DSI Mopho Editor VSTi

Post

For constructing the Fast Walsh–Hadamard transform you'll basically need a natural ordered Hadamard matrix. That's very easy too. You just apply your matrix with the "bit-reversal permutation" and then the "Gray code permutation". (You can find good explanations of these online). Then you just "buttefly add" according to the matrix.
www.mkdr.net

MophoEd - the BEST DSI Mopho Editor VSTi

Post

Ha what I did was almost perfect then except that I didn't have the 1 /sqrt of the amount of rows, I just did a * 0.4. It felt like it would be a lot more complex according to the way it was explained. Thanks a lot

Post Reply

Return to “DSP and Plugin Development”