-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIQ_variables.html
More file actions
232 lines (192 loc) · 8.77 KB
/
Copy pathIQ_variables.html
File metadata and controls
232 lines (192 loc) · 8.77 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset="utf-8"/>
<link rel='stylesheet' href='main.css'></link>
<script src="MathJax/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "all"} } });
</script>
<title>SDR IQ</title>
</head>
<body>
<h5><a href="index.html">table of contents</a></h5>
<h1>IQ variables</h1>
<p>
Warning: variable names in this may not be standard. I don't have
access to what the standard is. I don't even know if there is a
standard. It seems to vary in all the references I have access to.
Show me what you'd call a standard, and I'll tell you how it's not
self consistent. Nevertheless, I needed to define a standard for
myself. Here it is.
</p>
<p>
At some point in a circuit in that is feeding our SDR (software define
radio) we say there is a electric potential that varies continuously
with time. This point is somewhere between an AtoD (analog to
digital) (DtoA for tx) converter and an antenna. We'll call this
electric potential the "wave signal". If the power flow in this
circuit at this point is toward the antenna than we have a transmitter
(tx), and if the power in this circuit at this point is away from
the antenna than we have a receiver (rx). We call this electric
potential the wave signal. Following most engineering conventions we
drop the part of the model that this is an electric potential, and
consider it to be just a real number that varies in time, without
units. We consider it to be some kind of abstract signal wave form,
signal for short. We need this signal, which is just a function of
time, \(t\), (with no physical units), in order to define what
\(I(t)\) and \(Q(t)\) are.
</p>
<p>
Here we present an attempt to define \(I\) and \(Q\) in terms of a
predefined wave signal. In doing this we decide on some sign and
phase conventions as to how the signal wave is defined, that are
otherwise arbitrary. We don't have access to standards that
would clear up this arbitrariness, so we just make it up here.
</p>
<p>
We define a continuous signal \(x(t)\) with
$$x(t) = A(t) \cos(2 \pi f t + \phi(t)) \label{x}$$
where \(A(t)\) we call the amplitude as a function of time, \(t\), the
constant \(f\) we call the carrier frequency, and \(\phi(t)\) we call
the applied phase shift as a function of time, \(t\).
Note that in the case where the signal is just a single tone \(A(t)\)
would be a nonzero constant and \(\phi(t)\) could be any finite
constant.
</p>
<p>
The choose of the phase dependence of the signal seems arbitrary. We
could have picked the case that when the value of \(x(t)\), in
\ref{x}, with \(\phi(t) \to 0\), we have a sine wave, a cosine wave,
or in general a sinusoidal that is phase shifted by any constant.
Convention clearly shows that it is a cosine function, and hence
\(I(t)\) is "in-phase" with it, as they say; as we will see below.
</p>
<p>
There is also the question of whither of we should have \(+ \phi(t)\)
or have that replaced by \(- \phi(t)\). The references that I have
found do not make clear argument as to which is more common.
I may have to change this in the future.
</p>
<p>
It's important to note that the form of this function, in a sense,
defines what a "carrier wave" is, the \(A(t)\) and \(\phi(t)\) are
unspecified so \(x(t)\) can be any function of time, \(t\), not just
something close to a sine wave. In most applications it is close to a
simple sinusoidal wave. Later we will combine many signal waves each
with a different carrier frequency, \(f\).
</p>
<p>
For now we start with just one "signal", by definition, if you will.
From there will derive an ODE (ordinary differential equation) and
generalize this ODE; to add ideas like noise to the signal, for
example. Giving this kinematic form, \ref{x}, for the model of a
wave signal limits what we can do. This ODE model, that we refer to,
could be thought of as a reduction from solving Maxwell's equations,
but we, in a sense, will just imperially derive these ODEs. More on
that later.
</p>
<p>
We make a change of dynamical variables from \(A(t)\) and \(\phi(t)\)
to new dynamical variables \(I(t)\) and \(Q(t)\) defined by
$$x(t) =
I(t) \cos(2 \pi f t) + Q(t) \sin(2 \pi f t) \label{IQ} .$$
It's important to note this is a time dependent change of variables.
Convention says that \(I(t) \cos(2 \pi t)\) is called the in-phase
part of the signal, and \(Q(t) \sin(2 \pi f t)\) is the out-of-phase
part of the signal. That makes sense given that with \(Q\) and
\(\phi\) both set to \(0\), and \(I\) held constant the signal is \(I
\cos(2 \pi f t)\) where \(I\) is \(A\). I'm pretty sure this,
equation \ref{IQ}, is standard. The alternative is \(x(t) = I(t)
\cos(2 \pi f t) - Q(t) \sin(2 \pi f t)\). I have never seen it
expressed that way.
</p>
<p>
Euler's formula is
$$e^{i \theta} = \cos(\theta) + i \sin(\theta) \label{e}$$
where \(e\) is Euler's number, \(i\) is \(\sqrt{-1}\), and
\(\theta\) is any complex number.
With \ref{e} and
$$e^{i (x + y)} = e^{i x} e^{i y}$$
we get
$$\cos(x + y) + i \sin(x + y) = \cos(x) \cos(y) - \sin(x) \sin(y) +
i \left[\cos(x) \sin(y) + \sin(x) \cos(y) \right] \label{ee}$$
where \(x\) and \(y\) are any real numbers.
The imaginary and real parts of \ref{ee} give the two trig
identity equations
$$\sin(x + y) = \cos(x) \sin(y) + \sin(x) \cos(y) \label{sinsum}$$
and
$$\cos(x + y) = \cos(x) \cos(y) - \sin(x) \sin(y) .\label{cossum}$$
</p>
<p>
Using \ref{cossum}, with \(x \to \phi(t)\) and \(y \to 2 \pi f t\)
we can rewrite \ref{x} as
$$x(t) =
A(t) \cos(\phi(t)) \cos(2 \pi f t) -
A(t) \sin(\phi(t)) \sin(2 \pi f t) . \label{IQsum}$$
By comparing \ref{IQ} and \ref{IQsum} we see that we can also define
\(I(t)\) and \(Q(t)\) by
$$I(t) = A(t) \cos(\phi(t)) \label{IQ_I} $$
and
$$Q(t) = - A(t) \sin(\phi(t)) . \label{IQ_Q}$$
</p>
<p>
We can define carrier phase \(\theta(t)\) by
$$\theta(t) \equiv 2 \pi f t . $$
Now we see that \(I\) and \(Q\) are independent of the carrier phase,
\(\theta\). By using \(I\) and \(Q\) as
our dynamical variables we do not concern our selves with the
signal "carrier". To get our original signal \(x(t)\) back
from, this magical change of variables, \(I(t)\) and \(Q(t)\)
we need the carrier frequency.
</p>
<p>
Note: if we are not given the carrier frequency, \(f\), and are just
given \(I(t)\) and \(Q(t)\) as a function of \(t\) we can say we still
have the signal, but with no signal carrier. It's like removing the
carrier from the signal.
</p>
<p>
Summing the squares of equations \ref{IQ_Q} and \ref{IQ_I}, and given
the Pythagorean trigonometric identity
$$1 = \cos^{2}(x) + \sin^{2}(x)$$
we can show that
$$A^{2}(t) = I^{2}(t) + Q^{2}(t) .$$
Dividing equations \ref{IQ_Q} and \ref{IQ_I}, and given the
trigonometric relation
$$\tan(x) = \frac{\sin(x)}{\cos(x)}$$
we can show that
$$\tan(\phi(t)) = - \frac{Q(t)}{I(t)} \label{tanIQ}.$$
</p>
<h3>External References</h3>
<ul>
<li>
<a href="https://en.wikipedia.org/wiki/In-phase_and_quadrature_components"
>wikipedia IQ</a> As of 2024, Jan 16, they are using the
same phase and sign conventions in signal and IQ definitions
that I use here. Had I seen this before I started writing
this, I may not have written this page. I did not write the
wikipedia page myself because I do not consider myself an
authority. The point of writing this page was for my own
reference.
</li>
<li><a
href="https://www.youtube.com/playlist?list=PLu0BPYzTjiHru1KmPThmbY-8rRm3EWvUQ"
>Software Defined Radio with HackRF by Michael Ossmann</a>
</li>
<li><a href="https://pysdr.org/content/sampling.html">A Guide to
SDR and DSP using Python</a>
</li>
<li>YouTube video lecture: <a
href="https://www.youtube.com/watch?v=h_7d-m1ehoY">Basics
of IQ Signals and IQ modulation & demodulation - A
tutorial</a>
</li>
<li>Science Direct: <a
href="https://www.sciencedirect.com/topics/engineering/carrier-phase"
>carrier-phase</a>
</li>
</ul>
<h5><a href="index.html">table of contents</a></h5>
</body>
</html>