简体   繁体   English

逆FFT-获取绝对值的符号

[英]inverse FFT - get the sign of the absolute value

i'm using org.apache.commons.math3.transform Class FastFourierTransformer, i'm now trying to apply FFT on real data set, and the apply inverse FFT to get the original data set. 我正在使用org.apache.commons.math3.transform类FastFourierTransformer,现在尝试对实际数据集应用FFT,并应用逆FFT来获取原始数据集。 my problem is that in order to get the original data set i'm using the function abs() of complex number and i'm getting the correct number but not the correct sign. 我的问题是,为了获得原始数据集,我正在使用复数的函数abs(),而我得到的是正确的数字,而不是正确的符号。 in the original data set i have minus but on the inverse data set i'm getting only positive numbers. 在原始数据集中,我有负数,但在逆数据集中,我只有正数。 do you have any idea what i should do to get the correct sign? 你有什么想法我应该怎么做才能得到正确的信号?

The correct way to get the sign of a number that is lost after taking the absolute value is not to take the absolute value. 获取取绝对值后丢失的数字的符号的正确方法是不取绝对值。 An inverse FFT should undo a previous FFT. 逆FFT应该撤销先前的FFT。 Hence your complex result should, if your original data was real, already be real numbers (with the imaginary part zero, except for rounding errors). 因此,如果原始数据是实数,则复杂的结果应该已经是实数(虚数部分为零,但舍入误差除外)。 So you will want to only use the real part (rather than take the absolute value). 因此,您将只想使用实部(而不是取绝对值)。 Remember to include a sanity check: Make sure the imaginary parts are really negligibly small! 请记住要进行完整性检查:确保虚部很小,可以忽略不计!

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

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