[{"name":"Complex","comment":" Simple module for handling complex numbers.\nThis module was made for the needs of the signal processing library and thus kept to minimum.\n\n\n# Types\n\n@docs Complex\n\n\n# Constructors\n\n@docs imaginary, real, zero\n\n\n# Binary Operators\n\n@docs add, subtract, multiply, divideByReal, equal\n\n\n# Unary Operators\n\n@docs exp, abs, conjugate\n\n","unions":[],"aliases":[{"name":"Complex","comment":" Simple representation of a complex number\n","args":[],"type":"{ re : Basics.Float, im : Basics.Float }"}],"values":[{"name":"abs","comment":" The absolute value of complex number, which is also its distance from zero\n","type":"Complex.Complex -> Basics.Float"},{"name":"add","comment":" Add two complex numbers\n\n    add (real 1) (imaginary 2) --> { re = 1, im = 2 }\n\n","type":"Complex.Complex -> Complex.Complex -> Complex.Complex"},{"name":"conjugate","comment":" computes the conjugate of a complex number\n\n    conjugate { re = 1, im = 1 } --> { re = 1, im = -1 }\n\n","type":"Complex.Complex -> Complex.Complex"},{"name":"divideByReal","comment":" Divide a complex number by a real number.\nNotice that the divisor is given first.\n\n    real 2 |> divideByReal 2 --> { re = 1, im = 0 }\n\n","type":"Basics.Float -> Complex.Complex -> Complex.Complex"},{"name":"equal","comment":" Check equality of two complex numbers\n","type":"Complex.Complex -> Complex.Complex -> Basics.Bool"},{"name":"exp","comment":" Given complex number z, computes e^z\n","type":"Complex.Complex -> Complex.Complex"},{"name":"imaginary","comment":" Construct a `Complex` number with imaginary value only\n\n    imaginary 1 --> { re = 0, im = 1 }\n\n","type":"Basics.Float -> Complex.Complex"},{"name":"multiply","comment":" Multiply two complex numbers\n\n    multiply (imaginary 1) (real 2) --> { re = 0, im = 2 }\n\n","type":"Complex.Complex -> Complex.Complex -> Complex.Complex"},{"name":"real","comment":" Construct a `Complex` number with real value only\n\n    real 1 --> { re = 1, im = 0 }\n\n","type":"Basics.Float -> Complex.Complex"},{"name":"subtract","comment":" Subtract two complex numbers\n\n    subtract { re = 1, im = 2 } (real 2) --> { re = -1, im = 2 }\n\n","type":"Complex.Complex -> Complex.Complex -> Complex.Complex"},{"name":"zero","comment":" The complex zero\n","type":"Complex.Complex"}],"binops":[]},{"name":"Convolution","comment":" Functions for convolution\nSee: <https://en.wikipedia.org/wiki/Convolution>\n\n\n# Functions:\n\n@docs convolve, convolveDirectly\n\n","unions":[],"aliases":[],"values":[{"name":"convolve","comment":" Convolve two real number lists, using FFT for lists longer than 128 elements or direct convolution otherwise.\nThreshold was determined by benchmarks.\n\n    convolve [ 1, 0, 0, 0 ] [ 0, 0, 1, 1 ] --> [0, 0, 1, 1]\n\n","type":"List.List Basics.Float -> List.List Basics.Float -> List.List Basics.Float"},{"name":"convolveDirectly","comment":" Convolve two lists of numbers directly by\n$$ zs\\_j = \\\\sum\\_i^n {xs\\_i \\* ys\\_{j - i}} $$\n","type":"List.List Basics.Float -> List.List Basics.Float -> List.List Basics.Float"}],"binops":[]},{"name":"FFT","comment":" Functions for calculating the discrete finite fourier transform using the fast fourier transform algorithms.\n\n\n# Complex values\n\nFunctions that work on complex values\n\n@docs fft, inverseFft\n\n\n# Real values\n\nFunctions that work real (`Float`) values\n\n@docs realFft, realInverseFft\n\n","unions":[],"aliases":[],"values":[{"name":"fft","comment":" compute the fourier transform of a list of complex values\n\n    fft [ real 1, zero, real 1, imaginary 0.5 ]\n\n","type":"List.List Complex.Complex -> List.List Complex.Complex"},{"name":"inverseFft","comment":" compute the inverse fourier transform of a list of complex values\nThe inverse fourier transform of list Z is equal to $$(conjugate (fft (conjugate Z)) / (length Z))$$\nwhere Z\\* is the conjugate of Z.\n","type":"List.List Complex.Complex -> List.List Complex.Complex"},{"name":"realFft","comment":" compute the fourier transform of a list of real values. The output is a list of complex values.\n\n    realFft [ 1, 0, 1, 0.5 ]\n\n","type":"List.List Basics.Float -> List.List Complex.Complex"},{"name":"realInverseFft","comment":" compute the inverse fourier transform of a list of real values\nThe inverse fourier transform of list Z is equal to $$(conjugate (fft (conjugate Z)) / (length Z))$$\nwhere Z\\* is the conjugate of Z.\n","type":"List.List Basics.Float -> List.List Complex.Complex"}],"binops":[]},{"name":"WindowFunctions","comment":" Different windows used for sampling when working with FFT and convolution algorithms.\nSee: <https://en.wikipedia.org/wiki/Window_function>\n\n\n# Impulse\n\nThe impulse is the simplest window, it takes only the first value\n\n@docs impulse\n\n\n# Square\n\nSquare is just a list of ones (1). A centered square window is padded by zeros on both sides.\n\n@docs square, centeredSquare\n\n\n# Cosine-sum windows\n\nThese windows use the sum of cosine functions to create the window. They are very common in filtering.\n\n@docs blackman, hann, hamming\n\n","unions":[],"aliases":[],"values":[{"name":"blackman","comment":" returns a Blackman window of size n.\nSee: <https://en.wikipedia.org/wiki/Window_function#Blackman_window>\n","type":"Basics.Int -> List.List Basics.Float"},{"name":"centeredSquare","comment":" The centered square window is 1 for `width` number of elements around the middle of `size`.\nIf `size - width` is odd, than the returned window will be smaller than `size` by 1.\n\n    centeredSquare 3 1 --> [0, 1, 0]\n\n    centeredSquare 5 2 -> [0, 1, 1, 0]\n\n","type":"Basics.Int -> Basics.Int -> List.List Basics.Float"},{"name":"hamming","comment":" hann window is a cosine sum window with a0 parameter set to 0.54.\nSee: <https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows>\n","type":"Basics.Int -> List.List Basics.Float"},{"name":"hann","comment":" hann window is a cosine sum window with a0 parameter set to 0.5.\nSee: <https://en.wikipedia.org/wiki/Window_function#Hann_and_Hamming_windows>\n","type":"Basics.Int -> List.List Basics.Float"},{"name":"impulse","comment":" The impulse window is a window in which the first element is 1, and all other elements are zero\n","type":"Basics.Int -> List.List Basics.Float"},{"name":"square","comment":" The square window is 1 everywhere\n","type":"Basics.Int -> List.List Basics.Float"}],"binops":[]}]