|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.Filter1DNotch
public class Filter1DNotch
Audio filter - notch filter (very-narrow-band suppression).
Field Summary | |
---|---|
protected double |
a1
Coef for y[i-1]. |
protected double |
a2
Coef for y[i-2]. |
protected double |
b1
Coef for x[i-1]. |
protected static java.lang.String |
CATEGORY
Object category. |
protected double |
frequency
Suppressed frequency in Hz. |
static java.lang.String |
FREQUENCY
|
protected int |
channels
Number of channels to be processed. |
static RegPiece |
reg
Static registration instance for this class. |
protected double |
sampleRate
Sample rate in Hz. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
protected double |
unity
Unity (quality measure). |
static java.lang.String |
UNITY
|
protected int |
windowPtr
Index into xWindow and yWindow arrays. |
protected double[][] |
xWindow
History windows for each channel (input data). |
protected double[][] |
yWindow
History windows for each channel (output data). |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.Filter1D |
---|
IND_BYTES_PER_SAMPLE, IND_FREQUENCY, IND_CHANNELS, IND_SAMPLES |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
Filter1DNotch()
|
Method Summary | |
---|---|
int |
batch(double[] source,
int sourceSamples,
double[] target)
Processes one sample batch in double format. |
int |
batch(int[] source,
int sourceSamples,
int[] target)
Processes one sample batch in integer format. |
boolean |
format(int[] source,
int[] target)
Defines format modifications. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
protected double |
nextSample(double x,
int channel)
Computes next sample. |
void |
reset()
Starts a new data pass. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected double frequency
protected double unity
protected double sampleRate
protected int channels
protected double[][] xWindow
protected double[][] yWindow
protected int windowPtr
xWindow
and yWindow
arrays.
protected double b1
protected double a1
protected double a2
public static final java.lang.String FREQUENCY
public static final java.lang.String UNITY
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public Filter1DNotch()
Method Detail |
---|
protected double nextSample(double x, int channel)
x
- Input sample (xi).channel
- Channel number.
public boolean format(int[] source, int[] target)
batch(double[], int, double[])
calls.
format
in interface Filter1D
source
- Source audio format (channels, bytes-per-sample, samples, frequency).target
- Target audio format (channels, bytes-per-sample, samples, frequency).
true
if any format changes will be made (false => format identity
).batch(double[],int,double[])
,
batch(int[],int,int[])
public void reset()
reset
in interface Filter1D
batch(double[],int,double[])
,
batch(int[],int,int[])
public int batch(double[] source, int sourceSamples, double[] target)
channel0[0], channel1[0], ..
channelN[0], channel0[1], ..
.
batch
in interface Filter1D
source
- Source data array.sourceSamples
- Number of source time-slots.target
- Target data array.
format(int[], int[])
,
batch(int[],int,int[])
public int batch(int[] source, int sourceSamples, int[] target)
channel0[0], channel1[0], ..
channelN[0], channel0[1], ..
.
batch
in interface Filter1D
source
- Source data array.sourceSamples
- Number of source time-slots.target
- Target data array.
format(int[], int[])
,
batch(double[],int,double[])
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |