Sound.SC3.Lang.Math.Window

Description

Windowing functions.

Synopsis

# Type and conversion

type Window x = x -> xSource

A function from a (0,1) normalised input to an output.

type Table x = [x]Source

A discrete n element rendering of a `Window`.

window_table :: (Integral n, Fractional a, Enum a) => n -> Window a -> Table aSource

Generate an n element table from a (0,1) normalised window function.

# Math

Regular modified Bessel function of fractional order zero.

square :: Num a => a -> aSource

n ^ 2.

# Window functions

gaussian :: Floating a => a -> Window aSource

Gaussian window, θ <= 0.5.

hann :: Floating a => Window aSource

Hann raised cosine window.

hamming :: Floating a => Window aSource

Hamming raised cosine window.

Kaiser windowing function, β is shape (1,2,8).

`sinc` window.

Unit (`id`) window, also known as a Dirichlet window.

sine :: Floating a => Window aSource

`sin` window.

Triangular window, ie. Bartlett window with zero end-points.

# Tables

gaussian_table :: (Integral n, Floating b, Enum b) => n -> b -> [b]Source

`window_table` . `gaussian`.

``` import Sound.SC3.Plot
plotTable [gaussian_table 1024 0.25,gaussian_table 1024 0.5]
```

hamming_table :: Int -> [Double]Source

`window_table` . `hamming`.

plotTable [hann_table 128,hamming_table 128]

hann_table :: Int -> [Double]Source

`window_table` . `hann`.

plotTable [hann_table 128]

kaiser_table :: Int -> Double -> [Double]Source

`window_table` . `kaiser`.

let k = kaiser_table 128 in plotTable [k 1,k 2,k 8]

lanczos_table :: Integral n => n -> [Double]Source

`window_table` . `lanczos`.

plotTable [lanczos_table (2^9)]

sine_table :: (Integral n, Floating b, Enum b) => n -> [b]Source

`window_table` . `sine`.

plotTable [sine_table 128]

triangular_table :: (Integral n, Fractional b, Enum b) => n -> [b]Source

`window_table` . `triangular`.

plotTable [triangular_table (2^9)]