mirror of
https://github.com/make-42/xyosc
synced 2025-01-18 10:47:10 +01:00
yes
This commit is contained in:
parent
6516fa3b2f
commit
a59428ab19
2
main.go
2
main.go
@ -101,7 +101,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
||||
binary.Read(audio.SampleRingBuffer, binary.NativeEndian, &AX)
|
||||
binary.Read(audio.SampleRingBuffer, binary.NativeEndian, &AY)
|
||||
}
|
||||
FFTBuffer = window.Apply(FFTBuffer, signalprocessing.HannWindow)
|
||||
FFTBuffer = window.Apply(FFTBuffer, signalprocessing.CachedWindowFunction)
|
||||
X := fft.FFTReal(FFTBuffer)
|
||||
r, θ := cmplx.Polar(X[1])
|
||||
maxR := r
|
||||
|
@ -12,3 +12,7 @@ var HannWindow []float64
|
||||
func Init() {
|
||||
HannWindow = window.Hann(int(config.Config.ReadBufferSize / audio.SampleSizeInBytes / 2))
|
||||
}
|
||||
|
||||
func CachedWindowFunction(u int) []float64 {
|
||||
return HannWindow
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user