Is the application of a volume envelope to an audio signal a linear transformation?

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

I'm wondering if applying a volume envelope to an audio signal is a linear transformation or not.
I'm pretty sure that the sustain/hold part is linear since it's a constant gain. But what about the attack and the release part?

Post

You are multiplying two signals together, the envelope and the input. This is essentially ring modulation (just that the envelope doesn't, typically, contain enough high frequency content to create obviously inharminic sounds), so unless the envelope is a constant DC value the process is non linear.

Post

Linear transformation is defined as satisfying the linearity property
L[ax(t)+by(t)] = aL[x(t)]+bL[y(t)]
Multiplication of a signal x(t) by an amplitude envelope u(t) is L[x(t)]=u(t)x(t)
Respectively L[ax(t)+by(t)] = u(t)(ax(t)+by(t))=au(t)x(t)=bu(t)y(t) =aL[x(t)]+bL[y(t)]
hence it is linear. It is however not time-invariant, hence can't be seen as a filtering process.

Post

In other words, linearity means that the transformation commutes with mixing. The fact that ring modulation intuitively feels nonlinear is because it's lacking time-invariance and therefore not LTI (or possibly because, depending on how you see it, either one or two signals are involved, and in the latter case it's not a transformation of a signal).

Also there are a number of different meanings of the term linear, which sometimes adds quite some confusion.
- linear function f(x)=ax+b
- linear transformation (the one that commutes with mixing). Apparently linear function f(x)=ax+b doesn't commute with mixing and therefore is not a linear transformation
- linear operation: addition or subtraction of two entities, or a multiplication of an entity by a number (including negation), where entities can be vectors, signals, matrices etc. This one AFAIK is even not a rigorously defined term, but I guess it can be often encountered.
Last edited by Z1202 on Sat Oct 24, 2020 8:27 am, edited 1 time in total.

Post

cyberterror wrote: Fri Oct 23, 2020 5:08 pm I'm wondering if applying a volume envelope to an audio signal is a linear transformation or not.
I'm pretty sure that the sustain/hold part is linear since it's a constant gain. But what about the attack and the release part?
I'd like to point out that one needs to be careful with the word "linear" because when it comes to DSP, we practically always use "linear" as a short-hand for "linear time-invariant" (or "linear shift-invariant" in sampled systems) which is really the property that is usually the useful one.

So both matt42 (making the assumption that "linear shift-invariant" is the actual property of interest as is usually the case) and Z1202 (who is being pedantic and pointing out that it is the shift-invariance that is being violated) above are kinda right.

The more useful story when it comes to DSP is that when you have a linear shift-invariant process, the signal bandwidth stays the same. However, when you multiply two signals (which is not a linear shift-invariant operation), the total bandwidth will be the sum of the individual bandwidths and therefore aliasing can happen if precautions are not taken. Other than that I cannot see how it would really matter one way or another.

Post

Actually, it might also be a matter of how you defined the operator. For example point-wise multiplication of a vector (ie. the signal) by a constant vector (eg. a fixed envelope) is a linear operation (from vectors to vectors), but a function f(x,y)=x*y of two variables (eg. signals) is quadratic (and hence not linear).

So the key here then is whether or not the envelope is considered a constant vector (ie. part of the operator) or another variable parameter. As it turns out, usually in DSP it makes sense to treat anything that varies over time as a variable, at which point linearity essentially becomes the same thing as linear time/shift-invariant.

Post

mystran wrote: Sat Oct 24, 2020 2:24 pm Actually, it might also be a matter of how you defined the operator. For example point-wise multiplication of a vector (ie. the signal) by a constant vector (eg. a fixed envelope) is a linear operation (from vectors to vectors), but a function f(x,y)=x*y of two variables (eg. signals) is quadratic (and hence not linear).
It's bilinear, that is linear in each of the arguments.
mystran wrote: Sat Oct 24, 2020 2:24 pm So the key here then is whether or not the envelope is considered a constant vector (ie. part of the operator) or another variable parameter. As it turns out, usually in DSP it makes sense to treat anything that varies over time as a variable, at which point linearity essentially becomes the same thing as linear time/shift-invariant.
Regardless of whether envelope is a constant vector or not, multiplication by an envelope is linear (bilinear), since it commutes with mixing. I'm not sure how linearity becomes the same as LTI, unless the multiplicator is constant in respect to time (and hence time-invariant). Using "linear" as a shortcut for "LTI" is another story. The word "linear" has too many different meanings ;).

Post

Z1202 wrote: Sat Oct 24, 2020 3:18 pm
mystran wrote: Sat Oct 24, 2020 2:24 pm Actually, it might also be a matter of how you defined the operator. For example point-wise multiplication of a vector (ie. the signal) by a constant vector (eg. a fixed envelope) is a linear operation (from vectors to vectors), but a function f(x,y)=x*y of two variables (eg. signals) is quadratic (and hence not linear).
It's bilinear, that is linear in each of the arguments.
Bilinear yes, linear no. It is quadratic (like almost all bilinear functions) with respect to uniform scaling of the input space: f(a*x,a*y)=a^2*x*y.
Last edited by mystran on Sat Oct 24, 2020 5:52 pm, edited 1 time in total.

Post

Thanks for your answers, however it will take me some time to fully comprehend them :)

Also, according to wikipedia on the subject of time invariance:
In the language of signal processing, this property can be satisfied if the transfer function of the system is not a direct function of time except as expressed by the input and output.
Since wikipedia sometimes has errors/mistakes, is the above correct?

