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 floatcoefficientprotected float[]deltaiprotected floatdtprotected float[]indprotected float[]sineprivate static intSINETABLE_SIZEprotected static doubleTWOPI-
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 floatlookup(float i)Subclasses should define the way the do the interpolation.private floatmodS(float y)voidperform(double[] buffer)The perform method executed sums a number of oscillators equal to the stressParameter.voidsetBlockSize(int bSize)Set the block size and update the coefficient.voidsetParams(double param1)When changing the parameter using the GUI, also update the number of oscillators used in calculation.voidsetStressParameter(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:
performin classDspAlgorithm
-
modS
private float modS(float y)
- Parameters:
y-- Returns:
- y % S.
-
setStressParameter
public void setStressParameter(int stressParam)
Set the stress parameter.- Overrides:
setStressParameterin 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:
setParamsin 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:
setBlockSizein classDspAlgorithm- Parameters:
bSize-
-
-