BeFa

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(redirect for convenient searching)
 
(BeFa: add documentation (translated from Japanese with online translators))
Line 1: Line 1:
#REDIRECT [[External_filters#Audio_Filters]]
+
{{FilterCat4|External_filters|Plugins|Plugins_x64|Audio_filters}}
{{FilterCat|External_filters|Audio_filters|}}
+
{{Filter3
 +
| 1={{Author/kiraru2002}}
 +
| 2=v0.3
 +
| 3=[https://web.archive.org/web/20200618170251if_/https://files.videohelp.com/u/223002/Befa_v0_3.zip Befa_v0_3.zip]
 +
| 4=Audio filters
 +
| 5=[https://www.gnu.org/licenses/gpl-2.0.txt GPLv2]
 +
| 6=}}
 +
<br>
 +
== Description ==
 +
[[BeFa]]: Band Eliminate Filter for Audio.
 +
 
 +
'''Note''': the following documentation was translated from Japanese with online translators, it may not be 100% accurate.
 +
<br>
 +
<br>
 +
 
 +
== Requirements ==
 +
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.5.8 or greater]
 +
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]
 +
<br>
 +
== [[Script variables|Syntax and Parameters]] ==
 +
 
 +
:{{Template:FuncDef|Befa (clip, float "sec", int "freq", int "bandwidth", int "freq2", int "bandwidth2", int "dftsize", int "fade", int "window", int "mode", int "show", int "scale", int "plevel")}}
 +
<br>
 +
::{{Par2| |clip| }}
 +
:::Input clip.
 +
<br>
 +
::{{Par2|sec|float|1.3}}
 +
:::Specify the time to apply the effect from the beginning in seconds.
 +
:::Specify in 0-xx.0 seconds. (However, when 0.0 is specified, Befa is inactive).
 +
:::When <code>mode=1</code>, this parameter has no effect.
 +
<br>
 +
::{{Par2|freq|int|1000}}
 +
:::Sets the first removal frequency. The unit is Hz.
 +
:::Specify in the range of 0-(sampling freq/2)Hz. When 0 is specified, the band is not blocked.
 +
<br>
 +
::{{Par2|bandwidth|int|40}}
 +
:::Sets the width of the removal frequency. Range: 0 to 512
 +
:::Units are the number of points in the frequency domain after the discrete Fourier transform.
 +
:::One unit of width is = sampling frequency / 2 / (2^dftsize) [Hz].
 +
:::If you specify 10 (1024) for FFT, the data at the sampling frequency of 48000 Hz is:
 +
<div style="margin-left: 6em; max-width: 30em">
 +
<pre>
 +
Real discrete Fourier transform
 +
      0      0.0000 Hz
 +
      1      23.4375 Hz
 +
      ...
 +
      40    937.5000 Hz
 +
      41    960.9375 Hz
 +
      42    984.3750 Hz
 +
      43    1007.8125 Hz
 +
      44    1031.2500 Hz
 +
      45    1054.6875 Hz
 +
      46    1071.1250 Hz
 +
      ...
 +
    1023  23976.5625 Hz
 +
</pre>
 +
</div>
 +
:::However, even if the source does not contain a 1 kHz component, it will be decomposed into the form including the signal other than the 43rd frequency component due to the calculation error.
 +
:::A width value of n means that frequency components in the range ±n are also removed from the desired frequency component.
 +
:::When width 10 is specified with FFT 10, the frequency components of 773.4375 to 1242.1875 Hz are removed.
 +
<br>
 +
::{{Par2|freq2|int|-1}}
 +
:::Sets the second removal frequency, the unit is Hz. Range: -1 to (sampling freq/2)Hz.
 +
:::*No bandwidth blocking when 0 is specified.
 +
:::*If -1 is specified, then (freq * 2)Hz is assumed if <code>freq</code> is 9000Hz or less.
 +
:::Since the band is independent of the first removal frequency, if the same band as the first removal frequency band is specified, the band is removed twice. If you specify a window and the effect is weak, it may be interesting to try that.
 +
<br>
 +
::{{Par2|bandwidth2|int|-1}}
 +
:::Set the width of the second removal frequency. Range: -1 to 512
 +
:::When -1 is specified, <code>bandwidth2</code> = (bandwidth+7)/8
 +
<br>
 +
::{{Par2|dftsize|int|11}}
 +
:::Sets the block size for Fourier transform. Range: 8 to 14
 +
:::The unit is 2^n, where 9 gives an FFT size of 512, 10 gives 1024, 11 gives 2048, and 12 gives 4096.
 +
:::The higher the value, the better the frequency resolution, but the less responsive to the change in time.
 +
<br>
 +
::{{Par2|fade|int|25}}
 +
:::Specify the length of fade-in processing. The unit is %.
 +
:::If you specify 25 here and the time is set to 2 seconds, it means that the fade-in process will be performed for 0.5 seconds.
 +
:::When <code>mode=1</code>,  it is approximately % of 1 second.
 +
