我的Python编程问题如下:
我想创建一个测量结果数组。每个结果都可以描述为正态分布,其平均值是测量结果本身,标准偏差是其不确定度。在
伪代码可以是:
x1 = N(result1, unc1)
x2 = N(result2, unc2)
...
x = array(x1, x2, ..., xN)
我想计算x的FFT:
^{pr2}$
我想要的是,x中包含的测量不确定度通过FFT计算传播,因此f是振幅的一个数组及其不确定度,如下所示:
f = (a +/- unc(a), b +/- unc(b), ...)
你能给我个建议吗?在
Tags:
由离散傅里叶变换计算的每个傅里叶系数 数组的
x
是x
元素的线性组合;请参见 关于wikipedia page on the discrete Fourier transform上X_k的公式, 我写为(也就是说,}的离散傅里叶变换。)
如果x帴n是正态分布的,且均值和方差σ2是正态分布的,
再加上一点代数,就可以知道X_k的方差是和
x的方差
^{pr2}$X
是{换言之,每个傅立叶系数的方差是相同的; 它是
x
中测量值的方差之和。在使用你的符号,其中
unc(z)
是z
的标准偏差(请注意,xuk的量级的分布是Rice distribution。)
下面的脚本演示了这个结果。在本例中,标准
x
值的偏差从0.01线性增加到0.5。在打印输出为
如预期,傅里叶系数的样本方差为 所有(大约)与测量方差之和相同。在
这是脚本生成的情节。黑钻石是 单个
x
向量的傅立叶系数。蓝点是 800个x + noise
实现的Fourier系数。你可以看到 每个Fourier系数周围的点云大致是对称的 所有的“尺寸”都一样(当然,除了真正的系数, 在这个图中显示为实际轴上的水平线)。在相关问题 更多 >
编程相关推荐