Post

cyberterror wrote: Sat Oct 24, 2020 5:10 pm
In the language of signal processing, this property can be satisfied if the transfer function of the system is not a direct function of time except as expressed by the input and output.
Since wikipedia sometimes has errors/mistakes, is the above correct?
It is a bit vague I guess, but it's not wrong.

That said, I would generally consider "linear time-invariant" as a single concept, at least at first, because typically you can express a non-linear time-invariant system as a linear time-variant system and vice versa and it is the combination of linearity and time-invariance that gives you most of the nice properties such as no bandwith expansion.

Post

cyberterror wrote: Sat Oct 24, 2020 5:10 pm
In the language of signal processing, this property can be satisfied if the transfer function of the system is not a direct function of time...
The phrase sounds a bit awkward to me since the transfer function by definition cannot be a function of time, since it is defined only for time-invariant situations to begin with. (I must admit I haven't checked the full text of the source, though, or maybe there is a more generic definition I'm not aware of). It's like saying "light but without light".

Anyway, I think the point is not what is called what, but rather what do you expect from knowing that something is linear or LTI. Linearity gives you commutativity with mixing, as mentioned, OTOH LTI property makes the transformation behave as multiplication in the spectral domain (filtering), in which case it becomes possible to define the transfer function, which is simply the multiplier. This particularly implies that no new partials can be generated, since zero multiplied by anything still produces zero.

Time invariance simply means that if y(t)=F[x(t)], where F[] is the transformation, then y(t+T)=F[x(t+T)], that is time-shifting commutes with F. Intuitively, F contains no explicit dependency on time (but may depend on time differences and-or differentials)

Post

mystran wrote: Sat Oct 24, 2020 5:07 pm
Z1202 wrote: Sat Oct 24, 2020 3:18 pm
mystran wrote: Sat Oct 24, 2020 2:24 pm Actually, it might also be a matter of how you defined the operator. For example point-wise multiplication of a vector (ie. the signal) by a constant vector (eg. a fixed envelope) is a linear operation (from vectors to vectors), but a function f(x,y)=x*y of two variables (eg. signals) is quadratic (and hence not linear).
It's bilinear, that is linear in each of the arguments.
Bilinear yes, linear no. It is quadratic (like almost all bilinear functions) with respect to uniform scaling of the input space: f(a*x,a*y)=a^2*x*y.
Unless you substitute the same signal (or dependent signals) for both arguments, this quadratic aspect won't show up, but instead the linearity in respect to each of the arguments (signals) will.

Post

Z1202 wrote: Sun Oct 25, 2020 9:05 am
mystran wrote: Sat Oct 24, 2020 5:07 pm
Z1202 wrote: Sat Oct 24, 2020 3:18 pm
mystran wrote: Sat Oct 24, 2020 2:24 pm Actually, it might also be a matter of how you defined the operator. For example point-wise multiplication of a vector (ie. the signal) by a constant vector (eg. a fixed envelope) is a linear operation (from vectors to vectors), but a function f(x,y)=x*y of two variables (eg. signals) is quadratic (and hence not linear).
It's bilinear, that is linear in each of the arguments.
Bilinear yes, linear no. It is quadratic (like almost all bilinear functions) with respect to uniform scaling of the input space: f(a*x,a*y)=a^2*x*y.
Unless you substitute the same signal (or dependent signals) for both arguments, this quadratic aspect won't show up, but instead the linearity in respect to each of the arguments (signals) will.
See https://en.wikipedia.org/wiki/Linear_function and also https://en.wikipedia.org/wiki/Degree_of_a_polynomial

This is not just nitpicking either, because the distinction has great practical significance: you can represent linear functions of however many variables as affine maps (ie. augmented matrices) and use linear algebra to solve equations involving them. You can arbitrarily compose linear functions / operations and remain confident that the result will always be linear. As soon as you allow polynomials of degree 2 (such as x*y where both x and y are variables) then none of this is true anymore.

Post

My math PhD is from 30 years ago but I have to side with Z1202, although you are both right in one way or another. Bilinear literally means linear with respect to each argument. f(x,y)=x*y is linear with respect to x, linear with respect to y, but quadratic with respect to (x,y).
Follow me on Youtube for videos on spatial and immersive audio production.

Post

mystran wrote: Sun Oct 25, 2020 11:01 am See https://en.wikipedia.org/wiki/Linear_function and also https://en.wikipedia.org/wiki/Degree_of_a_polynomial

This is not just nitpicking either, because the distinction has great practical significance: you can represent linear functions of however many variables as affine maps (ie. augmented matrices) and use linear algebra to solve equations involving them. You can arbitrarily compose linear functions / operations and remain confident that the result will always be linear. As soon as you allow polynomials of degree 2 (such as x*y where both x and y are variables) then none of this is true anymore.
We're somewhat mixing two different concepts of linearity here, referred to in your link as linear functions and linear map respectively. I was clearly referring to the one implied by linear maps, since this is the one implicitly contained in the LTI. Furthermore, if I understood you correctly, you are implicitly extending the statements made in respect to functions of one argument to the functions of two arguments. Nevertheless, even in this stretched example the linearity of bilinear functions holds: you can stack as many bilinear functions as you want, and, as long as you keep independence of arguments, they stay (multi)linear.

Post Reply

Return to “DSP and Plugin Development”