帮助我理解FFT函数(Matlab)

发布于 2024-07-11 05:39:35 字数 145 浏览 4 评论 0原文

1) 除了负频率之外,FFT 函数提供的最小频率是多少? 是零吗?
2) 如果它为零,我们如何在对数刻度上绘制零?
3)结果总是对称的? 或者它只是看起来是对称的?
4)如果我使用abs(fft(y))来比较2个信号,我是否会失去一些准确性?

1) Besides the negative frequencies, which is the minimum frequency provided by the FFT function? Is it zero?
2) If it is zero how do we plot zero on a logarithmic scale?
3) The result is always symmetrical? Or it just appears to be symmetrical?
4) If I use abs(fft(y)) to compare 2 signals, may I lose some accuracy?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

忆离笙 2024-07-18 05:39:35

1) 除了负频率之外,FFT 函数提供的最小频率是多少? 是零吗?

fft(y) 返回一个向量,其中包含 y 的 DFT 的第 0 到第 (N-1) 个样本,其中应考虑 y(t)在 0 ... N-1 上定义(因此,y(t) 的“周期性重复”可以被认为是在 Z 上定义的周期性信号)。

fft(y) 的第一个样本对应于频率 0。
实数、离散时间、周期信号的傅立叶变换也具有离散域,并且是周期的和埃尔米特的(见下文)。 因此,负频率的变换是正频率的相应样本的共轭。

例如,如果您将y(的周期性重复)解释为在 Z 上定义的周期性实信号(采样周期 == 1),则 fft(y) 的域> 应解释为 N 个等距点 0, 2π/N ... 2π(N-1)/N。 负频率 -π ... -π/N 处的变换样本是频率 π ... π/N 处样本的共轭,并且等于频率处样本
π ... 2π(N-1)/N。

2)如果它为零,我们如何在对数刻度上绘制零?

如果您想绘制某种波特图,您可以仅绘制正频率的变换,忽略对应于最低频率(特别是 0)的样本。

3)结果总是对称的? 或者它只是看起来是对称的?

如果 y 为实数,则它具有 埃尔米特对称性:它的实部是对称的,其虚部是反对称的。 换句话说,其幅度是对称的,而其相位是反对称的。

4) 如果我使用 abs(fft(y)) 比较 2 个信号,是否会损失一些准确性?

如果您的意思是 abs(fft(x - y)),这是可以的,您可以使用它来了解差异(或误差,如果 x 是 y 的估计值)的频率分布)。 如果你的意思是 abs(fft(x)) - abs(fft(y)) (???) 你至少会丢失相位信息。

1) Besides the negative frequencies, which is the minimum frequency provided by the FFT function? Is it zero?

fft(y) returns a vector with the 0-th to (N-1)-th samples of the DFT of y, where y(t) should be thought of as defined on 0 ... N-1 (hence, the 'periodic repetition' of y(t) can be thought of as a periodic signal defined over Z).

The first sample of fft(y) corresponds to the frequency 0.
The Fourier transform of real, discrete-time, periodic signals has also discrete domain, and it is periodic and Hermitian (see below). Hence, the transform for negative frequencies is the conjugate of the corresponding samples for positive frequencies.

For example, if you interpret (the periodic repetition of) y as a periodic real signal defined over Z (sampling period == 1), then the domain of fft(y) should be interpreted as N equispaced points 0, 2π/N ... 2π(N-1)/N. The samples of the transform at the negative frequencies -π ... -π/N are the conjugates of the samples at frequencies π ... π/N, and are equal to the samples at frequencies
π ... 2π(N-1)/N.

2) If it is zero how do we plot zero on a logarithmic scale?

If you want to draw some sort of Bode plot you may plot the transform only for positive frequencies, ignoring the samples corresponding to the lowest frequencies (in particular 0).

3) The result is always symmetrical? Or it just appears to be symmetrical?

It has Hermitian symmetry if y is real: Its real part is symmetric, its imaginary part is anti-symmetric. Stated another way, its amplitude is symmetric and its phase anti-symmetric.

4) If I use abs(fft(y)) to compare 2 signals, may I lose some accuracy?

If you mean abs(fft(x - y)), this is OK and you can use it to get an idea of the frequency distribution of the difference (or error, if x is an estimate of y). If you mean abs(fft(x)) - abs(fft(y)) (???) you lose at least phase information.

一绘本一梦想 2024-07-18 05:39:35

好吧,如果你想了解快速傅里叶变换,你需要回到基础知识并了解 DFT 本身。 但是,这不是你问的,所以我只是建议你在自己的时间这样做:)

但是,回答你的问题:

  1. 是的,(正如你所说,除了负数)它是零。 对于 N 点输入,范围为 0 至 (N-1)。
  2. 在 MATLAB 中? 我不确定我是否理解你的问题 - 像绘制任何其他值一样绘制零值......不过,正如达菲莫正确指出的那样,不存在零的自然对数。
  3. 它本质上类似于 sinc(正弦基数)函数。 但它不一定是对称的。
  4. 你不会失去任何准确性,你只会得到幅度响应(但我想你已经知道了)。

Well, if you want to understand the Fast Fourier Transform, you want to go back to the basics and understand the DFT itself. But, that's not what you asked, so I'll just suggest you do that in your own time :)

But, in answer to your questions:

  1. Yes, (excepting negatives, as you said) it is zero. The range is 0 to (N-1) for an N-point input.
  2. In MATLAB? I'm not sure I understand your question - plot zero values as you would any other value... Though, as rightly pointed out by duffymo, there is no natural log of zero.
  3. It's essentially similar to a sinc (sine cardinal) function. It won't necessarily be symmetrical, though.
  4. You won't lose any accuracy, you'll just have the magnitude response (but I guess you knew that already).
ぽ尐不点ル 2024-07-18 05:39:35

查阅《C语言数值食谱》,第12章“快速傅里叶变换”说:

  1. 频率范围从负fc到正fc,其中fc是奈奎斯特临界频率,等于1/(2*delta) ,其中 delta 是采样间隔。 所以频率肯定可以是负值。

  2. 你无法绘制不存在的东西。 不存在零的自然对数。 您可以将频率绘制为 x 轴,也可以选择一个不包含零的范围作为半对数轴。

  3. 频率范围内是否存在对称性取决于时域函数的性质。 您可以在频域中绘制关于 y 轴不对称的图。

  4. 我认为这样取绝对值不是一个好主意。 您将需要阅读更多有关卷积、校正和信号处理的内容来比较两个信号。

Consulting "Numerical Recipes in C", Chapter 12 on "Fast Fourier Transform" says:

  1. The frequency ranges from negative fc to positive fc, where fc is the Nyquist critical frequency, which is equal to 1/(2*delta), where delta is the sampling interval. So frequencies can certainly be negative.

  2. You can't plot something that doesn't exist. There is no natural log of zero. You'll either plot frequency as the x-axis or choose a range that doesn't include zero for your semi-log axis.

  3. The presence or lack of symmetry in the frequency range depends on the nature of the function in the time domain. You can have a plot in the frequency domain that is not symmetric about the y-axis.

  4. I don't think that taking the absolute value like that is a good idea. You'll want to read a great deal more about convolution, correction, and signal processing to compare two signals.

窝囊感情。 2024-07-18 05:39:35
  1. fft的结果可以是0。已经被其他人回答了。
  2. 要绘制 0 频率,技巧是将其设置为一个非常小的正数(为此目的我使用 exp(-15))。
  3. 其他人已经回答了。
  4. 如果您只对大小感兴趣,是的,您可以这样做。 例如,这适用于许多图像处理问题。
  1. result of fft can be 0. already answered by other people.
  2. to plot 0 frequency, the trick is to set it to a very small positive number (I use exp(-15) for that purpose).
  3. already answered by other people.
  4. if you are only interested in the magnitude, yes you can do that. this is applicable, say, in many image processing problems.
不打扰别人 2024-07-18 05:39:35

你的问题有一半是:

3)FFT运算的结果取决于信号的性质; 因此,没有任何要求它是对称的,尽管如果是对称的,您可能会获得有关信号属性的更多信息

4) 这将比较一对信号的幅度,但相等并不能保证 FFT 相同(不要忘记阶段)。 然而,这可能足以满足您的目的,但您应该确定这一点。

Half your question:

3) The results of the FFT operation depend on the nature of the signal; hence there's nothing requiring that it be symmetrical, although if it is you may get some more information about the properties of the signal

4) That will compare the magnitudes of a pair of signals, but those being equal do no guarantee that the FFTs are identical (don't forget about phase). It may, however, be enough for your purposes, but you should be sure of that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文