FFT along third dimension
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I am trying to understand the fft along 3rd dimension
a = [1 2 3 4; 5 6 7 8; 9 10 11 12];
b = [1 2 3 4; 5 6 7 8; 9 10 11 12];
num_samples = 3;
num_chirps = 4;
num_of_antenna = 2;
w_range = blackman(num_samples);
w_doppler = blackman(num_chirps)';
w_angle = blackman(num_of_antenna);
window_3d = w_range.*w_doppler.*permute(w_angle,[3 2 1]);
window_2d = w_range .* w_doppler;
windowed_a = a.*window_2d;
windowed_b = b.*window_2d;
g1 = fft2(windowed_a);
g2 = fft2(windowed_b);
windowed_cat = cat(3,g1,g2).*permute(w_angle,[3 2 1]);
g3 = abs(fft(windowed_cat,[],3));
concat_3d = cat(3,a,b);
windowed_3d = concat_3d.*window_3d;
fft_2d = fft2(window_3d);
fft_3d = abs(fft(fft_2d,[],3));
ff_3d = abs(fftn(window_3d));
Shouldn't this be ture
g3==fft_3d==ff_3d
Why are they not equal?
댓글 수: 0
답변 (1개)
Matt J
2020년 8월 13일
편집: Matt J
2020년 8월 13일
They are equal,
>> isequal(g3, fft_3d ), isequal(g3 , ff_3d )
ans =
logical
1
ans =
logical
1
although in general, I think you should expect they might differ by small floating point errors.
If you literally typed in g3==fft_3d==ff_3d, then this will not be true for the same reason the following is not:
>> 2==2==2
ans =
logical
0
댓글 수: 6
Matt J
2020년 8월 18일
Those look valid to me. Since w_angle contains only zeros, it makes sense that all fo the results should be approximately, if not exactly, zero.
>> w_angle = blackman(num_of_antenna)
w_angle =
0
0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!