Amplify

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (1 revision)
(add link to avs+ documentation)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Func4Def|Amplify(clip, float ''amount1'' ''[, ...]'')|Amplify(clip, float ''left'', float ''right'')|AmplifydB(clip, float ''amount1'' ''[, ...]'')|AmplifydB(clip, float ''left'', float ''right'')}}
+
<div style="max-width:62em" >
  
Amplify multiplies the audio samples by ''amount''. You can specify different factors for each channel.
+
<div {{BlueBox2|40|0|3px solid purple}} >
If there are more volumes than there are channels, they are ignored. If there are fewer volumes than channels, the last volume is applied to the rest of the channels.  
+
{{AvsPlusFullname}}<br>
 +
Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/amplify.html https://avisynthplus.readthedocs.io]
 +
</div>
  
AmplifydB is the same except values are in decibels (dB). You can use negative dB values (or scale factors between 0 and 1) for reducing volume. Negative scale factors will shift the phase by 180 degrees (i.e. invert the samples).
 
  
Audio samples are converted to 16 bits in the process.
+
These filters amplify the audio of the clip by the prescribed amount. You can specify different {{FuncArg|amount}} arguments for each channel. If there are more arguments than there are channels, the extra ones are ignored. If there are fewer arguments than channels, the last one is applied to the rest of the channels.  
  
 +
8bit and 24bit audio is converted to [[Float|float]]; the other audio formats are kept as they are. See [[ConvertAudio]].
  
 +
 +
{{FuncDefH4|Amplify}}
 +
{{FuncDef|Amplify(clip, float ''amount'' [, float ''amount'' ]...)}}
 +
 +
:{{Par2|amount|float|1.0}}
 +
::Multiply (scale) the audio by {{FuncArg|amount}}; values are linear :
 +
::*{{FuncArg|amount}} > 1.0 increases volume
 +
::*{{FuncArg|amount}} < 1.0 decreases volume
 +
::*{{FuncArg|amount}} = 1.0 retains the same volume (default)
 +
::*Negative scale factors will shift the [http://www.soundonsound.com/sos/apr08/articles/phasedemystified.htm phase] by 180 degrees (i.e. invert the samples)
 +
 +
 +
{{FuncDefH4|AmplifyDB}}
 +
{{FuncDef|AmplifyDB(clip, float ''amount'' [, float ''amount'' ]...)}}
 +
 +
:{{Par2|amount|float|0.0}}
 +
::Multiply (scale) the audio by {{FuncArg|amount}}; values are in dB ([[wikipedia:Decibel|decibels]]) :
 +
::*{{FuncArg|amount}} > 0.0 increases volume
 +
::*{{FuncArg|amount}} < 0.0 decreases volume
 +
::*{{FuncArg|amount}} = 0.0 retains the same volume (default)
 +
 +
 +
The relation between ''linear'' and ''decibel'' gain control is:
 +
::'''lin''' = 10<sup> ('''dB'''/20)</sup>
 +
::'''dB''' = 20'''·'''log<sub>10</sub>('''lin''')
 +
For example,
 +
:*<tt>AmplifyDB(&nbsp;  0.0)</tt> ''is equivalent to''&nbsp; <tt>Amplify(1.0)&nbsp;</tt> (no change)
 +
:*<tt>AmplifyDB(&nbsp; 6.0)</tt> ''is equivalent to''&nbsp; <tt>Amplify(2.0)&nbsp;</tt> (about twice as loud)
 +
:*<tt>AmplifyDB( -6.0)</tt> ''is equivalent to''&nbsp; <tt>Amplify(0.5)&nbsp;</tt> (about half as loud)
 +
:*<tt>AmplifyDB( 20.0)</tt> ''is equivalent to''&nbsp; <tt>Amplify(10)&nbsp;&nbsp;</tt> (much louder)
 +
:*<tt>AmplifyDB(-20.0)</tt> ''is equivalent to''&nbsp; <tt>Amplify(0.1)&nbsp;</tt> (much softer)
 +
 +
 +
More examples:
 +
:*<tt>AmplifyDB(+3, 0)</tt> increases the volume of the left channel by a small amount.
 +
:*<tt>Amplify(-1, 1)</tt> inverts the phase of the left channel. See Wikipedia: [[Wikipedia:Out_Of_Phase_Stereo|Out Of Phase Stereo]].
 +
 +
==== See Also ====
 +
* [[Normalize]] - with ''show=true'', can show the maximum amplification possible without [[Wikipedia:Clipping_%28audio%29|clipping]].
 +
 +
</div>
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 +
[[Category:Audio_filters]]

Latest revision as of 05:32, 18 September 2022

AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io


These filters amplify the audio of the clip by the prescribed amount. You can specify different amount arguments for each channel. If there are more arguments than there are channels, the extra ones are ignored. If there are fewer arguments than channels, the last one is applied to the rest of the channels.

8bit and 24bit audio is converted to float; the other audio formats are kept as they are. See ConvertAudio.


Amplify

Amplify(clip, float amount [, float amount ]...)

float  amount = 1.0
Multiply (scale) the audio by amount; values are linear :
  • amount > 1.0 increases volume
  • amount < 1.0 decreases volume
  • amount = 1.0 retains the same volume (default)
  • Negative scale factors will shift the phase by 180 degrees (i.e. invert the samples)


AmplifyDB

AmplifyDB(clip, float amount [, float amount ]...)

float  amount = 0.0
Multiply (scale) the audio by amount; values are in dB (decibels) :
  • amount > 0.0 increases volume
  • amount < 0.0 decreases volume
  • amount = 0.0 retains the same volume (default)


The relation between linear and decibel gain control is:

lin = 10 (dB/20)
dB = 20·log10(lin)

For example,

  • AmplifyDB(  0.0) is equivalent to  Amplify(1.0)  (no change)
  • AmplifyDB(  6.0) is equivalent to  Amplify(2.0)  (about twice as loud)
  • AmplifyDB( -6.0) is equivalent to  Amplify(0.5)  (about half as loud)
  • AmplifyDB( 20.0) is equivalent to  Amplify(10)   (much louder)
  • AmplifyDB(-20.0) is equivalent to  Amplify(0.1)  (much softer)


More examples:

  • AmplifyDB(+3, 0) increases the volume of the left channel by a small amount.
  • Amplify(-1, 1) inverts the phase of the left channel. See Wikipedia: Out Of Phase Stereo.

[edit] See Also

  • Normalize - with show=true, can show the maximum amplification possible without clipping.
Personal tools