hsc3-lang-0.15: Haskell SuperCollider Language

Safe HaskellNone
LanguageHaskell98

Sound.SC3.Lang.Math.Window

Contents

Description

Windowing functions.

Synopsis

Type and conversion

type Window x = x -> x Source

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 a Source

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

Math

bessel0 :: Double -> Double Source

Regular modified Bessel function of fractional order zero.

square :: Num a => a -> a Source

n ^ 2.

Window functions

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

Gaussian window, θ <= 0.5.

hann :: Floating a => Window a Source

Hann raised cosine window.

hamming :: Floating a => Window a Source

Hamming raised cosine window.

kaiser :: Double -> Window Double Source

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

rectangular :: Window a Source

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

sine :: Floating a => Window a Source

sin window.

triangular :: Fractional a => Window a Source

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)]