<br>
 +
::{{Par2|window|int|1}}
 +
:::Specifies whether to multiply the band stop filter by the window function. Range: 0 to 3
 +
:::*0 : none, simply sets the specified frequency band to all zeros.
 +
:::*1 : Hann(Hanning) window
 +
:::*2 : Hamming window
 +
:::*3 : Blackman window (Wide band, lacking sharpness, not suitable for time signal removal)
 +
:::When specified, the frequency region specified by the width is not set to 0, but it is processed with a gentle characteristic so that it is close to 0 at the center and close to the original signal at the edges. When checking, use a wider width than usual.
 +
<br>
 +
::{{Par2|mode|int|0}}
 +
:::Specify the operation mode:
 +
:::*0 : Target (sec) seconds from the beginning, and thereafter through output.
 +
:::*1 : Filter the whole.
 +
<br>
 +
::{{Par2|show|int|0}}
 +
:::Spectrum graph is displayed.
 +
:::Actually, it takes a positive or negative value, but it is displayed as an absolute value (gain).
 +
:::Note that the graph after filtering is before the inverse DFT, so it is not actually cut and output in this way.
 +
:::*0 : Run only
 +
:::*1 : Display the spectrum of frequency band component on the image
 +
:::*2 : Limit the frequency band displayed according to the screen width
 +
<br>
 +
::{{Par2|scale|int|1024}}
 +
:::Specify the scaling factor for spectrum graph values. Range: 1 to ?
 +
:::The smaller the value, the more sensitive it becomes. The sensitivity decreases as it gets larger.
 +
<br>
 +
::{{Par2|plevel|int|100}}
 +
:::Specifies the brightness level of the background image.
 +
:::Specify from 0 to 100%. If the graph is hard to see, lower the gain to make it easier to see.
 +
<br>
 +
 
 +
== Examples ==
 +
BeFa with default values filters for 1.3 seconds from the beginning and fades in for 0.3 seconds.
 +
Befa()
 +
 
 +
 
 +
When sampled at 44.1kHz with CT5880 (SB PCI 128 digital), it disappeared with the following setting values:
 +
WavSource("foo.wav")
 +
Befa(show=1, mode=1, freq=990, scale=512, plavel=50)  # Graph display and filter all
 +
 
 +
 
 +
If you are filtering in the middle, discard the two frames before and after as buffer areas.
 +
last.trim(0,99) + last.trim(98,202).Befa().trim(2,101) + last.trim(200,0)
 +
<br>
 +
 
 +
== Changelog ==
 +
Version      Date            Changes<br>
 +
v0.3        2003/09/24      - Fixed bug: It corrects that the blank might be made on audio track, in mode=0.
 +
                              - Fixed bug: It corrects that A did not become effective, in freq2=0.
 +
                              - Changes default value.
 +
v0.2        2003/05/05      - Added show=1,2 (power spectrum analysis graph) and mode=1(effect all range)
 +
