|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.util.EventDistributions
public class EventDistributions
Implements 'entry delay approach' to generate event densities. From Charles Ames's suggestions in letter dated March 17, 1992 Source for Myhill distribution and additional comments from "A Catalog of Statistical Distributions" by Charles Ames. Leonardo Music Journal, Vol. 1 No. 1, 1991 This code implements the exponential distribution and the Myhill distribution. The Myhill distribution can be thought of as a more flexible exponential distribution; one whose variance can be controlled. This control is reflected in a ratio whose value causes the Myhill distribution to more or less approximate the exponential distribution. When the ratio is high (above 128), the two distributions are indistinguishable. When ratio is low, the Myhill transform generates increasingly regular, periodic patterns, as opposed to the clustering and leaps of the exponential transform.
Constructor Summary | |
---|---|
EventDistributions()
|
Method Summary | |
---|---|
static double |
genEntryDelayLog(double meanEventDensity)
GENERATE ENTRY DELAYS FROM LOGARITHMIC DISTRIBUTION This gives you lots of short entry delays with an occasional long one. |
static double |
genEntryDelayMyhill(double meanEventDensity,
double ratio)
GENERATE ENTRY DELAYS FROM MYHILL DISTRIBUTION This distribution maintains the balance of long to short durations that makes the logarithmic distribution appealing, additionally giving you control over mean AND variance. |
static void |
main(java.lang.String[] args)
Print out distributed entry delays |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventDistributions()
Method Detail |
---|
public static double genEntryDelayLog(double meanEventDensity)
f(u,m,sigma) = -(ln(1-u)) / m where m = (mean event density) and u is a driver value and distribution of entry delays is exponential
public static double genEntryDelayMyhill(double meanEventDensity, double ratio)
f = -ln[(U1-U2)u + U2] / m where U2 = the (1-R)th root of R and U1 = U2^R R is a ratio relating the maximum and minimum samples. m is mean event density u is a driver value Comments taken from Ames on Ratio values: Ratio represents approximation to pure exponential. It is the ratio relating the maximum and minimum allowed samples. Thus a ratio of 5.0 with a mean of 7.0 would yield a range from 2.8 to 14.0, since 14/2.8=5 and is centered on 7 Ratios over 128 makes Myhill behave indistinguishably from exponential. Ratios from 4 to 16 produce approximation ranging from 50% to 75% Ratios less than 2 are 'drunkenly regular'. Closer and closer to unity ratios generate more and more regular event patterns.
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |