Kissfft缩放 [英] kissfft scaling

查看:104
本文介绍了Kissfft缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找使用FFT和Kissfft库计算快速相关性的方法,并且缩放需要精确.需要进行什么缩放(向前和向后缩放)以及我要使用什么值来缩放数据?

I am looking to compute a fast correlation using FFTs and the kissfft library, and scaling needs to be precise. What scaling is necessary (forward and backwards) and what value do I use to scale my data?

推荐答案

3种最常见的FFT缩放因子是:

The 3 most common FFT scaling factors are:

  • 1.0正向FFT,1.0/N反向FFT

  • 1.0 forward FFT, 1.0/N inverse FFT

1.0/N正向FFT,1.0反向FFT

1.0/N forward FFT, 1.0 inverse FFT

1.0/sqrt(N),FFT& IFFT

1.0/sqrt(N) in both directions, FFT & IFFT

鉴于文档中可能存在的歧义,并且无论用户希望达到何种缩放比例目的都是正确"的,最好仅馈入一个已知振幅(1.0浮点或255整数)的纯正弦波,并且在输入时恰好是周期性的所讨论的FFT(和/或IFFT)的FFT长度,并查看缩放比例是否符合上述条件之一,可能与上述之一相差2X或sqrt(2),或所需的缩放比例完全不同.

Given any possible ambiguity in the documentation, and for whatever scaling the user expects to be "correct" for their purposes, best to just feed a pure sine wave of known (1.0 float or 255 integer) amplitude and exactly periodic in the FFT length to the FFT (and/or IFFT) in question, and see if the scaling matches one of the above, is maybe different from one of the above by 2X or sqrt(2), or the desired scaling is something completely different.

例如针对您的数据类型为您的环境中的kissfft编写单元测试.

e.g. Write a unit test for kissfft in your environment for your data types.

这篇关于Kissfft缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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