SuperEQ

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (Frequencies: typo)
m (correction: float only)
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
+
<div style="max-width:64em" >
{{Template:Func2Def|SuperEQ(clip, string filename)|SuperEQ(clip, float ''band1'' [, float ''band2'', ..., float ''band18''])}}
+
'''Equalization''' (British: equalisation, '''EQ''' for short) is the process of adjusting the balance between frequency components within an electronic signal. The most well known use of equalization is in sound recording and reproduction but there are many other applications in electronics and telecommunications. The circuit or equipment used to achieve equalization is called an ''equalizer''. These devices boost or cut the energy of specific frequency bands. (source: [http://en.wikipedia.org/wiki/Equalization_%28audio%29 wikipedia:Equalization])
  
'''Parameter:'''
+
'''SuperEQ''' (''Shibatch Super Equalizer'') is a [http://en.wikipedia.org/wiki/Equalization_%28audio%29#Graphic_equalizer graphic equalizer], originally created as a plugin for Winamp by [http://shibatch.sourceforge.net/ Naoki Shibata]. SuperEQ uses 16383th order [http://en.wikipedia.org/wiki/Finite_impulse_response FIR] filters using [http://en.wikipedia.org/wiki/Fast_Fourier_transform FFT]. Its equalization is very precise. Note that unlike traditional equalizers, there is very little [http://en.wikipedia.org/wiki/Roll-off roll-off] or overlap between the bands.
{| border="1"
+
</div>
|-
+
 
| filename
+
__TOC__
| Set EQ bands from a preset file
+
 
|-
+
== Syntax and Parameters ==
| band1-band18
+
<div style="max-width:64em" >
| Set EQ bands within your script
+
{{FuncDef
|}
+
|SuperEQ(clip, string filename)
 +
}}
 +
 
 +
:{{Par2|clip|clip|}}
 +
::Source clip. Audio is always converted to [[Float]].
 +
::{{AvsPluscon}} no conversion is performed. Accepts [[Float]] audio only.
 +
 
 +
:{{Par2|filename|string|}}
 +
::Set EQ bands from a preset file (see [[#Preset_Files|Preset Files]] below).
  
 +
{{FuncDef
 +
|SuperEQ(clip, int ''band1'' [, int ''band2'', ..., int ''band18'' ] )
 +
}}
  
'''Shibatch Super Equalizer''' is a graphic equalizer, originally created as a plugin for Winamp by [http://shibatch.sourceforge.net/ Naoki Shibata]. SuperEQ uses 16383th order [http://en.wikipedia.org/wiki/Finite_impulse_response FIR] filters using [http://en.wikipedia.org/wiki/Fast_Fourier_transform FFT]. Its equalization is very precise. Note that unlike traditional equalizers, there is very little [http://en.wikipedia.org/wiki/Roll-off roll-off] or overlap between the bands.
+
:{{Par2|band1, ..., band18|int|}}
 +
::Set EQ bands within your script (see [[#Band_Gain_Arguments|Band Gain Arguments]] below).
  
 +
</div>
  
=====''Frequencies''=====
+
==== Frequencies ====
The 18 bands cover the following frequency ranges:
+
<div style="max-width:64em" >
{| border="1"  style="text-align:right"
+
The 18 {{FuncArg|bands}} cover the following frequency ranges:
 +
:{| class="wikitable"
 
!Band #!!''f'' (low)!!''f'' (high)
 
!Band #!!''f'' (low)!!''f'' (high)
 
|-  
 
|-  
Line 55: Line 69:
 
|17||11840 Hz||16744 Hz
 
|17||11840 Hz||16744 Hz
 
|-  
 
|-  
|18||16744 Hz||22000±Hz
+
|18||16744 Hz||22000±Hz&nbsp;
 
|}
 
|}
 
(adapted from [http://avisynth2.cvs.sourceforge.net/viewvc/avisynth2/avisynth/src/audio/supereq.h?view=markup#l197 avisynth/src/audio/supereq.h])
 
(adapted from [http://avisynth2.cvs.sourceforge.net/viewvc/avisynth2/avisynth/src/audio/supereq.h?view=markup#l197 avisynth/src/audio/supereq.h])
<!-- For example, the first line of the file controls 0 to 65 Hz, and the sixth controls 262 to 370 Hz. -->
+
</div>
<!-- These frequencies are the frequencies of C and F# in the modern equal tempered scales.
+
The lowest is the C two octaves below middle C. -->
+
  
=====''Preset Files''=====
+
==== Preset Files ====
SuperEQ can accept a [http://www.foobar2000.org foobar2k] equalizer '''Preset''' (.feq) file. Foobar's equalizer can be found in the [http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Preferences:Playback:DSP_Manager DSPManager], and presets are adjusted and saved from there as well.
+
<div style="max-width:64em" >
 +
'''SuperEQ''' can accept a [http://www.foobar2000.org foobar2k] equalizer '''Preset''' (.feq) file. Foobar's equalizer can be found in the [http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Preferences:Playback:DSP_Manager DSPManager], and presets are adjusted and saved from there as well.
  
<blockquote style="width:90%; padding:0 1em; border-left:4px solid blue;">A Preset file is a text file with a positive or negative integer on each line. Nothing else is allowed on the line, except white space. Empty (blank) lines are ignored. Each line sets the gain in [http://en.wikipedia.org/wiki/Decibel decibels] for a frequency band. All text after the first 18 non-empty lines are ignored, allowing you to add comments to the file.</blockquote>
+
{{NotaBene3|A ''Preset'' file is a text file with a positive or negative integer on each line. Nothing else is allowed on the line, except white space. Empty (blank) lines are ignored. Each line sets the gain in [http://en.wikipedia.org/wiki/Decibel decibels] for a frequency band. All text after the first 18 non-empty lines is ignored, allowing you to add comments to the file.}}
<!--
+
If SuperEQ encounters an error in the preset file, all bands after the invalid line will be set to the last valid decibel value; but if the file can not be parsed at all, all bands may be set to +20 dB (??)
+
-->
+
  
Preset files can be found in your \AviSynth25\Examples folder (Equalizer Presets.zip), available online [http://avisynth2.cvs.sourceforge.net/viewvc/avisynth2/avisynth/distrib/Examples/Equalizer%20Presets.zip here], or may be found by searching the Web for "foobar2000 presets."  
+
Preset files can be found in your \AviSynth\Examples folder (Equalizer Presets.zip), available online [http://avisynth2.cvs.sourceforge.net/viewvc/avisynth2/avisynth/distrib/Examples/Equalizer%20Presets.zip here], or may be found by searching the Web for "foobar2000 presets."  
 
+
'''Example 1:''' ''Apply a Preset file''
+
  
 +
{{HiddenH5|Example: Using a Preset file}}
 +
'''Example 1:''' ''Using a Preset file''
 +
<div {{BoxWidthIndent|36|2}} >
 
  SuperEq("C:\Equalizer Presets\Loudness.feq")
 
  SuperEq("C:\Equalizer Presets\Loudness.feq")
 +
</div>
  
 
Contents of Loudness.feq:
 
Contents of Loudness.feq:
 +
<div {{BoxWidthIndent|36|2}} >
 
  4
 
  4
 
  4
 
  4
Line 95: Line 108:
 
  4
 
  4
 
  4
 
  4
 
+
[http://audacityteam.org/ Audacity] spectrum analysis of processed [http://en.wikipedia.org/wiki/White_noise white noise]:
+
*comment*
 +
(text after the first 18 non-empty lines will be ignored)
 +
</div>
 +
To give a very rough indication of the frequency response of the above example, here is a screenshot of an [http://audacityteam.org/ Audacity] spectrum analysis of processed [http://en.wikipedia.org/wiki/White_noise white noise] (which should be approximately flat without equalization, allowing for low-frequency variability)
 
:[[File:SuperEQ-loudness-624x534.png|206px]]
 
:[[File:SuperEQ-loudness-624x534.png|206px]]
 +
</div>
  
=====''Band Gain Arguments''=====
+
==== Band Gain Arguments ====
From Avisynth version 2.60, '''band gain arguments''' allow all 18 bands to be set within your script, instead of requiring a preset file. The values are specified in decibels, in floating point or integer format.
+
<div style="max-width:68em" >
 +
From Avisynth version 2.60, '''band gain arguments''' allow all 18 {{FuncArg|bands}} to be set within your script, instead of requiring a preset file. The values are specified in decibels (in integer format).
  
'''Example 2:''' ''Boost midrange (speech) using band arguments''
+
{{HiddenH5|Example: Using ''band'' arguments}}
 
+
'''Example 2:''' ''Boost midrange (speech) using {{FuncArg|band}} arguments''
  ConvertAudioToFloat ## optional but recommended
+
<div {{BoxWidthIndent|36|2}} >
 +
  [[ConvertAudioToFloat]]
 
  SuperEQ(
 
  SuperEQ(
 
  \  0,  [*    0 -    65  *]
 
  \  0,  [*    0 -    65  *]
Line 125: Line 144:
 
  \  0  [* 16744 - 22000± *]
 
  \  0  [* 16744 - 22000± *]
 
  \ )
 
  \ )
  ConvertAudioTo16bit ## required for VirtualDub
+
  [[Normalize]] ## avoid possible overload
 
+
[[ConvertAudioTo16bit]]
[http://audacityteam.org/ Audacity] spectrum analysis of processed [http://en.wikipedia.org/wiki/White_noise white noise]:
+
</div>
 +
To give a very rough indication of the frequency response of the above example, here is a screenshot of an [http://audacityteam.org/ Audacity] spectrum analysis of processed [http://en.wikipedia.org/wiki/White_noise white noise] (which should be approximately flat without equalization, allowing for low-frequency variability)
 
:[[File:SuperEQ-midboost-624x534.png|206px]]
 
:[[File:SuperEQ-midboost-624x534.png|206px]]
  
  
=====''Requirements''=====
+
{{HiddenH5|Example: Audio Spectrum Analyzer}}
 +
'''Example 3:''' ''Audio Spectrum Analyzer''
 +
 
 +
This is a rather extreme example of what can be done with '''SuperEQ'''. It implements a ''spectrum analyzer'' by displaying the audio level in each of '''SuperEQ''''s 18 frequency bands, using [[Histogram#Audiolevels_mode|Histogram("audiolevels")]]. See [http://forum.doom9.org/showthread.php?t=172569 this doom9.org thread] for details.
 +
:[[File:Avisynth-spectrum-analyzer-04.jpg|320px]]
 +
:''(shown being fed a 400 Hz tone)''
 +
</div>
  
This plugin is optimized for processors which have cache equal to or greater than 128k bytes (16383*2*sizeof(float) = 128k). This plugin won't work efficiently with K6 series processors.
+
== Requirements ==
 +
<div style="max-width:68em" >
 +
This filter is optimized for processors which have cache equal to or greater than 128k bytes (16383*2*sizeof(float) = 128k). This plugin won't work efficiently with K6 series processors.
 +
</div>
  
'''Changes:'''
+
== Changes ==
 
{| border="1"
 
{| border="1"
 +
|-
 +
| v2.61
 +
| The band gain arguments can only be int. It's now enforced as such.
 
|-
 
|-
 
| v2.60
 
| v2.60
Line 151: Line 183:
 
Copyright © 2001-2003, Peter Pawlowski
 
Copyright © 2001-2003, Peter Pawlowski
 
All rights reserved.
 
All rights reserved.
 
 
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 +
[[Category:Audio_filters]]

Revision as of 12:54, 6 July 2017

Equalization (British: equalisation, EQ for short) is the process of adjusting the balance between frequency components within an electronic signal. The most well known use of equalization is in sound recording and reproduction but there are many other applications in electronics and telecommunications. The circuit or equipment used to achieve equalization is called an equalizer. These devices boost or cut the energy of specific frequency bands. (source: wikipedia:Equalization)

SuperEQ (Shibatch Super Equalizer) is a graphic equalizer, originally created as a plugin for Winamp by Naoki Shibata. SuperEQ uses 16383th order FIR filters using FFT. Its equalization is very precise. Note that unlike traditional equalizers, there is very little roll-off or overlap between the bands.

Contents


Syntax and Parameters

SuperEQ(clip, string filename)

clip  clip =
Source clip. Audio is always converted to Float.
AVS+ no conversion is performed. Accepts Float audio only.
string  filename =
Set EQ bands from a preset file (see Preset Files below).

SuperEQ(clip, int band1 [, int band2, ..., int band18 ] )

int  band1, ..., band18 =
Set EQ bands within your script (see Band Gain Arguments below).

Frequencies

The 18 bands cover the following frequency ranges:

Band # f (low) f (high)
1 0 Hz 65 Hz
2 65 Hz 93 Hz
3 93 Hz 131 Hz
4 131 Hz 185 Hz
5 185 Hz 262 Hz
6 262 Hz 370 Hz
7 370 Hz 523 Hz
8 523 Hz 740 Hz
9 740 Hz 1047 Hz
10 1047 Hz 1480 Hz
11 1480 Hz 2093 Hz
12 2093 Hz 2960 Hz
13 2960 Hz 4186 Hz
14 4186 Hz 5920 Hz
15 5920 Hz 8372 Hz
16 8372 Hz 11840 Hz
17 11840 Hz 16744 Hz
18 16744 Hz 22000±Hz 

(adapted from avisynth/src/audio/supereq.h)

Preset Files

SuperEQ can accept a foobar2k equalizer Preset (.feq) file. Foobar's equalizer can be found in the DSPManager, and presets are adjusted and saved from there as well.

A Preset file is a text file with a positive or negative integer on each line. Nothing else is allowed on the line, except white space. Empty (blank) lines are ignored. Each line sets the gain in decibels for a frequency band. All text after the first 18 non-empty lines is ignored, allowing you to add comments to the file.

Preset files can be found in your \AviSynth\Examples folder (Equalizer Presets.zip), available online here, or may be found by searching the Web for "foobar2000 presets."

Example: Using a Preset file

Example 1: Using a Preset file

SuperEq("C:\Equalizer Presets\Loudness.feq")

Contents of Loudness.feq:

4
4
4
2
-2
-2
-2
-2
-2
-2
-2
-4
-10
-7
0
3
4
4

*comment* 
(text after the first 18 non-empty lines will be ignored)

To give a very rough indication of the frequency response of the above example, here is a screenshot of an Audacity spectrum analysis of processed white noise (which should be approximately flat without equalization, allowing for low-frequency variability)

SuperEQ-loudness-624x534.png

Band Gain Arguments

From Avisynth version 2.60, band gain arguments allow all 18 bands to be set within your script, instead of requiring a preset file. The values are specified in decibels (in integer format).

Example: Using band arguments

Example 2: Boost midrange (speech) using band arguments

ConvertAudioToFloat 
SuperEQ(
\   0,  [*     0 -    65  *]
\   0,  [*    65 -    93  *]
\   0,  [*    93 -   131  *]
\   0,  [*   131 -   185  *]
\   0,  [*   185 -   262  *]
\   0,  [*   262 -   370  *]
\   0,  [*   370 -   523  *]
\   5,  [*   523 -   740  *]
\  10,  [*   740 -  1047  *]
\  10,  [*  1047 -  1480  *]
\  10,  [*  1480 -  2093  *]
\   5,  [*  2093 -  2960  *]
\   0,  [*  2960 -  4186  *]
\   0,  [*  4186 -  5920  *]
\   0,  [*  5920 -  8372  *]
\   0,  [*  8372 - 11840  *]
\   0,  [* 11840 - 16744  *]
\   0   [* 16744 - 22000± *]
\ )
Normalize ## avoid possible overload
ConvertAudioTo16bit 

To give a very rough indication of the frequency response of the above example, here is a screenshot of an Audacity spectrum analysis of processed white noise (which should be approximately flat without equalization, allowing for low-frequency variability)

SuperEQ-midboost-624x534.png


Example: Audio Spectrum Analyzer

Example 3: Audio Spectrum Analyzer

This is a rather extreme example of what can be done with SuperEQ. It implements a spectrum analyzer by displaying the audio level in each of SuperEQ's 18 frequency bands, using Histogram("audiolevels"). See this doom9.org thread for details.

Avisynth-spectrum-analyzer-04.jpg
(shown being fed a 400 Hz tone)

Requirements

This filter is optimized for processors which have cache equal to or greater than 128k bytes (16383*2*sizeof(float) = 128k). This plugin won't work efficiently with K6 series processors.

Changes

v2.61 The band gain arguments can only be int. It's now enforced as such.
v2.60 Added custom band setting to allow all 16 bands to be set from script.
v2.54 Initial Release.

Some parts of SuperEQ are:
Copyright © Naoki Shibata.

Other parts are:
Copyright © 2001-2003, Peter Pawlowski All rights reserved.

Personal tools