v0.1        2002/12/27      - Ported (from 'Befa ver.0.3.1' created by MOGI, Kazuhiro as AviUtl's filter)
 +
<br>
 +
== Archived Downloads ==
 +
{| class="wikitable" border="1"; width="600px"
 +
|-
 +
!!width="100px"| Version
 +
!!width="150px"| Download
 +
!!width="150px"| Mirror
 +
|-
 +
!v0.3
 +
|[https://web.archive.org/web/20200618170251if_/https://files.videohelp.com/u/223002/Befa_v0_3.zip Befa_v0_3.zip]
 +
|[http://www.avisynth.nl/users/warpenterprises/files/befa_5F25_dll_20030924.zip befa_5F25_dll_20030924.zip]
 +
|-
 +
|}
 +
<br>
 +
==External Links ==
 +
*[http://web.archive.org/web/20081122113014/http://kiraru2002.at.infoseek.co.jp/#befa Original Japanese documentation] /// [http://web.archive.org/web/20071105084352/http://www.geocities.com/fredthompson6/Kiraru2002/Kiraru2002sROOM.htm#Befa Translation by fredthompson6]
 +
<br>
 +
<br>
 +
-----------------------------------------------
 +
'''Back to [[External_filters#Audio_Filters|External Filters]] &larr;'''

Revision as of 18:06, 18 June 2020

Abstract
Author kiraru2002
Version v0.3
Download Befa_v0_3.zip
Category Audio filters
License GPLv2
Discussion


Contents

Description

BeFa: Band Eliminate Filter for Audio.

Note: the following documentation was translated from Japanese with online translators, it may not be 100% accurate.

Requirements


Syntax and Parameters

Befa (clip, float "sec", int "freq", int "bandwidth", int "freq2", int "bandwidth2", int "dftsize", int "fade", int "window", int "mode", int "show", int "scale", int "plevel")


clip   =
Input clip.


float  sec = 1.3
Specify the time to apply the effect from the beginning in seconds.
Specify in 0-xx.0 seconds. (However, when 0.0 is specified, Befa is inactive).
When mode=1, this parameter has no effect.


int  freq = 1000
Sets the first removal frequency. The unit is Hz.
Specify in the range of 0-(sampling freq/2)Hz. When 0 is specified, the band is not blocked.


int  bandwidth = 40
Sets the width of the removal frequency. Range: 0 to 512
Units are the number of points in the frequency domain after the discrete Fourier transform.
One unit of width is = sampling frequency / 2 / (2^dftsize) [Hz].
If you specify 10 (1024) for FFT, the data at the sampling frequency of 48000 Hz is:
Real discrete Fourier transform
       0       0.0000 Hz
       1      23.4375 Hz
      ...
      40     937.5000 Hz
      41     960.9375 Hz
      42     984.3750 Hz
      43    1007.8125 Hz
      44    1031.2500 Hz
      45    1054.6875 Hz
      46    1071.1250 Hz
      ...
    1023   23976.5625 Hz
However, even if the source does not contain a 1 kHz component, it will be decomposed into the form including the signal other than the 43rd frequency component due to the calculation error.
A width value of n means that frequency components in the range ±n are also removed from the desired frequency component.
When width 10 is specified with FFT 10, the frequency components of 773.4375 to 1242.1875 Hz are removed.


int  freq2 = -1
Sets the second removal frequency, the unit is Hz. Range: -1 to (sampling freq/2)Hz.
  • No bandwidth blocking when 0 is specified.
  • If -1 is specified, then (freq * 2)Hz is assumed if freq is 9000Hz or less.
Since the band is independent of the first removal frequency, if the same band as the first removal frequency band is specified, the band is removed twice. If you specify a window and the effect is weak, it may be interesting to try that.


int  bandwidth2 = -1
Set the width of the second removal frequency. Range: -1 to 512
When -1 is specified, bandwidth2 = (bandwidth+7)/8


int  dftsize = 11
Sets the block size for Fourier transform. Range: 8 to 14
The unit is 2^n, where 9 gives an FFT size of 512, 10 gives 1024, 11 gives 2048, and 12 gives 4096.
The higher the value, the better the frequency resolution, but the less responsive to the change in time.


int  fade = 25
Specify the length of fade-in processing. The unit is %.
If you specify 25 here and the time is set to 2 seconds, it means that the fade-in process will be performed for 0.5 seconds.
When mode=1, it is approximately % of 1 second.


int  window = 1
Specifies whether to multiply the band stop filter by the window function. Range: 0 to 3
  • 0 : none, simply sets the specified frequency band to all zeros.
  • 1 : Hann(Hanning) window
  • 2 : Hamming window
  • 3 : Blackman window (Wide band, lacking sharpness, not suitable for time signal removal)
When specified, the frequency region specified by the width is not set to 0, but it is processed with a gentle characteristic so that it is close to 0 at the center and close to the original signal at the edges. When checking, use a wider width than usual.


int  mode = 0
Specify the operation mode:
  • 0 : Target (sec) seconds from the beginning, and thereafter through output.
  • 1 : Filter the whole.


int  show = 0
Spectrum graph is displayed.
Actually, it takes a positive or negative value, but it is displayed as an absolute value (gain).
Note that the graph after filtering is before the inverse DFT, so it is not actually cut and output in this way.
  • 0 : Run only
  • 1 : Display the spectrum of frequency band component on the image
  • 2 : Limit the frequency band displayed according to the screen width


int  scale = 1024
Specify the scaling factor for spectrum graph values. Range: 1 to ?
The smaller the value, the more sensitive it becomes. The sensitivity decreases as it gets larger.


int  plevel = 100
Specifies the brightness level of the background image.
Specify from 0 to 100%. If the graph is hard to see, lower the gain to make it easier to see.


Examples

BeFa with default values filters for 1.3 seconds from the beginning and fades in for 0.3 seconds.

Befa()


When sampled at 44.1kHz with CT5880 (SB PCI 128 digital), it disappeared with the following setting values:

WavSource("foo.wav")
Befa(show=1, mode=1, freq=990, scale=512, plavel=50)  # Graph display and filter all


If you are filtering in the middle, discard the two frames before and after as buffer areas.

last.trim(0,99) + last.trim(98,202).Befa().trim(2,101) + last.trim(200,0)


Changelog

Version      Date            Changes
v0.3 2003/09/24 - Fixed bug: It corrects that the blank might be made on audio track, in mode=0. - Fixed bug: It corrects that A did not become effective, in freq2=0. - Changes default value. v0.2 2003/05/05 - Added show=1,2 (power spectrum analysis graph) and mode=1(effect all range) v0.1 2002/12/27 - Ported (from 'Befa ver.0.3.1' created by MOGI, Kazuhiro as AviUtl's filter)


Archived Downloads

Version Download Mirror
v0.3 Befa_v0_3.zip befa_5F25_dll_20030924.zip


External Links




Back to External Filters

Personal tools