-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcor_pltf.m
executable file
·85 lines (77 loc) · 2.03 KB
/
cor_pltf.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
85
function h = cor_pltf(z, sv, paras, M0)
% COR_PLTF features of static cortical representation
% cor_pltf(z, sv, paras);
% cor_pltf(z, sv, paras, M0);
% z : static cortical representation, M-by-K, M = 128.
% sv : scale vector in cyc/oct, e.g., 2.^(-2:.5:3).
% paras : parameter set. (see WAV2AUD).
% M0 : # of frequency channel
%
% COR_PLTS plots the static cortical representation generated by AUD2CORS.
% See also: AUD2CORS
% Auther: Powen Ru ([email protected]), NSL, UMD
% v1.00: 17-Jun-97
% v1.01: 30-Jul-97, make it executable in Matlab4
% v1.02: 19-Aug-97, new: M0, dM for non-truncation
% v1.03: 16-Sep-97, colormap auto-detection
if isglobal('TICKLABEL'),
global TICKLABEL;
else,
TICKLABEL = 'ticklabel';
end;
% target cortical representaion
[M, K] = size(z);
if nargin < 4, M0 = M; end;
dM = max((M-M0)/2, 0);
if length(sv) ~= K, error('Size not matched'); end;
% xtick labels
xtic = (11:24:128);
xtlabel = [];
for fdx = 5:-1:1,
R1 = sprintf('%5d', round(1000*2^(fdx-3+paras(4))));
xtlabel = [R1; xtlabel];
end;
% ytick labels
ytic = []; ytlabel = [];
for k = 2:K,
R1 = log2(sv(k));
if abs(R1-round(R1)) < .001,
ytic = [ytic k];
ytlabel = [ytlabel; sprintf('%3.1f', sv(k))];
end;
end;
% image
K1 = 3;
K2 = K-1;
z = z(:, K1:K2);
mdx = 1-dM:M0+dM;
kdx = K1:K2;
a = abs(z);
p = angle(z);
zt = a .* (abs(p) < (pi/8));
%image(mdx, kdx, cplx_col(zt'));
%axis xy;
hold on;
contour(mdx, kdx, a', 8, 'c--');
hold on;
contour(mdx, kdx, p', 8, 'y');
zij = cor2sing(z);
h = plot(mdx(zij(:, 1)), kdx(zij(:, 2)), 'k*');
set(h, 'markersi', 10);
if dM,
plot([0 M0+1; 0 M0+1], [K+1 K+1; 1 1], 'k--');
end;
hold off;
set(gca, 'xtick', xtic, ['x' TICKLABEL], xtlabel, ...
'ytick', ytic, ['y' TICKLABEL], ytlabel, 'box', 'on');
if size(sv, 1) > 1,
for xi = 11:12:128,
text('position', [xi, .1*k], 'str', ['#' num2str(xi)], ...
'ho', 'ce', 'fontwe', 'bo', 'fontsi', 10, 'fontna', 'times');
end;
for yi = ytic,
text('position', [.02*M yi], 'str', ['#' num2str(yi)], ...
'ho', 'le', 'fontwe', 'bo', 'fontsi', 10, 'fontna', 'times');
end;
end;
axis tight