Documentation
¶
Overview ¶
Package window generates weights for time-domain samples. Hann, Hamming, and Blackman construct windows, and Window.Apply multiplies a sample slice by its window weights in place.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Blackman8 = blackman8 Blackman16 = blackman16 Blackman32 = blackman32 Blackman64 = blackman64 Blackman128 = blackman128 Blackman256 = blackman256 Blackman512 = blackman512 Blackman1024 = blackman1024 Blackman2048 = blackman2048 Blackman4096 = blackman4096 Blackman8192 = blackman8192 )
Precomputed Blackman windows for common transform sizes. Treat the coefficients as read-only.
var ( Hamming8 = hamming8 Hamming16 = hamming16 Hamming32 = hamming32 Hamming64 = hamming64 Hamming128 = hamming128 Hamming256 = hamming256 Hamming512 = hamming512 Hamming1024 = hamming1024 Hamming2048 = hamming2048 Hamming4096 = hamming4096 Hamming8192 = hamming8192 )
Precomputed Hamming windows for common transform sizes. Treat the coefficients as read-only.
var ( Hann8 = hann8 Hann16 = hann16 Hann32 = hann32 Hann64 = hann64 Hann128 = hann128 Hann256 = hann256 Hann512 = hann512 Hann1024 = hann1024 Hann2048 = hann2048 Hann4096 = hann4096 Hann8192 = hann8192 )
Precomputed Hann windows for common transform sizes. Treat the coefficients as read-only.
Functions ¶
This section is empty.
Types ¶
type GeneratorFunc ¶
GeneratorFunc is a type of function that generates a Window based on an input size.
func (GeneratorFunc) Generate ¶
func (w GeneratorFunc) Generate(size int) Window
Generate calls the GeneratorFunc itself, with the input int `size`.
type Window ¶
type Window []float64
Window is a custom type for a slice of float64, that repesents a Window that shapes input signal.
func Blackman ¶
Blackman returns an L-point Blackman window Reference: http://www.mathworks.com/help/signal/ref/blackman.html
func Hamming ¶
Hamming returns an L-point symmetric Hamming window. Reference: http://www.mathworks.com/help/signal/ref/hamming.html
func Hann ¶
Hann returns an L-point Hann window. Reference: http://www.mathworks.com/help/signal/ref/hann.html
func New ¶
func New(w GeneratorFunc, size int) Window
New creates a new Window from the input GeneratorFunc and size
The size should be a power of two supported in the fft package's BlockSize.
In case the input size `int` is not a power of two, it will fallback to the next available block size, with a series of bit-shifting operations on the input size to derive the closest element in the (private) blockSizes slice of ints.