MATLAB:从FFT2频谱获取功率直方图(MATLAB: Get power histogram from FFT2 spectrum)

编程入门 行业动态 更新时间:2024-10-28 10:29:07
MATLAB:从FFT2频谱获取功率直方图(MATLAB: Get power histogram from FFT2 spectrum)

我试图获得某些图像的所有频率的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 filters

Retransform 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 values

Now 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.

更多推荐

本文发布于:2023-08-07 13:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464749.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:直方图   频谱   功率   MATLAB   histogram

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!