フィルターのクリア

Is signal_matrix equal to signal_matrix2 ? (fftshift problem)

3 ビュー (過去 30 日間)
demin huang
demin huang 2023 年 3 月 11 日
編集済み: Aditya Srikar 2023 年 3 月 31 日
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 Center および File ExchangeTransforms についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by