Update Content - 2022-03-01
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
+++
|
||||
title = "Actuators"
|
||||
author = ["Thomas Dehaeze"]
|
||||
author = ["Dehaeze Thomas"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
@@ -17,19 +17,14 @@ Links to specific actuators:
|
||||
|
||||
For vibration isolation:
|
||||
|
||||
- In ([Ito and Schitter 2016](#orge96c061)), the effect of the actuator stiffness on the attainable vibration isolation is studied ([Notes]({{<relref "ito16_compar_class_high_precis_actuat.md#" >}}))
|
||||
- In <ito16_compar_class_high_precis_actuat>, the effect of the actuator stiffness on the attainable vibration isolation is studied ([Notes]({{<relref "ito16_compar_class_high_precis_actuat.md#" >}}))
|
||||
|
||||
|
||||
## Brush-less DC Motor {#brush-less-dc-motor}
|
||||
|
||||
- ([Yedamale 2003](#org9fa946a))
|
||||
- <yedamale03_brush_dc_bldc_motor_fundam>
|
||||
|
||||
<https://www.electricaltechnology.org/2016/05/bldc-brushless-dc-motor-construction-working-principle.html>
|
||||
|
||||
|
||||
|
||||
## Bibliography {#bibliography}
|
||||
|
||||
<a id="orge96c061"></a>Ito, Shingo, and Georg Schitter. 2016. “Comparison and Classification of High-Precision Actuators Based on Stiffness Influencing Vibration Isolation.” _IEEE/ASME Transactions on Mechatronics_ 21 (2):1169–78. <https://doi.org/10.1109/tmech.2015.2478658>.
|
||||
|
||||
<a id="org9fa946a"></a>Yedamale, Padmaraja. 2003. “Brushless Dc (BLDC) Motor Fundamentals.” _Microchip Technology Inc_ 20:3–15.
|
||||
## [Stepper Motor]({{<relref "stepper_motor.md#" >}}) {#stepper-motor--stepper-motor-dot-md}
|
||||
|
114
content/zettels/decimation.md
Normal file
114
content/zettels/decimation.md
Normal file
@@ -0,0 +1,114 @@
|
||||
+++
|
||||
title = "Decimation"
|
||||
author = ["Dehaeze Thomas"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
Tags
|
||||
: [Digital Signal Processing]({{< relref "digital_signal_processing.md" >}})
|
||||
|
||||
<div class="definition">
|
||||
|
||||
Decimation is the two-step process of low pass filtering followed by and operation known as downsampling.
|
||||
|
||||
</div>
|
||||
|
||||
We can downsample a sequence of sampled signal values by a factor of \\(M\\) by retaining every Mth sample and discarding all the remaining samples.
|
||||
Relative to the original sample rate \\(f\_{s,\text{old}}\\), the sample rate of the downsampled sequence is:
|
||||
|
||||
\begin{equation}
|
||||
f\_{s,\text{new}} = \frac{f\_{s,\text{old}}}{M}
|
||||
\end{equation}
|
||||
|
||||
<div class="exampl">
|
||||
|
||||
For example, assume that an analog sinewave has been sampled to produce \\(x\_{\text{old}}(n)\\).
|
||||
The downsampled sequence is:
|
||||
\\[ x\_{\text{new}}(m) = x\_{\text{old}}(Nm) \\]
|
||||
where \\(M=3\\), the result is shown in Figure [1](#figure--fig:decimation-example).
|
||||
|
||||
<a id="figure--fig:decimation-example"></a>
|
||||
|
||||
{{< figure src="/ox-hugo/decimation_example.png" caption="<span class=\"figure-number\">Figure 1: </span>Sample rate conversion: (a) original sequence; (b) downsampled by \\(M=3\\) sequence" >}}
|
||||
|
||||
</div>
|
||||
|
||||
The spectral implications of downsampling are what we should expect as shown in Figure
|
||||
|
||||
<a id="figure--fig:decimation-spectral-aliasing"></a>
|
||||
|
||||
{{< figure src="/ox-hugo/decimation_spectral_aliasing.png" caption="<span class=\"figure-number\">Figure 2: </span>Decimation by a factor of three: (a) spectrum of original \\(x\_{\text{old}}(n)\\) signal; (b) spectrum after downsampling by three." >}}
|
||||
|
||||
There is a limit to the amount of downsampling that can be performed relative to the bandwidth \\(B\\) of the original signal.
|
||||
We must ensure that \\(f\_{s,\text{new}} > 2B\\) to present overlapped spectral replications (aliasing errors) after downsampling.
|
||||
|
||||
If a decimation application requires \\(f\_{s,\text{new}}\\) to be less than \\(2B\\), then \\(x\_{\text{old}}(n)\\) must be low pass filtered before the downsampling process if performed.
|
||||
|
||||
|
||||
## Two Stage Decimation {#two-stage-decimation}
|
||||
|
||||
When the desired decimation factor \\(M\\) is larger, say \\(M > 20\\), there is an important feature of the filter / decimation process to keep in mind.
|
||||
Significant low pass filter computational savings may be obtained by implementing the two-stage decimation, shown in Figure [3](#figure--fig:decimation-two-stages) (b).
|
||||
|
||||
<a id="figure--fig:decimation-two-stages"></a>
|
||||
|
||||
{{< figure src="/ox-hugo/decimation_two_stages.png" caption="<span class=\"figure-number\">Figure 3: </span>Decimation: (a) single-stage; (b) two-stage" >}}
|
||||
|
||||
The question is: "Given a desired total downsampling factor \\(M\\), what should be the values of \\(M\_1\\) and \\(M\_2\\) to minimize the number of taps in low-pass filters \\(\text{LPF}\_1\\) and \\(\text{LPF}\_2\\)"?
|
||||
|
||||
For two stage decimation, the optimum value for \\(M\_1\\) is:
|
||||
|
||||
\begin{equation} \label{eq:M1opt}
|
||||
M\_{1,\text{opt}} \approx 2 M \cdot \frac{1 - \sqrt{MF/(2-F)}}{2 - F(M+1)}
|
||||
\end{equation}
|
||||
|
||||
where \\(F\\) is the ratio of single-stage low pass filter's transition region width to that filter's stop-band frequency:
|
||||
|
||||
\begin{equation}
|
||||
F = \frac{f\_{\text{stop}} - B^\prime}{f\_{\text{stop}}}
|
||||
\end{equation}
|
||||
|
||||
After using Eq. <eq:M1opt> to determine the optimum first downsampling factor, and setting \\(M\_1\\) equal to the integer sub-multiple of \\(M\\) that is closest to \\(M\_{1,\text{opt}}\\), the second downsampling factor is:
|
||||
|
||||
\begin{equation} \label{eq:M2\_from\_M1}
|
||||
M\_2 = \frac{M}{M\_1}
|
||||
\end{equation}
|
||||
|
||||
<div class="exampl">
|
||||
|
||||
Let's assume we have an \\(x\_{\text{old}}(n)\\) input signal arriving at a sample rate of \\(400\\,kHz\\), and we must decimate that signal by a factor of \\(M=100\\) to obtain a final sample rate of \\(4\\,kHz\\).
|
||||
Also, let's assume the base-band frequency range of interest is from \\(0\\) to \\(B^\prime = 1.8\\,kHz\\), and we want \\(60\\,dB\\) of filter stop-band attenuation.
|
||||
A single stage decimation low-pass filter's frequency response is shown in Figure [4](#figure--fig:decimation-two-stage-example) (a).
|
||||
The number of taps \\(N\\) required for a single-stage decimation would be:
|
||||
|
||||
\begin{equation}
|
||||
N = \frac{\text{Atten}}{22 (f\_{\text{stop}} - f\_{\text{pass}})} = \frac{60}{22(2.2/400 - 1.8/400)} = 2727
|
||||
\end{equation}
|
||||
|
||||
which is way too large for practical implementation.
|
||||
|
||||
To reduce the number of necessary filter taps, we can partition the decimation problem into two stages.
|
||||
With \\(M = 100\\), \\(F = (2200-1800)/2200\\), Eq. <eq:M1opt> yields \\(M\_{1,\text{opt}} = 26.4\\).
|
||||
The integer sub-multiple of 100 closest to \\(26.4\\) is \\(25\\), so we set \\(M\_1 = 25\\).
|
||||
Next, from Eq. <eq:M2_from_M1>, \\(M\_2 = 4\\) is found.
|
||||
|
||||
The first low pass filter has a pass-band cutoff frequency of \\(1.8\\,kHz\\) and its stop-band is \\(400/25 - 1.8 = 14.2\\,kHz\\) (Figure [4](#figure--fig:decimation-two-stage-example) (d)).
|
||||
The second low pass filter has a pass-band cutoff frequency of \\(1.8\\,kHz\\) and its stop-band is \\(4-1.8 = 2.2\\,kHz\\).
|
||||
The total number of required taps is:
|
||||
|
||||
\begin{equation}
|
||||
N\_{\text{total}} = N\_{\text{LPF}\_1} + N\_{\text{LPF}\_2} = \frac{60}{22(14.2/400-1.8/400)} + \frac{60}{22(2.2/16 - 1.8/16)} \approx 197
|
||||
\end{equation}
|
||||
|
||||
Which is much more efficient that the single stage decimation.
|
||||
|
||||
<a id="figure--fig:decimation-two-stage-example"></a>
|
||||
|
||||
{{< figure src="/ox-hugo/decimation_two_stage_example.png" caption="<span class=\"figure-number\">Figure 4: </span>Two stage decimation: (a) single-stage filter response; (b): decimation by 100; (c) spectrum of original signal; (d) output spectrum of the \\(M=25\\) down-sampler; (e) output spectrum of the \\(M=4\\) down-sampler." >}}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
## References: {#references}
|
||||
|
||||
<lyons11_under_digit_signal_proces>
|
@@ -1,18 +1,129 @@
|
||||
+++
|
||||
title = "Power Spectral Density"
|
||||
author = ["Thomas Dehaeze"]
|
||||
author = ["Dehaeze Thomas"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
Tags
|
||||
: [Signal to Noise Ratio]({{< relref "signal_to_noise_ratio" >}})
|
||||
: [Signal to Noise Ratio]({{<relref "signal_to_noise_ratio.md#" >}})
|
||||
|
||||
Tutorial about Power Spectral Density is accessible [here](https://research.tdehaeze.xyz/spectral-analysis/).
|
||||
|
||||
A good article about how to use the `pwelch` function with Matlab ([Schmid 2012](#org7c6692c)).
|
||||
A good article about how to use the `pwelch` function with Matlab <schmid12_how_to_use_fft_matlab>.
|
||||
|
||||
|
||||
## Parseval's Theorem - Linking the Frequency and Time domain {#parseval-s-theorem-linking-the-frequency-and-time-domain}
|
||||
|
||||
## Bibliography {#bibliography}
|
||||
For non-periodic finite duration signals, the energy in the time domain is described by:
|
||||
|
||||
<a id="org7c6692c"></a>Schmid, Hanspeter. 2012. “How to Use the FFT and Matlab’s Pwelch Function for Signal and Noise Simulations and Measurements.” _Institute of Microelectronics_.
|
||||
\begin{equation}
|
||||
\text{Energy} = \int\_{-\infty}^\infty x(t)^2 dt
|
||||
\end{equation}
|
||||
|
||||
Parseval's Theorem states that energy in the time domain equals energy in the frequency domain:
|
||||
|
||||
\begin{equation}
|
||||
\text{Energy} = \int\_{-\infty}^{\infty} x(t)^2 dt = \int\_{-\infty}^{\infty} |X(f)|^2 df
|
||||
\end{equation}
|
||||
|
||||
where \\(X(f)\\) is the Fourier transform of the time signal \\(x(t)\\):
|
||||
|
||||
\begin{equation}
|
||||
X(f) = \int\_{-\infty}^{\infty} x(t) e^{-2\pi j f t} dt
|
||||
\end{equation}
|
||||
|
||||
|
||||
## Power Spectral Density function (PSD) {#power-spectral-density-function--psd}
|
||||
|
||||
The power distribution over frequency of a time signal \\(x(t)\\) is described by the PSD denoted the \\(S\_x(f)\\).
|
||||
A PSD is a power density function with units \\([\text{SI}^2/Hz]\\), meaning that the area underneath the PSD curve equals the power (units \\([\text{SI}^2]\\)) of the signal (SI is the unit of the signal, e.g. \\(m/s\\)).
|
||||
|
||||
Using the definition of signal power \\(\bar{x^2}\\) and Parseval's theorem, we can link power in the time domain with power in the frequency domain:
|
||||
|
||||
\begin{equation}
|
||||
\text{power} = \lim\_{T \to \infty} \frac{1}{2T} \int\_{-T}^{T} x\_T(t)^2 dt = \lim\_{T \to \infty} \frac{1}{2T} \int\_{-\infty}^{\infty} |X\_T(f)|^2 df = \int\_{-\infty}^{\infty} \left( \lim\_{T \to \infty} \frac{|X\_T(f)|^2}{2T} \right) df
|
||||
\end{equation}
|
||||
|
||||
where \\(X\_T(f)\\) denotes the Fourier transform of \\(x\_T(t)\\), which equals \\(x(t)\\) on the interval \\(-T \le t \le T\\) and is zero outside this interval.
|
||||
|
||||
This term is referred to as the two-sided spectral density:
|
||||
|
||||
\begin{equation}
|
||||
S\_{x,two} (f) = \lim\_{T \to \infty} \frac{|X\_T(f)|^2}{2T}, \quad -\infty \le f \le \infty
|
||||
\end{equation}
|
||||
|
||||
In practice, the **one sided PSD** is used, which is only defined on the positive frequency axis but also contains all the power.
|
||||
It is defined as:
|
||||
|
||||
\begin{equation}
|
||||
S\_{x}(f) = \lim\_{T \to \infty} \frac{|X\_T(f)|^2}{T}, \quad 0 \le f \le \infty
|
||||
\end{equation}
|
||||
|
||||
For discrete time signals, the one-sided PSD estimate is defined as:
|
||||
|
||||
\begin{equation}
|
||||
\hat{S}(f\_k) = \frac{|X\_L(f\_k)|^2}{L T\_s}
|
||||
\end{equation}
|
||||
|
||||
where \\(L\\) equals the number of time samples and \\(T\_s\\) the sample time, \\(X\_L(f\_k)\\) is the N-point discrete Fourier Transform of the discrete time signal \\(x\_L[n]\\) containing \\(L\\) samples:
|
||||
|
||||
\begin{equation}
|
||||
X\_L(f\_k) = \sum\_{n = 0}^{N-1} x\_L[n] e^{-j 2 \pi k n/N}
|
||||
\end{equation}
|
||||
|
||||
|
||||
## Matlab Code for computing the PSD and CPS {#matlab-code-for-computing-the-psd-and-cps}
|
||||
|
||||
Let's compute the PSD of a signal by "hand".
|
||||
The signal is defined below.
|
||||
|
||||
```matlab
|
||||
%% Signal generation
|
||||
T_s = 1e-3; % Sampling Time [s]
|
||||
t = T_s:T_s:100; % Time vector [s]
|
||||
L = length(t);
|
||||
|
||||
x = lsim(1/(1 + s/2/pi/5), randn(1, L), t);
|
||||
```
|
||||
|
||||
The computation is performed using the `fft` function.
|
||||
|
||||
```matlab
|
||||
%% Parameters
|
||||
T_r = L*T_s; % signal time range
|
||||
d_f = 1/T_r; % width of frequency grid
|
||||
F_s = 1/T_s; % sample frequency
|
||||
F_n = F_s/2; % Nyquist frequency
|
||||
F = [0:d_f:F_n]; % one sided frequency grid
|
||||
|
||||
% Discrete Time Fourier Transform Wxx
|
||||
Wxx = fft(x - mean(x))/L;
|
||||
|
||||
% Two-sided Power Spectrum Pxx [SI^2]
|
||||
Pxx = Wxx.*conj(Wxx);
|
||||
|
||||
% Two-sided Power Spectral Density Sxx_t [SI^2/Hz]
|
||||
Sxx_t = Pxx/d_f;
|
||||
|
||||
% One-sided Power Spectral Density Sxx_o [SI^2/Hz] defined on F
|
||||
Sxx_o = 2*Sxx_t(1:L/2+1);
|
||||
```
|
||||
|
||||
The result is shown in Figure [1](#org41c99c6).
|
||||
|
||||
<a id="org41c99c6"></a>
|
||||
|
||||
{{< figure src="/ox-hugo/psd_manual_example.png" caption="Figure 1: Amplitude Spectral Density with manual computation" >}}
|
||||
|
||||
This can also be done using the `pwelch` function which integrated a "window" that permits to do some averaging.
|
||||
|
||||
```matlab
|
||||
%% Computation using pwelch function
|
||||
[pxx, f] = pwelch(x, hanning(ceil(5/T_s)), [], [], 1/T_s);
|
||||
```
|
||||
|
||||
The comparison of the two method is shown in Figure [2](#orge7a31a8).
|
||||
|
||||
<a id="orge7a31a8"></a>
|
||||
|
||||
{{< figure src="/ox-hugo/psd_comp_pwelch_manual_example.png" caption="Figure 2: Amplitude Spectral Density with manual computation" >}}
|
||||
|
19
content/zettels/stepper_motor.md
Normal file
19
content/zettels/stepper_motor.md
Normal file
@@ -0,0 +1,19 @@
|
||||
+++
|
||||
title = "Stepper Motor"
|
||||
author = ["Dehaeze Thomas"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
Tags
|
||||
:
|
||||
|
||||
|
||||
## 2 phase VS 5 phase stepper motor {#2-phase-vs-5-phase-stepper-motor}
|
||||
|
||||
<https://www.orientalmotor.com/stepper-motors/technology/2-phase-vs-5-phase-stepper-motors.html>
|
||||
|
||||
|
||||
## Errors {#errors}
|
||||
|
||||
For a two phase stepper motor, there are (typically) 200 steps per revolution.
|
||||
Errors with a period of 200 period/revolution can be expected.
|
Reference in New Issue
Block a user