mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-13 19:53:16 -05:00
drafting
This commit is contained in:
parent
c424d2b847
commit
179ebb7cc3
@ -57,9 +57,9 @@ const (
|
||||
)
|
||||
|
||||
var spectrumSmoothingMap map[SpecSmoothing]float32 = map[SpecSmoothing]float32{
|
||||
SpecSmoothingSlow: 0.05,
|
||||
SpecSmoothingSlow: 0.1,
|
||||
SpecSmoothingMedium: 0.2,
|
||||
SpecSmoothingFast: 1.0,
|
||||
SpecSmoothingFast: 0.4,
|
||||
}
|
||||
|
||||
func NewSpecAnalyzer(broker *Broker) *SpecAnalyzer {
|
||||
@ -154,8 +154,6 @@ func (s *SpecAnalyzer) update(buf sointu.AudioBuffer) *Spectrum {
|
||||
}
|
||||
// convert to decibels
|
||||
for c := range 2 {
|
||||
vek32.MaximumNumber_Inplace(ret[c], 1e-8)
|
||||
vek32.MinimumNumber_Inplace(ret[c], 1e8)
|
||||
vek32.Log10_Inplace(ret[c])
|
||||
vek32.MulNumber_Inplace(ret[c], 10)
|
||||
}
|
||||
@ -164,7 +162,7 @@ func (s *SpecAnalyzer) update(buf sointu.AudioBuffer) *Spectrum {
|
||||
|
||||
func (sd *SpecAnalyzer) process(buf sointu.AudioBuffer, channel int) {
|
||||
for i := range buf { // de-interleave
|
||||
sd.temp.tmp1[i] = buf[i][channel]
|
||||
sd.temp.tmp1[i] = removeNaNsAndClamp(buf[i][channel])
|
||||
}
|
||||
vek32.Mul_Inplace(sd.temp.tmp1, sd.temp.window) // apply windowing
|
||||
vek32.Gather_Into(sd.temp.tmp2, sd.temp.tmp1, sd.temp.bitPerm) // bit-reversal permutation
|
||||
|
||||
Reference in New Issue
Block a user