There is some confusion about the Bluetooth. Generally speaking, Bluetooth 1.0 - 3.0 includes classic Bluetooth. Bluetooth 4.0 starts to use Bluetooth Low Energy (BLE). A brief introduction about their difference can be found at link1, link2 and link3.
New features of Bluetooth 5 can be found here. The full and latest specification, v5.2 (released in 2019) can be downloaded here.
Unless otherwise highlighted, the following descriptions apply to BLE, which might not be correct for classic Bluetooth.
Visit MATLAB Bluetooth Protocol Stack for a detailed introduction about the Bluetooth and BLE protocol, and a mapping between them and the OSI model.
Figure from https://uk.mathworks.com/help/comm/ug/bluetooth-protocol-stack.html.
Some brief introduction of the protocol can be found at the Microchip Developer Center. The BLE protocol stack consists of
Figure from https://microchipdeveloper.com/wireless:ble-introduction.
Some key features of the BLE physical layer
Figure from https://microchipdeveloper.com/wireless:ble-introduction.
The preamble defined in BLE v5.2:
Channel 37, 38 and 39
Channel 0-36
The same packet format for both
BLE Packet Type. Figure from https://microchipdeveloper.com/wireless:ble-link-layer-packet-types
Advertising and Scanning. Figure from https://microchipdeveloper.com/wireless:ble-link-layer-discovery
Connection establishment. Figure from https://microchipdeveloper.com/wireless:ble-link-layer-connections
Connected phase. Figure from https://microchipdeveloper.com/wireless:ble-link-layer-connections
Note: The module is still under development and its classes, functions, methods and constants are subject to change. It only supports the basic BLE functions.
Matlab has also provided simulation support for Bluetooth and BLE. Visit Communications Toolbox Library for the Bluetooth Protocol support package for more information.
]]>A complete LoRaWAN application requires end devices, gateway, network server, and an application.
Tutorial
Sometimes people use LoRa as the physical layer modulation technique while LoRaWAN as the MAC protocol and also the network structure. In other cases, you may also see that LoRa is used as a general term to represent LoRa/LoRaWAN. A good tutorial and summary of the LoRa and LoRaWAN can be found at link.
LoRa (Long Range) is an IoT wireless technology patented by Smetech. It defines the physical layer modulation.
Some key features of LoRa
Understand LoRa modulation
Arduino LoRa Driver
LoRaWAN is a media access control (MAC) protocol for wide area networks. It is defined by LoRa Alliance. The first LoRaWAN specification was published on January 2015 (download link) and the latest LoRaWAN specifications is LoRaWAN® Specification v1.0.3 (July 2018) download link.
Many LoRaWAN protocol implementations may not support the latest version. For example, pycom devices only support LoRaWAN 1.0.2. The previous versions of LoRaWAN specifications can be accessed from https://lora-alliance.org/resource-hub
Some key features of LoRaWAN
LoRaWAN is not the only MAC protocol for LoRa. Symphony Link is also available. A difference between Symphony Link and LoRaWAN can be found here
There are different options for selecting the end devices, based on your preference. Here is a (non-comprehensive) summary of the LoRa/LoRaWAN devices and their drivers.
Hardware Type | Driver (LoRa) | Driver (LoRaWAN) | Language | Supported Devices |
---|---|---|---|---|
Pycom devices | LoRaMAC | LoRaWAN-OTAA, LoRaWAN-ABP | Micropython | FiPy, LoPy |
Arduino Shield | Arduino RadioHead | Arduino LMIC | Arduino C | Arduino LoRa GPS Sheild, Seeeduino LoRaWAN |
Raspberry Pi Shield | C | LoRa GPS HAT for Raspberry Pi | ||
mBed-Based | SX1272Lib, SX1276Lib | LoRaWAN-lib | C | SX1272MB2xAS , SX1276MB1xAS |
RN2483 | Microchip RN2483 |
A full list of the mbed LoRa device and the mbed LoRaWAN APIs
For example, if you are using Pycom devices, you can connect the end device by using Authentication By Personalisation (ABP) or Over The Air Authentication (OTAA).
You may have experience setting up a WiFi router (access point) at home or office. Users will need password to access the router for internet, which can be referred as a private router. In LoRaWAN, it is a different story. You do not need a password to connect to a gateway. As long as there is a gateway nearby, your end devices will connect to the gateway and eventually to the network server. In this case, the gateway is public. A detailed introduction on the gateway can be found at here, where you can find a list of recommended hardware.
If you intend to setup a gateway, you can configure it as public or private. An instruction of using RAK831 gateway can be found here here
The Things Network is a free and probably the most popular LoRaWAN server. Please refer to here for an instruction about creating applications in TTN.
Another tutorial from pycom can be found here.
Please refer to this link for building applications using TTN.
There is a number of data API and SDK for interaction between the applications and TTN server.
A LoRaWAN demo has been created at the Advanced Networks Research Group (ANRG), University of Liverpool. The demo built a complete LoRaWAN-based IoT system, including FiPy end devices, gateway, and applications. A detailed introduction can be found at link.
A public LoRaWAN gateway hosted at The Things Network by ANRG Link. The gateway was built following the instruction here
The most fascinate feature of Latex is that it allows you to focus on the content and frees you from worrying the format. It is very good at writing equations. It is excellent in managing the cross reference of figures and tables, and also the references. Please refer to the tutorial at Overleaf to start.
For any report and document, the basic elements include the text, figures, tables, equations, references, etc. You will then have to take care of the referencing of the figures, tables and equations. You may have to worry about the places of the figures and tables. Don’t worry, LaTex will sort out all of them.
If you have not used Latex before, I suggest to use the online platform, namely overleaf, first to get yourself familiar with Latex syntax. It may be a little complicated to install and setup Latex software. Overleaf will take care of the packages automatically and you can focus on learning Latex. However, since overleaf is an online platform, it will rely on your Internet connection. When you become more comfortable with Latex, I still recommend to use offline software.
There are many Latex editors available and many of them are free to use. If you are using LaTex with Windows, I strongly suggest to use the combination of Miktex+TeXnicCenter+Sumatra PDF viewer. They are very handy to use.
Some tips to use the above combinations:
When use MikTex, you will need the admin right to install all the required packages.
Different publishers and journals may have different LaTex templates. Please download from the publisher’s website. In particular, most of the IEEE journals and transactions use the same IEEE LaTex templates . There are some exceptions, e.g., IEEE Access.
Please read the document for instruction of how to use the IEEE LaTex template. I strongly suggest to read it time to time when you are using some special features of the template, e.g., subfigures, algorithms.
IEEE has special requirements on the bibliography. Bibtex is suggested to organize the references. Read the information here for instruction. When you are writing your only report without following the IEEE Latex template, you can still use the IEEE reference format. It is strongly suggested if you are from the electronics and electrical engineering areas.
It is very difficult and unfriendly to generate a table from scratch in Latex. There are many tools available to make this tedious work much easier.
Excel2LATEX is recommended over online table generators. It allows you to save the table in an Excel file and you can edit the table and regenerate the Latex source code whenever you want.
It is strongly recommended to use vector figures for academic publication because of their good resolution. Here is a brief but good explanation about the difference between the bitmap and vector figures. Generate pdf or eps because they are vector figures.
It is fine to use png, jpg for photos.
PowerPoint can produce quite good look diagrams. There are lots of icons. Save the slides to pdf file.
It is usually quite difficult if you want to add annotation into the Matlab figure. This can be achieved via PowerPoint (with a few steps).
When using Matlab to save figures to to pdf or eps, there will usually be margins. Use the export_fig to save Matlab figures without margin.
Matlab figures usually have the grey margin. Use the following codes can set the background to white and save figures into .fig, .pdf and .eps.
function print2pdf( filename )
savefig(filename)
filename1 = [filename '.pdf'];
filename2 = [filename '.eps'];
expression1 = ['export_fig ' filename1];
expression2 = ['export_fig ' filename2];
set(gcf, 'Color', 'w');
eval( expression1)
eval( expression2)
end
\begin{figure}[!t]
\centering
\includegraphics[width=3.4in]{fig1.pdf}
\caption{Caption.}
\label{fig:fig1}
\end{figure}
In order to include subfigures, IEEE template recommends to use subfig.sty. Declare subfig package in the preamble:
\ifCLASSOPTIONcompsoc
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\else
\usepackage[caption=false,font=footnotesize]{subfig}
\fi
Use the following code to include two subfigures
\begin{figure}[!t]
\centering
\subfloat[]{\includegraphics[width=3.4in]{Pictures/fig1.pdf}
\label{fig:fig1}}\\
\subfloat[]{\includegraphics[width=3.4in]{Pictures/fig2.pdf}
\label{fig:fig2}}
\caption{(a) Caption1. (b) Caption2.}
\label{fig:fig}
\end{figure}
When using figures, tables, and equations, I strongly suggest to use cross referencing. Please refer to this link for a detailed tutorial.
It includes two step. First, include the label during the definition. Prefix is recommended to distinguish them, e.g., \label{fig:fig1}, \label{tab:tab1}, and \label{eq:eq1}. This is extremely helpful when your report has many of them. Then, refer to it in the main text, e.g., \ ref{fig:fig1} (without space between \ and ref).
One attractive that Word has is the track change, which allows different people to edit the same document and see the changes that each other has made.
Unfortunately the Latex itself does not support track change, but there is an amazing utility named latexdiff to do something similar. It can compare two latex tex files and mark the changes between them. Please follow the latexdiff for instruction.
Alternatively, if you are using Overleaf, there is track changes feature. Read this link for details.
Bibtex is strongly recommended to organize reference in Latex. While it is very easy and efficient to use, there are a number of pitfalls. Please refer to this tutorial for details.
In order to avoid any errors, it is strong advised to download the bibtex entries from the online database, rather than creating from scratch by yourself. For example, search the title in the Google Scholar and click “Import into BibTeX” to view the bibtex record. If it is not there, turn it on in the Settings of Google Scholar.
The bibtex entries downloaded from any database are unfortunately not fully correct. You will need to adjust it according to the target journal and also the pitfalls mentioned above. In particular, check the journal field and delete any fields that are not required.
For example, a bibtex entry downloaded from Google Scholar is shown below
@article{zhang2016key,
title={Key generation from wireless channels: A review},
author={Zhang, Junqing and Duong, Trung Q and Marshall, Alan and Woods, Roger},
journal={Ieee access},
volume={4},
pages={614--626},
year={2016},
publisher={IEEE}
}
As for IEEE journals, there are two errors in this entry. The journal field should be {IEEE Access} and the publisher field is not required.
Please check How to Use the IEEEtran BIBTEX Style.
Journal and conference papers are the two widely used reference types. Examples are given below.
bibtex entry for Journal:
@article{shen2021towards,
title={Towards scalable and channel-robust radio frequency fingerprint identification for {LoRa}},
author={Shen, Guanxiong and Zhang, Junqing and Marshall, Alan and Cavallaro, Joseph R},
journal=IEEE_J_IFS,
volume={17},
pages={774--787},
year={2022},
}
bibtex entry for Conference
@inproceedings{shen2021infocom,
author={Shen, Guanxiong and Zhang, Junqing and Marshall, Alan and Peng, Linning and Wang, Xianbin},
title={Radio Frequency Fingerprint Identification for {LoRa}
Using Spectrogram and {CNN}},
booktitle={Proc. IEEE Int. Conf. Comput. Commun. (INFOCOM)},
pages={1--10},
address={Virtual Conference},
month=may,
year={2021},
}
How to add references correctly in IEEE journals and conferences:
Step 1: Create a file named mybibfile.bib
.
Step 2: at the end of the tex file, put
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,mybibfile}
before \end{document}
Step 3: Download the bibtex entry from Google Scholar. Check the following fields and make the relevant changes.
booktitle={Proc. IEEE ICC}
{OFDM}
, and {LoRa}
.If you need to create multiple bibliographies in the same document, multibib can help you with this. Check here for an introduction and an example.
Define in the preamble
\usepackage{color,xcolor,colortbl}
\newcommand{\blue}[1]{ {\color{blue}#1}}
\newcommand{\red}[1]{ {\color{red}#1}}
Use it in the main text as follows as \blue{I want this sentence to be highlighted in blue.}
Latex is powerful and fun, but it requires time to learn. If you experience any difficulties using it, feel free to contact me. I may have had the same awkward learning processing before and I will be happy to share.
]]>MNIST dataset is probably the most popular for create the first CNN example. It consists of 70,000 images of handwritten digits from 0-9.
Depending on your preference of the programming languages, there are Python and Matlab examples available.
conda list
conda install -c conda-forge tensorflow=1.13
Matlab has provided lots of useful resources.
]]>Strictly speaking, IEEE 802.11 is the standard by IEEE and WiFi is a trademark of the WiFi alliance. However, they are used interchangably in this post.
IEEE 802.11 standard defines the physcai layer and media access control (MAC) layer protocols. It has undergone a number of amendments in the last twenty years, since its first release in 1997. A complete list of the IEEE 802.11 amendments is summarized at wikipedia.
The main physical layer amendments include 802.11b (1999, DSSS), 802.11a (1999, OFDM, 5 GHz), 802.11g (2003, OFDM, 2.4 GHz), 802.11n (2009, MIMO OFDM, high throughput), 802.11ac (2013, MIMO OFDM, very high throughput), 802.11 ax(est late 2019, high efficiency).
OFDM Basics
IEEE 802.11 OFDM Receiver Design
WiFi use CSMA/CA as the MAC layer protocol.
Frame Types
How 802.11 Wireless Works 802.11 Association Process Explained
802.11 Wi-Fi Connection/Disconnection process
802.11 Wi-Fi Security Concepts
There is an 802.11 reference design implemented for WARP boards, which is compatible with the commercial WiFi. An experimental framework is implemented by Python for the research development. The available variables/parameters can be found here, among which the CSI is made public.
WARP is being actively used for research in many areas like power management, architectures for wireless receivers, physical layer algorithms, access protocols, routing and cognitive radios.
A list of papers using WARP can be found at here.
PLEASE NOTE WARP IS DISCONTINUED.
The commercial network interface cards (NICs) only provide received signal strength indicator (RSSI) but not channel state information (CSI). RSSI represents the received power which is averaged over a packet, thus it is a coarse grained parameter. On the other hand, CSI is a fine grained parameter, and offers detailed channel response over different frequencies/subcarriers, when OFDM-based technique is used.
There are some CSI extraction tools for the commercial NICs.
There is the Linux 802.11n CSI Tool for Intel 5300 NIC. This Intel NIC together with the CSI tool have been used extensively by researchers and led to many excellent research papers. A list of the relevant publications can be found at link.
Please note PCI-e interface is required for these NICs.
There is Atheros CSI Tool. A list of the relevant publications can be found at here.
The Matlab WLAN Toolbox is very powerful. There are many useful functions and examples. Both PHY and MAC layers are supported. I strongly suggest to test your idea and algorithms using this Toolbox before you do it with real hardware.
Scapy official website defines
Scapy is a Python program that enables the user to send, sniff and dissect and forge network packets. This capability allows construction of tools that can probe, scan or attack networks.
There is a library supporting IEEE 802.11.
Code Examples:
Wireshark is a network packet analyzer. A network packet analyzer presents captured packet data in as much detail as possible. You could think of a network packet analyzer as a measuring device for examining what’s happening inside a network cable, just like an electrician uses a voltmeter for examining what’s happening inside an electric cable (but at a higher level, of course).
]]>Set the operating mode of the device, which depends on the network topology. The mode can be Ad-Hoc (network composed of only one cell and without Access Point), Managed (node connects to a network composed of many Access Points, with roaming), Master (the node is the synchronisation master or acts as an Access Point), Repeater (the node forwards packets between other wireless nodes), Secondary (the node acts as a backup master/repeater), Monitor (the node is not associated with any cell and passively monitor all packets on the frequency) or Auto.
Journals can be mainly categorized into survey/tutorial-based and technical contribution-based. The latter can be further divided into regular papers (usually longer than eight pages) and letters (less than five pages).
A full list of the magazines and journals of the IEEE Communications Society can be found here.
Survey and tutorial summarize the recent progress of a particular research area. Read these articles will help grab an overall understanding of the topic, which is very helpful, in particular to beginners.
An differentiation between tutorial and survey can be found at the information for authors of IEEE Communications Surveys and Tutorials. Generally speaking, survey articles aim to provide a comprehensive coverage while tutorial is usually written in a technical-light manner, to be understood even by non-expert.
Communications and Networking
Security
Internet of Things
Other
Communications and Networking
Signal Processing
Computing
Security
Internet of Things
Sensing
Others
ACM
IEEE
Best Conferences of the Information Security
Deep learning is a branch of machine learning techniques that utilizes artificial neural networks to approximate a desired function based on the provided training data. It is particularly suitable for complicated tasks such as natural language processing (NLP), computer vision (CV), autonomous driving because the algorithms for these applications are difficult to design by hand. Deep learning can automatically learn algorithms from extensive number of real-world training data, making it an ideal approach for tackling such difficult tasks.
This section takes the MNIST handwritten digits classification problem as an example to describe a typical deep learning procedure. The Keras library is used for its simplicity. Note that this is a supervised classification task.
Ref. Links: Simple MNIST convnet (keras.io) Training a neural network on MNIST with Keras | TensorFlow Datasets
Import used Python libraries.
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
Load the training and test dataset. x_train
and y_train
are training data (images) and labels used to update neural network parameters. x_test
and y_test
are test data and labels used to evaluate the neural network performance.
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
Scale images to the [0, 1] range.
x_train = x_train.astype("float32") / 255
x_test = x_test.astype("float32") / 255
Make sure images have shape (28, 28, 1)
x_train = np.expand_dims(x_train, -1)
x_test = np.expand_dims(x_test, -1)
print("x_train shape:", x_train.shape)
print(x_train.shape[0], "train samples")
print(x_test.shape[0], "test samples")
One-hot encoding, i.e., converting labels to binary class vectors.
y_train = keras.utils.to_categorical(y_train, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)
Next a neural network is built before the training can be carried out. There are various types of neural networks available, such as recurrent neural network (RNN), convolutional neural network (CNN), graph neural network (GNN), transformer, etc. These neural network architectures/designs exhibit different inductive biases, i.e., the prior knowledge/assumption to the data. For example, the CNNs incorporates the assumption of translation invariance, and are therefore primarily used to process images and spatial data. While RNNs exhibits an inductive bias for capturing temporal dependencies in the inputs thus are widely used to process sequential data.
The loaded MNIST handwritten digits are gray-scale images, thus a simple CNN is built for processing.
num_classes = 10
input_shape = (28, 28, 1)
model = keras.Sequential(
[
keras.Input(shape=input_shape),
layers.Conv2D(32, kernel_size=(3, 3), activation="relu"),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Conv2D(64, kernel_size=(3, 3), activation="relu"),
layers.MaxPooling2D(pool_size=(2, 2)),
layers.Flatten(),
layers.Dropout(0.5),
layers.Dense(num_classes, activation="softmax"),
]
)
Next we will do the training. Keras is a highly encapsulated library and enables us to train the model with several lines of codes. The internal initialization, forward/backward propagation, parameter updating procedures are all encapsulated in the fit
function.
batch_size = 128
epochs = 15
model.compile(loss="categorical_crossentropy",
optimizer="adam",
metrics=["accuracy"])
model.fit(x_train,
y_train,
batch_size=batch_size,
epochs=epochs,
validation_split=0.1)
Then we can evaluate the model once the training is complete. A commonly used evaluation metric for classification problems is the overall accuracy.
score = model.evaluate(x_test, y_test, verbose=0)
print("Test loss:", score[0])
print("Test accuracy:", score[1])
This section introduces useful development tools, frameworks for AI research. The Python and MATLAB languages are recommended for beginners.
Python is currently the most popular programming language for AI researchers.
Two of the most popular deep learning frameworks, Tensorflow and PyTorch, are developed by Google and Facebook respectively. The best way to learn them is to follow the official tutorials, the links to which are listed below:
A special note is the TensorFlow has integrated Keras as a high-level API (they exist separately in the past). Keras offers a high level of encapsulation, making it especially suitable for beginners with limited knowledge in deep learning.
NumPy is another popular Python package used for scientific/numerical computing. It is often used to preprocess data before using Tensorflow/PyTorch to build and train a neural network. Beginners with experience in MATLAB should become familiar with NumPy quickly.
Anaconda simplified the package management process in Python. In short, the packages such as Tensorflow/PyTorch/NumPy can be installed using the anaconda platform. Anaconda can help create isolated environments and check the version of the package to be installed to avoid conflicts between different library versions.
PyCharm and VS Code are highly recommended IDEs for Python. MATLAB-familiar users can also try Spyder.
The MATLAB Deep Learning Toolbox provides a framework for designing and implementing neural networks. The author’s personal feeling is that MATLAB’s deep learning APIs are closer to Keras and are beginner friendly as well. MATLAB provides detailed official documentation and examples to get users familiar with deep learning faster.
As MATLAB requires a paid license, the public resources for MATLAB are limited compared to Python-based deep learning framework. Researchers who rely heavily on other MATLAB toolboxes, such as wireless researchers, may prefer the MATLAB Deep Learning Toolbox.
Features of IWR6843AOPEVM
- 60-GHz to 64-GHz mmWave sensor
- 4 receive (RX) 3 transmit (TX) antenna with 120° azimuth field of view (FoV) and 120° elevation FoV
- Direct interface with MMWAVEICBOOST and DCA1000
- Supports 60-pin high-speed interface for host-controlling interface
- Onboard capability for power-consumption monitoring
Device | Description |
---|---|
IWR6843AOPEVM | |
MMWAVEICBOOST, mmWave sensors carrier card platform | Optional, for CCS based debugging |
DCA1000 | Optional |
Computer | Windows 7 or 10 PC with Google Chrome Browser and TI Cloud Agent Extension installed. |
Micro USB Cable | |
Power Supply | 5V, 3A with 2.1-mm barrel jack (center positive). The power supply can be wall adapter style or a battery pack with a USB to barrel jack cable. |
This procedure can be done by following the online tutorial.
Flash the board with the corresponding binary file (.bin) for the specific function.
Note
gesture_ML_6443_AOP.bin
file in the address: MMWAVE_TOOLBOX_INSTALL_DIR>\labs\gesture_recognition\Gesture_with_Machine_Learning\prebuilt_binaries\
pymmWave is an asynchronous TI mmWave library to expedite the development mmWave sensor.
Please flash the sensor with the binary file out_of_box_6843_aop.bin
with the address:
<INDUSTRIAL_TOOLBOX_INSTALL_DIR>\mmwave_industrial_toolbox_<VER>\ labs\Out_Of_Box_Demo\prebuilt_binaries\
Note: The address above is wrong in the user guide in MMWAVE SDK Demo - Lab User’s Guide. Please follow the address here.
]]>