Ham Friendly Digital Signal Processing (DSP) using GNU

Download Report

Transcript Ham Friendly Digital Signal Processing (DSP) using GNU

Ham Friendly Digital Signal
Processing (DSP) using GNU Radio
Companion (GRC)
John Petrich, W7FU
[email protected]
ARRL / TAPR DCC
September 6, 2014
Audience Survey
●
●
How many are familiar with
Digital Signal Processing (DSP)?
How many are familiar with
GNU Radio Companion (GRC)?
Why Should I Learn More about
DSP?
●
●
The 'radio' in “SDR” is the DSP software
DSP is that part of the SDR that the home
experimenter can build
–
Contemporary SDR 'front ends' are very
challenging for the home experimenter to
build – miniaturized surface mount
components and multilayer PCB's
How can I develop my own DSP
applications?
'Ham Friendly' DSP
●
●
●
DSP software authoring is within
reach of any curious ham
Innovative and accessible graphical
DSP software: GRC, MATLAB,
LabView
'Beginner friendly' DSP text books,
on-line tutorials and support
GNU Radio DSP Library
GNU Radio is an Open Source DSP
library written in C++ to maximize
computation speed and efficiency, with
a Python shell
GNU Radio Companion (GRC)
GNU Radio Companion (GRC) is the
graphical user overlay on top of GNU
Radio. GRC permits visualization and
manipulation of the DSP functions (aka.
algorithms) without learning a
programming language
GNU Radio Companion (GRC)
GRC is designed for hands on, trial and
error experimentation with DSP.
Make a mistake? Change an
algorithm or a parameter in real time.
Adjust parameters while operating the
GRC DSP–enabled SDR
GRC Demonstration
●
Main screen, work space, DSP library
●
Move and link DSP graphical blocks,
execute a DSP program
●
●
Implementation of:
–
Filter
–
Mixer
–
Amplifier
SDR flow graph and demonstration
Basics of Digital Signal Processing
(DSP) using gnuradio companion
(GRC)
Tom McDermott, N5EG
[email protected]
Outline
• Float vs. Complex numbers
– Positive and negative frequency
• How do digital multipliers and analog mixers
compare?
• What is complex conjugate? Why do I care?
• Putting the pieces together
– Building a Weaver SSB receiver
Sine Wave
• Does a sine wave produce a single frequency?
– Try it with a FLOAT in gnuradio
– Try it with a COMPLEX in gnuradio
• Why do we get this result?
• Why is the shape of a single carrier a sine wave?
– Let's watch a movie
Flowgraphs
• COMPLEX
FG1C
• FLOAT
FG1F
Movie
• Too large to embed.
• A separate MP4 file.
What is a complex signal?
• We cannot tell the direction of rotation of a vector with
just one component (a FLOATing point number).
• We need two signals: real (In-phase, or I) and
Imaginary (Quadrature-phase or Q). (a COMPLEX
number).
• We can synthesize the Q component from the I
component.
– Wideband 90-degree phase shift.
– It makes an assumption about the signal.
• What is that assumption?
– Lets try it with gnuradio Hilbert transform.
Flowgraphs
FG2
• Create COMPLEX (analytic) signal from FLOAT signal
Mixer vs. Multiplier
• Analog mixers produce sum and difference
frequencies.
1
1
𝑥 𝑡 = cos ω1𝑡 ∗ cos ω2𝑡 = cos ω1𝑡 + ω2𝑡 + cos ω1𝑡 − ω2𝑡
2
2
• What happens when we multiply two FLOAT signals?
– How many output products are there?
• What happens when we multiply two COMPLEX
signals?
– How many output products are there?
• Try it with gnuradio
• What's going on here?
Flowgraphs
FG3F
FG3C
COMPLEX Digital multiplier produces
only the sum product.
To multiply two numbers with the same base, add the exponents
𝑥 𝑎 ∗ 𝑥 𝑏 = 𝑥 𝑎+𝑏
𝑥 𝑡 = 𝑒 𝑗ω1𝑡 ∗ 𝑒 𝑗ω2𝑡 = 𝑒 𝑗ω1𝑡+𝑗ω2𝑡 = 𝑒 𝑗
ω1+ω2 𝑡
Complex Conjugate
• Complex conjugate of a sequence inverts the
frequency sign of that sequence.
– Invert the sign of the Q portion only.
– Remember the movie.
𝑥 𝑡 = 𝑒 𝑗ω𝑡 = cos ω𝑡 + 𝑗sin ω𝑡
𝑒𝑗
−ω 𝑡
= cos ω𝑡 − 𝑗sin ω𝑡
Difference Mixer
• Complex multiply signal w1 with the conjugate of
signal w2.
– Produces w1+( – w2) = w1 – w2
𝑥 𝑡 = 𝑒 𝑗ω1𝑡 ∗ 𝑒 𝑗
−ω2 𝑡
= 𝑒 𝑗ω1𝑡−𝑗ω2𝑡 = 𝑒 𝑗
ω1−ω2 𝑡
Flowgraphs
FG4
Low Pass Filter
• Filter normally uses FLOAT taps and COMPLEX signal.
– Filter response is double-sided. Why?
FG5
Weaver SSB Receiver
FG6
Shift USB signal
by +1.5 kHz
Fo
-1.5K
Complex to
Float
Zero
+1.5K
Shift LSB signal
by -1.5 kHz
Fo
-1.5K
Zero
Complex to
Float
Zero
+1.5K
Zero
Backup Slides
FLOAT is two frequencies
these terms reinforce
1 𝑗ω𝑡 1 𝑗
𝑒
+ 𝑒
2
2
−ω 𝑡
these terms cancel out
1
1
= cos ω𝑡 + 𝑗sin ω𝑡
2
2
+
1
1
cos ω𝑡 − 𝑗sin ω𝑡
2
2
=
cos ω𝑡 + 𝑗0
→ Just a single waveform (“I” part with no “Q” part): is