A transfer function is just a matrix in disguise
This article was moved here from the old blog mixture-art.net, where it was written in June 2010. It remains as it was then, both in style and in content.
Common knowledge for engineers working in acoustics
That’s the subject of this post. Maybe because I’m doing work these days that doesn’t have much to do with sound, someone hit me with “Wait, what’s a transfer function?”
No, I’m not angry. If anything, it made me wonder whether my own guidance had been lacking, whether I’d left this alone for too long, whether I’d really been a good senior to my junior colleagues.
So, genuinely, I reflected on it.
Let me explain it in a way even a sharp elementary schooler could follow.
A “function”
Since it’s called a function, it’s a mathematical thing, so let’s define it briefly first: “The process or constraint by which something changes from an original state into a different state.”
For example: I threw a ball at a wall, there was a wall right in front of it, it hit the wall and bounced back. For the thrown ball to bounce back, there had to be a condition — a wall in its path.
I let go of my hands on a water slide, I flowed along the course, I ended up at the bottom. I ended up at the bottom because I followed the course.
This is a
transfer function.
Since it’s called “transfer,” it might be easier to understand in terms of communication. It’s a function that expresses how a signal, once sent, arrives at the receiving side.
on a phone call too, there’s a delay, noise mixes in, and it gets a bit harder to make out
Even on a phone call, there can be a time delay, noise gets mixed in, it gets a bit hard to hear, right?
A transfer function is convenient because once you’ve pinned it down, you can find the result for any input whatsoever.
Take the wall example again.
- Where is the wall positioned?
- What size is the wall?
- How much does it bounce back?
Turn all these details into a function, and then “what if I throw it straight on?”, “what if it’s a bounced throw?”, “what if I throw it at an angle?”, “how much will it bounce back if I throw it really fast?” — whatever the conditions, you can calculate it instantly with an equation.
Actually, it’s like an
equation.
y=4x+2
Something like that. No matter what x (the input) is, as long as you do the calculation, you know what y (the result) will be. That’s what a function is. (The example above is what’s called a linear function.)
A transfer function is a relative of these.
Now then, let’s open the throttle a little.
A transfer function is usually expressed as a
matrix.
Simply put, a matrix is a collection of numbers,
1 0 0
or
1 0 0 2 1 2 0 3 1
arranged like this. The details don’t matter here. Just go with “I guess that’s how it is.”
A transfer function expresses the idea that an original state A turns into B under the influence of a transfer function F, and mathematically it’s written as matrix multiplication.
B = F・A
State B is produced by hitting A with F.
The order might feel a little unnatural, but it’s not something essential, so don’t worry about it too much — just treat it as “that’s just how it is.” For example, it’s a fixed convention that in a fraction, the denominator goes on the bottom and the numerator on top. It’s that kind of thing. Just a rule of mathematical notation.
Now, here’s where transfer functions get interesting.
Engineers sometimes call a transfer function a
“filter,”
and they often use the phrase “apply an inverse filter.”
In a broad sense, this also means “solving a problem.”
Starting to feel kind of deep?
Well, well, let’s take it slow.
Sticking with the simple linear function example,
y=4x+2
asking “if x=2, what is y?” is
y=4×2 + 2 = 10 — that feels like “calculating.”
Now, “if we know y is 10, what is x?” is
10 = 4x +2 4x = 10 – 2 =8 x=2
That feels like “solving a problem.” This is what’s meant by “applying an inverse filter” in transfer function or matrix calculations.
Deriving the output from the input is just calculating, but figuring out what the input must have been when you know the output — that’s solving with the “inverse filter.” It feels like running things in reverse.
Now then, bringing this back to the transfer function story,
B = F・A
we apply the inverse filter of the transfer function F. Mathematically, applying an inverse filter means “multiplying by the inverse matrix of F from the left,” but again, just go with the feel of it.
The inverse matrix of F is written as F to the power of -1. Here I’ll write it as F^(-1).
So the equation becomes
F^(-1)・B = F^(-1)・F・A
When you apply the inverse filter, the rule is that “F^(-1)・F” cancels out and disappears.
that is what the inverse matrix is for, after all
That’s actually the whole point of the inverse matrix.
Therefore
A = F^(-1)・B
Input A can be found by applying the inverse filter of transfer function F to output B.
Now then, we’ve mastered everything we need.
From here, let’s talk about how this gets used in
acoustical engineering.
The process by which A becomes B is F.
Running it backward is F^(-1).
Here’s a simple example.
Somewhere, a performance (A) was played, and it reverberated in a certain hall (F), and it sounded good (B) to the listener.
B = F・A ・・・①
Now, listening to the same performance (A) at home (H), it sounded mediocre (C).
C = H・A ・・・②
Since mediocre is no good, you want it to sound good (B), so you wonder what kind of performance (D), compared to the earlier performance (A), would achieve that.
B = H・D ・・・③
For this to hold,
D = ?・A ・・・④
This is the kind of problem you can use this to “solve.”
This is going to get a bit “math-y,” but bear with me. We want to know the relationship between D and A, so let’s first apply “the inverse filter of H from the left” to turn ③ into something like ④.
H^(-1)・B = H^(-1)・H・D D = H^(-1)・B
Now substitute ① into this,
D = H^(-1)・F・A
There we go. Now we can solve, using F and H, for what kind of adjustment D should be relative to A.
Does that make sense, or not quite? Right?
Something’s bugging you, isn’t it.
Right.
“What even is F!”
“How do you figure out H!”
“How do you even get a transfer function in the first place?!”
Still more questions? Understood.
A “function” sounds like a fancy thing, but no matter how far you go, this is still talk about the real world, and in the end, it comes down to
measurement.
You find it out by actually measuring. You obtain the transfer function by measuring. That’s literally how it’s done.
This is a very simple idea: put in an input you know completely, and infer the answer by observing what the output turns out to be.
For example, in the case of a linear function,
y=ax+b
if a and b aren’t known, doing something like the following is enough to find them: try putting in x=0 and see what y comes out to, try putting in x=1 and see what y comes out to.
When measuring, you do something very similar to this to figure out F or H.
What’s “something similar”?
It means using a special matrix (I).
F・I = F
A matrix like that. It plays the role of “1” in multiplication.
What’s actually used in acoustic measurement is something called an
“impulse,”
which, in terms of time, is something that produces an infinitely loud sound at one instant, with no sound at all afterward, and in terms of frequency, is a sound that contains all frequencies equally (a bit of a high bar to explain here, so I’ll save it for another time). Measurement is done using this special kind of signal.
Once F or H is known this way, you can do things like feel as though you’re in hall F even though you’re actually in room H, or swap out a mediocre performance C for a surprisingly good one, B —
virtual things like that become possible.
There are all kinds of virtual technologies out in the world, each with its own ingenuity, but underlying all of them, at a basic level, is this logic of transfer functions and inverse filters.
Originally published in Japanese at https://clazytech.com/2010/06/1965/. Translated with LLM assistance and reviewed before publication.