Skip to content

Instantly share code, notes, and snippets.

@asubb
Created April 10, 2020 21:17
Show Gist options
  • Save asubb/899fe95be03e385f02a5a8ae888e02f2 to your computer and use it in GitHub Desktop.
Save asubb/899fe95be03e385f02a5a8ae888e02f2 to your computer and use it in GitHub Desktop.
wave-blog/using-jupyter/long.signal.kt
//Specify the parameters of future calculations:
val windowSize = 801
val stepSize = 256
val fftSize = 1024
// Define a signal, windowed sum of sinusoids:
val signal = (880.sine() + 440.sine() + 220.sine())
.window(windowSize, stepSize)
// The first FFT applying the triangular window function:
val triangularFft = signal
.triangular()
.fft(fftSize)
.toTable("fft-triangular", 2.m)
// And the seconds FFT applying the hamming window function:
val hammingFft = signal
.hamming()
.fft(fftSize)
.toTable("fft-hamming", 2.m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment