Created
April 10, 2020 21:17
-
-
Save asubb/899fe95be03e385f02a5a8ae888e02f2 to your computer and use it in GitHub Desktop.
wave-blog/using-jupyter/long.signal.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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