public class Downsample extends AbstractSignalProcessor<AudioBuffer,AudioBuffer>
Filters
and Mapping
) to avoid aliasing.
Date: Jul 22, 2010
Time: 2:38:54 PMDecimate
lastOut, signalProcessorSupport
Constructor and Description |
---|
Downsample()
Creates a downsample processor that drops/keeps every second frame.
|
Downsample(int nthFrameToKeep)
Keeps every nth frame, drops all other frames.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getNthFrameToKeep() |
int |
hashCode() |
protected AudioBuffer |
processNext(AudioBuffer buffer)
Processes the given input and returns some output.
|
void |
setNthFrameToKeep(int nthFrameToKeep)
Every
nthFrameToKeep th frame will be kept. |
String |
toString() |
connectTo, connectTo, connectTo, disconnectFrom, flush, getConnectedProcessors, getConnectedSource, getId, getOutput, process, read, reset, setId
public Downsample(int nthFrameToKeep)
nthFrameToKeep
- nth frame to keeppublic Downsample()
public int getNthFrameToKeep()
setNthFrameToKeep(int)
public void setNthFrameToKeep(int nthFrameToKeep)
nthFrameToKeep
th frame will be kept.
So if you specify 2, every 2nd frame will be kept.
If you specify 3, every third frame will be kept - leading to a sample rate reduction of,
e.g. 44100 to 44100/3 = 14700.nthFrameToKeep
- frame to keepprotected AudioBuffer processNext(AudioBuffer buffer)
AbstractSignalProcessor
processNext
in class AbstractSignalProcessor<AudioBuffer,AudioBuffer>
buffer
- input guaranteed not to be null
.Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.