Example #1
0
File: fft.go Project: refola/golang
func FrequenciesToSamples(freqs Frequencies) *TMSnippet {
	var samples TMSnippet
	f64samples := cplxsToReals(fft.IFFTReal(freqs.Freqs))
	samples.Samples = make([]float32, len(f64samples))
	for i, v := range f64samples {
		samples.Samples[i] = float32(v)
	}
	samples.SampleHz = 1 / freqs.DeltaHz // TODO: check if this even makes sense
	return &samples
}
Example #2
0
// Amplitude2Cepstrum returns (real) cepstrum from an amplitude spectrum.
func LogAmplitude2Cepsturm(logAmp []float64) []float64 {
	return gossp.ToReal(fft.IFFTReal(logAmp))
}