shanggdlk / Lora_backscatter

0 stars 0 forks source link

解调部分:需要三张图 #6

Closed shanggdlk closed 7 years ago

shanggdlk commented 7 years ago

图1里面放一个未调制的信号,颜色用黑色。 图2里面放一个调制过的信号,颜色用红色。 图3里面放图1图2chirp的fft图,画在一个图里。未调制的用黑色,调制过的用红色。可能有部分重叠,没有关系的。fft的强度归一化一下,放到0~1之内。 把三张图的横纵坐标都标记出来:图1,2:横坐标: Time (ms); 纵坐标: Frequency (KHz); 图3:横坐标: Frequency (KHz), 纵坐标 Relative amplitude (0~1)

AmandaHuyue commented 7 years ago

接收机设计

Step1:硬件接收原理:

image

           图一 接收器RF前端原理图

(1)当接收天线连接的能量检测模块检测到包的前导码脉冲,向接收机发送一个trigger信号,此时由RF前端开始接收914MHz的LoRa信号。当然,这里接收到的LoRa信号可能是经过250khz的FSK调制了的信号,暨我们在商用LoRa信号的Payload部分加载了10位Sensor信息和4位节点TAG信息的LoRa调制信号,也可能是普通商用节点发出的未经过250khz移频调制的信号。

(2)信号经rf_in天线进入,经过可编程增益LNA和一个单差分缓冲器,IQ两路信号进入差分IQ混频器,单独的I和Q两路分别经过模拟低通滤波器和可编程基带放大器。放大后的IQ模拟信号分别转入两个五阶连续时间Σ-△模数转换器转换为数字信号。

(3)转换的IQ数字信号由I_OUT和Q_OUT输出。至此,sx1257模块完成了接收信号并转换为IQ输出。

(4)1257输出的IQ信号传入超低功耗FPGA IGLOONANO中,分别变成四路输出,也就是说,1257输出的IQ信号串行输入,2X4路并行输出。这一步的目的是使得第(5)步可以在PC端一条“读”命令返回4 bit I_data和4 bit Q_data,提高系统的运行效率。

(5)FPGA并行输出的IQdata通过FT2232H高速USB BRIDGE子板传输给PC端并保存。

Step2:软件解调:

(1) 数据预处理:由于接收机接到的iqdata传给PC端是bit流格式数据,因此首先应在解调之前将IQ转换成double型数据并保存。

(2) 用matlab对保存的IQ数据数据进行滤波,滤掉了带外信号。

(2)我们的解调方式类似于CSS解调的方式。首先,我们对baseline chirp加上我们想要的信号。 在图二(a)的时候我们对信号进行250K的移频得到的图为图二(b)。(BW = 500k)

单个chirp(500k)经过移频后(250k)的图如下图所示。

image

image

                                (a)

image

                                   (b)

        图二(a & b).原信号和加载信息后信号payload部分对比

把两者放在同一坐标轴进行对比可知我们对其调制的内容是

000000000010100010000000000000000

其中一个数字代表一个chirp,1代表调制,0代表未调制。且从图三中我们可以看出在0的时候对他不做改变。

我们对其进行了FFT并对其峰值进行了追踪,当峰值距原信号的峰值250K时,说明他进行了调制,代表1.当其峰值没有时延时代表0.如果收到的信号每一个chirp做FFT变换之后得到的时延都是0,那么自然说明这是一个未经过FSK调制的信号,如此我们就能区分出它是否进行了调制。 下面具体说明FFT。我们首先对第一个chirp进行部分的采样,并进行FFT。紧接着对调制后的信号进行相同的FFT处理(相同的chirp和位置)。得到的图如下图所示,上图是未调制前信号的FFT图,下图则是调制之后的图。

image

可看出未发生频移,因为第一个chirp我们并未对其进行处理。每个chirp采样点个数是相同的,payload部分共有33个chirp信号,接下来就是逐个chirp采样后的对比。我们先前调制的内容为

000000000010100010000000000000000

所以经过11次循环处理出现下图。

image

前后两者峰值恰好相差了250k。即为1. 由此也可以解调出我们加载了信息的信号,并将解调的0-1信号按位存储。

按位存储的0-1信号中,根据我们调制时预设的格式,payload部分前10位是sensor传来的data,接着第11~14位是tagid,可以通过counter计数来确定。

AmandaHuyue commented 7 years ago

The Design of Receiver

Once the Energy Detection module detects the pulse of preamble, it will send a trigger signal to the FPGA controller chip. After that, the RF front end starts to receive the LoRa signal at 914 MHz. The received signal is transformed into the In-phase signal and the quadrature signal, referred to as I/Q signal, with Semtech sx1257 board. In order to improve the reading efficiency, the I/Q signal is passed to the FPGA controller chip to achieve the transformation of 1-way serial to 4-way parallel. Then the high-speed USB Bridge FT2232H chip passes the 4-way parallel I/Q signal to PC.

As for software demodulation, firstly, we need to preprocess the data. Since after passed to PC, the I/Q signal data received by the receiver are the bit stream format. So the bit stream should be converted to double data for further processing and saved before demodulation. Secondly, we use Matlab to filter out the out-of-band signal of IQ data. Finally, we need to demodulate the information of the modulated LoRa signal. According to the feature of LoRa signal, we demodulate it in a similar way to that of CSS demodulation. To begin with, we add the information to a baseline chirp (500k). We specify that the spread factor is 1, when tag wants to send 1, it modulates the signal and shifts the frequency of 250k; when it wants to send 0, it just outputs the original signal. In order to demodulate the information that tag loads, we can put the original signal and the backscattered signal on the same axis and do some comparison. For this reason, we perform FFT on it and track the peak. When the peak value of the backscattered signal is 250K away from the original signal, we can know that the signal is modulated to represent 1; when the peak has no delay, it represents 0, so that we will get the information that tag transmits, and the demodulated 0-1 signal is stored bit by bit.

In the bit wise stored 0-1 signal, payload is modulated according to our present frame format. More precisely, the first 10 bits of payload are set to carry the data collected by sensors, and the 11-14 bit is Tagid. If the delay of each chirp is 0 after FFT processing, then it supposed to be a signal without FSK modulation. In this way, we can distinguish whether a signal has been modulated or not.