Clear Filters
Clear Filters

Is signal_matrix equal to signal_matrix2 ? (fftshift problem)

3 views (last 30 days)
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 Comments
Paul
Paul on 11 Mar 2023
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 on 14 Mar 2023
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())) .

Sign in to comment.

Answers (1)

Aditya Srikar
Aditya Srikar on 31 Mar 2023
Edited: Aditya Srikar on 31 Mar 2023
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 !

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!