Spectrogram

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(update requirements for 64 bit)
m (Requirements)
Line 16: Line 16:
 
* Supported color formats: all colorspaces are supported but output clip will always be [[Y8]].
 
* Supported color formats: all colorspaces are supported but output clip will always be [[Y8]].
 
<br>
 
<br>
* [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2017 Redistributable Package (<tt>vc_redist.x86.exe</tt> or <tt>vc_redist.x64.exe</tt>)]
+
* [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2017 Redistributable Package] (<tt>vc_redist.x86.exe</tt> or <tt>vc_redist.x64.exe</tt>)
  
* [http://www.fftw.org/install/windows.html FFTW 3.3.5 (<tt>fftw-3.3.5-dll32.zip</tt> or <tt>fftw-3.3.5-dll64.zip</tt>)]
+
* [http://www.fftw.org/install/windows.html FFTW 3.3.5] (<tt>fftw-3.3.5-dll32.zip</tt> or <tt>fftw-3.3.5-dll64.zip</tt>)
 
:<span style="color:red">***</span> <tt>libfftw3f-3.dll</tt> needs to be in the search path (<tt>C:\windows\system32</tt> or <tt>C:\Windows\SysWOW64</tt>)
 
:<span style="color:red">***</span> <tt>libfftw3f-3.dll</tt> needs to be in the search path (<tt>C:\windows\system32</tt> or <tt>C:\Windows\SysWOW64</tt>)
 +
:<span style="color:red">***</span> be aware to have your whole processing chain in matching bits: either 32 bit (=x86) or 64 bit (x64).
 
:<span style="color:red">***</span> Spectrogram will not run or load without it.
 
:<span style="color:red">***</span> Spectrogram will not run or load without it.
 
<br>
 
<br>

Revision as of 13:31, 17 December 2018

Abstract
Author innocenat
Version r6
Download Spectrogram_r6.7z
Category Audio filters
License
Discussion


Contents

Description

Linear spectrogram for AviSynth 2.6.

Requirements

  • AviSynth 2.6.0 or greater
  • Supported color formats: all colorspaces are supported but output clip will always be Y8.


  • FFTW 3.3.5 (fftw-3.3.5-dll32.zip or fftw-3.3.5-dll64.zip)
*** libfftw3f-3.dll needs to be in the search path (C:\windows\system32 or C:\Windows\SysWOW64)
*** be aware to have your whole processing chain in matching bits: either 32 bit (=x86) or 64 bit (x64).
*** Spectrogram will not run or load without it.


Syntax and Parameters

Spectrogram (clip, int width, int height, bool "transpose")


clip   =
Input clip; audio must be float so use ConvertAudioToFloat() if needed. Video can be any colorspace but the output will always be Y8.
Frame rate of the spectrogram will always default to the frame rate of the input clip. If the input clip does not contain video then the frame rate will default to 24FPS.


int   =
Width of the spectrogram.


int   =
Height of the spectrogram. For best performance it's recommended that the height is a value of 2^n.


bool  transpose = false
When set to true the spectrogram will be rendered vertically; recommended for larger dimensions.
Spectrogram(x, y, transpose=true).TurnLeft() is identical to Spectrogram(x, y, transpose=false) but faster. For better performance use the optimized FTurnLeft() function from the FTurn plugin.


  • Note: the first 3 parameters are unnamed and do not have a default so they must be specified.


Examples

The following script creates a scrolling spectrogram from just an audio file. The length is automatically adjusted based on the duration of the audio and the desired frame rate. The output clip will be Y8, 512x256, and 59.94 FPS, of course this is all adjustable.

WavSource("sample.wav") # for other types of files you can use FFAudioSource or LWLibavAudioSource or any other suitable audio source filter
audio = last
fps = 60000 den = 1001 length = Round((AudioDuration(audio)*fps)/den) BlankClip(length, width=512, height=256, fps=fps, fps_denominator=den, pixel_type="Y8") AudioDub(last, audio) ConvertAudioToFloat() # if needed
Spectrogram(512, 256, transpose=true) TurnLeft()
Spectrogram.png


Changelog

Version      Date            Changes
r6 2018/12/13 - add x64 bit build and a VS2017 solution to the archive r5 2015/07/04 - increase cache sizes to accommodate larger dimensions - add "transpose" parameter for better performance
r4 2015/03/11 - fix a bug; the cache was actually completely broken
r3 2015/03/10 - fix a bug that caused a crash - it's now ~40-50% faster; more profiling and fixing a hot spot
r2 2015/03/09 - implement cache; increase speed by profiling
r1 2015/03/08 - initial release


Archived Downloads

Source code is included.

Version Download Mirror
r6 Spectrogram_r6.7z
r5 Spectrogram_r5.7z
r4 Spectrogram.7z




Back to External Filters

Personal tools