Skip to content

Commit ddcaf40

Browse files
committed
AM demodulation documentation
1 parent e3528a9 commit ddcaf40

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

docs/how-it-works.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ samples and filter coefficients.
154154

155155
### AM demodulation
156156

157-
Previously I used a Hilbert filter to get the [analytic signal], then the
157+
Previously I used a Hilbert filter to get the [analytic signal], because the
158158
absolute value of the [analytic signal] is the modulated signal.
159159

160160
Then I found a very fast demodulator implemented on [pietern/apt137]. For each
@@ -163,8 +163,6 @@ carrier frequency:
163163

164164
![AM demodulation formula]({{ site.baseurl }}/images/demodulation.png)
165165

166-
Where theta is the AM carrier frequency divided by the sample rate.
167-
168166
I couldn't find the theory behind that method, looks similar to I/Q
169167
demodulation. I was able to reach that final expression (which is used by
170168
[pietern/apt137]) by hand and I wrote the steps on ``extra/demodulation.pdf``. I

extra/demodulation.pdf

-13 KB
Binary file not shown.

extra/demodulation.png

4.07 KB
Loading

extra/demodulation.tex

+35-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,44 @@
77
\begin{document}
88
\pagestyle{empty}
99

10+
Two samples of an AM signal with carrier frequency $\omega_c$.
11+
1012
\begin{align*}
1113
\begin{cases}
12-
x[0]=A\sin(\omega t_{0}+\alpha)\\
13-
x[1]=A\sin(\omega t_{1}+\alpha)
14+
x[0]=f(t_{0})\sin(\omega_c t_{0}+\alpha)\\
15+
x[1]=f(t_{1})\sin(\omega_c t_{1}+\alpha)
1416
\end{cases}
1517
\end{align*}
1618

17-
If $t_{0}=0$, then $\omega t_{0}=0$ and $\omega t_{1}=\alpha$
19+
If the samples were taken $\Delta t$ seconds apart, then the sampling frequency
20+
$f_s$ is $1/\Delta t$.
21+
22+
\begin{align*}
23+
\begin{cases}
24+
x[0]=f(t_{0})\sin(\omega_c t_{0}+\alpha)\\
25+
x[1]=f(t_{0}+\Delta t)\sin(\omega_c (t_{0}+\Delta t)+\alpha)
26+
\end{cases}
27+
\end{align*}
28+
29+
If $\Delta t$ is quite small, $f(t_0) = f(t_0 + \Delta t) = A$:
30+
31+
\begin{align*}
32+
\begin{cases}
33+
x[0]=A\sin(\omega_c t_{0}+\alpha)\\
34+
x[1]=A\sin(\omega_c (t_{0}+\Delta t)+\alpha)
35+
\end{cases}
36+
\end{align*}
37+
38+
If $t_0 = 0$:
39+
40+
\begin{align*}
41+
\begin{cases}
42+
x[0]=A\sin(\alpha)\\
43+
x[1]=A\sin(\omega_c \Delta t+\alpha)
44+
\end{cases}
45+
\end{align*}
46+
47+
We define $\phi$ as $\omega_c \Delta t = \omega_c / f_s = 2\pi f_c / f_s$.
1848

1949
\begin{align*}
2050
\begin{cases}
@@ -69,4 +99,6 @@
6999
y[i]=\frac{\sqrt{x[i]^{2}+x[i-1]^{2}-2x[i]x[i-1]\cos\phi}}{\sin\phi}
70100
\end{align*}
71101

102+
Where $\phi = 2\pi f_c / f_s$
103+
72104
\end{document}

0 commit comments

Comments
 (0)