Scripts/FFTutils

From J Wiki
Jump to: navigation, search

FFT Utils provides windowing and other utility functions useful when using the FFT addon.

Download the script: File:Fftutils.ijs

Windows

NB.*hanning v hanning function of proper length
NB.*hamming v hamming function of proper length
NB.*blackmanharris v blackman-harris with minimum 4-term (monad) or arbitrary (dyad) values
NB.*nuttall v blackman-harris with Nuttall parameters

Utility Functions

NB.*twl v twenty log
NB.*tel v ten log

Example

This command plots twenty times the log magnitude of the FFT of a time series called data with each of the windows applied. The maximum is scaled to 0, and the minimum is clamped at -100.

'keystyle open; key Unwindowed Nuttall "B-H 4" Hamming Hanning' plot (_100 >.])(- >./)"1  twl | fftw"1  (], (* nuttall), (* blackmanharris),(* hamming),: (* hanning)) data

This example shows the effect of windowing on a simple sine wave.

'keystyle open; key Unwindowed Nuttall "B-H 4" Hamming Hanning' plot(- >./)"1  twl | fftw"1  (], (* nuttall), (* blackmanharris),(* hamming),: (* hanning)) sin i. 128

See Also


Contributed by Bill Harris