|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oregondsp.signalProcessing.Sequence
public class Sequence
Class to implement basic signal processing operations on scalar sequences. This class can be used in two ways. Objects of this class may be instantiated to represent sequences and in that case will serve as a containers for sequence values (float precision). For this use, methods are supplied that alter or operate on the values of the contained sequence. Alternatively, the methods (where it makes sense) are supplied in static form. The class may be used to operate on the user's float arrays without need to instantiate a Sequence object. This class is far from comprehensive; it primarily implements methods used by other classes in this package.
Constructor Summary | |
---|---|
Sequence(float[] x)
Instantiates a new sequence from an array of float values. |
|
Sequence(int N)
Instantiates a new sequence of all zeros, of length N samples. |
Method Summary | |
---|---|
static void |
alias(float[] src,
float[] dst)
Method to alias a source sequence into a destination sequence. |
void |
alias(int N)
Aliases the current sequence into a smaller sequence. |
static void |
circularShift(float[] y,
int shift)
Performs a circular shift of a sequence. |
void |
circularShift(int shift)
Performs a circular shift on this sequence, in-place |
static void |
decimate(float[] y,
int decrate,
float[] ydecimated)
Decimates a sequence by a specified rate. |
void |
decimate(int decrate)
Decimates this sequence in-place. |
float |
get(int index)
Accessor for an individual value of the sequence. |
float[] |
getArray()
Accessor for the entire array of sequence values. |
void |
reverse()
Reverses this sequence in-place. |
static void |
reverse(float[] y)
Reverses a sequence in place. |
void |
rmean()
Removes the mean of this sequence in-place. |
static void |
rmean(float[] y)
Removes the mean of a sequence. |
static void |
stretch(float[] y,
int rate,
float[] ystretched)
Stretches a sequence by a specified rate. |
void |
stretch(int rate)
Stretches this sequence by a specified rate, in place. |
void |
timesEquals(float f)
Multiplies this sequence by a constant, in-place. |
static void |
timesEquals(float[] y,
float f)
Multiplies a sequence by a constant. |
static void |
zeroShift(float[] y,
int shift)
Shifts a sequence left or right and pads with zeros (unlike the circular shift, sequence values are lost). |
void |
zeroShift(int shift)
Performs a shift on this sequence with zero-fill. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sequence(float[] x)
x
- float[] containing the Sequence values.public Sequence(int N)
N
- int specifying the length of the sequence.Method Detail |
---|
public static void alias(float[] src, float[] dst)
src
- float[] containing the source sequence.dst
- float[] containing the destination sequence.public void alias(int N)
N
- New length of the sequence, and alias modulus.public float get(int index)
index
- int containing the index of the desired sequence value.
public float[] getArray()
public static void reverse(float[] y)
y
- float[] containing the sequence to be reversed.public void reverse()
public static void rmean(float[] y)
y
- float[] specifying the sequence to be demeaned.public void rmean()
public static void circularShift(float[] y, int shift)
y
- float[] containing sequence to be shifted.shift
- int specifying the size and direction of the shift. A negative
number specifies a left shift, a positive number, a right shift.
A zero shift leaves the sequence unchanged.public void circularShift(int shift)
shift
- int specifying the size and direction of the shift. A negative number
specifies a left shift and a positive number, a right shift. A zero shift
leaves the sequence unchanged.public static void zeroShift(float[] y, int shift)
y
- float[] containing the sequence to be shifted.shift
- int specifying the direction and size of the shift. A negative shift is to the left.
Zeros are fed in from the right in that case. A positive shift is to the right. Zeros
are fed in from the left in that case. A zero shift leaves the sequence unchanged.public void zeroShift(int shift)
shift
- int specifying the direction and size of the shift. A negative shift is to the left.
Zeros are fed in from the right in that case. A positive shift is to the right. Zeros
are fed in from the left in that case. A zero shift leaves the sequence unchanged.public static void decimate(float[] y, int decrate, float[] ydecimated)
y
- float[] containing the sequence to be decimated.decrate
- int specifying the decimation rate.ydecimated
- float[] containing the decimated sequence.public void decimate(int decrate)
decrate
- int specifying the decimation rate.public static void stretch(float[] y, int rate, float[] ystretched)
y
- float[] containing the sequence to be stretched.rate
- int containing the stretch rate.ystretched
- float[] containing the stretched sequence.public void stretch(int rate)
rate
- int containing the stretch rate (factor).public static void timesEquals(float[] y, float f)
y
- float[] containing the sequence to be scaled.f
- float containing the multiplicative constant.public void timesEquals(float f)
f
- float specifying the multiplicative constant.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |