mirror of
https://github.com/make-42/xyosc
synced 2025-01-18 18:57: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, &AX)
|
||||||
binary.Read(audio.SampleRingBuffer, binary.NativeEndian, &AY)
|
binary.Read(audio.SampleRingBuffer, binary.NativeEndian, &AY)
|
||||||
}
|
}
|
||||||
FFTBuffer = window.Apply(FFTBuffer, signalprocessing.HannWindow)
|
FFTBuffer = window.Apply(FFTBuffer, signalprocessing.CachedWindowFunction)
|
||||||
X := fft.FFTReal(FFTBuffer)
|
X := fft.FFTReal(FFTBuffer)
|
||||||
r, θ := cmplx.Polar(X[1])
|
r, θ := cmplx.Polar(X[1])
|
||||||
maxR := r
|
maxR := r
|
||||||
|
@ -12,3 +12,7 @@ var HannWindow []float64
|
|||||||
func Init() {
|
func Init() {
|
||||||
HannWindow = window.Hann(int(config.Config.ReadBufferSize / audio.SampleSizeInBytes / 2))
|
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