Upload
truongkhanh
View
226
Download
2
Embed Size (px)
Citation preview
Analog/Digital Communications Primerfor Amateur Radio
Joseph D. Gaeddert
Virginia Polytechnic Institute & State University
March 19, 2013
Joseph D. Gaeddert Analog/Digital Communications Primer
# include <liquid / liquid.h>
// ...
int main() {
float kf = 0.1f; // modulation factor
liquid_freqdem_type type = LIQUID_FREQDEM_DELAYCONJ;
// create modulator/demodulator objects
freqmod fmod = freqmod_create(kf);
freqdem fdem = freqdem_create(kf, type);
float m; // input message
float complex s; // modulated signal
float y; // output/demodulated message
// repeat as necessary
{
// modulate signal
freqmod_modulate(fmod, m, &s);
// demodulate signal
freqdem_demodulate(fdem, s, &y);
}
// clean up objects
freqmod_destroy(fmod);
freqdem_destroy(fdem);
}
Joseph D. Gaeddert Analog/Digital Communications Primer
introduction
I about your presenter
I what we all should get from this presentation
I brief introduction to analog communications (AM/FM)
I brief introduction to digital communications
I software-defined radio
I why I joined in amateur radio
Joseph D. Gaeddert Analog/Digital Communications Primer
fourier transformdefinition
Time domainx(t)
FrequencydomainX (f )
X (f ) =∞∫−∞
x(t)e−j2πftdt
x(t) =∞∫−∞
X (f )e j2πftdf
I We can think of the Fourier Transform and the Inverse FourierTransform as the means for moving between the time andfrequency domains
I Note that no information is lost in the transformationI Both are equivalent representations of a signal
Joseph D. Gaeddert Analog/Digital Communications Primer
fourier transformexample: cos(2πf0t)
t
g(t)
f
G(f )
12δ(f + f0)
12δ(f + f0)
g(t) = cos(2πf0t) ⇔ G (f ) =1
2δ(f + f0) +
1
2δ(f − f0)
Notes: g(t) has even symmetry ∴ G (f ) is purely real.
Joseph D. Gaeddert Analog/Digital Communications Primer
analog communicationsintro to modulation
I In general time-varying modulation of a sinusoid can bewritten as
s(t) = A(t) cos(
2πfct + θ(t))
I fc is the nominal carrier frequencyI A(t) is the time-varying amplitudeI θ(t) is the time-varying phase
t
s(t), unmodulated carrier
Joseph D. Gaeddert Analog/Digital Communications Primer
amplitude modulationspectrum of double side-band transmitted carrier AM
t
m(t)
t
1 + kam(t)
t
s(t) = [1 + kam(t)] cos(2πfc t)
f
M(f )
f
δ(f ) + kaM(f )
f
S(f )
−fc fc
Joseph D. Gaeddert Analog/Digital Communications Primer
amplitude modulationspectrum of double side-band transmitted carrier AM
t
m(t)
t
1 + kam(t)
t
s(t) = [1 + kam(t)] cos(2πfc t)
f
M(f )
f
δ(f ) + kaM(f )
f
S(f )
−fc fc
Joseph D. Gaeddert Analog/Digital Communications Primer
amplitude modulationspectrum of double side-band transmitted carrier AM
t
m(t)
t
1 + kam(t)
t
s(t) = [1 + kam(t)] cos(2πfc t)
f
M(f )
f
δ(f ) + kaM(f )
f
S(f )
−fc fc
Joseph D. Gaeddert Analog/Digital Communications Primer
amplitude modulationdouble side-band transmitted carrier AM
t
m(t), message signal
t
s(t) = Ac [1 + kam(t)] cos(2πfc t)
f
S(f )
−fc fc
Joseph D. Gaeddert Analog/Digital Communications Primer
amplitude modulationdouble side-band suppressed carrier AM
t
m(t), message signal
t
s(t) = Acm(t) cos(2πfc t)
f
S(f ) = Ac2M(f + fc ) +
Ac2M(f − fc )
−fc fc
Joseph D. Gaeddert Analog/Digital Communications Primer
amplitude modulationsingle side-band AM
f
M(f ), message signal
f
S(f ), modulated messageBPF
−fc fc
f
S(f ), single side-band
−fc fc
Joseph D. Gaeddert Analog/Digital Communications Primer
frequency modulationintroduction
We can transmit information m(t) by varying the angle θi (t) of acarrier
Phase Modulation (PM)The phase of the carrier is varied
linearly with m(t)
θi (t) = 2πfct + kpm(t)
s(t) = Ac cos(2πfct + kpm(t))
Frequency Modulation (FM)The frequency of the carrier is varied linearly
with m(t)
fi (t) = fc + kfm(t)
θi (t) = 2πfct + 2πkf
t∫0
m(τ)dτ
s(t) = Ac cos
2πfct + 2πkf
t∫0
m(τ)dτ
Joseph D. Gaeddert Analog/Digital Communications Primer
frequency modulationamplitude vs. frequency modulation
t
m(t), message signal
t
s(t), DSB AM
t
s(t), FM
Joseph D. Gaeddert Analog/Digital Communications Primer
band-pass digitalbinary band-pass modulation
Three forms of signaling...
0 0 1 1 0 1 1 0 0 1Input Data
t
Amplitude-shift keying
t
Phase-shiftkeying
t
Frequency-shift keying
Joseph D. Gaeddert Analog/Digital Communications Primer
band-pass digitalM = 4 (2-bit) band-pass modulation
Extend binary to include more data...
00 01 11 10 01 01 11 10 00 11Input Data
t
Amplitude-shift keying
t
Phase-shiftkeying
t
Frequency-shift keying
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulationM-ary amplitude-shift keying (ASK)
00 01 11 10 01 01 11 10 00 11Input Data
t
t
Amplitude-shift keying
s(t) =
0 symbol 00
0.4 · Ac sin (2πfct) symbol 01
0.8 · Ac sin (2πfct) symbol 10
1.2 · Ac sin (2πfct) symbol 11
I Similar to on-off keying
I Spectrum contains a linecomponent at f = fc
I Does not need coherent detector
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation2-level amplitude-shift keying (2-ASK)
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation4-level amplitude-shift keying (4-ASK)
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulationM-ary phase-shift keying (PSK)
00 01 11 10 01 01 11 10 00 11Input Data
t
t
Phase-shiftkeying
s(t) =
+Ac sin (2πfct) symbol 00
+Ac cos (2πfct) symbol 01
−Ac sin (2πfct) symbol 10
−Ac cos (2πfct) symbol 11
I Similar to analog QAM
I Spectrum contains no linecomponents
I Does need coherent detector
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulationM-ary phase-shift keying (PSK)
I In general, M-ary PSK signals can be written as
s(t) =
√2
Tscos(2πfct + θm)
where
θm =2π
M(m − 1) m = 0, 1, 2, · · · ,M − 1
real
imag
01 M = 2
real
imag
0001
10
11
M = 4
real
imag
000001
010
011
100101
110 111
M = 8
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation2-level phase-shift keying (2-PSK)
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation4-level phase-shift keying (4-PSK)
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulationM-ary quadrature amplitude modulation (M-QAM)
I In general we may arbitrarily modulate both amplitude and phase:
s(t) = am
√2
Tscos(2πfct) + bm
√2
Tssin(2πfct) 0 ≤ t < Ts
I
Q
0000
0001
0011
0010
0100
0101
0111
0110
1100
1101
1111
1110
1000
1001
1011
1010
16-QAM
I
Q 64-QAM
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation64 quadrature amplitude modulation (64-QAM)
I
Q
000000
000001
000010
000011
000110
000101
000110
000111
001000
001001
001010
001011
001110
001101
001110
001111
010000
010001
010010
010011
010110
010101
010110
010111
011000
011001
011010
011011
011110
011101
011110
011111
110000
110001
110010
110011
110110
110101
110110
110111
101000
101001
101010
101011
101110
101101
101110
101111
110000
110001
110010
110011
110110
110101
110110
110111
111000
111001
111010
111011
111110
111101
111110
111111
64-QAM
Joseph D. Gaeddert Analog/Digital Communications Primer
Digital Communications16-QAM, High SNR
16-QAM
Qu
ad
ratu
re
In-phase
I In-phase (cosine), quadrature(sine)
I Each of 16 symbols represents 4unique bit sequences (16 = 24)
I High ratio of signal energy tonoise energy (SNR)
I Low probability of error (good!)
Joseph D. Gaeddert Analog/Digital Communications Primer
Digital Communications16-QAM, Low SNR
16-QAM
Qu
ad
ratu
re
In-phase
I SNR degrades
I Received sample points notconfined to within their bins
I Probability of error increases(bad!)
Joseph D. Gaeddert Analog/Digital Communications Primer
Digital CommunicationsQPSK, Low SNR
QPSK
Qu
ad
ratu
re
In-phase
I Fall back to lower modulationscheme
I Each of 4 symbols representsonly 2 unique bit sequences(4 = 22)
I Probability of error againreduced
I ...but at the expense of lowerdata rate
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulationM-ary frequency-shift keying (FSK)
00 01 11 10 01 01 11 10 00 11Input Data
t
t
Frequency-shift keying
s(t) =
Ac cos (2πf0t) symbol 00
Ac cos (2πf1t) symbol 01
Ac cos (2πf2t) symbol 10
Ac cos (2πf3t) symbol 11
I Similar to analog FM
I Spectrum contains linecomponents at f = f0, f1, f2, f3
I Unlike ASK and PSK, FSKincreases bandwidth
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation2-level frequency-shift keying (2-FSK)
Joseph D. Gaeddert Analog/Digital Communications Primer
M-ary level modulation4-level frequency-shift keying (4-FSK)
Joseph D. Gaeddert Analog/Digital Communications Primer
software-defined radioswhat is SDR?
traditional radio designsoftware radio design
float mod_index = 0.1f; // modulation index
int sc = 1; // suppress carrier?
liquid_modem_amtype type = LIQUID_MODEM_AM_DSB;
// create/initialize automatic gain control
agc_rrrf agc = agc_rrrf_create();
// create AM demodulator object
ampmodem demod = ampmodem_create(mod_index,type,sc);
// run demodulator
while (devices.rf.data_availble()) {
// pull input sample and apply gain control
agc_rrrf_execute(agc, devices.rf.data(), &y);
// demodulate signal
float y;
ampmodem_demodulate(demod, x, &y);
// push demodulated output to sound out device
devices.sound.push(y);
}
// destroy objects
agc_crcf_destroy(agc);
ampmodem_destroy(demod);
Joseph D. Gaeddert Analog/Digital Communications Primer
software-defined radiosarbitrary linear constellations
-1.5
-1
-0.5
0
0.5
1
1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Q
I
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
-1.5
-1
-0.5
0
0.5
1
1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Q
I
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111
-1.5
-1
-0.5
0
0.5
1
1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Q
I
000000
000001
000010
000011
000100
000101
000110
000111
001000
001001
001010
001011
001100
001101
001110
001111
010000
010001
010010
010011
010100
010101
010110
010111
011000
011001
011010
011011
011100
011101
011110
011111
100000
100001
100010
100011
100100
100101
100110
100111
101000
101001
101010
101011
101100
101101
101110
101111
110000
110001
110010
110011
110100
110101
110110
110111
111000
111001
111010
111011
111100
111101
111110
111111
-1.5
-1
-0.5
0
0.5
1
1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Q
I
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Q
I
0 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
28293031
32
33
34
35
36
37383940
41
42
43
44
45
4647484950
51
52
53
54
55
56
57
58
59
60
61
62
63
-1.5
-1
-0.5
0
0.5
1
1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Q
I
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Joseph D. Gaeddert Analog/Digital Communications Primer
numerically-controlled oscillatorphase-locked loop
-1
0
1
0 50 100 150 200 250 300 350 400
real
Sample Index
inputnco
-1
0
1
0 50 100 150 200 250 300 350 400
imag
Sample Index
inputnco
-3
-2
-1
0
1
2
3
0 50 100 150 200 250 300 350 400
phase e
rror
[radia
ns]
Sample Index
# include <liquid / liquid.h>
//...
int main() {
// create tx/rx nco objects
nco_crcf nco_tx = nco_crcf_create(LIQUID_VCO);
nco_crcf nco_rx = nco_crcf_create(LIQUID_VCO);
// ... initialize objects ...
float complex * x;
unsigned int i;
// loop as necessary
{
// generate complex sinusoid
nco_crcf_cexpf(nco_tx, &x[i]);
// compute phase error
float dphi = nco_crcf_get_phase(nco_tx) -
nco_crcf_get_phase(nco_rx);
// update pll and nco objects
nco_crcf_pll_step(nco_rx, dphi);
nco_crcf_step(nco_tx);
nco_crcf_step(nco_rx);
}
// destry nco object
nco_crcf_destroy(nco_tx);
nco_crcf_destroy(nco_rx);
}
Joseph D. Gaeddert Analog/Digital Communications Primer
arbitrary filter designrecursive/non-recursive
-100
-80
-60
-40
-20
0
20
-0.4 -0.2 0 0.2 0.4
Pow
er S
pect
ral D
ensi
ty [d
B]
Normalized Frequency
-80
-70
-60
-50
-40
-30
-20
-10
0
0 0.1 0.2 0.3 0.4 0.5
Pow
er S
pect
ral D
ensi
ty [d
B]
Normalized Frequency
-120
-100
-80
-60
-40
-20
0
20
0 0.1 0.2 0.3 0.4 0.5
Pow
er
Spectr
al D
ensity [dB
]
-0.4
-0.2
0
0.2
0 0.0625 0.125
Normalized Frequency, ω/2π
G(ω)H(ω)
I arbitrary non-recursive filterdesign (Parks-McClellan)
I improved square-root Nyquistfilters
I recursive filter design:Butterworth, Chebyshev-I/II,elliptic, Bessel
Joseph D. Gaeddert Analog/Digital Communications Primer
high-level communications structuresmulticarrier: OFDM (ofdmflexframe)
time
S0 S0
...
S1 H0 H1
...
P0 P1
...
P(n-1)
header payload
frequency
−Fs 0 Fs
pilot subcarrierspectral nullguard band
I fully configurable (like with flexframe structure)
I additionally configurable subcarrier allocation
I capable of notching spectrum
Joseph D. Gaeddert Analog/Digital Communications Primer
high-level communications structuresmulticarrier: OFDM (ofdmflexframe), actual transmission
Joseph D. Gaeddert Analog/Digital Communications Primer
high-level communications structuresmulticarrier: OFDM (ofdmflexframe), actual reception
Joseph D. Gaeddert Analog/Digital Communications Primer
ResourcesJoseph D. Gaeddert
I email: [email protected]
I website: http://ganymede.ece.vt.edu
I project: http://github.com/jgaeddert/liquid-dsp
Joseph D. Gaeddert Analog/Digital Communications Primer