public class FourierFunction extends java.lang.Object implements Function
Constructor and Description |
---|
FourierFunction(float[][] frequencies,
float[] amplitudes,
float[][] phases)
Creates an n-dimensional function composed of explicitly defined sinusoids.
|
FourierFunction(float[] frequencies,
float[] amplitudes,
float[] phases)
Creates a 1-dimensional function composed of explicitly defined sinusoids.
|
FourierFunction(float fundamental,
float cutoff,
float rms,
long seed)
Creates a 1-dimensional band-limited pink noise function with specified parameters.
|
FourierFunction(float fundamental,
float cutoff,
float rms,
long seed,
int type)
Creates a 1-dimensional band-limited noise function with specified parameters.
|
Modifier and Type | Method and Description |
---|---|
Function |
clone() |
float[] |
getAmplitudes() |
int |
getComponents() |
float |
getCutoff() |
int |
getDimension() |
float[][] |
getFrequencies() |
float |
getFundamental() |
float[][] |
getPhases() |
float |
getRms() |
long |
getSeed() |
float |
map(float[] from) |
float[] |
multiMap(float[][] from) |
void |
setAmplitudes(float[] amplitudes) |
void |
setFrequencies(float[][] frequencies) |
void |
setPhases(float[][] phases) |
public FourierFunction(float[] frequencies, float[] amplitudes, float[] phases)
frequencies
- Explicit list of frequencies of sinusoidal components of the
function (Hz)amplitudes
- The amplitude of each componentphases
- The phase lead of each component (from -.5 to .5)public FourierFunction(float[][] frequencies, float[] amplitudes, float[][] phases)
frequencies
- Lists of frequencies (length n; ith members define frequencies of ith component along each dimension)amplitudes
- The amplitude of each componentphases
- Lists of phases (length n; ith members define phases of ith component along each dimension)public FourierFunction(float fundamental, float cutoff, float rms, long seed, int type)
fundamental
- The fundamental frequency (Hz), i.e., frequency step size.cutoff
- The high-frequency limit (Hz)rms
- The root-mean-squared function amplitudeseed
- Random seedtype
- The type of noise: 0 = white; 1 = pink;public FourierFunction(float fundamental, float cutoff, float rms, long seed)
fundamental
- The fundamental frequency (Hz), i.e., frequency step size.cutoff
- The high-frequency limit (Hz)rms
- The root-mean-squared function amplitudeseed
- Random seedpublic int getDimension()
getDimension
in interface Function
Function.getDimension()
public int getComponents()
public float[][] getFrequencies()
public void setFrequencies(float[][] frequencies)
frequencies
- Lists of frequencies (length n; ith members define frequencies of ith component along each dimension)public float[] getAmplitudes()
public void setAmplitudes(float[] amplitudes)
amplitudes
- The amplitude of each componentpublic float[][] getPhases()
public void setPhases(float[][] phases)
phases
- Lists of phases (length n; ith members define phases of ith component along each dimension)public float map(float[] from)
map
in interface Function
from
- Must have same length as getDimension()Function.map(float[])
public float[] multiMap(float[][] from)
multiMap
in interface Function
from
- An array of arguments; each element must have length getDimension().Function.multiMap(float[][])
public float getFundamental()
public float getCutoff()
public float getRms()
public long getSeed()