forked from bmezhou/planeWaveBMode
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUntitled.m
81 lines (69 loc) · 1.41 KB
/
Untitled.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
dyn = 60;
load bfDasTisu.mat;
% bfDas0 = bfDas;
%
[xq, yq] = demod(bfDas, 5e6, 40e6, 'qam');
bfDas0 = abs(xq + 1i * yq);
bfDas0 = bfDas0(400:end, :);
bfDas0 = bfDas0 - min(min(bfDas0));
bfDas0 = bfDas0/max(max(bfDas0));
bfDas0 = 20*log10(bfDas0) + dyn;
% bfDas0 = bfDas0(961,:);
%
% x = 0:509;
% x = x * 0.3048e-3/4;
logEnv = (bfDas0) / dyn * 255;
logEnv(logEnv <= 0) = 0;
figure;
image(logEnv);
colormap(gray(256));
ylim([1, 1350])
% load bfDasPhan2.mat;
% load bfMVTisu.mat;
% bfDas1 = bfDas;
[xq, yq] = demod(bfDas, 5e6, 40e6, 'qam');
bfDas1 = abs(xq + 1i * yq);
bfDas1 = bfDas1(400:end, :);
bfDas1 = bfDas1 - min(min(bfDas1));
bfDas1 = bfDas1/max(max(bfDas1));
bfDas1 = 20*log10(bfDas1) + dyn;
[m, n] = size(bfDas1);
for i = 1:n
bfDas1(:, i) = bfDas1(:, i) .* (1 + 0.3 * (1:m)'./m);
end
logEnv = (bfDas1) / dyn * 255;
logEnv(logEnv <= 0) = 0;
figure;
image(logEnv);
colormap(gray(256));
ylim([1, 1350])
% %{
figure;
plot(bfDas0(1107,:));
hold on
plot(bfDas1(1107,:), 'r');
ylim([-20, 50])
figure;
plot(bfDas0(:, 400));
hold on
plot(bfDas1(:, 400), 'r');
%{
figure;
plot(bfDas0(:, 255));
hold on
plot(bfDas1(:, 255), 'r');
ylim([-120, 0.5])
figure;
plot(bfDas0(862, :)); % 186
hold on
plot(bfDas1(862, :), 'r');
ylim([-120, 0.5])
% load compData.mat;
%
% figure;
% env = abs(hilbert(compData(50:1300, :)));
% env = env/max(env(:));
% logEnvCM = (20 * log10(env) + 60)/60 *255;
% image(logEnvCM);
% colormap(gray(256));
%}