AdditiveSynthesisLookupTable
JavaScript is disabled on your browser.
br.usp.ime.dspbenchmarking.algorithms
Class AdditiveSynthesisLookupTable
- java.lang.Object
-
- br.usp.ime.dspbenchmarking.algorithms.DspAlgorithm
-
- br.usp.ime.dspbenchmarking.algorithms.StressAlgorithm
-
- br.usp.ime.dspbenchmarking.algorithms.AdditiveSynthesisLookupTable
-
- Direct Known Subclasses:
- AdditiveSynthesisLookupTableCubic, AdditiveSynthesisLookupTableLinear, AdditiveSynthesisLookupTableTruncated
public abstract class AdditiveSynthesisLookupTable extends StressAlgorithm
An abstract additive synthesis using lookup table.
-
-
Field Summary
Fields Modifier and Type Field and Description protected float
coefficient
protected float[]
deltai
protected float
dt
protected float[]
ind
protected float[]
sine
private static int
SINETABLE_SIZE
protected static double
TWOPI
-
Fields inherited from class br.usp.ime.dspbenchmarking.algorithms.StressAlgorithm
stressParameter
-
Fields inherited from class br.usp.ime.dspbenchmarking.algorithms.DspAlgorithm
blockSize, parameter1, sampleRate
-
-
Constructor Summary
Constructors Constructor and Description AdditiveSynthesisLookupTable(int sRate, int bSize, int stressParam)
-
Method Summary
Methods Modifier and Type Method and Description protected abstract float
lookup(float i)
Subclasses should define the way the do the interpolation.private float
modS(float y)
void
perform(double[] buffer)
The perform method executed sums a number of oscillators equal to the stressParameter.void
setBlockSize(int bSize)
Set the block size and update the coefficient.void
setParams(double param1)
When changing the parameter using the GUI, also update the number of oscillators used in calculation.void
setStressParameter(int stressParam)
Set the stress parameter.-
Methods inherited from class br.usp.ime.dspbenchmarking.algorithms.DspAlgorithm
getAlgorithmName, getBlockSize, getParameter1, getSampleRate
-
-
-
-
Field Detail
-
sine
protected float[] sine
-
TWOPI
protected static final double TWOPI
- See Also:
- Constant Field Values
-
SINETABLE_SIZE
private static final int SINETABLE_SIZE
- See Also:
- Constant Field Values
-
coefficient
protected float coefficient
-
ind
protected float[] ind
-
dt
protected float dt
-
deltai
protected float[] deltai
-
-
Constructor Detail
-
AdditiveSynthesisLookupTable
public AdditiveSynthesisLookupTable(int sRate, int bSize, int stressParam)
-
-
Method Detail
-
perform
public void perform(double[] buffer)
The perform method executed sums a number of oscillators equal to the stressParameter.- Specified by:
perform
in classDspAlgorithm
-
modS
private float modS(float y)
- Parameters:
y
-- Returns:
- y % S.
-
setStressParameter
public void setStressParameter(int stressParam)
Set the stress parameter.- Overrides:
setStressParameter
in classStressAlgorithm
- Parameters:
fSize
-
-
setParams
public void setParams(double param1)
When changing the parameter using the GUI, also update the number of oscillators used in calculation.- Overrides:
setParams
in classDspAlgorithm
-
lookup
protected abstract float lookup(float i)
Subclasses should define the way the do the interpolation.- Parameters:
i
-- Returns:
-
setBlockSize
public void setBlockSize(int bSize)
Set the block size and update the coefficient.- Overrides:
setBlockSize
in classDspAlgorithm
- Parameters:
bSize
-
-
-