Top Description Fields Constructors Methods
javazoom.jl.decoder

public final Class SynthesisFilter

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .InvalidClassException, .InvalidObjectException, .ObjectInputStream, java.lang.reflect.Array

A class for the synthesis filter bank. This class does a fast downsampling from 32, 44.1 or 48 kHz to 8 kHz, if ULAW is defined. Frequencies above 4 kHz are removed by ignoring higher subbands.

Field Summary

Modifier and TypeField and Description
private float[]
_tmpOut

Compute PCM Samples.

private float[]
private int
private int
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static final float
private static float[]
d

private static float[][]
d16

d[] split into subarrays of length 16.

private static final double
private float[]
private float
private float[]
private float[]

Constructor Summary

AccessConstructor and Description
public
SynthesisFilter(int channelnumber, float factor, float[] eq0)

Contructor.

Method Summary

Modifier and TypeMethod and Description
public void
calculate_pcm_samples(OutputBuffer buffer)

Calculate 32 PCM samples and put the into the Obuffer-object.

private void
compute_new_v()

Compute new values via a fast cosine transform.

private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
private void
public static Object
private static Object
deserializeArray(InputStream
The InputStream to deserialize an object from.
in
,
Class<T>
The class denoting the type of the array elements.
elemType
,
int
The expected length of the array, or -1 if any length is expected.
length
)

Deserializes an array from a given InputStream.

public void
input_sample(float sample, int subbandnumber)

Inject Sample.

public void
input_samples(float[] s)

private static float[]

Returns:

the loaded values for d[].
load_d
()

Loads the data for the d[] from the resource SFd.ser.

public void
reset()

Reset the synthesis filter.

private static float[][]

Returns:

An array of arrays in which each element in the returned array will be of length blockSize.
splitArray
(final float[]
The array to split up into blocks.
array
,
final int
The size of the blocks to split the array into. This must be an exact divisor of the length of the array, or some data will be lost from the main array.
blockSize
)

Converts a 1D array into a number of smaller arrays.

private static float[]

Returns:

The subarray, which may be of length 0.
subArray
(final float[]
The array to retrieve a subarra from.
array
,
final int
The offset in the array that corresponds to the first index of the subarray.
offs
,
int
The number of indeces in the subarray.
len
)

Returns a subarray of an existing array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_tmpOutback to summary
private float[] _tmpOut

Compute PCM Samples.

actual_vback to summary
private float[] actual_v
actual_write_posback to summary
private int actual_write_pos
channelback to summary
private int channel
cos11_32back to summary
private static final float cos11_32
cos11_64back to summary
private static final float cos11_64
cos13_32back to summary
private static final float cos13_32
cos13_64back to summary
private static final float cos13_64
cos15_32back to summary
private static final float cos15_32
cos15_64back to summary
private static final float cos15_64
cos17_64back to summary
private static final float cos17_64
cos19_64back to summary
private static final float cos19_64
cos1_16back to summary
private static final float cos1_16
cos1_32back to summary
private static final float cos1_32
cos1_4back to summary
private static final float cos1_4
cos1_64back to summary
private static final float cos1_64
cos1_8back to summary
private static final float cos1_8
cos21_64back to summary
private static final float cos21_64
cos23_64back to summary
private static final float cos23_64
cos25_64back to summary
private static final float cos25_64
cos27_64back to summary
private static final float cos27_64
cos29_64back to summary
private static final float cos29_64
cos31_64back to summary
private static final float cos31_64
cos3_16back to summary
private static final float cos3_16
cos3_32back to summary
private static final float cos3_32
cos3_64back to summary
private static final float cos3_64
cos3_8back to summary
private static final float cos3_8
cos5_16back to summary
private static final float cos5_16
cos5_32back to summary
private static final float cos5_32
cos5_64back to summary
private static final float cos5_64
cos7_16back to summary
private static final float cos7_16
cos7_32back to summary
private static final float cos7_32
cos7_64back to summary
private static final float cos7_64
cos9_32back to summary
private static final float cos9_32
cos9_64back to summary
private static final float cos9_64
dback to summary
private static float[] d
d16back to summary
private static float[][] d16

