FFT 和加速度计数据:为什么我会得到这个输出? [英] FFT and accelerometer data: why am I getting this output?

查看:28
本文介绍了FFT 和加速度计数据:为什么我会得到这个输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 StackOverflow 上阅读了有关对加速度计数据执行 FFT 的各种帖子,但没有一篇文章能帮助我理解我的问题.

我正在执行),我能够解决我的问题问题.解决方案几乎就是该链接中描述的内容.这是我现在的图表:http://imgur.com/wGs43

解决方案

低频失真可能是由于缺乏窗口化.尝试应用窗口函数.

整体偏移可能是由于两种不同 FFT 实现中的不同缩放因子造成的 - 我猜您看到的是 24 dB 的偏移,这对应于 256 倍的缩放差异.

I have read various posts here at StackOverflow regarding the execution of FFT on accelerometer data, but none of them helped me understand my problem.

I am executing this FFT implementation on my accelerometer data array in the following way:

int length = data.size();
double[] re = new double[256];
double[] im = new double[256];
for (int i = 0; i < length; i++) {
    input[i] = data[i];
}

FFT fft = new FFT(256);
fft.fft(re, im);

float outputData[] = new float[256];
for (int i = 0; i < 128; i++) {
    outputData[i] = (float) Math.sqrt(re[i] * re[i]
    + im[i] * im[i]);
}

I plotted the contents of outputData (left,) and also used R to perform the FFT on my data (right.)

What am I doing wrong here? I am using the same code for executing the FFT that I see in other places.

EDIT: Following the advice of @PaulR to apply a windowing function, and the link provided by @BjornRoche (http://baumdevblog.blogspot.com.br/2010/11/butterworth-lowpass-filter-coefficients.html), I was able to solve my problem. The solution is pretty much what is described in that link. This is my graph now: http://imgur.com/wGs43

解决方案

The low frequency artefacts are probably due to a lack of windowing. Try applying a window function.

The overall shift is probably due to different scaling factors in the two different FFT implementations - my guess is that you are seeing a shift of 24 dB which corresponds to a difference in scaling by a factor of 256.

这篇关于FFT 和加速度计数据:为什么我会得到这个输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