2019-04-17 17:58:41 +02:00
|
|
|
#+TITLE:SpeedGoat
|
|
|
|
:DRAWER:
|
|
|
|
#+STARTUP: overview
|
|
|
|
|
2019-04-17 18:20:17 +02:00
|
|
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
|
|
|
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
|
|
|
|
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/zenburn.css"/>
|
|
|
|
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.min.js"></script>
|
|
|
|
#+HTML_HEAD: <script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
|
|
|
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
|
|
|
|
#+HTML_HEAD: <script type="text/javascript" src="../js/readtheorg.js"></script>
|
2019-04-17 17:58:41 +02:00
|
|
|
|
|
|
|
#+PROPERTY: header-args:matlab :session *MATLAB*
|
|
|
|
#+PROPERTY: header-args:matlab+ :comments org
|
2019-04-17 18:20:17 +02:00
|
|
|
#+PROPERTY: header-args:matlab+ :results output
|
2019-04-17 17:58:41 +02:00
|
|
|
#+PROPERTY: header-args:matlab+ :exports both
|
|
|
|
#+PROPERTY: header-args:matlab+ :eval no-export
|
|
|
|
#+PROPERTY: header-args:matlab+ :output-dir figs
|
|
|
|
:END:
|
|
|
|
|
2019-04-17 18:20:17 +02:00
|
|
|
* Setup
|
|
|
|
Two L22 geophones are used.
|
|
|
|
They are placed on the ID31 granite.
|
|
|
|
They are leveled.
|
|
|
|
|
|
|
|
The signals are amplified using voltage amplifier with a gain of 60dB.
|
|
|
|
The voltage amplifiers include a low pass filter with a cut-off frequency at 1kHz.
|
|
|
|
|
|
|
|
#+name: fig:figure_name
|
|
|
|
#+caption: Setup
|
|
|
|
#+attr_html: :width 500px
|
|
|
|
[[file:./figs/setup.jpg]]
|
|
|
|
|
|
|
|
#+name: fig:figure_name
|
|
|
|
#+caption: Geophones
|
|
|
|
#+attr_html: :width 500px
|
|
|
|
[[file:./figs/geophones.jpg]]
|
|
|
|
|
|
|
|
* Signal Processing
|
|
|
|
** Matlab Init :noexport:ignore:
|
2019-04-17 17:58:41 +02:00
|
|
|
#+begin_src matlab :exports none :results silent :noweb yes
|
|
|
|
<<matlab-init>>
|
|
|
|
#+end_src
|
|
|
|
|
2019-04-17 18:20:17 +02:00
|
|
|
** Load data
|
2019-04-17 17:58:41 +02:00
|
|
|
#+begin_src matlab :results none
|
|
|
|
load('mat/data_001.mat', 't', 'x1', 'x2');
|
|
|
|
dt = t(2) - t(1);
|
|
|
|
#+end_src
|
|
|
|
|
2019-04-17 18:20:17 +02:00
|
|
|
** Time Domain Data
|
2019-04-17 17:58:41 +02:00
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
hold on;
|
|
|
|
plot(t, x1);
|
|
|
|
plot(t, x2);
|
|
|
|
hold off;
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
|
|
|
xlim([t(1), t(end)]);
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:data_time_domain
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/data_time_domain.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:data_time_domain
|
|
|
|
#+CAPTION: Time domain Data
|
|
|
|
#+RESULTS: fig:data_time_domain
|
|
|
|
[[file:figs/data_time_domain.png]]
|
|
|
|
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
hold on;
|
|
|
|
plot(t, x1);
|
|
|
|
plot(t, x2);
|
|
|
|
hold off;
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
|
|
|
xlim([0 1]);
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:data_time_domain_zoom
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/data_time_domain_zoom.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:data_time_domain_zoom
|
|
|
|
#+CAPTION: Time domain Data - Zoom
|
|
|
|
#+RESULTS: fig:data_time_domain_zoom
|
|
|
|
[[file:figs/data_time_domain_zoom.png]]
|
|
|
|
|
2019-04-17 18:20:17 +02:00
|
|
|
** Compute PSD
|
2019-04-18 13:42:57 +02:00
|
|
|
We first define the parameters for the frequency domain analysis.
|
2019-04-17 17:58:41 +02:00
|
|
|
#+begin_src matlab :results none
|
2019-04-18 13:42:57 +02:00
|
|
|
win = hanning(ceil(length(x1)/100));
|
|
|
|
Fs = 1/dt;
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
[pxx1, f] = pwelch(x1, win, [], [], Fs);
|
|
|
|
[pxx2, ~] = pwelch(x2, win, [], [], Fs);
|
2019-04-17 17:58:41 +02:00
|
|
|
#+end_src
|
|
|
|
|
2019-04-17 18:20:17 +02:00
|
|
|
** Take into account sensibility of Geophone
|
2019-04-17 17:58:41 +02:00
|
|
|
The Geophone used are L22.
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
S0 = 88; % Sensitivity [V/(m/s)]
|
|
|
|
f0 = 2; % Cut-off frequnecy [Hz]
|
|
|
|
S = (s/2/pi/f0)/(1+s/2/pi/f0);
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
bodeFig({S});
|
|
|
|
ylabel('Amplitude [V/(m/s)]')
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:geophone_sensibility
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/geophone_sensibility.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:geophone_sensibility
|
|
|
|
#+CAPTION: Sensibility of the Geophone
|
|
|
|
#+RESULTS: fig:geophone_sensibility
|
|
|
|
[[file:figs/geophone_sensibility.png]]
|
|
|
|
|
|
|
|
|
|
|
|
We take into account the gain of the electronics.
|
|
|
|
The cut-off frequency is set at 1kHz.
|
|
|
|
|
|
|
|
- [ ] Check what is the order of the filter
|
|
|
|
- [ ] Maybe I should not use this filter as there is no high frequencies anyway?
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
G0 = 60; % [dB]
|
|
|
|
|
|
|
|
G = G0/(1+s/2/pi/1000);
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
hold on;
|
2019-04-18 13:42:57 +02:00
|
|
|
plot(f, sqrt(pxx1)./squeeze(abs(freqresp(G, f, 'Hz')))./squeeze(abs(freqresp(S, f1, 'Hz'))));
|
|
|
|
plot(f, sqrt(pxx2)./squeeze(abs(freqresp(G, f, 'Hz')))./squeeze(abs(freqresp(S, f2, 'Hz'))));
|
2019-04-17 17:58:41 +02:00
|
|
|
hold off;
|
|
|
|
set(gca, 'xscale', 'log');
|
|
|
|
set(gca, 'yscale', 'log');
|
|
|
|
xlabel('Frequency [Hz]'); ylabel('PSD [m/s/sqrt(Hz)]')
|
2019-04-18 09:20:31 +02:00
|
|
|
xlim([2, 500]);
|
2019-04-17 17:58:41 +02:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:psd_velocity
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/psd_velocity.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:psd_velocity
|
|
|
|
#+CAPTION: Spectral density of the velocity
|
|
|
|
#+RESULTS: fig:psd_velocity
|
|
|
|
[[file:figs/psd_velocity.png]]
|
2019-04-18 13:42:57 +02:00
|
|
|
|
2019-04-18 09:20:31 +02:00
|
|
|
** Transfer function between the two geophones
|
|
|
|
#+begin_src matlab :results none
|
2019-04-18 13:42:57 +02:00
|
|
|
[T12, ~] = tfestimate(x1, x2, win, [], [], Fs);
|
2019-04-18 09:20:31 +02:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
ax1 = subplot(2, 1, 1);
|
2019-04-18 13:42:57 +02:00
|
|
|
plot(f, abs(T12));
|
2019-04-18 09:20:31 +02:00
|
|
|
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
|
|
|
set(gca, 'XTickLabel',[]);
|
|
|
|
ylabel('Magnitude');
|
|
|
|
|
|
|
|
ax2 = subplot(2, 1, 2);
|
2019-04-18 13:42:57 +02:00
|
|
|
plot(f, mod(180+180/pi*phase(T12), 360)-180);
|
2019-04-18 09:20:31 +02:00
|
|
|
set(gca, 'xscale', 'log');
|
|
|
|
ylim([-180, 180]);
|
|
|
|
yticks([-180, -90, 0, 90, 180]);
|
|
|
|
xlabel('Frequency [Hz]'); ylabel('Phase');
|
|
|
|
|
|
|
|
linkaxes([ax1,ax2],'x');
|
2019-04-18 09:37:33 +02:00
|
|
|
xlim([1, 500]);
|
2019-04-18 09:20:31 +02:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:tf_geophones
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/tf_geophones.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:tf_geophones
|
|
|
|
#+CAPTION: Estimated transfer function between the two geophones
|
|
|
|
#+RESULTS: fig:tf_geophones
|
|
|
|
[[file:figs/tf_geophones.png]]
|
2019-04-18 13:42:57 +02:00
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
[coh12, ~] = mscohere(x1, x2, win, [], [], Fs);
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
plot(f, coh12);
|
|
|
|
set(gca, 'xscale', 'log');
|
|
|
|
xlabel('Frequency [Hz]'); ylabel('Coherence');
|
|
|
|
ylim([0,1]); xlim([1, 500]);
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:coh_geophones
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/coh_geophones.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:coh_geophones
|
|
|
|
#+CAPTION: Cohererence between the signals of the two geophones
|
|
|
|
#+RESULTS: fig:coh_geophones
|
|
|
|
[[file:figs/coh_geophones.png]]
|
|
|
|
|
|
|
|
** Huddle Test
|
|
|
|
#+NAME: fig:huddle_test
|
|
|
|
#+HEADER: :headers '("\\usepackage{tikz}" "\\usepackage{import}" "\\import{$HOME/MEGA/These/LaTeX/}{config.tex}")
|
|
|
|
#+HEADER: :imagemagick t :fit yes :iminoptions -scale 100% -density 150 :imoutoptions -quality 100
|
|
|
|
#+HEADER: :results raw replace :buffer no :eval no-export :exports both :mkdirp yes
|
|
|
|
#+HEADER: :output-dir figs
|
|
|
|
#+begin_src latex :file huddle-test.pdf :post pdf2svg(file=*this*, ext="png") :exports results
|
|
|
|
\begin{tikzpicture}
|
|
|
|
\coordinate[] (U) at (0, 0) {};
|
|
|
|
\node[block, above right=0.5 and 2 of U] (S1) {$S_1$};
|
|
|
|
\node[block, below right=0.5 and 2 of U] (S2) {$S_2$};
|
|
|
|
\node[addb={+}{}{}{}{}, right=0.5 of S1] (add1) {};
|
|
|
|
\node[addb={+}{}{}{}{}, right=0.5 of S2] (add2) {};
|
|
|
|
|
|
|
|
\draw[] (U) node[above right]{$U$} -- ++(1, 0) node[]{$\bullet$};
|
|
|
|
\draw[->] ($(U)+(1, 0)$) |- (S1.west);
|
|
|
|
\draw[->] ($(U)+(1, 0)$) |- (S2.west);
|
|
|
|
|
|
|
|
\draw[->] (S1.east) -- (add1.west);
|
|
|
|
\draw[->] (S2.east) -- (add2.west);
|
|
|
|
|
|
|
|
\draw[->] (add1.east) -- ++(1, 0) node[above]{$X_1$};
|
|
|
|
\draw[->] (add2.east) -- ++(1, 0) node[above]{$X_2$};
|
|
|
|
|
|
|
|
\draw[<-] (add1.north) -- ++(0, 0.8)node[right]{$N_1$};
|
|
|
|
\draw[<-] (add2.north) -- ++(0, 0.8)node[right]{$N_2$};
|
|
|
|
\end{tikzpicture}
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:huddle_test
|
|
|
|
#+CAPTION: Huddle test block diagram
|
|
|
|
#+RESULTS: fig:huddle_test
|
|
|
|
[[file:figs/huddle-test.png]]
|
|
|
|
|
|
|
|
We are measuring $X_1$ and $X_2$.
|
|
|
|
The goal is to determine $N$.
|
|
|
|
|
|
|
|
\begin{align*}
|
|
|
|
X_1(\omega) &= S_1(\omega) U(\omega) + N_1(\omega)\\
|
|
|
|
X_2(\omega) &= S_2(\omega) U(\omega) + N_2(\omega)
|
|
|
|
\end{align*}
|
|
|
|
|
|
|
|
Then
|
|
|
|
\[ X_2(\omega) = \frac{S_2(\omega)}{S_1(\omega)} X_1(\omega) + N_2(\omega) - \frac{S_2(\omega)}{S_1(\omega)}N_1(\omega) \]
|
|
|
|
|
|
|
|
We suppose $N_1 = N_2 = N$
|
|
|
|
\[ N_2(\omega) - \frac{S_2(\omega)}{S_1(\omega)}N_1(\omega) = \left( 1 - \frac{S_2(\omega)}{S_1(\omega)}\right) N(\omega) \]
|
|
|
|
and
|
|
|
|
\[ N(\omega) = \frac{S_2(\omega)}{S_1(\omega)} X_2(\omega) - N_2(\omega) - \frac{S_2(\omega)}{S_1(\omega)}N_1(\omega) \]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
S = abs(T12.*pxx1);
|
|
|
|
|
|
|
|
N = pxx2 - (T12.^2).*pxx1;
|
|
|
|
N = abs(N)/2;
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+begin_src matlab :results none
|
|
|
|
figure;
|
|
|
|
hold on;
|
|
|
|
plot(f, pxx1, '-');
|
|
|
|
plot(f, pxx2, '-');
|
|
|
|
plot(f, N, 'k:', 'linewidth', 1);
|
|
|
|
hold off;
|
|
|
|
set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log');
|
|
|
|
xlim([1, 500]);
|
|
|
|
legend('$\Phi_{ss} (f)$','$\Phi_{nn} (f)$')
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:huddle_test_results
|
|
|
|
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
|
|
|
#+begin_src matlab :var filepath="figs/huddle_test_results.pdf" :var figsize="wide-tall" :post pdf2svg(file=*this*, ext="png")
|
|
|
|
<<plt-matlab>>
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+NAME: fig:huddle_test_results
|
|
|
|
#+CAPTION: Results of the Huddle test
|
|
|
|
#+RESULTS: fig:huddle_test_results
|
|
|
|
[[file:figs/huddle_test_results.png]]
|