简体   繁体   English

根据 fft 后获得的频率、幅度和相位重建原始信号

[英]Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft

Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft.根据 fft 后获得的频率、幅度和相位重建原始信号。

Greetings问候

I'm trying to rebuild a signal from the frequency, amplitude, and phase obtained after I do an fft of a signal, but when I try and combine the fft data (frequency, amplitude, and phase) back to see if I get a similar signal, the pattern is a little off.我正在尝试根据对信号进行 fft 后获得的频率、幅度和相位来重建信号,但是当我尝试将 fft 数据(频率、幅度和相位)组合回来以查看是否得到类似的信号,模式有点偏离。 I think it has to do with my formula which may be a little incorrect.我认为这与我的公式有关,可能有点不正确。

The formula I'm using to combine the data is:我用来组合数据的公式是:

amplitude*sin(2*pi*time*frequency+phase)+amplitude*cos(2*pi*time*frequency+phase);

Please note: At the moment I don't want to use IFFT due to the fact that I will be editing the amplitude and frequencies before the calculations are done请注意:目前我不想使用 IFFT,因为我将在计算完成之前编辑幅度和频率

An image of the plot is below. plot 的图像如下。 The top one is the original signal and the bottom one is the signal created with the equation.顶部是原始信号,底部是使用方程式创建的信号。 If you want to know I'm using matlab but I think the problem is with the equation.如果您想知道我使用的是 matlab 但我认为问题出在方程式上。在此处输入图像描述

tia蒂亚

The IFFT is an efficient implementation of the following transformation: IFFT 是以下转换的有效实现:

       N-1
x[n] = SUM X[k] exp(j*2*pi*n*k/N)
       k=0

where X[k] are your FFT results ( complex amplitudes), and x[n] are your time-domain samples.其中X[k]是您的 FFT 结果(振幅),而x[n]是您的时域样本。 For real-only inputs, this can be rewritten in terms of cos and sin (or in terms of cos with a phase term), but it's usually easier just to stick with the complex representation.对于纯实数输入,可以根据cossin (或根据带有phase项的cos )重写,但坚持使用复杂表示通常更容易。

[This can be heavily vectorised, but I'll leave that up to you!] [这可以大量矢量化,但我会留给你!]

I don't see why you want both a sin and a cos term in your equation: this should do it...我不明白你为什么要在你的方程中同时使用 sin 和 cos 项:这应该这样做......

amplitude*sin(2*pi*time*frequency+phase);

Using both sin and cosine terms will, unless there is something odd about the FFT, cause scaling issues and a phase shift.除非 FFT 有什么奇怪的地方,否则同时使用正弦和余弦项会导致缩放问题和相移。 However I do not know if that would explain the distortion you've seen.但是我不知道这是否可以解释您所看到的失真。 That may be due to something to do with the FFT block sizes you have used.这可能与您使用的 FFT 块大小有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM