-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_fft3_color.m
84 lines (73 loc) · 2.47 KB
/
show_fft3_color.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
function show_fft3_color(tf,fse,fst,fig)
%
% SHOW_FFT3 graphically represents a 3D Fourier transform
%
% The input 3D Fourier transform is in 2D array format (see help of now2then
% for additional details on the 2D format).
%
% Restrictions:
% . It assumes squared frames (as fft3 and ifft3)
% . It requires real (not complex) input, so it requires a decision from
% the user to choose from abs(F), real(F), etc. where F is the Fourier
% transform.
%
% SYNTAX: show_fft3( F, fsx, fst, fig)
%
% F = 3D Fourier transform data (in 2D array format)
% fsx = spatial sampling frequency (e.g. in cycl/deg)
% fst = temporal sampling frequency (e.g. in Hz)
% fig = figure where the plot will be displayed
%
tf=abs(tf);
m=size(tf);
nf=m(2)/m(1);
%[fx,fy,ft]=dominio_freq_espacio_temp(fse,fst,m(1),m(1),nf);
[x,y,t,fx,fy,ft] = spatio_temp_freq_domain(m(1),m(1),nf,fse,fse,fst);
Fx=zeros(m(1),m(1),nf);
Fy=zeros(m(1),m(1),nf);
Ft=zeros(m(1),m(1),nf);
TF=zeros(m(1),m(1),nf);
for i=1:nf
fotog=sacafot(fx,m(1),m(1),i);
Fx(:,:,i)=fotog;
fotog=sacafot(fy,m(1),m(1),i);
Fy(:,:,i)=fotog;
fotog=sacafot(ft,m(1),m(1),i);
Ft(:,:,i)=fotog;
fotog=sacafot(tf,m(1),m(1),i);
TF(:,:,i)=fotog;
end
figure(fig);clf
% contourslice(Fx,Fy,Ft,TF,linspace(min(min(fx)),max(max(fx)),20),[],[])
% xlabel('f_x'),ylabel('f_y'),zlabel('f_t'),
% axis([min(min(fx)) max(max(fx)) min(min(fy)) max(max(fy)) min(min(ft)) max(max(ft))])
% %axis equal
%
% figure(fig+1);
% max(max(Ft))
p = patch(isosurface(Fx, Fy, Ft, TF, max(max(max(TF)))/4));
isonormals(Fx,Fy,Ft,TF, p)
set(p, 'FaceColor', 'red', 'EdgeColor', 'none');
daspect([1 1 1])
view(3)
camlight; lighting phong,
% p = patch(isosurface(Fx, Fy, Ft, Ft, 0));
% isonormals(Fx,Fy,Ft,TF, p)
% set(p, 'FaceColor', 'green', 'EdgeColor', 'none');
% alpha(0.5)
% daspect([1 1 1])
% view(3)
% camlight; lighting phong,
% box on,
pp=patch([min(min(fx)) max(max(fx)) max(max(fx)) min(min(fx))],[min(min(fy)) min(min(fy)) max(max(fy)) max(max(fy))],[0 0 0 0],'b');
set(pp,'EdgeColor', 'none','FaceAlpha',0.6);
hold on
plot3([min(min(fx)) max(max(fx))],[0 0],[0 0],'k-')
plot3([0 0],[min(min(fy)) max(max(fy))],[0 0],'k-')
plot3([0 0],[0 0],[min(min(ft)) max(max(ft))],'k-')
box on,
xlabel('f_x (cpd)'),ylabel('f_y (cpd)'),zlabel('f_t (Hz)'),
%axis([min(min(fx)) max(max(fx)) min(min(fy)) max(max(fy)) min(min(ft)) max(max(ft))])
axis([-5 5 -5 5 -1.5 1.5])
hold off
%axis equal