Is signal_matrix equal to signal_matrix2 ? (fftshift problem)

2 次查看(过去 30 天)
signal_matrix2 = fft(fftshift(ifft(fftshift(signal_matrix,1),[],1),1),[],1);
signal_matrix is a Nr*Na matrix. I think signak_matrix2 should be the same as signal_matrix. However, Only by using signal_matrix2 can get the correct result. So I want to know the difference between signal_matrix1 and signal_matrix2.
  2 个评论
Paul
Paul 2023-3-11
Hi demin,
Why do should signal_matrix and signal_matrix2 be the same? I mean, if we step through each operation
signa_matrix -> fftshift -> ifft -> fftshift -> fft -> signal_matrix2
and track what's happening at each step, why would they be expected to be the same?
demin huang
demin huang 2023-3-14
Thank you. I've solved my problem. At first, I used signal matrix 1, but got the wrong result. Correct results can be obtained by transforming signal_matrix to signal_matrix2. The problem stems from the way fft is used. One feasible way is fftshift(fft(fftshift())) .

请先登录,再进行评论。

回答(1 个)

Aditya Srikar
Aditya Srikar 2023-3-31
编辑:Aditya Srikar 2023-3-31
Hey Demin,
The matrices signal_matrix and signal_matrix2 need not be the same.
Because as you perform the series of operations on signal_matrix, the elements would get modified.
Consider the following example
signal_matrix = [1 2;3 4]
% step-1
res1 = fftshift(signal_matrix,1) % res1 = [3 4; 1 2]
% step-2
res2 = ifft(res1,[],1) % res2 = [2 3; 1 1]
%step-3
res3 = fftshift(res2,1) % res3 = [1 1; 2 3]
%step-4 => final answer
signal_matrix2 = fft(res3, [], 1) % signal_matrix2 = [3 4; -1 -2]
We can clearly observe that the matrix is being modified in each step in given series of operations. So we can say that the resultant matrix obtained after performing the operations can be different from the input matrix.
Hope it helps !

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by