C# Class IntXLib.FhtHelper

Contains helping methods for work with FHT (Fast Hartley Transform). FHT is a better alternative of FFT (Fast Fourier Transform) - at least for IntX.
ファイルを表示 Open project: devoyster/IntXLib

Public Methods

Method Description
ConvertDigitsToDouble ( uint digits, uint length, uint newLength ) : double[]

Converts IntX digits into real representation (used in FHT).

ConvertDoubleToDigits ( double array, uint length, uint digitsLength, uint digitsRes ) : void

Converts real digits representation (result of FHT) into usual IntX digits.

Fht ( double array, uint length ) : void

Performs FHT "in place" for given double[] array.

Fht ( double slice, uint length, int lengthLog2 ) : void

Performs FHT "in place" for given double[] array slice.

MultiplyFhtResults ( double data, double data2, uint length ) : void

Multiplies two FHT results and stores multiplication in first one.

ReverseFht ( double array, uint length ) : void

Performs FHT reverse "in place" for given double[] array.

ReverseFht ( double slice, uint length, int lengthLog2 ) : void

Performs reverse FHT "in place" for given double[] array slice.

Private Methods

Method Description
Fht4 ( double slice ) : void

Performs FHT "in place" for given double[] array slice. Fast version for length == 4.

FhtButterfly ( double slice1, double slice2, uint index1, uint index2, double cos, double sin ) : void

Performs "butterfly" operation for Fht(double*, uint, int).

FhtHelper ( )
FillSineTable ( double sineTable ) : void

Fills sine table for FHT.

GetInitialTrigValues ( TrigValues valuesPtr, int lengthLog2 ) : void

Initializes trigonometry values for FHT.

NextTrigValues ( TrigValues valuesPtr ) : void

Generates next trigonometry values for FHT basing on previous ones.

ReverseFht8 ( double slice ) : void

Performs reverse FHT "in place" for given double[] array slice. Fast version for length == 8.

ReverseFhtButterfly ( double slice1, double slice2, uint index1, uint index2, double cos, double sin ) : void

Performs "butterfly" operation for ReverseFht(double*, uint, int).

ReverseFhtButterfly2 ( double slice1, double slice2, uint index1, uint index2, double cos, double sin ) : void

Performs "butterfly" operation for ReverseFht(double*, uint, int). Another version.

Method Details

ConvertDigitsToDouble() public static method

Converts IntX digits into real representation (used in FHT).
public static ConvertDigitsToDouble ( uint digits, uint length, uint newLength ) : double[]
digits uint Big integer digits.
length uint length.
newLength uint Multiplication result length (must be pow of 2).
return double[]

ConvertDoubleToDigits() public static method

Converts real digits representation (result of FHT) into usual IntX digits.
public static ConvertDoubleToDigits ( double array, uint length, uint digitsLength, uint digitsRes ) : void
array double Real digits representation.
length uint length.
digitsLength uint New digits array length (we always do know the upper value for this array).
digitsRes uint Big integer digits.
return void

Fht() public static method

Performs FHT "in place" for given double[] array.
public static Fht ( double array, uint length ) : void
array double Double array.
length uint Array length.
return void

Fht() public static method

Performs FHT "in place" for given double[] array slice.
public static Fht ( double slice, uint length, int lengthLog2 ) : void
slice double Double array slice.
length uint Slice length.
lengthLog2 int Log2().
return void

MultiplyFhtResults() public static method

Multiplies two FHT results and stores multiplication in first one.
public static MultiplyFhtResults ( double data, double data2, uint length ) : void
data double First FHT result.
data2 double Second FHT result.
length uint FHT results length.
return void

ReverseFht() public static method

Performs FHT reverse "in place" for given double[] array.
public static ReverseFht ( double array, uint length ) : void
array double Double array.
length uint Array length.
return void

ReverseFht() public static method

Performs reverse FHT "in place" for given double[] array slice.
public static ReverseFht ( double slice, uint length, int lengthLog2 ) : void
slice double Double array slice.
length uint Slice length.
lengthLog2 int Log2().
return void