在vb.net中执行各种快速傅立叶变换相关任务

时间:2018-12-26 11:18:40

标签: vb.net fft

我有以下图形:

1

我想过滤掉“慢”错误,以便仅保留高频错误。我认为快速傅立叶变换是正确的工具。我认为这是正确的工作流程:

  • 执行FFT
  • 应用高/低通滤波器
  • 执行逆FFT

必须高效地完成此操作,因为这需要在CPU已承受来自其他任务的负载时执行。

我的问题是我需要在vb.net中执行此操作。我找到了两个可以做到这一点的库:Alglib和this,这是来自fftw的端口。 fftw.net上没有文档,我无法弄清楚。

这是我用alglib编写的代码:

Dim x As Double() 'x axis values
Dim fx As Double() 'y axis values

'code to read from txt file to the double array
'...


Dim f() As alglib.complex = New alglib.complex() {}
XAlglib.fftr1d(fx, f) 'note that this doesn't take x axis values, only y 


'code to display everything as graph, taking only the real part of the complex struct for displaying.
'only the first half of the  FFT values are displayed, as the second half is a mirrored version of the first half
...

结果图:

2

Here是文档的链接。

结果图不能完全正确,因为我无法输入x值。而且它在y轴上低于0。

有人可以告诉我需要更改什么以获得正确的结果,或者告诉我使用其他库的代码吗?

0 个答案:

没有答案