4.16.24 21st Century Movements for Black Lives.pptx
BEST gr-bertool
1. University of Messina - DIECII
The gr-bertool
Supervisors
Candidate
Prof. Salvatore Serrano
Arturo Rinaldi
Prof. Giuseppe Campobello
Department of Electronics Engineering, Chemistry and Electrical Engineering
BEST School - Messina, September 2013
2. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
2 of 66
Arturo Rinaldi - The gr-bertool
3. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
• The simulated channels were :
2 of 66
Arturo Rinaldi - The gr-bertool
4. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
• The simulated channels were :
◦ Wired : AWGN
2 of 66
Arturo Rinaldi - The gr-bertool
5. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
• The simulated channels were :
◦ Wired : AWGN
◦ Wireless : Rayleigh and Rician
2 of 66
Arturo Rinaldi - The gr-bertool
6. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
• The simulated channels were :
◦ Wired : AWGN
◦ Wireless : Rayleigh and Rician
• Verify the correspondence between the theoretical and experimental
results of the BER (Bit Error Rate)
2 of 66
Arturo Rinaldi - The gr-bertool
7. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
• The simulated channels were :
◦ Wired : AWGN
◦ Wireless : Rayleigh and Rician
• Verify the correspondence between the theoretical and experimental
results of the BER (Bit Error Rate)
• Provide complementary tools to show how audio and video files are
modified under the effect of the transmission channels
2 of 66
Arturo Rinaldi - The gr-bertool
8. Goal of the thesis work
• The making of a learning tool for the analysis of the digital modulations
in different communication channels
• The simulated channels were :
◦ Wired : AWGN
◦ Wireless : Rayleigh and Rician
• Verify the correspondence between the theoretical and experimental
results of the BER (Bit Error Rate)
• Provide complementary tools to show how audio and video files are
modified under the effect of the transmission channels
• The gr-bertool was built by using the open-source DSP platform GNU
Radio
2 of 66
Arturo Rinaldi - The gr-bertool
9. GNU Radio
• GNU Radio is an open-source software
toolkit providing a huge library of
blocks for Digital Signal Processing
(DSP) written in C++ which can be
combined together in order to build and
develop radio applications
Gnu Radio Companion (GRC), XML
Python Flow Graph
(Created using the processing blocks)
SWIG (Port C++ blocks to Python)
GNU Radio Signal Processing Blocks
(C++)
USB Interface / Gigabit Ethernet
Generic RF Front End
( USRP / USRP 2 )
3 of 66
Arturo Rinaldi - The gr-bertool
10. GNU Radio
• GNU Radio is an open-source software
toolkit providing a huge library of
blocks for Digital Signal Processing
(DSP) written in C++ which can be
combined together in order to build and
develop radio applications
• It is provided with a graphical interface
to ease its learning curve (GRC : GNU
Radio Companion)
Gnu Radio Companion (GRC), XML
Python Flow Graph
(Created using the processing blocks)
SWIG (Port C++ blocks to Python)
GNU Radio Signal Processing Blocks
(C++)
USB Interface / Gigabit Ethernet
Generic RF Front End
( USRP / USRP 2 )
3 of 66
Arturo Rinaldi - The gr-bertool
11. Software-Defined Radio : an introduction
• GNU Radio was developed to be in use of Software-Defined Radio
(SDR), a new “paradigm” of communication systems
4 of 66
Arturo Rinaldi - The gr-bertool
12. Software-Defined Radio : an introduction
• GNU Radio was developed to be in use of Software-Defined Radio
(SDR), a new “paradigm” of communication systems
• A receiver is an SDR device if its communication functions are made as
reconfigurable software working on ad hoc hardware
4 of 66
Arturo Rinaldi - The gr-bertool
13. Software-Defined Radio : an introduction
• GNU Radio was developed to be in use of Software-Defined Radio
(SDR), a new “paradigm” of communication systems
• A receiver is an SDR device if its communication functions are made as
reconfigurable software working on ad hoc hardware
• So it’s possible to implement different software transmission standards
by using only one device
4 of 66
Arturo Rinaldi - The gr-bertool
14. Software-Defined Radio : an introduction
• GNU Radio was developed to be in use of Software-Defined Radio
(SDR), a new “paradigm” of communication systems
• A receiver is an SDR device if its communication functions are made as
reconfigurable software working on ad hoc hardware
• So it’s possible to implement different software transmission standards
by using only one device
• An SDR sytem is also able to recognize and avoid possible interferences
with other transmission channels
4 of 66
Arturo Rinaldi - The gr-bertool
15. A general overview on the main
GNU Radio blocks
5 of 66
Arturo Rinaldi - The gr-bertool
16. Signal Source
The block generates different kind of waveforms to
be used as the main signal to transmit or as a
reference one.
The block is only not able to generate Sinusoidal or
Costant kind of waveforms but also Square,
Triangle and Saw Tooth ones.
Type : complex, float, int, short
6 of 66
Arturo Rinaldi - The gr-bertool
17. Noise Source
The block is able to generate noise according to the
Uniform, Gaussian, Laplacian and Impulse
models.
Please also note that the Amplitude parameter fed
to the Gaussian kind of noise is the standard
deviation σ of the Gaussian Noise, given by :
σ=
N0
2
where N0 /2 is the power spectral density of white
noise (i.e. its variance).
Type : complex, float, int, short
Arturo Rinaldi - The gr-bertool
7 of 66
18. Operators
These blocks perform the four basic arithmetical
functions over the signal sources they are fed with
(sum, subtraction, multiplication and division).
Please also note that they perform the operation
element by element (i.e. first element of the row first element of the column) so the rule of thumb is
to feed the inputs with equal amounts of data.
Type : complex, float, int, short
8 of 66
Arturo Rinaldi - The gr-bertool
19. Random Source 2
The block generates a random array of unsigned
integer data with values spanning from 0 to 255 (we
are working with 1-byte elements !).
We use it because is a more reliable source of
random data compared to the one provided with the
GNU Radio platform.
The only parameter fed to the block is the number
of samples (i.e. the length of the generated list of
elements).
Type : complex, float, byte
9 of 66
Arturo Rinaldi - The gr-bertool
20. Random Source 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from g n u r a d i o i m p o r t g r
i m p o r t random
d e f OnDataSource random ( s a m p l e s ) :
src1 = [ ]
f o r i in range ( samples ) :
d a t a = random . r a n d i n t ( 0 , 2 5 5 )
s r c 1 . append ( d a t a )
return src1
c l a s s randomsource b ( gr . h i e r b l o c k 2 ) :
def
init
( s e l f , number samples ) :
gr . h i e r b l o c k 2 .
init
( s e l f , ” randomsource b ” ,
gr . i o s i g n a t u r e (0 , 0 , 0) ,
gr . i o s i g n a t u r e (1 , 1 , gr . s i z e o f c h a r ) )
d a t a s a m p l e s = OnDataSource random ( n u m b e r s a m p l e s )
s e l f . v e c t o r = g r . v e c t o r s o u r c e b ( d a t a s a m p l e s , True , 1 )
s e l f . connect ( s e l f . vector , s e l f )
10 of 66
Arturo Rinaldi - The gr-bertool
21. Random Source - The easy way
The block generates a random array of unsigned
integer data.
It is a more direct implementation compared to the
one we have just seen.
We feed it with the data list (of unsigned integer of
course) and we also set to Yes the repeat option
since we need a constant stream of data.
Let’s see how to build the data array this time....
11 of 66
Arturo Rinaldi - The gr-bertool
22. Random Source - The easy way
1
2
3
4
5
6
7
from g n u r a d i o i m p o r t g r
i m p o r t numpy
d a t a = map ( i n t , numpy . random . r a n d i n t ( 0 , 2 5 6 , 6 e5 ) )
v e c t o r = g r . v e c t o r s o u r c e b ( d at a , True , 1 )
12 of 66
Arturo Rinaldi - The gr-bertool
23. Packed to Unpacked
The block returns sequences of packed bytes
according to the integer number we set to the Bits
per Chunk argument.
It is possible to set the Endianness of the output
sequences according to Big (MSB) or Little (LSB)a .
So let’s assume we have this binary sequence
11100001. If we feed it to the block we’ll get four
binary sequences, specifically :
•
•
•
•
00000011
00000010
00000000
00000001
Type : int, short, byte
a Johathan Swift, “Gulliver’s Travels”
13 of 66
Arturo Rinaldi - The gr-bertool
24. Map
We usually exploit this block every time we want to
perform Gray Coding on the symbols of a digital
modulation.
For a 2-bit symbols modulation :
•
•
Binary to Gray sequence : [0,1,3,2]
Gray to Binary sequence : [0,1,3,2]
For a 3-bit symbols modulation :
•
•
Binary to Gray sequence : [0,1,3,2,7,6,4,5]
Gray to Binary sequence : [0,1,3,2,6,7,5,4]
Type : byte
14 of 66
Arturo Rinaldi - The gr-bertool
25. Constellation Decoder - 1
It could be seem strange feeding the same coding
numeric sequence when un-gray a constellation.
However, this is due to how GNU Radio works and in
particular how the Constellation Decoder block
operates over the signal points.
So, once you have assigned the correct Symbol
Value Out (i.e. for a QPSK constellation is
[0,1,2,3]), you have to scramble the Symbol
Position values again to perform a correct decoding.
You can take care of this by using a cascading link to
the Map block again and feeding it with the
originary coding sequence.
15 of 66
Arturo Rinaldi - The gr-bertool
26. Constellation Decoder - 2
Please also note that all our work is based on the ”old” version of the
gr constellation decoder block. In fact, the version we have just dealt
with is the one taken from the GNU Radio 3.4.2 tarball and built again as a
custom block with the cmake custom wrapper you can usually find inside a
tarball1 .
This however is nowadays considered an old-school method since the latest
tarballs provide the “Swiss-army knife” tool called gr-modtool, which will
generate the skeleton of your new custom package.
1 This is true for tarball version ranging from 3.5.0 to 3.6.5.1
16 of 66
Arturo Rinaldi - The gr-bertool
27. Chunks to Symbols
Once we have set the coding on our binary sequences
(the ones from the Packed to Unpacked block) we
can assign the points of the constellation to them.
So for example, if we want to build a BPSK
constellation we will assign the points [-1,1] to the
Symbols Table.
Otherwise if we want to build a QPSK constellation
we will assign these other points :
[1+1j,-1+1j,-1-1j,1-1j]
Input type : int, short, byte
Output type : complex, float
17 of 66
Arturo Rinaldi - The gr-bertool
28. Throttle
We usually use this block to limit the cpu load when
operating with non-audio or non-usrp sources/sinks.
This means that our system won’t freeze or be
overloaded by the GNU Radio engine.
If by any chance we forget it to put it in our flow
graph, we will be warned about it runtime.
Type : complex, float, int, short, byte
18 of 66
Arturo Rinaldi - The gr-bertool
29. WX GUI Slider
It’s a simple slider making part of the GNU Radio
GUIs. We can use to vary at runtime the value of
certain variable we have previously set.
We will mostly use this slider to set the Eb /N0 value
in our simulations.
We are also able to set the Default Value (it is
usually a float one), and the number of steps
between the Maximum and Minimum value of the
variable itself.
19 of 66
Arturo Rinaldi - The gr-bertool
30. WX GUI Scope Sink
The WX GUI Scope Sink is a simple graphical sink
to show our generated waveforms or digital
constellations as well.
At runtime, you will notice that is provided with
buttons to set the X and Y axis divisions and their
offset as well.
Be sure to set XY Mode to On when working with
digital constellations or any complex stream of data
to show both the orthogonal components in the
correct way.
Type : complex, float
20 of 66
Arturo Rinaldi - The gr-bertool
31. Unpacked to Packed
Basically, this block exactly works in the reverse way
of the Packed to Unpacked block we saw a couple
of slides ago.
Remembering the four binary sequences, which were
“splitted” from the original one :
•
•
•
•
00000011
00000010
00000000
00000001
they will be reverted to the original transmitted
binary sequence 11100001.
Type : int, short, byte
21 of 66
Arturo Rinaldi - The gr-bertool
32. Import
The Import block allows us to import the installed
python libraries or even some custom code residing
in your PYTHONPATH(s).
Some common examples of imports into the block
are :
• Import: numpy
• Import:
scipy
• Import:
<my-code>
and so on.
22 of 66
Arturo Rinaldi - The gr-bertool
33. WX GUI Number Sink
The WX GUI Number Sink is a simple graphical
sink to display the result of a numeric calculation of
a GNU Radio flow graph.
We also might feed it,for example, with a constant
source (depending on a variable) to have a numeric
reference to compare with a real-time result.
You can also set the number of the decimal digits so
to get more accuracy in the displayed result.
Type : complex, float
23 of 66
Arturo Rinaldi - The gr-bertool
34. BER and SER calculation
These ones are the blocks for the BER and SER
calculation of the digital modulation. We usually
feed their inputs with the reference and the decoded
stream of data.
Please note that we have only to specify the number
of Bits per Symbol only in the BER block.
It is also recommended to set number of samples of
Window Size to 600k or 1M (and of the input data
streams as well) to get an accurate measure of the
error rates.
Input type : byte
Output Type : float
24 of 66
Arturo Rinaldi - The gr-bertool
35. Now let’s build a QPSK
constellation together ! ! !
25 of 66
Arturo Rinaldi - The gr-bertool
36. Click on the GRC icon in your menu bar
or just type from your local shell :
$ gnuradio-companion &
26 of 66
Arturo Rinaldi - The gr-bertool
44. BER experimental verification
• The Bit Error Rate (BER) of a digital modulation, is the number of bit
errors divided by the total number of transferred bits during a studied
time interval
34 of 66
Arturo Rinaldi - The gr-bertool
45. BER experimental verification
• The Bit Error Rate (BER) of a digital modulation, is the number of bit
errors divided by the total number of transferred bits during a studied
time interval
• Let’s verify the BER theoretical values with the experimental ones by
varying the signal-to-noise ratio Eb /N0
34 of 66
Arturo Rinaldi - The gr-bertool
46. BER experimental verification
• The Bit Error Rate (BER) of a digital modulation, is the number of bit
errors divided by the total number of transferred bits during a studied
time interval
• Let’s verify the BER theoretical values with the experimental ones by
varying the signal-to-noise ratio Eb /N0
• From digital communications theory is well known that for a Q-PSK
modulation the Bit Error Rate is given by :
Pb = Q
2Eb
N0
34 of 66
Arturo Rinaldi - The gr-bertool
47. BER experimental verification
• This set of tools calculates the BER in
a range of Eb /N0 values given by min
and max with the opportunity to
choose the increase step size
35 of 66
Arturo Rinaldi - The gr-bertool
48. BER experimental verification
• This set of tools calculates the BER in
a range of Eb /N0 values given by min
and max with the opportunity to
choose the increase step size
• We can enable or disable the Gray
Coding
35 of 66
Arturo Rinaldi - The gr-bertool
49. BER experimental verification
• This set of tools calculates the BER in
a range of Eb /N0 values given by min
and max with the opportunity to
choose the increase step size
• We can enable or disable the Gray
Coding
• By clicking on the Plot button the BER
curves are showed in a simple BER vs
Eb /N0 diagram
35 of 66
Arturo Rinaldi - The gr-bertool
50. BER experimental verification
We can see a perfect agreement between the theoretical results and the
experimental ones :
(a) BER AWGN BPSK
(b) BER AWGN Q-PSK
(c) BER AWGN 8-PSK
36 of 66
Arturo Rinaldi - The gr-bertool
52. The Real-Time BER Calculation
38 of 66
Arturo Rinaldi - The gr-bertool
53. Real-Time BER and signal constellation evolution
• This tool allow us to show the real-time
BER and signal constellation evolution
in the three different types of
examinated transmission channels
39 of 66
Arturo Rinaldi - The gr-bertool
54. Real-Time BER and signal constellation evolution
• This tool allow us to show the real-time
BER and signal constellation evolution
in the three different types of
examinated transmission channels
• In the following example we’ll show the
BER evolution in the Rician Channel in
the range of Eb /N0 values going from
−15 dB to 0 dB
39 of 66
Arturo Rinaldi - The gr-bertool
55. Real-Time BER and signal constellation evolution
• This tool allow us to show the real-time
BER and signal constellation evolution
in the three different types of
examinated transmission channels
• In the following example we’ll show the
BER evolution in the Rician Channel in
the range of Eb /N0 values going from
−15 dB to 0 dB
• Once started the BER value settles to
the BER value corresponding to
Eb /N0 = 0 dB about equal to ≈ 0.11
39 of 66
Arturo Rinaldi - The gr-bertool
56. Real-Time BER and signal constellation evolution
• This tool allow us to show the real-time
BER and signal constellation evolution
in the three different types of
examinated transmission channels
• In the following example we’ll show the
BER evolution in the Rician Channel in
the range of Eb /N0 values going from
−15 dB to 0 dB
• Once started the BER value settles to
the BER value corresponding to
Eb /N0 = 0 dB about equal to ≈ 0.11
• Ch1 Experimental Value ; Ch2
Theoretical Value
39 of 66
Arturo Rinaldi - The gr-bertool
57. Real-Time BER and signal constellation evolution
• This tool allow us to show the real-time
BER and signal constellation evolution
in the three different types of
examinated transmission channels
• In the following example we’ll show the
BER evolution in the Rician Channel in
the range of Eb /N0 values going from
−15 dB to 0 dB
• Once started the BER value settles to
the BER value corresponding to
Eb /N0 = 0 dB about equal to ≈ 0.11
• Ch1 Experimental Value ; Ch2
Theoretical Value
• Let’s see the evolution....
Arturo Rinaldi - The gr-bertool
39 of 66
64. The signal constellation
• Let’s consider a generic transmission scheme for a TLC system.
m(t)
S
s(t)
Tx
r(t)
Tx Channel
d(t)
Rx
D
Figure : Generic block diagram for a TLC system
46 of 66
Arturo Rinaldi - The gr-bertool
65. The signal constellation
• Let’s consider a generic transmission scheme for a TLC system.
m(t)
S
s(t)
r(t)
Tx
d(t)
Rx
Tx Channel
D
Figure : Generic block diagram for a TLC system
• In the absence fo any noise in the channel the generci transmitted
symbol si will be correctly received. The plot of the received symbols is
¯
knows as “Constellation” of the digital modulation.
ℑ
s3 (‘01’)
¯
s0 (‘11’)
¯
ℜ
s2 (‘00’)
¯
s1 (‘10’)
¯
Figure : Constellation of a QPSK modulation
46 of 66
Arturo Rinaldi - The gr-bertool
66. The signal constellation
• The presence of noise in the channel modifies phase and amplitude of
the transmitted symbols and so the received symbol ri is not one
¯
belonging to the constellation showed before
ℑ
s3 (‘01’)
¯
s0 (‘11’)
¯
The transmitted si symbol is not
¯
correctly received
ri
¯
ℜ
s2 (‘00’)
¯
s1 (‘10’)
¯
47 of 66
Arturo Rinaldi - The gr-bertool
67. Evolution of the Signal Constellation
48 of 66
Arturo Rinaldi - The gr-bertool
68. Evolution of the Signal Constellation
49 of 66
Arturo Rinaldi - The gr-bertool
69. Evolution of the Signal Constellation
50 of 66
Arturo Rinaldi - The gr-bertool
70. Evolution of the Signal Constellation
51 of 66
Arturo Rinaldi - The gr-bertool
71. Evolution of the Signal Constellation
52 of 66
Arturo Rinaldi - The gr-bertool
74. Image Transmission
• This tool allow us to observe how the
most common image formats are
affected by digital modulations
55 of 66
Arturo Rinaldi - The gr-bertool
75. Image Transmission
• This tool allow us to observe how the
most common image formats are
affected by digital modulations
• We studied the effects over the
simulated channels (AWGN, Rayleigh e
Rician) for a fixed value of
Eb /N0 = 0 dB and Q-PSK digital
modulation for a Jpeg image
55 of 66
Arturo Rinaldi - The gr-bertool
76. Image Transmission
• This tool allow us to observe how the
most common image formats are
affected by digital modulations
• We studied the effects over the
simulated channels (AWGN, Rayleigh e
Rician) for a fixed value of
Eb /N0 = 0 dB and Q-PSK digital
modulation for a Jpeg image
• Let’s see the results......
55 of 66
Arturo Rinaldi - The gr-bertool
77. Image Transmission : AWGN Channel
(a) Original
(b) AWGN
56 of 66
Arturo Rinaldi - The gr-bertool
78. Image Transmission : Rician Channel
(c) Original
(d) Rician
57 of 66
Arturo Rinaldi - The gr-bertool
79. Image Transmission : Rayleigh Channel
(e) Original
(f) Rayleigh
58 of 66
Arturo Rinaldi - The gr-bertool
81. Audio Transmission
• This tool allow us to observe how the
most common audio formats are
affected by digital modulations
60 of 66
Arturo Rinaldi - The gr-bertool
82. Audio Transmission
• This tool allow us to observe how the
most common audio formats are
affected by digital modulations
• We studied the effects over the
simulated channels (AWGN, Rayleigh e
Rician) for a fixed value of
Eb /N0 = 10 dB and Q-PSK digital
modulation
60 of 66
Arturo Rinaldi - The gr-bertool
83. Audio Transmission
• This tool allow us to observe how the
most common audio formats are
affected by digital modulations
• We studied the effects over the
simulated channels (AWGN, Rayleigh e
Rician) for a fixed value of
Eb /N0 = 10 dB and Q-PSK digital
modulation
• We took as sample the wav file
play it sam.wav with the following
specifications :
60 of 66
Arturo Rinaldi - The gr-bertool
84. Audio Transmission
Specifications of the sample file
play_it_sam.wav :
File Size: 1.76M
Bit Rate: 1.41M
Encoding: Signed PCM
Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
Duration: 00:00:10.00
• Let’s see the results....
61 of 66
Arturo Rinaldi - The gr-bertool
88. Conclusions
Why using gr-bertool ? Advantages
It’s an helpful tool for the teacher to use in TLC courses
65 of 66
Arturo Rinaldi - The gr-bertool
89. Conclusions
Why using gr-bertool ? Advantages
It’s an helpful tool for the teacher to use in TLC courses
The student can find a quick verification with the learnt notions during
classes
65 of 66
Arturo Rinaldi - The gr-bertool
90. Conclusions
Why using gr-bertool ? Advantages
It’s an helpful tool for the teacher to use in TLC courses
The student can find a quick verification with the learnt notions during
classes
It has an ”user-friendly” GUI
65 of 66
Arturo Rinaldi - The gr-bertool
91. Conclusions
Why using gr-bertool ? Advantages
It’s an helpful tool for the teacher to use in TLC courses
The student can find a quick verification with the learnt notions during
classes
It has an ”user-friendly” GUI
It’s open-source !
65 of 66
Arturo Rinaldi - The gr-bertool
92. Contact Information
Arturo Rinaldi
Freelance Collaborator @ DIECII
Address : Dep. of Electronics Engineering (DIECII) C.da di Dio, 98166 Messina (Italy)
E-mail : arty.net2@gmail.com
Fixed : +39-090-3977376 ; Mobile : +39-340-5795584 (Whatsapp)
Skype : arty.net ; Facebook : arty.net
Twitter : artynet2 ; LinkedIn : Arturo Rinaldi
Prof. Giuseppe Campobello, Ph.D.
Researcher in Telecommmunications
Address : Dep. of Electronics Engineering (DIECII) C.da di Dio, 98166 Messina (Italy) - Room: 636
(block B, 6th floor)
E-mail : gcampobello@unime.it
Fixed : +39-090-3977378
Prof. Salvatore Serrano, Ph.D.
Researcher in Telecommmunications
Address : Dep. of Electronics Engineering (DIECII) C.da di Dio, 98166 Messina (Italy)
E-mail : sserrano@unime.it
Fixed : +39-090-3977522
66 of 66
Arturo Rinaldi - The gr-bertool