如何解释 MATLAB 中图像的 fft2() 图?坐标轴代表什么?

信息处理 图像处理 matlab fft 傅里叶变换
2022-02-12 09:01:18

我得到了灰度图像的频谱使用

img_shft = fftshift(img_fft);
final_spectrum = im2uint8(mat2gray(log(abs(img_shft)+1)));

imagesc(final_spectrum);
plot(final_spectrum);

我的 imagesc 输出如下。坐标轴代表什么?是x轴频率和y轴幅度吗?

在此处输入图像描述

这是我的 plot() 输出。为什么会有这么多不同颜色的线条?(我在获取 fft2 之前将我的 RGB 图像转换为灰度)什么是轴?

在此处输入图像描述

为什么当我们获取 fft 信号时,我们不能得到清晰且易于解释的频率图?(对不起,我是信号处理的新手)

非常感谢任何建议。

1个回答
% Assume your data sequence x[n1,n2] is stored on a 2D MATLAB matrix as:
%
% X = [ 1, 2, 3 ]
%     [ 4, 5, 6 ]    X(i,j) is the i-th row ,j-th column.
%     [ 7, 8, 9 ]
%     [10, 11,12]
% 
% MATLAB treats the i-rows as the first dimension, n1; whereas the 
% j-columns as the second dimension, n2. And Top-Left is the first
% element x[0,0] (origin of n1-n2 axes).
%
% The DTF of x[n1,n2] is defined to be f[k1,k2] = DFT{x[n1,n2]}
% and it's given by F = fft2(X), matrix of the same size:
%
% F = [ F11, F12, F13 ]
%     [ F21, F22, F23 ]    F(i,j) is the i-th row ,j-th column.
%     [ F31, F32, F33 ]    i-rows is the 1st dim k1
%     [ F42, F42, F43 ]    j-cols is the 2nd dim k2
%
%
% To display the 2D spectrum magnitude |F| of X, you can use imshow() 
% function, which maps matrix elements to display pixels in an order 
% preserving manner; i.e., top left matrix element |F11| is displayed
% on the top-left pixel of the image window...
%
% The dimensions k1,k2 of F are the w1 and w2 frequency axes of 
% the DTFT respectively. The value of the element at (k1,k2) is the
% value of the 2D DFT/FFT F(k1,k2).