public static void FHT(double[] data, FourierTransform.Direction direction){
int N = data.length;
if (direction == FourierTransform.Direction.Forward){
ComplexNumber[] cdata = new ComplexNumber[N];
for (int i = 0; i < N; i++)
cdata[i] = new ComplexNumber(data[i], 0);
FourierTransform.FFT(cdata, FourierTransform.Direction.Forward);
for (int i = 1; i < (N/2); i++)
{
cdata[i].real *= 2.0;
cdata[i].imaginary *= 2.0;
}
for (int i = (N/2)+1; i < N; i++)
{
cdata[i].real = 0.0;
cdata[i].imaginary = 0.0;
}
FourierTransform.FFT(cdata, FourierTransform.Direction.Backward);
// Convert back to our init
Java实现希尔伯特(hilbert)变换
最新推荐文章于 2024-09-28 23:33:46 发布