Documentation ¶
Index ¶
- Constants
- Variables
- func AbsFloat32(x float32) float32
- func AbsFloat32s(data []float32) []float32
- func AbsFloat64(x float64) float64
- func AbsFloat64s(data []float64) []float64
- func AbsInt16(x int16) int16
- func AbsInt16s(data []int16) []int16
- func AbsMinMaxFloat32s(data []float32) (absData []float32, min, max float32)
- func AbsMinMaxFloat64s(data []float64) (absData []float64, min, max float64)
- func AbsMinMaxInt16s(data []int16) (absData []int16, min, max int16)
- func BaseFFT(array []T, size, sign int)
- func BytesToFloat32(b []byte) (float32, error)
- func BytesToFloat64(b []byte) (float64, error)
- func BytesToInt16(b []byte) (int16, error)
- func Complex128sToFloat64s(data []complex128) []float64
- func DFT(array []complex128, size int)
- func FFT(array []T, size int)
- func FFT2(array, temp, omega []complex128)
- func FFTCos(n, m int) float64
- func FFTHardCorded(array []T, size, n, sign int)
- func FFTPrime(array []T, size, n, sign int)
- func FFTSin(n, m int) float64
- func Float32ToBytes(v float32) ([]byte, error)
- func Float32sToFloat64s(data []float32) []float64
- func Float32sToInt16s(data []float32) []int16
- func Float64ToBytes(v float64) ([]byte, error)
- func Float64sToFloat32s(data []float64) []float32
- func Float64sToInt16s(data []float64) []int16
- func GenerateFadeinFadeoutFilter(length int) (fadeinFilter, fadeoutFilter []float64)
- func IDFT(array []complex128, size int)
- func IFFT(array []T, size int)
- func Int16ToBytes(v int16) ([]byte, error)
- func Int16sToFloat32s(data []int16) []float32
- func Int16sToFloat64s(data []int16) []float64
- func LenDXXFile(filename string) (int, error)
- func LinearConvolutionFreqDomain(x, y []complex128) []complex128
- func LinearConvolutionTimeDomain(x, y []float64) []float64
- func MaxFloat32s(data []float32) float32
- func MaxFloat64s(data []float64) float64
- func MaxInt16s(data []int16) int16
- func MinFloat32s(data []float32) float32
- func MinFloat64s(data []float64) float64
- func MinInt16s(data []int16) int16
- func PinkNoise(samples, fs int) []float64
- func Read(r io.Reader, dt DataType, length int) ([]float64, error)
- func ReadDXXFile(filename string) ([]float64, error)
- func SizedDFT(array, temp, omega []complex128, size, n int)
- func SizedFFT2(array []T, temp, omega []complex128, size int)
- func Sum(vs []float64) float64
- func Write(w io.Writer, dt DataType, data []float64) error
- func WriteDXXFile(filename string, data []float64) error
- type DataType
- type T
Constants ¶
const ( BitLenShort = 16 BitLenFloat = 32 BitLenDouble = 64 ByteLenShort = 2 ByteLenFloat = 4 ByteLenDouble = 8 )
const ( FFTPrimeThreshold = 256 Forward = -1 Backward = 1 )
const FftHardCordedSize = 4
Variables ¶
var (
ErrUnknownDataType = errors.New("unknown data type")
)
Functions ¶
func AbsFloat32 ¶
func AbsFloat32s ¶
func AbsFloat64 ¶
func AbsFloat64s ¶
func AbsMinMaxFloat32s ¶
func AbsMinMaxFloat64s ¶
func AbsMinMaxInt16s ¶
func BytesToFloat32 ¶
func BytesToFloat64 ¶
func BytesToInt16 ¶
func Complex128sToFloat64s ¶
func Complex128sToFloat64s(data []complex128) []float64
func DFT ¶
func DFT(array []complex128, size int)
func FFT2 ¶
func FFT2(array, temp, omega []complex128)
func FFTHardCorded ¶
func Float32ToBytes ¶
func Float32sToFloat64s ¶
func Float32sToInt16s ¶
func Float64ToBytes ¶
func Float64sToFloat32s ¶
func Float64sToInt16s ¶
func IDFT ¶
func IDFT(array []complex128, size int)
func Int16ToBytes ¶
func Int16sToFloat32s ¶
func Int16sToFloat64s ¶
func LenDXXFile ¶
LenDXXFile reads sample size of .DXX file. This func determines the data type from the filename extension and reads that data.
func LinearConvolutionFreqDomain ¶
func LinearConvolutionFreqDomain(x, y []complex128) []complex128
LinearConvolutionFreqDomain return linear convolution. len: len(x) + len(y) - 1
func MaxFloat32s ¶
func MaxFloat64s ¶
func MinFloat32s ¶
func MinFloat64s ¶
func PinkNoise ¶
PinkNoise generates pinknoise using Voss algorithm. http://www.firstpr.com.au/dsp/pink-noise/
func Read ¶
Read reads data from reader as specified data type. The return type is []float64 to make the data easier to handle.
func ReadDXXFile ¶
ReadDXXFile reads .DXX file. This func determines the data type from the filename extension and reads that data. The return type is []float64 to make the data easier to handle.
func SizedDFT ¶
func SizedDFT(array, temp, omega []complex128, size, n int)
func SizedFFT2 ¶
func SizedFFT2(array []T, temp, omega []complex128, size int)
func Write ¶
Writes writes data to writer as specified data type. The return type is []float64 to make the data easier to handle.
func WriteDXXFile ¶
WriteDXXFile writes data to .DXX file. This func determines the data type from the filename extension and writes the data to the file. The return type is []float64 to make the data easier to handle.
Types ¶
type DataType ¶
type DataType int
DataType is type of DataType behaves as enum.
func StringToDataType ¶
StringToDataType determines data type from specified string. If the specified string is invalid, this func returns error.
type T ¶
type T = complex128