diff --git a/ASCEE_lasp.lyx b/ASCEE_lasp.lyx index b34ed14..5641ab0 100644 --- a/ASCEE_lasp.lyx +++ b/ASCEE_lasp.lyx @@ -4,7 +4,7 @@ \begin_header \save_transient_properties true \origin unavailable -\textclass article +\textclass memoir \begin_preamble \input{tex/preamble_article.tex} \end_preamble @@ -15,8 +15,8 @@ \language_package babel \inputencoding utf8 \fontencoding global -\font_roman "libertine" "Linux Libertine O" -\font_sans "default" "Courier New" +\font_roman "libertine" "Libertinus Sans" +\font_sans "default" "default" \font_typewriter "default" "default" \font_math "libertine-ntxm" "auto" \font_default_family default @@ -31,7 +31,7 @@ \default_output_format default \output_sync 1 \output_sync_macro "\synctex=1" -\bibtex_command biber +\bibtex_command default \index_command default \paperfontsize 10 \spacing single @@ -551,6 +551,10 @@ confidential \end_layout +\begin_layout Chapter +Power spectra estimation +\end_layout + \begin_layout Section Fourier transform vs discrete Fourier transform \end_layout @@ -718,7 +722,7 @@ Sample frequency: \end_layout \begin_layout Standard -Frequency resolution +Frequency resolution: \begin_inset Formula \begin{equation} \Delta f=\frac{f_{s}}{N_{\mathrm{DFT}}}, @@ -735,7 +739,7 @@ i.e. \end_layout \begin_layout Standard -Definition of the DFT: +Our definition of the DFT: \end_layout \begin_layout Standard @@ -1089,11 +1093,11 @@ w_{N}=0.01 \end_layout -\begin_layout Section +\begin_layout Chapter Impedance tube \end_layout -\begin_layout Subsection +\begin_layout Section Design aspects \end_layout @@ -1742,7 +1746,7 @@ where ). \end_layout -\begin_layout Subsection +\begin_layout Section Method for computing the sample impedance, absorption and reflection coefficient \end_layout @@ -2017,12 +2021,65 @@ Nonlinearities Noise \end_layout +\begin_layout Chapter +Digital signal processing +\end_layout + \begin_layout Section Filter bank design \end_layout \begin_layout Subsection -Overlap-save method +FIR Filter +\end_layout + +\begin_layout Standard +An FIR filter performs the operation: +\begin_inset Formula +\begin{equation} +y[n]=\boldsymbol{h}*\boldsymbol{x}[n]\equiv\sum_{m=0}^{N-1}h[m]x[n-m]. +\end{equation} + +\end_inset + +This operation can be implemented in time domain, or in frequency domain. + Notably the +\begin_inset Quotes eld +\end_inset + +fast convolution form +\begin_inset Quotes erd +\end_inset + + is of interest, as it requires fewer operations for high +\begin_inset Formula $N$ +\end_inset + + (smaller complexity). +\end_layout + +\begin_layout Subsubsection +Fast convolution: overlap-save method +\end_layout + +\begin_layout Standard +Definitions: +\end_layout + +\begin_layout Itemize +FIR Filter length: +\begin_inset Formula $N$ +\end_inset + + +\end_layout + +\begin_layout Itemize +Block length of inputs: +\begin_inset Formula $L$ +\end_inset + + \end_layout \begin_layout Standard @@ -2047,7 +2104,7 @@ status open \align center \begin_inset Graphics filename img/overlap_save.pdf - width 90text% + width 70text% \end_inset @@ -2055,12 +2112,19 @@ status open \begin_inset Caption Standard \begin_layout Plain Layout - +Overlap-save algorithm \end_layout \end_inset +\begin_inset CommandInset label +LatexCommand label +name "fig:schematic_overlapsave" + +\end_inset + + \end_layout \end_inset @@ -2069,7 +2133,7 @@ status open \end_layout \begin_layout Standard -The yellow blocks are saved for the next +The yellow blocks are saved for the next block. \end_layout \begin_layout Section @@ -2246,7 +2310,7 @@ H\left(\omega\right)=H[z=e^{i\omega T}], For the DSP equation: \begin_inset Formula \begin{equation} -H(\omega)=\frac{\sum\limits _{p=0}^{P}a_{p}e^{-ip\Omega}}{1-\sum\limits _{m=1}^{M}b_{m}e^{-im\Omega}} +H(\omega)=\frac{\sum\limits _{p=0}^{P-1}a_{p}e^{-ip\Omega}}{1-\sum\limits _{m=1}^{M-1}b_{m}e^{-im\Omega}} \end{equation} \end_inset @@ -2595,6 +2659,146 @@ Example: 1000 Hz octave band: pass-band is from 750 Hz to 1500 Hz. Use a Hamming window to reduce the pass and stop-band ripple. \end_layout +\begin_layout Subsection +First order digital high pass +\end_layout + +\begin_layout Standard +A simple digital high-pass filter can be implemented using: +\begin_inset Formula +\begin{equation} +G(s)=\frac{\tau s}{1+\tau s}, +\end{equation} + +\end_inset + +where +\begin_inset Formula $\tau$ +\end_inset + + is the +\begin_inset Formula $-3$ +\end_inset + + +\begin_inset space ~ +\end_inset + +dB time constant, as when +\begin_inset Formula $\omega=\tau^{-1}$ +\end_inset + +, +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Formula $|G|=\frac{1}{\sqrt{2}}$ +\end_inset + +. +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +\begin_inset Formula $2\left(\omega\tau\right)^{2}=1+\left(\omega\tau\right)^{2}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\left(\omega\tau\right)^{2}=1$ +\end_inset + + +\end_layout + +\end_inset + + Such that the cut-on frequency is: +\begin_inset Formula +\begin{equation} +\frac{1}{2\pi f_{c}}=\tau. +\end{equation} + +\end_inset + +Filling in, we find: +\begin_inset Formula +\begin{equation} +G(s)=\frac{\frac{s}{2\pi f_{c}}}{1+\frac{s}{2\pi f_{c}}}, +\end{equation} + +\end_inset + + Applying the bilinear transform, we find: +\begin_inset Note Note +status open + +\begin_layout Plain Layout +\begin_inset Formula $G(s)=\frac{2\pi f_{c}s}{1+2\pi f_{c}s},$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Bilinear: +\begin_inset Formula $2f_{s}\frac{z-1}{z+1},$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\frac{2f_{s}\tau\left(z-1\right)}{2f_{s}\tau\left(z-1\right)+z+1}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Readjust: +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\frac{2f_{s}\tau\left(1-z^{-1}\right)}{2f_{s}\tau\left(1-z^{-1}\right)+1+z^{-1}}$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Make denominator a0 1: +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\frac{\frac{2f_{s}\tau}{\left(1+2f_{s}\tau\right)}\left(1-z^{-1}\right)}{1+\frac{\left(1-2f_{s}\tau\right)}{\left(1+2f_{s}\tau\right)}z^{-1}}$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Formula +\begin{equation} +G[z]=\frac{\frac{2f_{s}\tau}{\left(1+2f_{s}\tau\right)}\left(1-z^{-1}\right)}{1+\frac{\left(1-2f_{s}\tau\right)}{\left(1+2f_{s}\tau\right)}z^{-1}} +\end{equation} + +\end_inset + + +\end_layout + \begin_layout Section Sound level meter implementation \end_layout @@ -2611,7 +2815,7 @@ Fast time-weighted sound level,of the A-weighted pressure signal : \begin_inset Formula \begin{equation} -L_{AF}=10\log_{10}\left(\frac{1}{\tau_{F}}\int\limits _{-\infty}^{t}p_{A}^{2}\left(\xi\right)e^{-\left(t-\xi\right)/\tau_{F}}\right)-10\log_{10}\left(p_{\mathrm{ref}}^{2}\right), +L_{AF}=10\log_{10}\left(\frac{1}{\tau_{F}}\int\limits _{-\infty}^{t}p_{A}^{2}\left(\xi\right)e^{-\left(t-\xi\right)/\tau_{F}}\mathrm{d}\xi\right)-10\log_{10}\left(p_{\mathrm{ref}}^{2}\right), \end{equation} \end_inset @@ -2662,6 +2866,26 @@ ms Implementation of single pole low pass filter \end_layout +\begin_layout Standard +The time weighting is specified as: +\begin_inset Formula +\begin{equation} +L_{\mathrm{AF}}(t)=10\log_{10}\left[\frac{1}{p_{\mathrm{ref}}^{2}}\frac{1}{\tau_{F}}\int_{-\infty}^{t}p_{\mathrm{A}}^{2}(t)\exp\left(-\frac{\left(t-\xi\right)}{\tau_{\mathrm{F}}}\right)\mathrm{d}\xi\right]. +\end{equation} + +\end_inset + +The Laplace transform of the integral is: +\begin_inset Formula +\begin{equation} +\mathcal{L}\left[\frac{1}{\tau_{F}}\int_{-\infty}^{t}p_{\mathrm{A}}^{2}\exp\left(-\frac{\left(t-\xi\right)}{\tau_{\mathrm{F}}}\right)\mathrm{d}\xi\right]=p_{\mathrm{A}}^{2}(s)\frac{1}{1+\tau_{F}s} +\end{equation} + +\end_inset + + +\end_layout + \begin_layout Standard A single pole low pass filter has a frequency response of \begin_inset Formula @@ -2671,6 +2895,14 @@ G_{\mathrm{splp}}=\frac{1}{1+\tau s}, \end_inset + +\end_layout + +\begin_layout Subsubsection +Implementation using Bilinear transform +\end_layout + +\begin_layout Standard we create a digital filter from this one using the bilinear transform: \begin_inset Formula \begin{equation} @@ -2691,22 +2923,32 @@ status collapsed \end_layout \begin_layout Plain Layout -\begin_inset Formula $G_{\mathrm{splp},d}=\frac{z+1}{\left(1+\tau2f_{s}\right)z+1-\tau2f_{s}}$ +Filling in +\begin_inset Formula $z=\exp(i\omega/f_{s})$ +\end_inset + + and setting +\begin_inset Formula $\omega=0$ \end_inset \end_layout \begin_layout Plain Layout -Divide by -\begin_inset Formula $z$ + +\series bold +\begin_inset Formula $G_{\mathrm{splp},d}(\omega=0)=1$ \end_inset -, both numerator and denominator: + \end_layout \begin_layout Plain Layout -\begin_inset Formula $G_{\mathrm{splp},d}=\frac{1+z^{-1}}{\left(1+\tau2f_{s}\right)+\left(1-\tau2f_{s}\right)z^{-1}}$ +============== +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $G_{\mathrm{splp},d}=\frac{1+z^{-1}}{\left(1+2f_{s}\tau\right)+\left(1-2f_{s}\tau\right)z^{-1}}$ \end_inset @@ -2741,7 +2983,31 @@ Normalizing such that \end_layout \begin_layout Plain Layout -– +– Check: filling in +\begin_inset Formula $z=0$ +\end_inset + + should give a unit gain: +\end_layout + +\begin_layout Plain Layout + +\family roman +\series medium +\shape up +\size normal +\emph off +\bar no +\strikeout off +\xout off +\uuline off +\uwave off +\noun off +\color none +\begin_inset Formula $G_{\mathrm{splp},d}(z=0)=\frac{\left(1+2\tau f_{s}\right)^{-1}}{\frac{\left(1-\tau2f_{s}\right)}{\left(1+2\tau f_{s}\right)}}$ +\end_inset + + \end_layout \end_inset @@ -2749,7 +3015,7 @@ Normalizing such that \begin_inset Formula \begin{equation} -G_{\mathrm{splp},d}=\frac{1+z^{-1}}{\left(\frac{1}{\tau}+2f_{s}\right)+\left(\frac{1}{\tau}-2f_{s}\right)z^{-1}}, +G_{\mathrm{splp},d}=\frac{\left(1+2\tau f_{s}\right)^{-1}\left(1+z^{-1}\right)}{1+\frac{\left(1-\tau2f_{s}\right)}{\left(1+2\tau f_{s}\right)}z^{-1}}, \end{equation} \end_inset @@ -2775,9 +3041,10 @@ No correction for frequency warping has been done, as for all cases . The output frequency of the sound level meter will be decimated to a sampling - frequency, where the single pole low pass filter has a -20 dB point: + frequency, where the single pole low pass filter has a -20 dB point, such + that aliasing is at max ~ 0.1 times any oscillation: \begin_inset Note Note -status open +status collapsed \begin_layout Plain Layout \begin_inset Formula $\frac{1-0.01}{0.01}=\left|\tau s\right|\Rightarrow\left|s\right|=\frac{1}{\tau}\frac{1-0.01}{0.01}\Rightarrow f_{s,\mathrm{slm}}=$ @@ -2861,6 +3128,156 @@ id>N-o \end_inset +\end_layout + +\begin_layout Subsubsection +Implementation using the matched Z-transform method +\begin_inset Formula +\begin{equation} +G_{\mathrm{splp},d}=\frac{1-\exp\left(-\left(f_{s}\tau\right)^{-1}\right)}{1-\exp\left(-\left(f_{s}\tau\right)^{-1}\right)z^{-1}} +\end{equation} + +\end_inset + + +\end_layout + +\begin_layout Standard +By setting unity gain for +\begin_inset Formula $\omega=0$ +\end_inset + +, this results in the following simple difference equation: +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +\begin_inset Formula $Y[z]=\frac{1-\exp\left(\left(f_{s}\tau_{d}\right)^{-1}\right)}{1-\exp\left(\left(f_{s}\tau_{d}\right)^{-1}\right)z^{-1}}X[z]$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $y[n]=\exp\left(\left(f_{s}\tau_{d}\right)^{-1}\right)y[n-1]+\left[1-\exp\left(\left(f_{s}\tau_{d}\right)^{-1}\right)\right]x[n]$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Formula +\begin{align} +y[n] & =\alpha y[n-1]+\left(1-\alpha\right)x[n],\\ +\alpha & =\exp\left(-\frac{1}{f_{s}\tau}\right) +\end{align} + +\end_inset + + +\end_layout + +\begin_layout Standard +This way: the number of dB's / s, that the level is decaying, after signal + stop is: +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +\begin_inset Formula +\[ +y[n]=\alpha y[n-1] +\] + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +For +\begin_inset Formula $\alpha>0$ +\end_inset + +: +\begin_inset Formula +\[ +|y[n]|=\alpha|y[n-1]| +\] + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula +\[ +y[n]=y[0]\alpha^{n} +\] + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula +\[ +L\left(y[n]\right)=20\log\left(|y[n]\right)=20\log\left(|y(0)|\right)+20\log\left(\alpha^{n}\right) +\] + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula +\begin{align*} +L(y(t)) & =20\log\left(|y[n=\frac{t}{\Delta t}]\right)=20\log\left(|y(0)|\right)+\frac{t}{\Delta t}20\log\left(\alpha\right)\\ + & =20\log\left(|y(0)|\right)+t\frac{1}{\Delta t}\underbrace{20\log\left(\alpha\right)} +\end{align*} + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Formula +\begin{equation} +\mathrm{Decay\,rate\,dB\,/\,s}\approx\frac{20}{\Delta t}\log\left(\alpha\right) +\end{equation} + +\end_inset + + +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +And the other way around: +\begin_inset Formula $20\log\left(\alpha\right)=d\Delta t$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\alpha=10^{\frac{d\Delta t}{20}}$ +\end_inset + + +\end_layout + +\end_inset + + \end_layout \begin_layout Subsection @@ -3864,6 +4281,533 @@ h=s^{-1}*\left(y[n]-e[n]\right) \end_inset +\end_layout + +\begin_layout Section +Transfer function estimation using least squares estimation and a FIR filter +\end_layout + +\begin_layout Standard +This is a time domain method to estimate the transfer function by minimizing + the error. + For a FIR system we can write +\begin_inset Formula +\begin{equation} +y[n]=\sum_{l=0}^{L-1}w[n-l]x[n-l]+d[n]=\boldsymbol{w}\cdot\boldsymbol{x}[n]+d[n], +\end{equation} + +\end_inset + +where +\begin_inset Formula $\boldsymbol{w}$ +\end_inset + + is the vector of FIR coefficients +\begin_inset Formula $d[n]$ +\end_inset + + is an unknown disturbance (noise), and +\begin_inset Formula $\boldsymbol{x}[n]$ +\end_inset + + the time history at discrete time point +\begin_inset Formula $n$ +\end_inset + + containing +\begin_inset Formula $L$ +\end_inset + + points. + If we write +\begin_inset Formula +\begin{equation} +e[n]=y[n]-\boldsymbol{w}\cdot\boldsymbol{x}[n], +\end{equation} + +\end_inset + +we can generate the cost function +\begin_inset Formula +\begin{equation} +J=\sum_{n=0}^{N-1}e^{2}[n] +\end{equation} + +\end_inset + +to be minimized, we can estimate the optimal filter +\begin_inset Formula $\boldsymbol{w}$ +\end_inset + + by taking the derivative of +\begin_inset Formula $J$ +\end_inset + + w.r.t. + to +\begin_inset Formula $\boldsymbol{w}$ +\end_inset + + and setting that to 0. + This results in: +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +\begin_inset Formula $\frac{\partial J}{\partial\boldsymbol{w}}=\frac{\partial}{\partial\boldsymbol{w}}\sum_{n=0}^{N-1}\left[e[n]^{2}\right]=\sum_{n=0}^{N-1}\left[2e[n]\frac{\partial e[n]}{\partial\boldsymbol{w}}\right]$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Working out: +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $\frac{\partial J}{\partial\boldsymbol{w}}=\sum_{n=0}^{N-1}\left[2e[n]\boldsymbol{x}[n]\right]$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Setting this to +\begin_inset Formula $\boldsymbol{0}$ +\end_inset + +: +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula +\[ +\sum_{n=0}^{N-1}\left[2\left(y[n]-\boldsymbol{w}\cdot\boldsymbol{x}[n]\right)\boldsymbol{x}[n]\right]=\boldsymbol{0} +\] + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Defining the matrix +\begin_inset Formula $X_{nl}$ +\end_inset + + containing the time history at time at time instance +\begin_inset Formula $n$ +\end_inset + + and history point +\begin_inset Formula $l$ +\end_inset + +, and +\begin_inset Formula $Y_{nl}$ +\end_inset + + containing the output signal at time instance +\begin_inset Formula $n$ +\end_inset + +, we can write +\begin_inset Formula $\hat{\boldsymbol{y}}=\boldsymbol{X}\cdot\boldsymbol{w}$ +\end_inset + +, such that: +\begin_inset Formula +\[ +\sum_{n=0}^{N-1}\left[2\left(y[n]-\boldsymbol{w}\cdot\boldsymbol{x}[n]\right)\boldsymbol{x}[n]\right]=\boldsymbol{0} +\] + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +For all +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Section +Vector fitting +\end_layout + +\begin_layout Itemize +Method to estimate poles and zeros (rational transfer function estimation) + of an arbitrary transfer function. + Guaranteed stable poles. +\end_layout + +\begin_layout Standard +Suppose we want to fit the transfer function +\begin_inset Formula $f(s)$ +\end_inset + + using a rational function approximation as: +\begin_inset Formula +\begin{equation} +f(s)\approx\sum_{n=1}^{N}\frac{c_{n}}{s-a_{n}}+d+sh, +\end{equation} + +\end_inset + +where +\begin_inset Formula $a_{n}$ +\end_inset + + are the poles. + We introduce an +\emph on +unknown +\emph default + function +\begin_inset Formula $\sigma(s)$ +\end_inset + + which shares the same poles as +\begin_inset Formula $f(s)$ +\end_inset + +, but with different zeros: +\begin_inset Formula +\begin{equation} +\sigma(s)=\sum_{n=1}^{N}\frac{\tilde{c}_{n}}{s-a_{n}}+1 +\end{equation} + +\end_inset + +We create the augmented problem: +\begin_inset Formula +\begin{equation} +\left[\begin{array}{c} +\sigma(s)f(s)\\ +\sigma(s) +\end{array}\right]\approx\left[\begin{array}{c} +\sum\limits _{n=1}^{N}\frac{c_{n}}{s-a_{n}}+d+sh\\ +\sum_{n=1}^{N}\frac{\tilde{c}_{n}}{s-a_{n}}+k(s) +\end{array}\right]. +\end{equation} + +\end_inset + +So we assume that we can fit +\begin_inset Formula $\sigma(s)f(s)$ +\end_inset + + with the top equation, and +\begin_inset Formula $\sigma(s)$ +\end_inset + + with the bottom equation. + By multiplying the bottom equation with +\begin_inset Formula $f(s)$ +\end_inset + +, we find: +\begin_inset Formula +\begin{equation} +\underbrace{\sum\limits _{n=1}^{N}\frac{c_{n}}{s-a_{n}}+d+sh}_{\left(\sigma f\right)_{\mathrm{fit}}}=\underbrace{\left(\sum_{n=1}^{N}\frac{\tilde{c}_{n}}{s-a_{n}}+1\right)f(s)}_{\sigma_{\mathrm{fit}}(s)f(s)}, +\end{equation} + +\end_inset + + +\end_layout + +\begin_layout Standard +For a certain set of starting poles +\begin_inset Formula $a_{n}$ +\end_inset + +, we are able to fit the zeros. +\end_layout + +\begin_layout Section +Soft gain transitioning +\end_layout + +\begin_layout Standard +Equation governing gain evolution, running at each sample: +\begin_inset Formula +\begin{equation} +\Delta g=\alpha\left(g_{\mathrm{required}}-g_{\mathrm{old}}\right), +\end{equation} + +\end_inset + +which can be written as: +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +\begin_inset Formula $G[z]\left(1-z^{-1}\right)=\alpha\left(G_{\mathrm{required}}[z]-z^{-1}G[z]\right)$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $G[z]\left(1-z^{-1}\right)+\alpha z^{-1}G[z]=\alpha G_{\mathrm{required}}[z]$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $G[z]=\frac{\alpha}{1+\left(\alpha-1\right)z^{-1}}G_{\mathrm{required}}[z]$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Formula +\begin{equation} +G[z]=\frac{\alpha}{1+\left(\alpha-1\right)z^{-1}}G_{\mathrm{required}}(z), +\end{equation} + +\end_inset + +which is an approximate first order digital low-pass filter: +\begin_inset Note Note +status open + +\begin_layout Plain Layout +Filling in for +\begin_inset Formula $H(s)=H[z=e^{sT}],$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $G\left(s\right)=\frac{\alpha}{1+\left(\alpha-1\right)\exp\left(-s/f_{s}\right)}G_{\mathrm{required}}(s)$ +\end_inset + +,for +\begin_inset Formula $s\ll f_{s}$ +\end_inset + + can be written as: +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $G\left(s\right)\approx\frac{\alpha}{\alpha+\left(1-\alpha\right)s/f_{s}}G_{\mathrm{required}}(s)$ +\end_inset + + which has a pole at approximately: +\begin_inset Formula $s_{p}=f_{s}\left[1-\frac{1}{1-\alpha}\right]$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +Fill in: +\begin_inset Formula $\alpha=0.1\Rightarrow s_{p}=f_{s}\left[1-\frac{1}{0.9}\right]$ +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Formula $s=f_{s}\left[-9\right]$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Formula +\begin{equation} +G\left(s\right)\approx\frac{\alpha}{\alpha+s/f_{s}}G_{\mathrm{required}}(s)\qquad s\ll f_{s},0<\alpha\ll1 +\end{equation} + +\end_inset + +Hence for the transition time constant, +\begin_inset Formula $s_{p}=-\frac{2\pi}{\tau_{p}}$ +\end_inset + +, we find: +\begin_inset Note Note +status open + +\begin_layout Plain Layout +\begin_inset Formula $\alpha=1-\frac{1}{1+\frac{2\pi}{\tau_{p}f_{s}}}$ +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Formula +\begin{equation} +\alpha=1-\frac{1}{1+\frac{2\pi}{\tau_{p}f_{s}}} +\end{equation} + +\end_inset + + +\end_layout + +\begin_layout Chapter +Programming aspects +\end_layout + +\begin_layout Section +Array ordering +\end_layout + +\begin_layout Itemize +A 2D array of is called in +\emph on +row-major order +\emph default + if each of the rows is subsequentially put in memory. + This means, we can find element +\begin_inset Formula $A_{\mathrm{row},\mathrm{col}}=A_{ij}$ +\end_inset + + in memory +\begin_inset Formula $A[i+j\mathrm{n_{rows}}]$ +\end_inset + +. + This is also called a C-contiguous array. +\end_layout + +\begin_layout Itemize +A 2D array of is called in +\emph on +column-major order +\emph default + if each of the columns is subsequentially put in memory. + This means, we can find element +\begin_inset Formula $A_{\mathrm{row},\mathrm{col}}=A_{ij}$ +\end_inset + + in memory +\begin_inset Formula $A[in_{\mathrm{cols}}+j]$ +\end_inset + +. + This is also called a Fortran-contiguous array. + For the +\family typewriter +dmat +\family default + structure in +\family typewriter +LASP +\family default +, we have chosen to use the Fortran-contiguous convention. +\end_layout + +\begin_layout Standard +Numpy works under the hood with +\family typewriter +strides +\family default +, strides are the values with which each array index needs to be multiplied + to obtain the value of each index in an +\begin_inset Formula $N$ +\end_inset + +-dimensional array. + +\family typewriter +Strides +\family default + is a tuple containing +\begin_inset Formula $(a,b,c,\dots$ +\end_inset + +). + Such that +\begin_inset Formula $A[i,j,k,\dots]=A[ai+bj+ck+\dots]$ +\end_inset + +. + Strides are a method to have an arbitrary memory layout, and also provide + a very easy way to transpose an array over one dimension (just swap the + stride values in the tuple). +\end_layout + +\begin_layout Chapter +Beamforming +\end_layout + +\begin_layout Section +Near-field cardioid beamformer +\end_layout + +\begin_layout Standard +\begin_inset Formula +\begin{equation} +\boldsymbol{x}(\omega)=\boldsymbol{a}(\omega)s, +\end{equation} + +\end_inset + +where +\begin_inset Formula $s$ +\end_inset + + is the source signal, and +\begin_inset Formula $\boldsymbol{a}(\omega)$ +\end_inset + + the transfer from the source signal to the measured signal +\begin_inset Formula $\boldsymbol{x}$ +\end_inset + +. + Now, we would like to generate a signal +\begin_inset Formula $y=\boldsymbol{w}^{H}\boldsymbol{x}$ +\end_inset + +, that is sensitive to signals at position +\begin_inset Formula $\boldsymbol{r}_{s}$ +\end_inset + + and not sensitive to signals at other positions. + Therefore, the optimal beamformer is such that: +\begin_inset Formula +\begin{align} +\boldsymbol{w}^{H}\boldsymbol{a}s_{\boldsymbol{r}=\boldsymbol{r}_{0}} & =1,\\ +\boldsymbol{w}^{H}\boldsymbol{a}s_{\boldsymbol{r}\neq\boldsymbol{r}_{0}} & =0. +\end{align} + +\end_inset + + Now, the sensitivity to a source is: +\begin_inset Formula +\begin{equation} +\boldsymbol{a}=\left\{ \begin{array}{c} +\exp\left(-i\omega R_{1}/c_{0}\right)/R_{1}\\ +\exp\left(-i\omega R_{2}/c_{0}\right)/R_{2}\\ +\vdots\\ +\\ +\end{array}\right\} +\end{equation} + +\end_inset + + \end_layout \begin_layout Standard diff --git a/img/overlap_save.pdf b/img/overlap_save.pdf index b6bb32f..bea522b 100644 Binary files a/img/overlap_save.pdf and b/img/overlap_save.pdf differ