aboutsummaryrefslogtreecommitdiffstats
path: root/doc/thesis/figures/tikz/qam-modulator.tex
blob: a55ff29c1ff5d6b46b8e7ffcb47dce702360992e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
% vim: set ts=2 sw=2 noet:

\begin{circuitikz}[
	]
	\matrix [
		row sep = 5mm, column sep = 7mm,
		nodes = {
			align = center,
			fill = white,
		},
	] {
		& \coordinate (vmi);
			& \node[twoportshape] (B2Li) {};
			&
			& \coordinate (mi);
			&
			& \node[mixer] (Mi) {};
			& \coordinate (si);
			\\
		\node[] (M) {\(m(n)\)};
			& \node[twoportshape] (BSp) {};
			&
			&
			& \node[twoportshape] (H) {};
			& \node[oscillator] (OSC) {};
			& \coordinate (phii);
			& \node[adder] (SUM) {};
			& \node (S) {\(s(t)\)};
			\\
		&&&& \coordinate (phiq);
			\\[-3mm]
		& \coordinate (vmq);
			& \node[twoportshape] (B2Lq) {};
			& \coordinate (mq);
			& \node[mixer] (Mq) {};
			&
			&
			& \coordinate (sq);
			\\
	};

	% Add missing lables
	\node at (H.center) {\large \(\mathcal{H}\)};
	\node at (B2Li.center) {\textsf{B2L}};
	\node at (B2Lq.center) {\textsf{B2L}};
	\node at (BSp) {\textsf{BSp}};

	% Add connections
	\begin{scope}[thick, -latex]
		\draw (M) -- (BSp.west);

		\draw (BSp.north) |- (B2Li.west);
		\draw (B2Li.east) -- (Mi.west);
		\draw (Mi.east) -| (SUM.north);

		\draw (BSp.south) |- (B2Lq.west);
		\draw (B2Lq.east) -- (Mq.west);
		\draw (Mq.east) -| (SUM.south);

		\draw (SUM.east) -- (S);

		\draw (OSC.east) -| (Mi.south);
		\draw (OSC.west) -- (H.east);
		\draw (H.south) -- (Mq.north);
	\end{scope}

	% Add signal labels
	\node[above right] at (vmi) {\(\vec{m}_i\)};
	\node[below right] at (vmq) {\(\vec{m}_q\)};

	\node[above] at (mi) {\(m_i(t)\)};
	\node[below] at (mq) {\(m_q(t)\)};

	\node[above right] at (phii) {\(\phi_i\)};
	\node[right, yshift = 1mm] at (phiq) {\(\phi_q\)};

	\node[above left] at (si) {\(s_i(t)\)};
	\node[below left] at (sq) {\(s_q(t)\)};

	% Draw digital signals
	\begin{scope}[font = \ttfamily\footnotesize, text = blue!70!white]
		\node[above = 1mm of M, xshift = 2mm] {\(\ldots 1100101\)};
		\node[above = 7mm of vmi, xshift = 3mm]
			{\(\overbracket[.8pt]{\,11\ldots 00\,}^{\sqrt{M} \text{ bits}}\)};
	\end{scope}

	% Draw analog waveform
	\begin{scope}[font = \ttfamily\tiny]
		\coordinate (O) at ($(mi)+(-2mm,10.5mm)$);

		\node[left, red!70!white, anchor = east, text width = 8mm, align = right]
			at ($(O) + (-2mm,0)$) {\(2^{\sqrt{M}}\) levels};

		\foreach \y in {-3mm,0,3mm} {
			\draw[gray, densely dotted] (O) ++(-2mm,\y) -- ++(22mm,0);
		}

		\draw[thick, draw = red!70!white] (O)
			-- ++(3mm,0) -- ++(0,-3mm) -- ++(3mm,0) -- ++(0,6mm)
			-- ++(3mm,0) -- ++(0,-3mm) -- ++(3mm,0) -- ++(0,-3mm)
			-- ++(3mm,0) -- ++(0,3mm)  -- ++(3mm,0);
	\end{scope}

	% Draw constellation diagram
	\begin{scope}
		\coordinate (O) at ($(S)+(-7mm,8mm)$);
		\draw[gray, -latex] (O) ++(-2mm,0) -- ++(12mm,0) node[right] {\tiny \(\phi_i\)};
		\draw[gray, -latex] (O) ++(0,-2mm) -- ++(0,12mm) node[above] {\tiny \(\phi_q\)};

		\node[
			circle, thick,
			minimum size = 3pt,
			inner sep = 0, outer sep = .8pt,
			draw = gray, fill = red!50!white
		] (P) at ($(O)+(5mm, 4mm)$) {};

		\node[gray, above right] at (P) {\tiny \(s\)};

		\draw[gray, densely dotted]
			(P) -- (P |- O)
			(P) -- (P -| O);
	\end{scope}


	% Background elements
	\begin{pgfonlayer}{background}
		\fill[left color = white, right color = blue!20, draw = white]
			($(B2Li.north) + (0,1.1)$) coordinate (D) rectangle ($(B2Lq.south) - (3,1)$);
		\fill[right color = white, left color = red!20, draw = white]
			($(B2Li.north) + (0,1.1)$) coordinate (A) rectangle ($(B2Lq.south) + (9,-1)$);

		\node[blue!50, anchor = south east, font = \ttfamily\bfseries, xshift = -4mm]
			at (D) {\bfseries\ttfamily Digital bits};
		\node[red!50, anchor = south west, font = \bfseries\ttfamily, xshift = 4mm]
			at (A) {Analog waveform};
	\end{pgfonlayer}
\end{circuitikz}