public final class DecoderUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
binaryToBytes(java.lang.String input)
Takes a String containing a bit sequence and return the corresponding byte array
|
static java.lang.String |
byteToUTF8(byte[] bytes) |
static java.lang.String |
decodeBitToText(java.lang.String bitOfText) |
static float |
freq2idx(int freq,
int fs,
int winlen)
Get the index of a specific frequency depending on sample rate and window length
|
static double |
getComplexAbsolute(double real,
double imaginary)
Calculates an absolute value of a complex number
|
static float |
getRelativeIndexPosition(float value,
float minValue,
float maxValue) |
static double |
max(double[] values)
Helper to get maximum value out of double array
|
static double |
mean(double[] m)
the array double[] m MUST BE SORTED
|
static double |
median(double[] m)
the array double[] m MUST BE SORTED
|
static int |
nextPowerOfTwo(int n)
Calculates power of two values
|
static java.lang.String |
removeFillingCharsAndCRCChars(java.lang.String bitMessage,
int generatorPolynomLength)
Checks for filling characters and error correction bits and deletes them.
|
public static java.lang.String decodeBitToText(java.lang.String bitOfText)
public static byte[] binaryToBytes(java.lang.String input)
input
- A String containing bitspublic static java.lang.String byteToUTF8(byte[] bytes)
public static java.lang.String removeFillingCharsAndCRCChars(java.lang.String bitMessage, int generatorPolynomLength)
bitMessage
- message to checkgeneratorPolynomLength
- length of crc generator polynompublic static double max(double[] values)
values
- array to get the max ofpublic static double mean(double[] m)
m
- public static double median(double[] m)
m
- public static float getRelativeIndexPosition(float value, float minValue, float maxValue)
public static float freq2idx(int freq, int fs, int winlen)
freq
- frequency to get the index offs
- sample ratewinlen
- window lengthpublic static int nextPowerOfTwo(int n)
n
- initial valuepublic static double getComplexAbsolute(double real, double imaginary)
real
- imaginary
-