Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ok-landscape
GitHub Repository: Ok-landscape/computational-pipeline
Path: blob/main/latex-templates/templates/acoustics/sound_propagation.tex
51 views
unlisted
1
% Sound Propagation Analysis
2
\documentclass[11pt,a4paper]{article}
3
\usepackage[utf8]{inputenc}
4
\usepackage[T1]{fontenc}
5
\usepackage{amsmath,amssymb}
6
\usepackage{graphicx}
7
\usepackage{booktabs}
8
\usepackage{siunitx}
9
\usepackage{geometry}
10
\geometry{margin=1in}
11
\usepackage{pythontex}
12
\usepackage{hyperref}
13
\usepackage{float}
14
15
\title{Sound Propagation Analysis\\Wave Equations and Transmission Loss}
16
\author{Acoustic Engineering Department}
17
\date{\today}
18
19
\begin{document}
20
\maketitle
21
22
\begin{abstract}
23
Analysis of sound wave propagation through various media, including acoustic impedance, transmission coefficients, and transmission loss calculations.
24
\end{abstract}
25
26
\section{Introduction}
27
28
Sound propagation is governed by the acoustic wave equation and boundary conditions at material interfaces.
29
30
\begin{pycode}
31
import numpy as np
32
import matplotlib.pyplot as plt
33
plt.rcParams['text.usetex'] = True
34
plt.rcParams['font.family'] = 'serif'
35
36
c_air, rho_air = 343, 1.21
37
Z_air = rho_air * c_air
38
39
media = {
40
'Air': {'c': 343, 'rho': 1.21},
41
'Water': {'c': 1480, 'rho': 1000},
42
'Steel': {'c': 5960, 'rho': 7850},
43
'Concrete': {'c': 3400, 'rho': 2400},
44
'Glass': {'c': 5200, 'rho': 2500},
45
}
46
for props in media.values():
47
props['Z'] = props['rho'] * props['c']
48
\end{pycode}
49
50
\section{Acoustic Impedance}
51
52
$Z = \rho c$
53
54
\begin{pycode}
55
fig, ax = plt.subplots(figsize=(10, 5))
56
names = list(media.keys())
57
impedances = [media[n]['Z'] for n in names]
58
ax.bar(names, impedances, color=plt.cm.viridis(np.linspace(0, 0.8, len(names))))
59
ax.set_ylabel('Acoustic Impedance (Pa$\\cdot$s/m)')
60
ax.set_title('Characteristic Acoustic Impedance')
61
ax.set_yscale('log')
62
ax.grid(True, alpha=0.3, axis='y')
63
plt.tight_layout()
64
plt.savefig('impedance_comparison.pdf', dpi=150, bbox_inches='tight')
65
plt.close()
66
\end{pycode}
67
68
\begin{figure}[H]
69
\centering
70
\includegraphics[width=0.9\textwidth]{impedance_comparison.pdf}
71
\caption{Acoustic impedance comparison.}
72
\end{figure}
73
74
\section{Reflection and Transmission}
75
76
$R = \frac{Z_2 - Z_1}{Z_2 + Z_1}$
77
78
\begin{pycode}
79
materials = ['Water', 'Steel', 'Concrete', 'Glass']
80
Z1 = media['Air']['Z']
81
R_coeffs = [(media[m]['Z'] - Z1) / (media[m]['Z'] + Z1) for m in materials]
82
T_intensity = [1 - r**2 for r in R_coeffs]
83
84
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5))
85
ax1.bar(materials, R_coeffs, color='steelblue')
86
ax1.set_ylabel('Reflection Coefficient $R$')
87
ax1.set_title('Reflection at Air-Material Interface')
88
ax1.grid(True, alpha=0.3, axis='y')
89
90
ax2.bar(materials, T_intensity, color='coral')
91
ax2.set_ylabel('Intensity Transmission $T_I$')
92
ax2.set_title('Transmission')
93
ax2.grid(True, alpha=0.3, axis='y')
94
plt.tight_layout()
95
plt.savefig('reflection_transmission.pdf', dpi=150, bbox_inches='tight')
96
plt.close()
97
\end{pycode}
98
99
\begin{figure}[H]
100
\centering
101
\includegraphics[width=0.95\textwidth]{reflection_transmission.pdf}
102
\caption{Reflection and transmission coefficients.}
103
\end{figure}
104
105
\section{Mass Law Transmission Loss}
106
107
$TL = 20 \log_{10}(\pi f m / \rho c)$
108
109
\begin{pycode}
110
freq = np.logspace(1, 4, 200)
111
surface_masses = {'Gypsum (12mm)': 10, 'Concrete (100mm)': 240, 'Steel (3mm)': 24, 'Glass (6mm)': 15}
112
113
fig, ax = plt.subplots(figsize=(10, 6))
114
for name, m in surface_masses.items():
115
TL = 20 * np.log10(np.pi * freq * m / (rho_air * c_air))
116
ax.semilogx(freq, TL, linewidth=1.5, label=f'{name}')
117
ax.set_xlabel('Frequency (Hz)')
118
ax.set_ylabel('Transmission Loss (dB)')
119
ax.set_title('Mass Law Transmission Loss')
120
ax.legend(loc='lower right')
121
ax.grid(True, alpha=0.3, which='both')
122
ax.set_xlim([10, 10000])
123
plt.tight_layout()
124
plt.savefig('mass_law_tl.pdf', dpi=150, bbox_inches='tight')
125
plt.close()
126
\end{pycode}
127
128
\begin{figure}[H]
129
\centering
130
\includegraphics[width=0.9\textwidth]{mass_law_tl.pdf}
131
\caption{Mass law transmission loss predictions.}
132
\end{figure}
133
134
\section{Coincidence Effect}
135
136
\begin{pycode}
137
panels = {
138
'Steel (3mm)': {'E': 200e9, 'rho': 7850, 'nu': 0.3, 'h': 0.003},
139
'Aluminum (2mm)': {'E': 70e9, 'rho': 2700, 'nu': 0.33, 'h': 0.002},
140
'Glass (6mm)': {'E': 70e9, 'rho': 2500, 'nu': 0.22, 'h': 0.006},
141
}
142
143
f_coincidence = {}
144
for name, p in panels.items():
145
fc = (c_air**2 / (2 * np.pi)) * np.sqrt(12 * p['rho'] * (1 - p['nu']**2) / (p['E'] * p['h']**2))
146
f_coincidence[name] = fc
147
148
fig, ax = plt.subplots(figsize=(10, 6))
149
for name, p in panels.items():
150
m = p['rho'] * p['h']
151
fc = f_coincidence[name]
152
TL_mass = 20 * np.log10(np.pi * freq * m / (rho_air * c_air))
153
dip = 15 * np.exp(-(freq - fc)**2 / (2 * (fc * 0.5)**2))
154
TL = np.maximum(TL_mass - dip, 0)
155
ax.semilogx(freq, TL, linewidth=1.5, label=name)
156
ax.set_xlabel('Frequency (Hz)')
157
ax.set_ylabel('Transmission Loss (dB)')
158
ax.set_title('TL with Coincidence Effect')
159
ax.legend(loc='lower right')
160
ax.grid(True, alpha=0.3, which='both')
161
ax.set_xlim([100, 10000])
162
plt.tight_layout()
163
plt.savefig('coincidence_tl.pdf', dpi=150, bbox_inches='tight')
164
plt.close()
165
\end{pycode}
166
167
\begin{figure}[H]
168
\centering
169
\includegraphics[width=0.9\textwidth]{coincidence_tl.pdf}
170
\caption{Transmission loss with coincidence dips.}
171
\end{figure}
172
173
\section{Double Wall TL}
174
175
\begin{pycode}
176
m1, m2 = 12, 12
177
air_gaps = [50, 100, 200]
178
179
fig, ax = plt.subplots(figsize=(10, 6))
180
for gap in air_gaps:
181
ell = gap / 1000
182
f0 = (1 / (2 * np.pi)) * np.sqrt((rho_air * c_air**2 / ell) * (1/m1 + 1/m2))
183
TL_double = np.zeros_like(freq)
184
for i, f in enumerate(freq):
185
if f < f0:
186
TL_double[i] = 20 * np.log10(np.pi * f * (m1 + m2) / (rho_air * c_air))
187
else:
188
TL_single = 20 * np.log10(np.pi * f * m1 / (rho_air * c_air))
189
TL_double[i] = 2 * TL_single + 20 * np.log10(f / f0)
190
ax.semilogx(freq, np.maximum(TL_double, 0), linewidth=1.5, label=f'Gap = {gap} mm')
191
ax.set_xlabel('Frequency (Hz)')
192
ax.set_ylabel('Transmission Loss (dB)')
193
ax.set_title('Double Wall Transmission Loss')
194
ax.legend(loc='lower right')
195
ax.grid(True, alpha=0.3, which='both')
196
ax.set_xlim([50, 5000])
197
plt.tight_layout()
198
plt.savefig('double_wall_tl.pdf', dpi=150, bbox_inches='tight')
199
plt.close()
200
\end{pycode}
201
202
\begin{figure}[H]
203
\centering
204
\includegraphics[width=0.9\textwidth]{double_wall_tl.pdf}
205
\caption{Double wall transmission loss.}
206
\end{figure}
207
208
\section{Atmospheric Absorption}
209
210
\begin{pycode}
211
def atm_absorption(f, T=20, h=50, p=101.325):
212
T_K = T + 273.15
213
C = -6.8346 * (273.16/T_K)**1.261 + 4.6151
214
h_mol = h * (101.325/p) * 10**C
215
f_rO = (p/101.325) * (24 + 4.04e4 * h_mol * (0.02 + h_mol)/(0.391 + h_mol))
216
f_rN = (p/101.325) * (T_K/293.15)**(-0.5) * (9 + 280 * h_mol * np.exp(-4.170 * ((T_K/293.15)**(-1/3) - 1)))
217
alpha = 8.686 * f**2 * ((1.84e-11 * (101.325/p) * (T_K/293.15)**0.5) +
218
(T_K/293.15)**(-2.5) * (0.01275 * np.exp(-2239.1/T_K) / (f_rO + f**2/f_rO) +
219
0.1068 * np.exp(-3352.0/T_K) / (f_rN + f**2/f_rN)))
220
return alpha
221
222
freq_atm = np.logspace(2, 4.5, 100)
223
fig, ax = plt.subplots(figsize=(10, 6))
224
for T, h, label in [(20, 50, '20C, 50\\% RH'), (20, 20, '20C, 20\\% RH'), (0, 50, '0C, 50\\% RH')]:
225
ax.loglog(freq_atm, atm_absorption(freq_atm, T, h) * 1000, linewidth=1.5, label=label)
226
ax.set_xlabel('Frequency (Hz)')
227
ax.set_ylabel('Absorption (dB/km)')
228
ax.set_title('Atmospheric Absorption')
229
ax.legend()
230
ax.grid(True, alpha=0.3, which='both')
231
plt.tight_layout()
232
plt.savefig('atmospheric_absorption.pdf', dpi=150, bbox_inches='tight')
233
plt.close()
234
\end{pycode}
235
236
\begin{figure}[H]
237
\centering
238
\includegraphics[width=0.9\textwidth]{atmospheric_absorption.pdf}
239
\caption{Atmospheric sound absorption.}
240
\end{figure}
241
242
\section{Spreading Loss}
243
244
\begin{pycode}
245
L_W = 100
246
distances = np.linspace(1, 100, 100)
247
freq_cases = [500, 2000, 8000]
248
249
fig, ax = plt.subplots(figsize=(10, 6))
250
for f in freq_cases:
251
alpha = atm_absorption(f)
252
L_p = L_W - 20 * np.log10(distances) - 11 - alpha * distances
253
ax.plot(distances, L_p, linewidth=1.5, label=f'{f} Hz')
254
ax.set_xlabel('Distance (m)')
255
ax.set_ylabel('SPL (dB)')
256
ax.set_title('Sound Level vs Distance')
257
ax.legend()
258
ax.grid(True, alpha=0.3)
259
plt.tight_layout()
260
plt.savefig('spreading_loss.pdf', dpi=150, bbox_inches='tight')
261
plt.close()
262
\end{pycode}
263
264
\begin{figure}[H]
265
\centering
266
\includegraphics[width=0.9\textwidth]{spreading_loss.pdf}
267
\caption{Sound level decay with distance.}
268
\end{figure}
269
270
\section{Results}
271
272
\begin{pycode}
273
print(r'\begin{table}[H]')
274
print(r'\centering')
275
print(r'\caption{Acoustic Properties}')
276
print(r'\begin{tabular}{@{}lccc@{}}')
277
print(r'\toprule')
278
print(r'Material & $c$ (m/s) & $\rho$ (kg/m$^3$) & $Z$ (Pa$\cdot$s/m) \\')
279
print(r'\midrule')
280
for name, props in media.items():
281
print(f"{name} & {props['c']} & {props['rho']} & {props['Z']:.0f} \\\\")
282
print(r'\bottomrule')
283
print(r'\end{tabular}')
284
print(r'\end{table}')
285
\end{pycode}
286
287
\section{Conclusions}
288
289
This analysis demonstrates key principles of sound propagation and transmission loss including mass law, coincidence effects, and atmospheric absorption.
290
291
\end{document}
292
293