71 dB
Headphoneus Supremus
Generating a linear fade in of length T for a signal happens by multiplying the signal with function
f(t) = k*t, t ∈ [0, T]
f(t) = 0, t < 0
f(t) = 1, t > T
where k is the inverse of the length of the fade in (k = 1/T) and at the starting point of the fade in t = 0.
Logarithmic fade in/out is more natural than linear fade in/out, because they are linear on logarithmic scale and especially logarithmic fade out follows the way reverberant sound decay. Here is -17.4 dB => 0 dB logarithmic fade in:
f(t) = exp(2*k*t)/exp(2), t ∈ [0, T]
f(t) = 0, t < 0
f(t) = 1, t > T
The (theoretical) problem with these fade ins/outs is that the derivative of the fade in curve doesn't exist in the beginning and the end of the fade in/out. The sharp corners are theoretically illegal in digital audio, because they require infinite bandwidth. To fix this, the curves needs to be modified so that the derivate exists everywhere eliminating the need for infinite bandwidth. Since the derivative before and after the fade in/out section is clearly zero, the derivative of the fade in/out curve needs to also be zero at these points. Lets use scaled time variable x = k*t so that the scaled length of the fade in/out is 1. We can create the derivative for fixed "linear" fade in as:
f'(x) = 𝛂(x)(x-1) = 𝛂(x² - x)
where 𝛂 in a scaling constant. f'(x) clearly is zero when x = 0 or x = 1 satisfying our goal. Now the fixed linear fade in curve is the integral of f'(x):
f(x) = ∫f'(x)dx = 𝛂∫(x² - x)dx = 𝛂(x³/3 - x²/2) + C
The integration constant C can be determined by setting
f(0) = 0
giving us C = 0. For calculating scaling constant 𝛂, we set
f(1) = 1
giving us 𝛂 = -6.
Hence our fixed linear fade in function is
f(x) = 3x² - 2x³
It looks like this:
Only the blue 0 to 1 part of it is used. Using this fixed linear fade in we can create fixed logarithmic fade in
f(x) = exp( 𝛽 * ( 3x² - 2x³ ) ) / exp( 𝛽 )
where 𝛽 determines the amount of fade in (about 8.7*𝛽 dB). In the graph below 𝛽=2 (17.4 dB fade in) and the gray dotted line shows the normal logarithmic fade in for comparison:
f(t) = k*t, t ∈ [0, T]
f(t) = 0, t < 0
f(t) = 1, t > T
where k is the inverse of the length of the fade in (k = 1/T) and at the starting point of the fade in t = 0.
Logarithmic fade in/out is more natural than linear fade in/out, because they are linear on logarithmic scale and especially logarithmic fade out follows the way reverberant sound decay. Here is -17.4 dB => 0 dB logarithmic fade in:
f(t) = exp(2*k*t)/exp(2), t ∈ [0, T]
f(t) = 0, t < 0
f(t) = 1, t > T
The (theoretical) problem with these fade ins/outs is that the derivative of the fade in curve doesn't exist in the beginning and the end of the fade in/out. The sharp corners are theoretically illegal in digital audio, because they require infinite bandwidth. To fix this, the curves needs to be modified so that the derivate exists everywhere eliminating the need for infinite bandwidth. Since the derivative before and after the fade in/out section is clearly zero, the derivative of the fade in/out curve needs to also be zero at these points. Lets use scaled time variable x = k*t so that the scaled length of the fade in/out is 1. We can create the derivative for fixed "linear" fade in as:
f'(x) = 𝛂(x)(x-1) = 𝛂(x² - x)
where 𝛂 in a scaling constant. f'(x) clearly is zero when x = 0 or x = 1 satisfying our goal. Now the fixed linear fade in curve is the integral of f'(x):
f(x) = ∫f'(x)dx = 𝛂∫(x² - x)dx = 𝛂(x³/3 - x²/2) + C
The integration constant C can be determined by setting
f(0) = 0
giving us C = 0. For calculating scaling constant 𝛂, we set
f(1) = 1
giving us 𝛂 = -6.
Hence our fixed linear fade in function is
f(x) = 3x² - 2x³
It looks like this:
Only the blue 0 to 1 part of it is used. Using this fixed linear fade in we can create fixed logarithmic fade in
f(x) = exp( 𝛽 * ( 3x² - 2x³ ) ) / exp( 𝛽 )
where 𝛽 determines the amount of fade in (about 8.7*𝛽 dB). In the graph below 𝛽=2 (17.4 dB fade in) and the gray dotted line shows the normal logarithmic fade in for comparison:
Last edited: