为什么线性调频频率的微小变化会导致快速傅立叶变换输出发生重大变化?

路西恩

使用Audacity,我生成并导出了两个非常相似的线性调频脉冲,各1秒。一个具有440.00Hz的频率,另一个具有440.01Hz的频率。

使用Julia,我编写了一个简短的脚本来生成FFT图:

using WAV
using FFTW
using PyPlot

data, bps = wavread("440.01hz.wav")
plot(fft(data))

440.01绘图着眼于我的期望,在该频率处有一个大的尖峰:峰值约为440但是,在精确的整数440文件上重复相同的过程会产生以下结果:花线锯齿状的线条非常尖峰,没有尖峰。并进行缩小,看起来像这样(x轴转到44100,因为那是文件的每秒节拍数):野图我以更多的频率重复了该过程,并且似乎总是产生良好的效果(合理吗? )的结果是当频率为非整数时,否则会造成混淆。我在这里遇到什么问题?

编辑:

这些是文件:

440.00Hz http://www.mediafire.com/file/n6erdh3tkzslpro/440.00hz.wav/file

440.01Hz http://www.mediafire.com/file/2au05df2aelmn9o/440.01hz.wav/file

And here's a plot of both waves (almost indistinguishable) plotted with both fft's zoomed in:

在此处输入图片说明

And zoomed out:

在此处输入图片说明

The code used to generate these is the same as the one above, but with 4 plots (440 WAV, 440 FFT, 440.01 WAV, 440.01 FFT).

Edit2:

I figured out at least part of the problem. If I first pass the fourier transform of the 440.00hz wav to the absolute value function before plotting it plot(fft(data) .|> abs), I get a correct result:

在此处输入图片说明

So I know the solution to the problem now, but not why the solution works. The question still remains: what is it about integer frequencies that produces a graph with no spikes? Or, equally valid, why do fractional frequencies produce graphs with them?

Matt Timmermans

The (real) FFT decomposes your signal into a sum of sinusoidal components.

For each frequency you get a complex number. (ignoring the negative frequencies for now) The real part gives the cosine component, and the imaginary part gives the sine component.

You are making a .wav file with a sine wave in it, so you only get sine components, but you're plotting the real components so they're all 0.

Except... The FFT considers your signal to be periodic. When you use an arbitrary frequency, you don't end up with an integer number of cycles in the file, so there is a discontinuity when it wraps around from the end to the start.

Since your signal is not a perfect sinusoid in that case, you get some energy in the cosine components.

--

What you're doing with this FFT is probably very far from what you want to do. If you ask a question about how to do what you're really trying to do, we might be able to help.

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

为什么边框半径会导致Chrome按钮的样式发生巨大变化?

为什么在加载程序集后PowerShell输出发生变化?

为什么如果块输出发生变化以进行停止/警告?

位置发生重大变化-我们有什么保证?

为什么我的代码需要这么长时间才能运行,为什么它的运行时会发生重大变化?

范围TS重大变化?

为什么TYPE_ADDED_TO_INTERFACE被认为是一项重大变化?

是什么导致与8.0.2相比,8.1中的自转发生了巨大变化?

为什么添加内联汇编注释会导致GCC生成的代码发生如此根本的变化?

为什么修改不相关的变量会导致链接列表发生变化?

为什么创建新的 Pandas 列会导致原始列发生变化?

为什么更改采样频率后频谱也会变化?

删除图像后,为什么链接的位置会发生巨大变化?

重大变化 Prime OF 11 迁移

Android清单中的微小变化会导致应用崩溃

自2002年以来,C ++模板标准是否发生了重大变化?

如何使用快速傅立叶变换计算频率

为什么变量会变化?

为什么它显示多个或变化的频率?

NHibernate 4升级带来重大变化

AngularJS 1.2和1.4之间有重大变化吗?

ServiceStack在4.0.22.0中发生重大变化,CredentialsAuthProvider.OnAuthenticated现在返回一些信息

从函数返回后,什么会导致 C++ 对象的类型信息发生变化?

了解快速傅立叶变换方法的输出

哪些情况会导致硬盘 UUID 发生变化?

张量的值为什么会变化?

为什么grepping PID会不断变化?

为什么输出没有变化?

函数的哈希码在原子内部发生变化...为什么会这样?