hsc3-0.19.1: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.SC3.Common.Math.Window

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

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.

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]

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