d[] split into subarrays of length 16. This provides for more faster access by allowing a block of 16 to be addressed with constant offset.

MY_PIback to summary
private static final double MY_PI
samplesback to summary
private float[] samples
scalefactorback to summary
private float scalefactor
v1back to summary
private float[] v1
v2back to summary
private float[] v2

Constructor Detail

SynthesisFilterback to summary
public SynthesisFilter(int channelnumber, float factor, float[] eq0)

Contructor. The scalefactor scales the calculated float pcm samples to short values (raw pcm samples are in [-1.0, 1.0], if no violations occur).

Method Detail

calculate_pcm_samplesback to summary
public void calculate_pcm_samples(OutputBuffer buffer)

Calculate 32 PCM samples and put the into the Obuffer-object.

compute_new_vback to summary
private void compute_new_v()

Compute new values via a fast cosine transform.

compute_pcm_samplesback to summary
private void compute_pcm_samples(OutputBuffer buffer)
compute_pcm_samples0back to summary
private void compute_pcm_samples0(OutputBuffer buffer)
compute_pcm_samples1back to summary
private void compute_pcm_samples1(OutputBuffer buffer)
compute_pcm_samples10back to summary
private void compute_pcm_samples10(OutputBuffer buffer)
compute_pcm_samples11back to summary
private void compute_pcm_samples11(OutputBuffer buffer)
compute_pcm_samples12back to summary
private void compute_pcm_samples12(OutputBuffer buffer)
compute_pcm_samples13back to summary
private void compute_pcm_samples13(OutputBuffer buffer)
compute_pcm_samples14back to summary
private void compute_pcm_samples14(OutputBuffer buffer)
compute_pcm_samples15back to summary
private void compute_pcm_samples15(OutputBuffer buffer)
compute_pcm_samples2back to summary
private void compute_pcm_samples2(OutputBuffer buffer)
compute_pcm_samples3back to summary
private void compute_pcm_samples3(OutputBuffer buffer)
compute_pcm_samples4back to summary
private void compute_pcm_samples4(OutputBuffer buffer)
compute_pcm_samples5back to summary
private void compute_pcm_samples5(OutputBuffer buffer)
compute_pcm_samples6back to summary
private void compute_pcm_samples6(OutputBuffer buffer)
compute_pcm_samples7back to summary
private void compute_pcm_samples7(OutputBuffer buffer)
compute_pcm_samples8back to summary
private void compute_pcm_samples8(OutputBuffer buffer)
compute_pcm_samples9back to summary
private void compute_pcm_samples9(OutputBuffer buffer)
deserializeback to summary
public static Object deserialize(InputStream in) throws IOException
deserializeArrayback to summary
private static Object deserializeArray(InputStream in, Class<T> elemType, int length) throws IOException

Deserializes an array from a given InputStream.

Parameters
in:InputStream

The InputStream to deserialize an object from.

elemType:Class<T>

The class denoting the type of the array elements.

length:int

The expected length of the array, or -1 if any length is expected.

input_sampleback to summary
public void input_sample(float sample, int subbandnumber)

Inject Sample.

input_samplesback to summary
public void input_samples(float[] s)
load_dback to summary
private static float[] load_d()

Loads the data for the d[] from the resource SFd.ser.

Returns:float[]

the loaded values for d[].

resetback to summary
public void reset()

Reset the synthesis filter.

splitArrayback to summary
private static float[][] splitArray(final float[] array, final int blockSize)

Converts a 1D array into a number of smaller arrays. This is used to achieve offset + constant indexing into an array. Each sub-array represents a block of values of the original array.

Parameters
array:float[]

The array to split up into blocks.

blockSize:int

The size of the blocks to split the array into. This must be an exact divisor of the length of the array, or some data will be lost from the main array.

Returns:float[][]

An array of arrays in which each element in the returned array will be of length blockSize.

subArrayback to summary
private static float[] subArray(final float[] array, final int offs, int len)

Returns a subarray of an existing array.

Parameters
array:float[]

The array to retrieve a subarra from.

offs:int

The offset in the array that corresponds to the first index of the subarray.

len:int

The number of indeces in the subarray.

Returns:float[]

The subarray, which may be of length 0.