问题描述
我无法理解FFT的运行情况.给定许多正弦点,我需要将它们拟合为正弦函数.也就是说,我需要根据y = A·sin(B·t + C)+ D来了解A,B,C和D.
我打算这样做的方式是通过执行FFT-> D(偏移)是0 Hz时的幅度,B是FFT幅度最大的频率,因此我也可以知道A在那一点.
我将C#(.NET)与Exocortex.DSP.v1库一起使用.我做了自己的图形库.您可以从此处-.gt;下载.exe. http://openelectronicdesigns.com/files/public/myFFT.zip [ ^ ].
这只是一个显示我的问题的程序.我生成一个时间信号,然后计算FFT,并在Complex图中表示复数.如您所见,当您取消选中"FFT窗口"并将频率设置为10(1024个点上的10个周期)时,您可以更改相位,并且复杂"图中的相量也会随之变化.在这种情况下,相位是正确的.
问题来了.如果您更改频率,假设频率为10.25Hz,则相位也会更改,这是我不了解的.只有在FFT的1024个点内有完整的周期数时,我才能计算相位.最初,我认为这是因为从最后一个点到初始点的不连续性,这就是为什么我添加了FFT窗口化选项的原因.但这没什么大不同...
有人可以告诉我我在做什么错吗?我认为这可能是一个概念性问题,而不是程序性问题,但是这里有很多聪明人;)
谢谢!
Hi,
I''m having trouble to understand what''s going on with my FFT. Given a number of sinusoidal points, I need to fit them into a sine function. That is, I need to know A, B, C and D from y = A·sin(B·t+C)+D.
The way I intended to do it was by performing the FFT -> D (the offset) would be the amplitude at 0 Hz, B the frequency where the FFT amplitude is maximum, so I can also know A at that point.
I use C# (.NET) together with the Exocortex.DSP.v1 library. I did my own graphic library. You can download the .exe from here -> http://openelectronicdesigns.com/files/public/myFFT.zip[^].
This is just a program to show my problem. I generate a time signal, then calculate the FFT, and represent the complex number in the Complex plot. As you can see when you uncheck the "FFT Windowing" and set the frequency to 10 (10 cycles over 1024 points), you can change the phase, and the phasor at the Complex plot changes according to it. The phase is correct in that case.
Here the problem comes. If you change the frequency, let''s say at 10.25Hz, the phase also changes, and that''s what I don''t understand. I can only calculate the phase when I have a complete number of cycles inside the 1024 points of the FFT. Initially I thought it was because of the discontinuity from the last to the initial point, and that''s why I added the FFT Windowing option. But it makes no major difference...
Anyone could please tell me what am I doing wrong? I think it might be a conceptual problem rather than a programmatic one, but there are lots of intelligent people around here ;)
Thank you!
推荐答案
这篇关于关于FFT相位问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!