[orx-fft] Add orx-fft for a simple fast fourier transform routine
This commit is contained in:
9
orx-fft/src/commonMain/kotlin/HannWindow.kt
Normal file
9
orx-fft/src/commonMain/kotlin/HannWindow.kt
Normal file
@@ -0,0 +1,9 @@
|
||||
package org.openrndr.extra.fft
|
||||
|
||||
import kotlin.math.PI
|
||||
import kotlin.math.cos
|
||||
|
||||
class HannWindow : WindowFunction() {
|
||||
override fun value(length: Int, index: Int): Float = 0.5f * (1f - cos((PI * 2.0 * index / (length - 1f)))
|
||||
.toFloat())
|
||||
}
|
||||
Reference in New Issue
Block a user