-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sound_Absorption.m
187 lines (142 loc) · 4.04 KB
/
Sound_Absorption.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
%getting general dimensions of room
%Absorbtion @ 1KHZ
clc
clear
LF=input("Please enter the length of the floor in feet.\n");
WF=input("Please enter the width of the floor in feet.\n");
H=input("Please enter the height of the room in feet.\n");
V=LF*WF*H;
AF=LF*WF;
materials=input("Please enter the material of the floor. Please type one of the following:\n" + ...
" Carpet\n Concrete\n Wood\n Tile\n Brick\n\n ", "s");
switch materials
case "Carpet"
EAF=0.15*AF;
case "Concrete"
EAF=0.06*AF;
case "Wood"
EAF=0.06*AF;
case "Tile"
EAF=0.01*AF;
case "Brick"
EAF=0.04*AF;
otherwise
disp("Invalid input. Please try again.");
end
%Total effective area
TotalEA=EAF;
%areaCeiling==areaFloor
AC=AF;
materials=input("Please enter the material of the ceiling. Please type one of the following:\n" + ...
" Plaster\n Concrete\n Wood\n Fiberglass\n Brick\n\n ", "s");
switch materials
case "Plaster"
EAC=0.05*AC;
case "Concrete"
EAC=0.06*AC;
case "Wood"
EAC=0.06*AC;
case "Fiberglass"
EAC=0.9*AC;
case "Brick"
EAC=0.04*AC;
otherwise
disp("Invalid input. Please try again.");
end
TotalEA=[TotalEA,EAC];
L1=input("Please enter the length of Wall 1 in feet.\n");
W1=input("Please enter the width of Wall 1 in feet.\n");
A1=L1*W1;
materials=input("Please enter the material of Wall 1. Please type one of the following:\n" + ...
" Plaster\n Concrete\n Wood\n Fiberglass\n Brick\n\n ", "s");
switch materials
case "Plaster"
EA1=0.05*A1;
case "Concrete"
EA1=0.06*A1;
case "Wood"
EA1=0.06*A1;
case "Fiberglass"
EA1=0.9*A1;
case "Brick"
EA1=0.04*A1;
otherwise
disp("Invalid input. Please try again.");
end
TotalEA=[TotalEA,EA1];
L2=input("Please enter the length of Wall 2 in feet.\n");
W2=input("Please enter the width of Wall 2 in feet.\n");
A2=L2*W2;
materials=input("Please enter the material of Wall 2. Please type one of the following:\n" + ...
" Plaster\n Concrete\n Wood\n Fiberglass\n Brick\n\n ", "s");
switch materials
case "Plaster"
EA2=0.05*A2;
case "Concrete"
EA2=0.06*A2;
case "Wood"
EA2=0.06*A2;
case "Fiberglass"
EA2=0.9*A2;
case "Brick"
EA2=0.04*A2;
otherwise
disp("Invalid input. Please try again.");
end
TotalEA=[TotalEA,EA2];
L3=input("Please enter the length of Wall 3 in feet.\n");
W3=input("Please enter the width of Wall 3 in feet.\n");
A3=L3*W3;
materials=input("Please enter the material of Wall 3. Please type one of the following:\n" + ...
" Plaster\n Concrete\n Wood\n Fiberglass\n Brick\n\n ", "s");
switch materials
case "Plaster"
EA3=0.05*A3;
case "Concrete"
EA3=0.06*A3;
case "Wood"
EA3=0.06*A3;
case "Fiberglass"
EA3=0.9*A3;
case "Brick"
EA3=0.04*A3;
otherwise
disp("Invalid input. Please try again.");
end
TotalEA=[TotalEA,EA3];
L4=input("Please enter the length of Wall 4 in feet.\n");
W4=input("Please enter the width of Wall 4 in feet.\n");
A4=L4*W4;
materials=input("Please enter the material of Wall 4. Please type one of the following:\n" + ...
" Plaster\n Concrete\n Wood\n Fiberglass\n Brick\n\n ", "s");
switch materials
case "Plaster"
EA4=0.05*A4;
case "Concrete"
EA4=0.06*A4;
case "Wood"
EA4=0.06*A4;
case "Fiberglass"
EA4=0.9*A4;
case "Brick"
EA4=0.04*A4;
otherwise
disp("Invalid input. Please try again.");
end
TotalEA=[TotalEA,EA4];
SurfaceAreas=[AF,AC,A1,A2,A3,A4];
S=sum(SurfaceAreas);
A=sum(TotalEA);
TotalAbsorbtion=(A/S)
if TotalAbsorbtion >= 0.2
RT60=-0.049*(V/(S*log(1-TotalAbsorbtion)))
else
RT60=0.049*(V/A)
end
[c,ind]=max(TotalEA);
explode=zeros(1,6);
explode(ind)=1;
labels={'Floor','Ceiling','Wall 1','Wall 2','Wall 3','Wall 4'};
pie(TotalEA,explode)
legend(labels,'Location','northeastoutside','Orientation','vertical');
title("Effective Absorbtion Area of Each Surface");