// fixed window to FFT
stream.window(401)
.hamming()
.fft(512)
// sliding window to FFT
stream.window(401)
.sliding(101)
.hamming()
.fft(512)
Technically that means multiplying two different windowed streams, however second window stream should be generated based on the window size.
// function implementation here based on current value `i`
// out of overall values `n`
fun windowImpl(i: Int, n: Int): Sample { /* ... */ }
val window = stream.window(401)
val windowFn = FunctionSampleStream(fn = { i - > windowImpl(i, 401)} ).window(401)
val windowedStream = window * windowFn
val fft = windowedStream.fft(512)
// add new stream to be able to generate stream out of functions.
class FunctionSampleStream(
fn: (Int) -> Sample
) : BeanStream<Sample, FunctionSampleStream> {
/* ... */
}
Need to come up with some nice short API.
So objectives of this issue:
Introduce new type of stream that is generated based on function value
sine() and sineSweep() functions possible can be migrated on this new approach.
Using that new approach introduce window functions:
Support of different window functions for WaveBeans.
Suggested API
Technically that means multiplying two different windowed streams, however second window stream should be generated based on the window size.
Need to come up with some nice short API.
So objectives of this issue:
sine()
andsineSweep()
functions possible can be migrated on this new approach.