public class SpectralFilter extends Circuit implements UnitSink, UnitSource
for (int i = 0; i < numFFTs; i++) {
filter.getSpectralOutput(i).connect(processors[i].input);
processors[i].output.connect(filter.getSpectralInput(i));
}
See the example program "HearSpectralFilter.java". Note that this spectral API is experimental
and may change at any time.SpectralProcessor| Modifier and Type | Field and Description |
|---|---|
UnitInputPort |
input |
UnitOutputPort |
output |
FALSE, PORT_NAME_AMPLITUDE, PORT_NAME_CUTOFF, PORT_NAME_FREQUENCY, PORT_NAME_FREQUENCY_SCALER, PORT_NAME_INPUT, PORT_NAME_OUTPUT, PORT_NAME_PAN, PORT_NAME_PHASE, PORT_NAME_PRESSURE, PORT_NAME_TIMBRE, PORT_NAME_TIME, synthesisEngine, TRUE, VERY_SMALL_FLOAT| Constructor and Description |
|---|
SpectralFilter()
Create a default sized filter with 2 FFT/IFFT pairs and a sizeLog2 of
Spectrum.DEFAULT_SIZE_LOG_2.
|
SpectralFilter(int numFFTs,
int sizeLog2) |
| Modifier and Type | Method and Description |
|---|---|
UnitInputPort |
getInput() |
UnitOutputPort |
getOutput() |
UnitSpectralInputPort |
getSpectralInput(int i) |
UnitSpectralOutputPort |
getSpectralOutput(int i) |
SpectralWindow |
getWindow() |
void |
setWindow(SpectralWindow window)
Specify one window to be used for all FFTs and IFFTs.
|
add, addPortAlias, flattenOutputs, generate, getPortByName, setEnabled, setFrameRate, setSynthesisEngine, usePresetaddPort, addPort, autoStop, convertHalfLifeToMultiplier, convertTimeToRate, generate, getCircuit, getFramePeriod, getFrameRate, getId, getPorts, getSynthesisEngine, getSynthesizer, getTopUnit, getUnitGenerator, incrementWrapPhase, isEnabled, isStartRequired, printConnections, printConnections, printConnections, pullData, setCircuit, setPort, start, start, start, stop, stop, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUnitGenerator, start, start, stop, stopgetUnitGeneratorpublic UnitInputPort input
public UnitOutputPort output
public SpectralFilter()
public SpectralFilter(int numFFTs,
int sizeLog2)
numFFTs - number of FFT/IFFT pairs for the overlap and addsizeLog2 - for example, use 10 to get a 1024 bin FFT, 12 for 4096public SpectralWindow getWindow()
public void setWindow(SpectralWindow window)
window - default is HammingWindowSpectralWindowFactorypublic UnitOutputPort getOutput()
getOutput in interface UnitSourcepublic UnitInputPort getInput()
public UnitSpectralOutputPort getSpectralOutput(int i)
i - public UnitSpectralInputPort getSpectralInput(int i)
i -