GEN20
Generates functions of different windows.
These windows are usually used for spectrum analysis or for grain envelopes.
Syntax
Initialization
size -- number of points in the table. Must be a power of 2 ( + 1).
window -- Type of window to generate:
- 1 = Hamming
- 2 = Hanning
- 3 = Bartlett ( triangle)
- 4 = Blackman ( 3-term)
- 5 = Blackman - Harris ( 4-term)
- 6 = Gaussian
- 7 = Kaiser
- 8 = Rectangle
- 9 = Sinc
max -- For negative p4 this will be the absolute value at window peak point. If p4 is positive or p4 is negative and p6 is missing the table will be post-rescaled to a maximum value of 1.
opt -- Optional argument required by the Gaussian window, the Kaiser window and the Sinc window.
Examples
This creates a function which contains a 4 - term Blackman - Harris window with maximum value of 1.
This creates a function that contains a Hanning window with a maximum value of 456.
This creates a function that contains a Hamming window with a maximum value of 1.
This creates a function that contains a Kaiser window with a maximum value of 1. The extra argument specifies how "open" the window is, for example a value of 0 results in a rectangular window and a value of 10 in a Hamming like window.
This creates a function that contains a Gaussian window with a maximum value of 1. The extra argument specifies how broad the window is, as the standard deviation of the curve; in this example the s.d. is 2. The default value is 1.
This creates a function that contains a Sinc window with a maximum value of 1. The extra argument specifies the range of the function as multiple of π. The default value is 1.
For all diagrams, see Window Functions
Here is an example of the GEN20 routine. It uses the file gen20.csd.
These are the diagrams of the waveforms of the GEN20 routines, as used in the example:


Credits
Author: Paris Smaragdis
MIT, Cambridge
1995
Author: John ffitch
University of Bath/Codemist Ltd.
Bath, UK
New in Csound version 3.2
Optional argument to Gaussian added in 5.10