我试图获得某些图像的所有频率的1D功率直方图。 我将描述迄今为止我所做的。
阅读图像(如果需要,转换为灰度) 计算FFT2并将其移位 在傅立叶域中,应用一些过滤器重新转换到空间域并显示(用于视觉验证过滤器工作)
FFT2和fftshift新创建的图像(可选,我可以使用前ifft2输入以及)
计算功率谱,即。^ 2所有的傅立叶域值现在开始棘手的部分。 对于功率直方图,我必须得到所有涉及频率的特定频率的所有值。 有了一个连续的信号,我只能从0到2pi为所有频率进行积分,就是这样。
但我无法整合离散值,至少我认为这是错误的。 对于从0到2pi的积分,我不得不总结所有与第0频率有一定距离的值。 我不能那样做,因为那样我就不得不确定离中心的距离,因为这些值位于方矩阵中,所以会失败。 如果我要总结有限宽度环的值,那么我必须确保不多次选择某些值。
也许我只是在错误的方向思考,因为我对MATLAB相对来说比较陌生。 但是,我怎样才能计算这样的功率直方图?
Phreak
I am trying to get the 1D power histogram of all the frequencies of certain images. I will describe what I have done so far.
Read the image (if neccessary, convert to grayscale) Calculate the FFT2 and shift it In the Fourier domain, apply some filtersRetransform to the spatial domain and display (for visual verification that the filter worked)
FFT2 and fftshift that newly created image (optional, I could have used the former ifft2 input as well)
Calculate the power spectrum, i.e. .^2 all the fourier domain valuesNow begins the tricky part. For a power histogram I'd have to get all the values of a certain frequency, for all frequencies involved. With a contiuous signal, I'd just integrate from 0 to 2pi for all frequencies, and that's it.
But I cannot integrate with discrete values, at least I think it is wrong. And for an integration from 0 to 2pi, I'd have to sum up all values with a certain distance to the 0th frequency. I cannot to that because then I'd have to determine the distance from the centre, which will fail because the values are located in a square matrix. If I were to sum up the values from a ring of finite width, then I'd have to make sure not to select some values multiple times.
Maybe I'm just thinking in a wrong direction, because I am relatively new to MATLAB. But how can I calculate such power histograms?
Phreak
最满意答案
这看起来像你需要的: FEX
虽然我不确定你为什么不使用2D信息。
This looks like what you need: FEX
Although I am not sure why you wouldn't just use the 2D information.
更多推荐
发布评论