3.1. Sound Attenuation in Acoustics#
Introduction#
Sound attenuation refers to the gradual reduction of sound intensity as it propagates through a medium. This attenuation is primarily caused by two factors:
Classical Attenuation – Due to viscosity and thermal conductivity.
Molecular Attenuation – Due to energy redistribution among molecular modes.
In this interactive visualization, we explore how sound waves diminish over distance, controlled by key parameters such as frequency, attenuation constant, and speed of sound.
Mathematical Representation of Sound Attenuation#
A plane harmonic wave experiencing attenuation in a homogeneous medium can be expressed as:
where:
\(A\) is the initial amplitude,
\(m\) is the attenuation constant (in \(\text{m}^{-1}\)),
\(\omega = 2 \pi f\) is the angular frequency,
\(k = \frac{\omega}{c}\) is the wave number,
\(c\) is the speed of sound,
\(x\) is the distance,
\(t\) is time.
The first exponential term \(e^{-\frac{m}{2} x}\) accounts for the amplitude decay as the wave propagates. A higher \(m\) results in stronger attenuation, meaning the wave diminishes faster over distance.
Understanding the Interactive Visualization#
This Python-based interactive simulation allows users to visualize how sound waves attenuate as they travel through a medium. The key adjustable parameters are:
Frequency (\(f\) in Hz): Determines the oscillation rate of the wave.
Attenuation Constant (\(m\) in \(\text{m}^{-1}\)): Defines how rapidly the wave diminishes over distance.
Speed of Sound (\(c\) in m/s): Affects the wave propagation speed.
Code Explanation#
Waveform Definition:
The function generates a plane wave that undergoes attenuation.
The pressure wave is computed as a combination of exponential decay and harmonic oscillation.
Visualization:
Real Component (Re(p)): Represents the oscillatory behavior of the wave.
Magnitude (abs(p)): Shows the absolute envelope of the decaying wave.
Interactivity:
Users can adjust the frequency, attenuation constant using sliders.
The plot dynamically updates to illustrate the effect of these parameters on attenuation.
Interpreting the Graph#
Higher Frequencies (\(f\)): Increase the oscillation rate but do not directly affect attenuation.
Larger Attenuation Constant (\(m\)): Causes the wave to decay more rapidly.
Changes in Speed of Sound (\(c\)): Modify the wavelength of the wave but do not directly control amplitude decay.
This simulation provides an intuitive way to explore the physics of sound attenuation in different conditions.
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as widgets
from ipywidgets import interact
def attenuation(f=1000, m=1, c=340):
"""
Interactive visualization of sound attenuation.
Parameters:
f : float
Frequency of the wave (Hz).
m : float
Attenuation constant (1/m).
"""
omega = 2 * np.pi * f # Angular frequency
dx = 0.01 # Step size
x = np.arange(0, 10, dx) # Distance range (0 to 10 meters)
t = 0 # Fixed time
A = 1 # Initial amplitude
k = omega / c # Wave number
# Compute the pressure wave
p = A * np.exp(-m * x / 2) * np.exp(1j * (omega * t - k * x))
plt.figure(figsize=(10, 5))
plt.plot(x, np.real(p), 'k', label="Re(p)")
plt.plot(x, np.abs(p), 'k', linewidth=2, label="abs(p)")
plt.xlabel("x (m)", fontsize=14)
plt.ylabel("p (Pa)", fontsize=14)
plt.title(f"Attenuation with m = {m}", fontsize=16)
plt.legend()
plt.grid(True)
plt.xlim(0, 10)
plt.ylim(-1, 1)
plt.show()
interact(attenuation, f=widgets.FloatSlider(min=20, max=5000, step=100, value=1000, description="Frequency [Hz]"),
m=widgets.FloatSlider(min=1, max=10, step=1, value=1, description="Attenuation Constant [1/m]"),
c=widgets.FloatText (value=340, description="Speed of Sound [m/s]"));
Molecular Attenuation#
Physical Background#
Molecular attenuation occurs due to the redistribution of acoustic energy among different molecular motion modes (translational, rotational, and vibrational). Unlike classical attenuation, molecular relaxation introduces frequency-dependent losses in sound propagation.
Molecular attenuation is described using the relaxation time \(\tau\), which represents the time needed for energy redistribution among molecular modes. The attenuation coefficient \(m\) is given by:
where:
\(\beta\) is a proportionality constant,
\(\tau\) is the relaxation time of the propagation medium,
\(\omega = 2\pi f\) is the angular frequency of the sound wave.
This equation highlights how molecular attenuation varies with frequency. The attenuation is strongest around a critical frequency, determined by \(\tau\).
Interactive Visualization of Molecular Attenuation#
This interactive Python code visualizes how molecular attenuation depends on relaxation time. The key adjustable parameters are:
Relaxation time (\(\tau\) in s): Controls how energy redistributes among molecular states.
Speed of Sound (\(c\) in m/s): Affects the propagation of sound waves.
Code Explanation#
Attenuation Calculation:
The function computes the attenutation in dB over a range of attenuation coefficient \(m(\omega)\).
The decay in wave amplitude is computed at a fixed distance (\(x = 100\) m).
Visualization:
The plot displays attenuation per kilometer (dB/km) on a logarithmic frequency scale.
Users can observe how attenuation varies with frequency and relaxation time.
Interactivity:
Users adjust \(\tau\) and \(c\) to see the influence on attenuation.
The plot dynamically updates based on the chosen parameters.
Interpreting the Graph#
Lower \(\tau\) values: Faster energy redistribution, causing lower attenuation.
Higher \(\tau\) values: Stronger frequency-dependent attenuation.
Effect of Speed of Sound (\(c\)): Alters the wave number but does not directly affect attenuation strength.
This simulation helps in understanding how molecular effects influence sound wave propagation.
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as widgets
from ipywidgets import interact
def mol_attenuation(tau=1e-3, c=340):
"""
Interactive visualization of molecular attenuation.
Parameters:
tau : float
Relaxation time of the propagation medium.
c : float
Speed of sound (m/s), user-adjustable.
"""
omega = np.arange(10, 20000, 10) # Angular frequency range (rad/s)
k = omega / c # Wave number
m = 1e-2 * omega * tau / (1 + (omega * tau) ** 2) # Molecular attenuation formula
x = 100 # Fixed distance (m)
A = 1 # Initial amplitude
p = A * np.exp(-m * x / 2) # Pressure wave with attenuation
# Plot attenuation
plt.figure(figsize=(8, 5))
plt.semilogx(omega / (2 * np.pi), 20 * np.log10(1 / np.abs(p)), "k", linewidth=2)
plt.xlabel("f (Hz)", fontsize=14)
plt.ylabel("Attenuation/km (dB)", fontsize=14)
plt.title(f"Molecular Attenuation (τ = {tau}, c = {c} m/s)", fontsize=16)
plt.grid(True)
plt.xlim(20, omega[-1] / (2 * np.pi))
plt.ylim(0, 5)
plt.show()
style = {"description_width": "150px"}
tau_slider = widgets.FloatSlider(
min=1e-4, max=1e-2, step=1e-4, value=1e-3, description="Relaxation time τ (s)", style=style
)
c_input = widgets.FloatText(value=340, description="c (m/s)", style=style)
interact(mol_attenuation, tau=tau_slider, c=c_input)
References#
[Kut06]