Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SWT ¶
Example ¶
analog of https://github.com/rafat/wavelib/wiki/SWT-Example-Code
rand.Seed(0) obj := WaveInit("bior3.5") defer obj.Free() input := make([]float64, 256) for idx := range input { input[idx] = rand.Float64() } wt := WTInit(obj, "swt", 256, 1) defer wt.Free() SetWTConv(wt, "direct") SWT(wt, input) for _, value := range wt.Output() { fmt.Printf("%g\n", value) } output := make([]float64, 256) ISWT(wt, output) diff := make([]float64, 256) for i := 0; i < wt.SigLength(); i++ { diff[i] = output[i] - input[i] } fmt.Printf("\n MAX %g \n", absMax(diff)) WTSummary(wt)
Output:
func WaveFree ¶
func WaveFree(obj WaveObject)
Types ¶
type WaveObject ¶
type WaveObject struct {
C_WaveObject C.wave_object
}
func WaveInit ¶
func WaveInit(name string) WaveObject
func (WaveObject) Free ¶
func (obj WaveObject) Free()
Click to show internal directories.
Click to hide internal directories.