From Schmid.wiki

(→Mid/side Processing) |
|||

Line 32: | Line 32: | ||

p = 1.0 is a linear fade (at t=0.5, inputs are multiplied with 0.5, ~ -6dB) | p = 1.0 is a linear fade (at t=0.5, inputs are multiplied with 0.5, ~ -6dB) | ||

p = 2.0 is an exponential fade (at t=0.5, inputs are multiplied with 0.25, ~ -12dB) | p = 2.0 is an exponential fade (at t=0.5, inputs are multiplied with 0.25, ~ -12dB) | ||

− | |||

− | |||

− | |||

===Durations=== | ===Durations=== | ||

Line 64: | Line 61: | ||

wavelength(50 Hz) = 343.21 m/s / 50 per/s ~ 7 m/per | wavelength(50 Hz) = 343.21 m/s / 50 per/s ~ 7 m/per | ||

wavelength(20 KHz) = 343.21 m/s / 20000 per/s ~ 0.017 m/per = 1.7 cm/per | wavelength(20 KHz) = 343.21 m/s / 20000 per/s ~ 0.017 m/per = 1.7 cm/per | ||

+ | |||

+ | ===References=== | ||

+ | * [https://ccrma.stanford.edu/~jos/st/Decibels.html Julios O. Smith III: Mathematics of the DFT: Decibels] | ||

+ | * [http://audioundone.com/different-fade-shapes Audio Undone: Different Fade Shapes] | ||

+ | |||

[[Category:Audio]] | [[Category:Audio]] |

## Revision as of 10:25, 5 June 2017

## Contents

## Audio Cheatsheet

### Amplitude

In general:

Amplitude_dB = 20 log10(intensity/intensity_ref)

If we measure relative to a full scale signal:

Amplitude_dB = 20 log10(intensity)

So, for example:

Amplitude_dB( 1.0 ) = 20 log10(1) = 0 dB Amplitude_dB( 0.0 ) = 20 log10(0) = -infinity dB Amplitude_dB( 0.5 ) = 20 log10(0.5) ~ -6 dB Amplitude_dB( sqrt(0.5) ) = 20 log10(sqrt(0.5)) ~ -3 dB

### Mid/side Processing

From stereo til M/S:

side = 0.5 * (left - right) mid = 0.5 * (left + right)

From M/S to stereo:

left = mid + side right = mid - side

Derivation:

mid + side = 0.5 * (l + r) + 0.5 * (l - r) = 0.5 * l + 0.5 * r + 0.5 * l - 0.5 * r = l mid - side = 0.5 * (l + r) - 0.5 * (l - r) = 0.5 * l - 0.5 * r + 0.5 * l + 0.5 * r = r

### Exponential Cross-fade

Exponential / logarithmic cross-fades can be performed with this general formula, where out is the result of mixing in_a and in_b from t=0..1 with power p:

out = in_a t^p + in_b (1-t)^p

Different values of p result in different fade shapes:

p = 0.5 is an equal power fade (at t=0.5, inputs are multiplied with sqrt(0.5) ~ 0.707, ~ -3dB) p = 1.0 is a linear fade (at t=0.5, inputs are multiplied with 0.5, ~ -6dB) p = 2.0 is an exponential fade (at t=0.5, inputs are multiplied with 0.25, ~ -12dB)

### Durations

Given that tempo is beat/minute and sample_rate is smp/s:

beat_duration = 60/tempo s/b sample_duration = 1/sample_rate s

Examples (assumes sample_rate = 48000 smp/s):

beat_duration(120) = 60/120 = 0.5 s/b = 24000 smp beat_duration(140) = 60/140 ~ 0.428 s/b ~ 20571 smp

Examples (assumes sample_rate = 44100 smp/s):

beat_duration(140) = 60/140 ~ 0.428 s/b = 18900 smp

### Relative Frequency

If we want to adjust the pitch of a sound a given number of semitones (positive or negative):

relative_frequency = 2^(semitones/12)

Examples:

relative_frequency(+12) = 2^(12/12) = 2 # octave relative_frequency(-12) = 2^(-12/12) = 0.5 # octave down relative_frequency(+7) = 2^(7/12) ~ 1.50 # fifth relative_frequency(+4) = 2^(4/12) ~ 1.26 # major third

### Wave length

Speed of sound:

343.21 m/s

Examples:

wavelength(50 Hz) = 343.21 m/s / 50 per/s ~ 7 m/per wavelength(20 KHz) = 343.21 m/s / 20000 per/s ~ 0.017 m/per = 1.7 cm/per