-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomputeReflectionCoeffecient.m
68 lines (61 loc) · 1.74 KB
/
computeReflectionCoeffecient.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
function [X, theta] = computeReflectionCoeffecient(ntheta, params)
% [X, theta] = computeReflectionCoeffecient(ntheta, params)
%
% Computes the reflection or transmission coefficient with the parameters
% specified in the params-struct (see parsAsmInput for more details).
% ntheta specifies how many angle the reflection coefficient should be
% calculated at from params.thetamin to params.thetamax
%
%
% Input:
% ntheta - Number of angles
% params - Parameters as generated by parseAsmInput
%
% Output:
% X - Reflection or transmission coefficients. Size: ntheta x num freq
% theta - Angles for which X is computed
%
%% Unpack parameters
aRx = params.aRx;
aTx = params.aTx;
c_F = params.cf;
rho_F = params.rho_fluid;
rho_S = params.rho_solid;
cp = params.cp;
cs = params.cs;
thick = params.thickness;
d1 = params.distanceTx;
d3 = params.distanceRx;
al_dB = params.alphaLambda_dB;
fres = 0.5*params.cp/params.thickness; %#ok<*NASGU>
x0 = params.displaceRx;
refl = params.reflection;
%% Samplings stuff
f = params.f;
nf = length(f);
thetamax = params.thetamax;
thetamin = params.thetamin;
theta = linspace(thetamin, thetamax, ntheta);
q = sin(theta);
X = zeros(ntheta, nf);
for i = 1:nf
%% Plate response, angular
% Multiply with wave length and convert from dB to linear
% Loss parameter
if al_dB ~= 0
% log(10)/10 = 0.2303
alphaL = al_dB*0.2303*f(i)/c_F;
else
alphaL = 0;
end
%% Reflection/Transmission coefficient
if refl
Plate = reflectionCoefficientAnalytical(f(i), q,...
thick, rho_F, rho_S, cp, cs, c_F, alphaL);
else
[~, Plate] = reflectionCoefficientAnalytical(f(i), q,...
thick, rho_F, rho_S, cp, cs, c_F, alphaL);
end
X(:, i) = Plate;
end
end