FFT along third dimension

1 次查看(过去 30 天)
ARN
ARN 2020-8-13
评论: Matt J 2020-8-18
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?

回答(1 个)

Matt J
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
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 CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by