Posts

Finite Difference Simulation of a Helmholtz Resonator - 2D Acoustic Wave Equation

In this project we wish to simulate the acoustics of a Helmholtz Resonator (HR) as may be found in a vented loudspeaker enclosure design. The vent functions as a Helmholtz resonator and has a low frequency attenuation effect. The enclosure is compartmentalized due to the vent design. Therefore, in order to carry out the simulation we must implement reflecting boundary conditions in the interior of the simulation region. In addition, a mixture of absorbing and reflecting boundary conditions are needed at the edges of the simulation region. Absorbing boundary conditions for the wave equation require additional attention and are implemented as described by [Alam & Mohiuddin, 2021]. Read a detailed explanation report can be found here here . The Github project is availabe here: https://github.com/aruymgaart/AMATH/tree/master/acoustic_simulation .

Combination Finite Difference & Spectral Solution to Advection-Diffusion PDE

Vorticity $\omega$ is a measure of local rotation (in a fluid). It is related to the angular velocity of a solid. Vorticity is generally a vector (valued function). However, it can be viewed as a scalar in 2D because it is always perpendicular to the plane. If fluid velocity $\vec{v}$ (in 2D) has components $u$ and $v$ \begin{equation} \vec{v}(t) = \begin{pmatrix} u(t) \\ v(t) \end{pmatrix} \end{equation} then these vector components are related to a scalar quantity called the \textbf{stream function} $\psi$ as follows \begin{align} u = -\psi_y \\ v = \psi_x \end{align} so that \begin{equation} \vec{v}(t) = \begin{pmatrix} u(t) \\ v(t) \end{pmatrix} = \begin{pmatrix} -\psi_y \\ \psi_x \end{pmatrix} \end{equation} So $\psi$ is a scalar valued function while the components of the fluid velocity vector can be derived from it. \begin{equation} \label{eq:hw4_laplacian_eqn} \nabla^2 \psi = \omega \end{equation} Vorticity-Streamfunction PDE \begin{align} \omega_t + [\psi,\omega] ...

MNIST Classification LDA SVM CART & Generalized Eigenvalue Problems

In this UW assignment report we analyze the MNIST handwritten digit dataset. We start with Principal Component Analysis (PCA) for dimensionality reduction and visualization. Visualization of the digits is accomplished by projection on 3 principal components such that each image is represented by a single 3D point. We next build a few supervised classifiers and compare their accuracy. Classification methods explored in this report include Linear Discriminant Analysis (LDA), Support Vector Machine (SVM) and Classification And Regression Tree (CART) used in the classification mode. Read a detailed explanation of MNIST classification with LDA, SVM & CART in terms of eigenvalue problems here . The Github project is availabe here: https://github.com/aruymgaart/AMATH/tree/master/MNIST_classifier_LDA_SVM_CART_582HW4 . Python implementation of DMD:

Video Background Subtraction With Dynamic Mode Decomposition

In this UW AMATH582 assignment we will subtract stationary background from videos of moving objects using Dynamic Mode Decomposition (DMD). We approximate the unknown dynamics with a linear system by organizing the image sequence into two sets related by the linear difference equation allowing us to solve for its matrix by least squares. We then discard the low frequency mode corresponding to the static background. Read a detailed explanation of Dynamic Mode Decomposition and its application to video background subtraction here . The Github project is availabe here: https://github.com/aruymgaart/AMATH/tree/master/video_background_dynamic_mode_decomposition_582HW5 . Python implementation of DMD:

Music Scoring With STFT-Gabor Transform

In this UW AMATH582 assignment report we analyze samples of music and attempt to reproduce guitar and bass music scores from them. In order to accomplish this we carry out a time-frequency decomposition of the signal. For the latter, we make use of the Short Time Fourier Transform (STFT) also called Gabor transform. We use low, high or bandpass filters to isolate the bass or guitar from other sound. Read a detailed explanation of the short time Fourier (Gabor) transform and its application to music scoring here . The Github project is availabe here: https://github.com/aruymgaart/AMATH/tree/master/stft_gabor_music_scoring_582HW2 . Example source code:

DFT Noise Filtering

In this UW AMATH582 assignment we are provided with noisy acoustic submarine positioning data. The data comprises discrete time measurements made at half hour increments organized into a 4D array. Each time frame is a 3D array of cartesian coordinates containing the acoustically detected intensity volume. The data is transformed into reciprocal space by 3D FFT. Averaging the transformed signal increases the signal to noise ratio and allows discovery of the frequency "signature". In reciprocal space, the frequency volume containing the signal remains centered at the same position regardless of time index while the signal position in lab space follows a trajectory. The fixed location of the center frequency in reciprocal space allows placement of a Gaussian filter centered at the central frequency component. Each time frame is FFT 3D transformed, filtered in k space and subsequently transformed back. The resulting denoised echo is now positioned by a simple maximum allowing th...

Fourier Transform of Single Frequency Sines and Cosines

Image
Fourier Transform Of Single Frequency Sines And Cosines The Fourier transform (FT) of function $f(x)$ is defined as follows: $$ F(k) = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^{\infty} f(x) e^{-ikx} dx $$ The FT is dervived from a Fourier series in complex notation. The Fourier series expands a function into a weighted set of orthogonal basis functions. In case of the FT, the basis functions are sines and cosines. Sines and cosines are periodic on $2\pi$ meaning that the functions repeat themselves at increments of $2 \pi$. The principle idea is that we can represent most functions as a linear combination - a weighted sum - of sine and cosine basis functions. When a function of time $t$ is Fourier transformed, the components of the FT correspond to frequencies of the basis sines and cosines. Frequency is proportional to inverse time. The FT space is often called reciprocal space. If the function transformed were a function of position $x$, the FT is a function of inverse position. I...