当前位置:网站首页>The solution of frame dropping problem in gnuradio OFDM operation
The solution of frame dropping problem in gnuradio OFDM operation
2022-07-08 01:22:00 【You roll, I don't roll】
Recently running GNURadio Medium OFDM The problem of losing frames was found during routine .
The use of gnuradio yes 3.8 Version of ,Ubuntu by 20.04, And at least for now gnuradio 3.9 There's a problem , Here are the causes and solutions .
When using the original routine ( One time transmission 10 frame 960 Bytes of data ) There is no frame loss during the test , But when we replace the data to be sent with picture data to send, we cannot receive it correctly , Even if the channel condition is changed to an ideal noise-free and distortion free channel in the simulation, the same number of data frames will still be lost at the same location .
Found in debugging , When the interval between two trigger signals of timing information is generally 4 In this case , Respectively 958、959、960、961. But only when the job is 958( A complete OFDM The data frame is 960 individual QPSK data ) Frame loss will occur , No problem with anything else , and 958 And normal 960 Two short QPSK data . in addition , The generation of trigger signal for timing is normal , The problem should be in the module that uses the trigger signal after the trigger signal is generated .
After re analyzing the process of data sending and parsing in the routine , I think it could be Header/Payload Demux Problems in the module source code , So let's look at the source code of this module .

Source code process and problems :
in general , The reason for frame loss is that the interval between two adjacent timing signals is too short , When extracting data from the current frame, the timing signal of the data of the next frame is read as the data of the current frame , In this way, the timing signal of the next frame of data is lost , Therefore, it causes the phenomenon of frame loss . This phenomenon is inherent in the source code . The specific analysis is as follows :
chart 2 The parallel transmission relationship between the data and the trigger signal is strictly implemented at the corresponding position ,Header/Payload Demux Module read first trigger The signal , When reading the value 1 Time is considered to be the beginning of a frame of data , At this time, it starts from the corresponding position of the data signal and then extracts 1919 Data is output as the data of the current frame .

According to the data processing process of the source code , In the source code, every time a timing signal is received , Will be extracted immediately after the timing signal 959 Data is output as the current frame , Therefore, it puts forward high requirements for the accuracy of timing signals , If the interval between two adjacent timing signals is smaller than the length of the normal data frame , For example, the normal interval is 960, If there is an interval of 958 The interval of , Pictured 3, Then in the subsequent extraction 959 The timing signal of the next frame will be read together with the data of the current frame when the data is received , In this way, the timing signal of the next frame of data is lost , Therefore, it causes the phenomenon of frame loss .

The way to solve this problem is to modify the source code , On the basis of ensuring that adjacent timing signals do not want to interfere with each other, compile and install the source code again . The source code that needs to be modified is gr-digital/lib/header_payload_demux_impl.cc as well as gr-digital/lib/header_payload_demux_impl.h . First, in the header_payload_demux_impl.h Add variables to :
int d_next_trigger_offset;
And then in header_payload_demux_impl.cc Change in find_trigger_signal Function as follows :
......
int trigger_nums = 0;
if (max_rel_offset < skip_items) {
return rel_offset;
}
if (in_trigger) {
for (int i = skip_items; i < max_rel_offset; i++) {
if (in_trigger[i]) {
trigger_nums++;
// record location of the first trigger
if(trigger_nums == 1) {
rel_offset = i;
}
// If there is a second trigger signal,record offset of between the first and second trigger
else if (trigger_nums == 2) {
d_next_trigger_offset = i - rel_offset;
break;
}
}
}
}
......
And then modify general_work() Medium case STATE_PAYLOAD In state consume The process is as follows :
......
// Calculate whether the current frame consumes the trigger signal of the next frame data
// If yes, then make corrections
int consume_compensation = 0;
int consume_nums = 0;
// Calculate total consumption
consume_nums = (d_curr_payload_len + d_header_len) * (d_items_per_symbol + d_gi) +
d_header_padding_total_items +
d_curr_payload_offset -
items_padding ;
// make a decision
if(d_next_trigger_offset <= consume_nums) {
consume_compensation = consume_nums - d_next_trigger_offset + 1;
}
else {
consume_compensation = 0;
}
// add the corrections
const int items_to_consume =
d_curr_payload_len * (d_items_per_symbol + d_gi) - items_padding - consume_compensation;
......
After modification, compile and install the source code again , Problem solving ~
边栏推荐
- 跨模态语义关联对齐检索-图像文本匹配(Image-Text Matching)
- 2022 examination for safety production management personnel of hazardous chemical production units and new version of examination questions for safety production management personnel of hazardous chem
- 网络模型的保存与读取
- Measure the voltage with analog input (taking Arduino as an example, the range is about 1KV)
- Complete model verification (test, demo) routine
- FIR filter of IQ signal after AD phase discrimination
- 2. Nonlinear regression
- Chapter improvement of clock -- multi-purpose signal modulation generation system based on ambient optical signal detection and custom signal rules
- Su embedded training - Day9
- 130. 被围绕的区域
猜你喜欢
5. Contrôle discret et contrôle continu
利用GPU训练网络模型
USB type-C docking design | design USB type-C docking scheme | USB type-C docking circuit reference
Chapter XI feature selection
2022 operation certificate examination for main principals of hazardous chemical business units and main principals of hazardous chemical business units
Introduction to ML regression analysis of AI zhetianchuan
Markdown learning (entry level)
2021-04-12 - new features lambda expression and function functional interface programming
Complete model training routine
Ag9310 same function alternative | cs5261 replaces ag9310type-c to HDMI single switch screen alternative | low BOM replaces ag9310 design
随机推荐
AI zhetianchuan ml novice decision tree
A speed Limited large file transmission tool for every major network disk
Content of one frame
How to write mark down on vscode
2022 safety officer-c certificate examination paper and safety officer-c certificate simulated examination question bank
跨模态语义关联对齐检索-图像文本匹配(Image-Text Matching)
Overall introduction of the project
Connect to the previous chapter of the circuit to improve the material draft
基础篇——整合第三方技术
Vscode reading Notepad Chinese display garbled code
How to transfer Netease cloud music /qq music to Apple Music
HDMI to VGA acquisition HD adapter scheme | HDMI to VGA 1080p audio and video converter scheme | cs5210 scheme design explanation
Cross modal semantic association alignment retrieval - image text matching
2、TD+Learning
完整的模型训练套路
2021-03-14 - play with generics
网络模型的保存与读取
Get started quickly using the local testing tool postman
Ag9311maq design 100W USB type C docking station data | ag9311maq is used for 100W USB type C to HDMI with PD fast charging +u3+sd/cf docking station scheme description
14.绘制网络模型结构