[go: up one dir, main page]

CN108183729A - The channel interleaving method and system of power line carrier communication based on FPGA - Google Patents

The channel interleaving method and system of power line carrier communication based on FPGA Download PDF

Info

Publication number
CN108183729A
CN108183729A CN201810224147.7A CN201810224147A CN108183729A CN 108183729 A CN108183729 A CN 108183729A CN 201810224147 A CN201810224147 A CN 201810224147A CN 108183729 A CN108183729 A CN 108183729A
Authority
CN
China
Prior art keywords
code
bit
block
power line
row
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810224147.7A
Other languages
Chinese (zh)
Inventor
李战胜
谭晓丽
王国蕊
介玺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN201810224147.7A priority Critical patent/CN108183729A/en
Publication of CN108183729A publication Critical patent/CN108183729A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B3/00Line transmission systems
    • H04B3/54Systems for transmission via power distribution lines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0057Block codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0071Use of interleaving

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Error Detection And Correction (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

本发明属于电力线载波通信领域,公开了一种基于FPGA的电力线载波通信的信道交织方法,所述基于FPGA的电力线载波通信的信道交织方法进行检验码的交织、信息码的交织、信息码和检验码的混合交织以及循环移位;交织处理后,将相邻比特分配到不同子载波上进行传输,将相邻比特映射到星座图中相对重要和次等重要的位置上;同时,在时域维度上对信息离散化,将有记忆信道转化为无记忆信道,再与纠错码配合降低误码率。本发明经过多级交织处理,在时域维度上对信息离散化,可以近似地将有记忆信道转化为无记忆信道,再与纠错码配合可以降低系统误码率,提高系统可靠性。

The invention belongs to the field of power line carrier communication, and discloses a channel interleaving method of power line carrier communication based on FPGA. The channel interleaving method of power line carrier communication based on FPGA performs interleaving of inspection codes, interleaving of information codes, and verification of information codes. Mixed interleaving and cyclic shifting of codes; after interleaving, the adjacent bits are allocated to different subcarriers for transmission, and the adjacent bits are mapped to relatively important and less important positions in the constellation diagram; at the same time, in the time domain Dimensionally discretize the information, transform the memory channel into a memoryless channel, and then cooperate with the error correction code to reduce the bit error rate. The present invention discretizes information in the time-domain dimension through multi-level interleaving processing, and can approximately convert a memory channel into a memoryless channel, and then cooperate with an error correction code to reduce the system bit error rate and improve system reliability.

Description

基于FPGA的电力线载波通信的信道交织方法及系统Channel interleaving method and system of FPGA-based power line carrier communication

技术领域technical field

本发明属于电力线载波通信领域,尤其涉及一种基于FPGA的电力线载波通信的信道交织方法及系统。The invention belongs to the field of power line carrier communication, in particular to an FPGA-based channel interleaving method and system for power line carrier communication.

背景技术Background technique

目前,业内常用的现有技术是这样的:At present, the existing technologies commonly used in the industry are as follows:

近20年来,低压电力线载波通信已经广泛应用于电力系统监控、远程抄表、家庭自动化等领域。目前,随着智能电网、能源互联网、“四网合一”等概念的发展,低速电力线通信已经不能满足社会需要。In the past 20 years, low-voltage power line carrier communication has been widely used in power system monitoring, remote meter reading, home automation and other fields. At present, with the development of concepts such as smart grid, energy Internet, and "four networks in one", low-speed power line communication can no longer meet social needs.

宽带电力线载波通信是指带宽在2~30MHz,传输速率在1Mbps以上的系统。宽带电力线载波通信系统,其物理层以正交频分复用为核心。电力线设计的初衷只是用来电力传输,并没有考虑到用电力线进行数据传输,不是专用的通信信道。低压电力线上连接着繁杂的用电设备,网络拓扑结构复杂,设备随机接入和切出,其信道特性恶劣。电力线信道上电力线上的噪声可以分为有色背景噪声、突发性噪声、随机脉冲噪声和周期脉冲噪声等,其中脉冲噪声对电力线的通信质量影响最大,被认为是电力线介质进行数据传输时产生突发错误的主要原因。电力线信道的频率选择性衰落和脉冲噪声会导致成串的比特错误,而信道交织目的是为了分布传输的信息比特,最大限度地改变信息结构,使信道的突发错误在时间上得以扩散,配合纠错码,可以降低突发错误,因此,设计合适的信道交织方法意义重大。Broadband power line carrier communication refers to a system with a bandwidth of 2 to 30 MHz and a transmission rate of more than 1 Mbps. The core of the physical layer of broadband power line carrier communication system is OFDM. The original intention of the power line design is only for power transmission, and does not consider the use of power lines for data transmission, not a dedicated communication channel. The low-voltage power line is connected with complicated electrical equipment, the network topology is complex, the equipment is randomly connected and switched out, and its channel characteristics are bad. The noise on the power line on the power line channel can be divided into colored background noise, burst noise, random pulse noise and periodic pulse noise, etc. Among them, the pulse noise has the greatest impact on the communication quality of the power line, which is considered to be the sudden change in the data transmission of the power line medium. The main reason for sending errors. The frequency selective fading and impulse noise of the power line channel will cause a series of bit errors, and the purpose of channel interleaving is to distribute the transmitted information bits, change the information structure to the greatest extent, and make the burst errors of the channel diffuse in time. Error-correcting codes can reduce burst errors, so it is of great significance to design a suitable channel interleaving method.

目前常用的交织方法是分组交织,分组交织是将纠错编码输出的信号均匀分成m个码组,每个码组含有n段数据,排列成m行n列的矩阵,然后以列的方式从左到右依次读出。现如今,对于宽带电力线载波通信系统,要求能提供的应用越来越丰富,因此,要求电力线载波传输速率的提高。针对于此,Turbo码也被应用于电力线载波通信系统中,也要求有更适应系统、可靠性更高的信道交织方法来满足系统需要。At present, the commonly used interleaving method is group interleaving. Group interleaving is to divide the output signal of the error correction code into m code groups evenly. Read from left to right. Nowadays, for the broadband power line carrier communication system, more and more applications are required to be provided. Therefore, it is required to increase the transmission rate of the power line carrier. In view of this, Turbo codes are also applied in the power line carrier communication system, and a channel interleaving method that is more adaptable to the system and has higher reliability is also required to meet the needs of the system.

综上所述,现有技术存在的问题是:In summary, the problems in the prior art are:

(1)目前,电力线信道特性差,容易出现突发差错,系统误码率高。(1) At present, the channel characteristics of power lines are poor, prone to burst errors, and the system bit error rate is high.

(2)目前常用的信道交织方法是分组交织,分组交织可以改变信息的结构,但是只是在时域或频率上一维上进行交织,对于m×n的分组交织器,周期为m比特干扰影响了传输过程的话,产生错误的m比特解交织后将变成连续比特进入纠错码译码,势必导致译码失败,从而产生较高误码率。(2) At present, the commonly used channel interleaving method is group interleaving, which can change the structure of information, but it only interleaves in one dimension in the time domain or frequency. For an m×n group interleaver, the period is m-bit interference If the transmission process is interrupted, the erroneous m bits will become continuous bits and enter the error correction code decoding after deinterleaving, which will inevitably lead to decoding failure, resulting in a higher bit error rate.

(3)宽带电力线通信中,其带宽较大,速率较高,可用子载波数目较多,分组交织并不能最大程序地改变信息的原始结构,交织不够充分导致相邻数据可能会仍然处于同一子信道或相邻子信道,依然会产生连续错误。导致连续错误后,纠错码不能正确纠错,系统误码率较高,不能满足宽带电力线通信的需要。(3) In broadband power line communication, the bandwidth is large, the rate is high, and the number of available subcarriers is large. Packet interleaving cannot change the original structure of the information to the greatest extent. Adjacent data may still be in the same subcarrier due to insufficient interleaving. Channels or adjacent sub-channels, continuous errors will still occur. After continuous errors are caused, the error correction code cannot correct the error correctly, and the bit error rate of the system is high, which cannot meet the needs of broadband power line communication.

解决上述技术问题的难度和意义:The difficulty and significance of solving the above technical problems:

现如今,随着智能电网、能源互联网、“四网合一”等概念的发展,对于宽带电力线载波通信系统,要求能提供的应用越来越丰富。高速率的宽带电力线通信系统,其带宽大、速率高、可用子载波数目较多。电力线信道特性差、高速率的要求以及系统的复杂,对系统性能提出了要求。而信道交织势必带来系统的延时,综上因素,如何在延时和性能之间找到平衡,提高系统可靠性是信道交织方法设计的困难之处。现有的分组交织方法,不能够充分打乱原始信息结构,依然能产生连串比特错误,不适合宽带电力线信道环境。Nowadays, with the development of concepts such as smart grid, energy Internet, and "four networks in one", broadband power line carrier communication systems are required to provide more and more applications. A high-speed broadband power line communication system has large bandwidth, high speed, and a large number of available subcarriers. Poor power line channel characteristics, high-speed requirements, and system complexity impose requirements on system performance. However, channel interleaving will inevitably bring system delay. To sum up the above factors, how to find a balance between delay and performance and improve system reliability is the difficulty in the design of channel interleaving methods. The existing packet interleaving method cannot fully disrupt the original information structure, and can still generate a series of bit errors, which is not suitable for the broadband power line channel environment.

本发明提出的信道交织方法,有四级交织,在尽可能引入小的延时的前提下,最大化改变了信息的原始结构,使得相邻比特尽量落在不同可用子载波上以及有效将相邻比特映射到星座图中相对重要和次等重要的位置上,经过多级交织处理,在时域维度上对信息离散化,可以近似地将有记忆信道转化为无记忆信道,可以有效降低连续错误的发生,能够满足高速电力线通信的需要,实现高速速率传输。The channel interleaving method proposed by the present invention has four levels of interleaving. Under the premise of introducing a small delay as much as possible, the original structure of the information is changed to the greatest extent, so that adjacent bits fall on different available subcarriers as much as possible and effectively separate the corresponding subcarriers. Adjacent bits are mapped to relatively important and less important positions in the constellation diagram, and after multi-level interleaving processing, the information is discretized in the time domain dimension, which can approximately convert the memory channel into a memoryless channel, which can effectively reduce the continuous The occurrence of errors can meet the needs of high-speed power line communication and realize high-speed transmission.

发明内容Contents of the invention

针对现有技术存在的问题,本发明提供了一种基于FPGA的电力线载波通信的信道交织方法及系统流程图。Aiming at the problems existing in the prior art, the present invention provides a channel interleaving method and system flow chart of FPGA-based power line carrier communication.

本发明是这样实现的,一种基于FPGA的电力线载波通信的信道交织方法,进行检验码的交织、信息码的交织、信息码和检验码的混合交织以及循环移位;交织处理后,将相邻比特分配到不同子载波上进行传输,将相邻比特映射到星座图中相对重要和次等重要的位置上;同时,在时域维度上对信息离散化,将有记忆信道转化为无记忆信道,再与纠错码配合降低误码率。The present invention is achieved in this way, a channel interleaving method based on FPGA-based power line carrier communication, which performs interleaving of inspection codes, interleaving of information codes, mixed interleaving of information codes and inspection codes, and cyclic shifting; after the interleaving process, the phase The adjacent bits are allocated to different subcarriers for transmission, and the adjacent bits are mapped to relatively important and less important positions in the constellation diagram; at the same time, the information is discretized in the time domain dimension, and the channel with memory is transformed into memoryless channel, and then cooperate with the error correction code to reduce the bit error rate.

进一步,所述基于FPGA的电力线载波通信的信道交织方法具体包括:Further, the channel interleaving method of the FPGA-based power line carrier communication specifically includes:

步骤一,对检验码进行交织处理;Step 1, performing interleaving processing on the check code;

步骤二,对信息码进行交织处理;Step 2, interleaving the information code;

步骤三,对信息码和检验码之间进行混合交织;Step 3, performing mixed interleaving between the information code and the check code;

步骤四,进行循环移位处理。Step 4, perform cyclic shift processing.

进一步,所述步骤一具体包括:Further, said step one specifically includes:

将检验码的第一块(n-k)/4比特输出到区块1中,第二块(n-k)/4比特输出到区块2中,第三块(n-k)/4比特输出到区块3中,第四块(n-k)/4比特输出到区块4中;等价于将检验码存入到一个(n-k)/4列4行的矩阵,其中,第一行代表区块1,第二行代表区块2,第三块代表区块3,第四行代表区块4;写入数据时,按行顺序写入数据;Output the first block (n-k)/4 bits of the check code to block 1, the second block (n-k)/4 bits to block 2, and the third block (n-k)/4 bits to block 3 , the fourth block (n-k)/4 bits is output to block 4; it is equivalent to storing the check code in a matrix of (n-k)/4 columns and 4 rows, where the first row represents block 1, and the first row The second line represents block 2, the third block represents block 3, and the fourth line represents block 4; when writing data, write data in row order;

读出数据时,按列将四行的数据同时读取,首先从第0列开始读取,在首地址上加上一个读取步长S,第一轮读出的列的顺序为(0,2*S,3*S,……),第一轮一共读取((n-k)/4)/S列;When reading data, read the data of four rows at the same time by column, first read from column 0, add a read step S to the first address, and the order of the columns read in the first round is (0 ,2*S,3*S,...), the first round reads a total of ((n-k)/4)/S columns;

接着,进行第二轮,读取首地址加1,从第1列开始读取,在首地址上加上一个读取步长S,第二轮读出的列的顺序为(1,2*S+1,3*S+1,……),第二轮一共读取((n-k)/4)/S列,以此类推,通过S轮的读取,读出全部检验码。Then, carry out the second round, read the first address plus 1, start reading from the first column, add a read step S to the first address, and the order of the columns read in the second round is (1,2* S+1, 3*S+1, ...), the second round reads ((n-k)/4)/S columns in total, and so on, through S rounds of reading, all check codes are read out.

进一步,所述步骤二具体包括:Further, said step two specifically includes:

将信息码的第一块k/4比特输出到区块1中,第二块k/4比特输出到区块2中,第三块k/4比特输出到区块3中,第四块k/4比特输出到区块4中;等价于将信息码存入到一个k/4列4行的矩阵,其中,第一行代表区块1,第二行代表区块2,第三块代表区块3,第四行代表区块4;写入数据时,按行顺序写入数据;Output the first block k/4 bits of the information code to block 1, the second block k/4 bits to block 2, the third block k/4 bits to block 3, and the fourth block k /4 bits are output to block 4; it is equivalent to storing the information code in a matrix of k/4 columns and 4 rows, where the first row represents block 1, the second row represents block 2, and the third block Represents block 3, and the fourth row represents block 4; when writing data, write data in row order;

读出数据时,按列将四行的数据同时读取;其中,T=k/4,对于信息码的交织,从一个偏移值offset列开始读取,首先从第offset列开始读取,之后在首地址上加上一个读取步长S,第一轮读出的列的顺序为(offset,(offset+S)mod T,(offset+2*S)modT,……),第一轮共读取(k/4)/S列;When reading data, read the data of four rows simultaneously by column; wherein, T=k/4, for the interleaving of information code, start reading from an offset value offset column, first start reading from the offset column, Then add a reading step S to the first address, the order of the columns read in the first round is (offset, (offset+S) mod T, (offset+2*S) mod T, ...), the first A total of (k/4)/S columns are read in rounds;

接着,进行第二轮,读取首地址加1,从第1列开始读取,之后在首地址上加上一个读取步长S,第二轮读出的列的顺序为(offset+1,(offset+S+1)mod T,(offset+2*S+1)modT,……),第二轮一共读取(k/4)/S列,以此类推,通过S轮的读取,读出全部信息码。Then, carry out the second round, read the first address plus 1, start reading from the first column, and then add a read step S to the first address, the order of the columns read in the second round is (offset+1 ,(offset+S+1)mod T,(offset+2*S+1)modT,...), the second round reads a total of (k/4)/S columns, and so on, through S rounds of reading Take, read all information codes.

进一步,所述步骤三具体包括:Further, said step three specifically includes:

检验码交织后,输出为(n-k)/4比特,信息码交织后,输出为k/4比特,(n-k)/4比特与k/4比特进行混合交织;输出结果为前4比特为信息码,接着4比特检验码,以此类推,完成检验码和信息码之间的交织过程;After the check code is interleaved, the output is (n-k)/4 bits, after the information code is interleaved, the output is k/4 bits, (n-k)/4 bits and k/4 bits are mixed and interleaved; the output result is the first 4 bits are the information code , followed by a 4-bit check code, and so on, to complete the interleaving process between the check code and the information code;

所述串并转换,包括:将k比特信息码经过串并转换后变成k/4个位宽为4比特的数据,将(n-k)比特检验码经过串并转换后变成(n-k)/4个位宽为4比特的数据;将这n/4个数据交替输出,信息码在前,接着检验码,以此类推;The serial-to-parallel conversion includes: converting the k-bit information code into k/4 data with a bit width of 4 bits after serial-to-parallel conversion, and converting the (n-k) bit check code into (n-k)/ 4 pieces of data with a bit width of 4 bits; output the n/4 pieces of data alternately, with the information code first, followed by the check code, and so on;

所述步骤四具体包括:The fourth step specifically includes:

将第步骤三处理后的数据,按照0到7循环编号,每两个半字节调整依次顺序,对于标号为0和1,不处理直接输出,对于标号2和3,循环右移1位,对于标号4和5,循环右移2位,对于标号6和7,循环右移3位;之后再进行并串转换输出。The processed data in the third step is numbered according to the cycle from 0 to 7, and the sequence is adjusted every two nibbles. For labels 0 and 1, they are not processed and directly output. For labels 2 and 3, they are cyclically shifted to the right by 1 bit. For labels 4 and 5, rotate right by 2 bits, and for labels 6 and 7, rotate right by 3 bits; then perform parallel-to-serial conversion and output.

本发明的另一目的在于提供一种实现所述基于FPGA的电力线载波通信的信道交织方法的计算机程序。Another object of the present invention is to provide a computer program for realizing the channel interleaving method of the FPGA-based power line carrier communication.

本发明的另一目的在于提供一种实现所述基于FPGA的电力线载波通信的信道交织方法的信息数据处理终端。Another object of the present invention is to provide an information and data processing terminal for realizing the channel interleaving method of the FPGA-based power line carrier communication.

本发明的另一目的在于提供一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行所述的基于FPGA的电力线载波通信的信道交织方法。Another object of the present invention is to provide a computer-readable storage medium, including instructions, which, when run on a computer, cause the computer to execute the FPGA-based power line carrier communication channel interleaving method.

本发明的另一目的在于提供一种基于FPGA的电力线载波通信的信道交织系统包括:Another object of the present invention is to provide a channel interleaving system based on FPGA-based power line carrier communication including:

检验码交织单元,利用RAM和乒乓结构对检验码交织;The check code interleaving unit uses the RAM and the ping-pong structure to interleave the check code;

信息码交织单元,利用RAM和乒乓结构对信息码交织;The information code interleaving unit uses the RAM and the ping-pong structure to interleave the information code;

混合交织单元,用于串并转换,对信息码和检验码之间进行混合交织;The hybrid interleaving unit is used for serial-to-parallel conversion, and performs hybrid interleaving between the information code and the check code;

循环移位操作单元,用于进行循环移位操作,之后并串变换。The cyclic shift operation unit is used for performing a cyclic shift operation followed by a parallel-to-serial conversion.

本发明的另一目的在于提供一种搭载有所述基于FPGA的电力线载波通信的信道交织系统的信息数据处理终端。Another object of the present invention is to provide an information data processing terminal equipped with the FPGA-based power line carrier communication channel interleaving system.

综上所述,本发明的优点及积极效果为:In summary, the advantages and positive effects of the present invention are:

本发明进行检验码的交织、信息码的交织、信息码和检验码的混合交织以及循环移位。交织处理后,有效地将相邻比特分配到不同子载波上进行传输,同时有效将相邻比特映射到星座图中相对重要和次等重要的位置上,可以有效降低频率衰落对系统的影响。本发明经过多级交织处理,在时域维度上对信息离散化,可以近似地将有记忆信道转化为无记忆信道,再与纠错码配合可以降低系统误码率,提高系统可靠性。The invention performs interleaving of inspection codes, interleaving of information codes, mixed interleaving of information codes and inspection codes, and cyclic shifting. After interleaving, adjacent bits are effectively allocated to different subcarriers for transmission, and adjacent bits are effectively mapped to relatively important and less important positions in the constellation diagram, which can effectively reduce the impact of frequency fading on the system. The present invention discretizes information in the time-domain dimension through multi-level interleaving processing, and can approximately convert a memory channel into a memoryless channel, and then cooperate with an error correction code to reduce the system bit error rate and improve system reliability.

对于m×n的分组交织器,周期为m比特干扰影响了传输过程的话,产生错误的m比特解交织后将变成连续比特进入纠错码译码,势必导致译码失败。相比于m×n的分组交织器,本发明具有较多优点,分组交织和本发明的技术对比如表1所示:For an m×n packet interleaver, if the period is m-bit interference affects the transmission process, the wrong m-bits will become continuous bits after de-interleaving and enter the error-correcting code decoding, which will inevitably lead to decoding failure. Compared with the m×n packet interleaver, the present invention has more advantages, and the technical comparison between packet interleaving and the present invention is shown in Table 1:

表1Table 1

目前行之有效的方法是利用正交频分复用(OFDM)系统,利用多载波进行数据的传输。电力线信道具有频率选择性,当某一个频段干扰大时,该频段的子载波上数据都会发生错误,会产生频率选择性衰落,导致连串的比特均会产生错误。本发明的基于FPGA的信道交织方法可保证相邻的比特在经过OFDM调制后会落在不相邻的子载波上了,同时可以使得相邻比特映射到星座图相对重要和次重要的星座图上。经过交织后,最大化分散了原有连续比特,当经过解交织处理后,错误分散,依然在纠错码的纠错范围之内,从而减轻衰落信道对系统性能的影响。Currently, an effective method is to use an Orthogonal Frequency Division Multiplexing (OFDM) system to transmit data using multiple carriers. The power line channel has frequency selectivity. When a certain frequency band has strong interference, data errors will occur on the subcarriers of this frequency band, and frequency selective fading will occur, resulting in errors in a series of bits. The FPGA-based channel interleaving method of the present invention can ensure that adjacent bits will fall on non-adjacent sub-carriers after OFDM modulation, and at the same time, adjacent bits can be mapped to relatively important and less important constellation diagrams superior. After interleaving, the original continuous bits are maximized. After de-interleaving, the error dispersion is still within the error correction range of the error correction code, thereby reducing the impact of fading channels on system performance.

本发明针对电力线载波通信信道传输特性恶劣,利用FPGA资源,提出信道交织方法,在时域维度上,可以离散信道的突发差错,近似地将有记忆信道转化为无记忆信道,使得纠随机差错的纠错码可以用于电力线载波通信系统中。通过信道交织的处理,再配合相应的纠错码,可以克服电力线载波通信信道特性差的缺点,大幅度提高频谱利用率,从而利用电力线进行有效的通信传输。Aiming at the poor transmission characteristics of the power line carrier communication channel, the present invention uses FPGA resources to propose a channel interleaving method, which can discrete channel burst errors in the time domain dimension, and approximately convert memory channels into memoryless channels, so that random errors can be corrected The error correction code can be used in the power line carrier communication system. Through the processing of channel interleaving, combined with the corresponding error correction code, the disadvantage of poor communication channel characteristics of power line carrier can be overcome, and the spectrum utilization rate can be greatly improved, so that the power line can be used for effective communication transmission.

本发明的仿真实验表明,输入信息码和检验码采用特殊比特,信息码为0,1交替的128比特,检验码也是0,1交替的128比特,parity_out是检验码交织结果,data_out是信息码交织结果,da_pa_out是信息码和检验码混合交织的结果,DP_ND是交织最终输出结果。输出时钟CLK3是输入时钟CLK1的两倍,可以看到交织结果先是64比特的0,再是64比特的1,接着又是64比特的0,然后64比特的1,结果与Matlab结果一致,是正确的。The simulation experiment of the present invention shows that the input information code and the check code adopt special bits, the information code is 128 bits alternated with 0 and 1, and the check code is also 128 bits alternated with 0 and 1, parity_out is the interleaving result of the check code, and data_out is the information code The interleaving result, da_pa_out is the mixed interleaving result of the information code and the check code, and DP_ND is the final output result of the interleaving. The output clock CLK3 is twice that of the input clock CLK1. It can be seen that the interleaving result is first 64-bit 0, then 64-bit 1, then 64-bit 0, and then 64-bit 1. The result is consistent with the Matlab result. correct.

附图说明Description of drawings

图1是本发明实施例提供的基于FPGA的电力线载波通信的信道交织方法流程图。FIG. 1 is a flowchart of a channel interleaving method for FPGA-based power line carrier communication provided by an embodiment of the present invention.

图2是本发明实施例提供的基于FPGA的电力线载波通信的信道交织系统示意图。Fig. 2 is a schematic diagram of a channel interleaving system for FPGA-based power line carrier communication provided by an embodiment of the present invention.

图3是本发明实施例提供的检验码交织器硬件实现框图。Fig. 3 is a hardware implementation block diagram of a verification code interleaver provided by an embodiment of the present invention.

图4是本发明实施例提供的信息码交织器硬件实现框图。Fig. 4 is a hardware implementation block diagram of an information code interleaver provided by an embodiment of the present invention.

图5是本发明实施例提供的信息码和检验码混合交织器硬件实现框图。Fig. 5 is a hardware implementation block diagram of the information code and check code hybrid interleaver provided by the embodiment of the present invention.

图6是本发明实施例提供的循环移位硬件实现框图。FIG. 6 is a block diagram of cyclic shift hardware implementation provided by an embodiment of the present invention.

图7是本发明实施例提供的整体仿真结果图。FIG. 7 is a diagram of an overall simulation result provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention more clear, the present invention will be further described in detail below in conjunction with the examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

现有技术中,电力线信道特性差,容易出现突发差错;系统误码率高。In the prior art, the channel characteristics of the power line are poor, and burst errors are prone to occur; the bit error rate of the system is high.

下面结合具体分析对本发明作进一步描述。The present invention will be further described below in conjunction with specific analysis.

如图1所示,本发明实施例提供的基于FPGA的电力线载波通信的信道交织方法,利用Verilog程序实现信道交织,所述信道交织方法的实现主要包括以下几个步骤:As shown in Figure 1, the channel interleaving method based on the FPGA-based power line carrier communication provided by the embodiment of the present invention utilizes the Verilog program to realize channel interleaving, and the realization of the channel interleaving method mainly includes the following steps:

第一步,对检验码进行交织处理。The first step is to interleave the check code.

第二步,对信息码进行交织处理。In the second step, the information code is interleaved.

第三步,对信息码和检验码进行混合交织。In the third step, mixed interleaving is performed on the information code and the check code.

第四步,进行循环移位处理。The fourth step is to perform cyclic shift processing.

所述的电力线载波通信的信道交织方法的FPGA实现包括以下步骤:The FPGA implementation of the channel interleaving method of the power line carrier communication comprises the following steps:

步骤一,利用RAM和乒乓结构对检验码交织。Step 1, using RAM and ping-pong structure to interleave the check code.

步骤二,利用RAM和乒乓结构对信息码交织。Step 2, using RAM and ping-pong structure to interleave the information code.

步骤三,串并转换,对信息码和检验码之间进行混合交织。Step 3, serial-to-parallel conversion, performing hybrid interleaving between the information code and the check code.

步骤四,进行循环移位操作,之后并串变换。Step 4, perform a circular shift operation, and then perform a parallel-to-serial conversion.

所述步骤一具体包括:Described step one specifically includes:

假设信道信道编码后是信息码和检验码分别传输出来,信息码长度为k比特,检验码长度为(n-k)比特。本设计主要针对码率为1/2。本步骤针对(n-k)比特检验码进行交织处理。Assume that after channel coding, the information code and the check code are transmitted separately, the length of the information code is k bits, and the length of the check code is (n-k) bits. This design is mainly aimed at code rate 1/2. In this step, the interleaving process is performed on the (n-k) bit check code.

将检验码的第一块((n-k)/4比特)输出到区块1中,第二块((n-k)/4比特)输出到区块2中,第三块((n-k)/4比特)输出到区块3中,第四块((n-k)/4比特)输出到区块4中。等价于将检验码存入到一个(n-k)/4列4行的矩阵,其中,第一行代表区块1,第二行代表区块2,第三块代表区块3,第四行代表区块4。写入数据时,按行顺序写入数据。读出数据时,按列将四行的数据同时读取,首先从第0列开始读取,之后在首地址上加上一个读取步长S,这样第一轮读出的列的顺序为(0,2*S,3*S,……),第一轮一共读取((n-k)/4)/S列;接着,进行第二轮,读取首地址加1,即从第1列开始读取,之后在首地址上加上一个读取步长S,第二轮读出的列的顺序为(1,2*S+1,3*S+1,……),第二轮一共读取((n-k)/4)/S列,依次类推,通过S轮的读取,即可读出全部检验码。其中,相关参数见表1。Output the first block ((n-k)/4 bits) of the verification code to block 1, the second block ((n-k)/4 bits) to block 2, and the third block ((n-k)/4 bits ) into block 3 and the fourth block ((n-k)/4 bits) into block 4. It is equivalent to storing the verification code in a matrix of (n-k)/4 columns and 4 rows, where the first row represents block 1, the second row represents block 2, the third block represents block 3, and the fourth row Represents block 4. When writing data, write data in row order. When reading data, read the data of four rows at the same time by column, first read from the 0th column, and then add a read step S to the first address, so that the order of the columns read in the first round is (0,2*S,3*S,...), the first round reads ((n-k)/4)/S columns in total; then, the second round is performed, and the first address is read plus 1, that is, from the first The column starts to be read, and then a read step S is added to the first address. The order of the columns read in the second round is (1,2*S+1,3*S+1,...), the second A total of ((n-k)/4)/S columns are read in rounds, and so on. After reading in S rounds, all check codes can be read out. Among them, the relevant parameters are shown in Table 1.

步骤二具体包括:Step two specifically includes:

本步骤针对k比特检验码进行交织处理。将信息码的第一块(k/4比特)输出到区块1中,第二块(k/4比特)输出到区块2中,第三块(k/4比特)输出到区块3中,第四块(k/4比特)输出到区块4中。等价于将信息码存入到一个k/4列4行的矩阵,其中,第一行代表区块1,第二行代表区块2,第三块代表区块3,第四行代表区块4。写入数据时,按行顺序写入数据。读出数据时,按列将四行的数据同时读取。为方便描述,定义T=k/4。对于信息码的交织,不是从第0列开始读取,而是要从一个偏移值offset列开始读取,首先从第offset列开始读取,之后在首地址上加上一个读取步长S,这样第一轮读出的列的顺序为(offset,(offset+S)mod T,(offset+2*S)modT,……),第一轮一共读取(k/4)/S列;接着,进行第二轮,读取首地址加1,即从第1列开始读取,之后在首地址上加上一个读取步长S,第二轮读出的列的顺序为(offset+1,(offset+S+1)mod T,(offset+2*S+1)modT,……),第二轮一共读取(k/4)/S列,依次类推,通过S轮的读取,即可读出全部信息码。其中,相关参数见表2。In this step, the interleaving process is performed on the k-bit check code. Output the first block (k/4 bits) of the information code to block 1, the second block (k/4 bits) to block 2, and the third block (k/4 bits) to block 3 , the fourth block (k/4 bits) is output into block 4. It is equivalent to storing the information code in a matrix of k/4 columns and 4 rows, where the first row represents block 1, the second row represents block 2, the third block represents block 3, and the fourth row represents the block Block 4. When writing data, write data in row order. When reading out the data, the data of the four rows are read out at the same time by column. For convenience of description, define T=k/4. For the interleaving of the information code, it is not to start reading from the 0th column, but to start reading from an offset value offset column, first start reading from the offset column, and then add a read step to the first address S, so the order of the columns read in the first round is (offset, (offset+S) mod T, (offset+2*S) mod T, ...), and the first round reads a total of (k/4)/S Then, carry out the second round, read the first address plus 1, that is, start reading from the first column, and then add a read step S to the first address, and the order of the columns read in the second round is ( offset+1, (offset+S+1)mod T, (offset+2*S+1)modT,...), the second round reads (k/4)/S columns in total, and so on, through S rounds Read, you can read all the information code. Among them, the relevant parameters are shown in Table 2.

表2Table 2

信息码(比特数)Information code (number of bits) 偏移值offset value 步长step size 128128 1616 44 576576 7272 1616

步骤三具体包括:Step three specifically includes:

检验码交织后,输出为(n-k)/4比特,信息码交织后,输出为k/4比特,对二者进行混合交织。输出结果应为前4比特为信息码,接着4比特检验码,依次类推即可完成检验码和信息码之间的交织过程。After the check code is interleaved, the output is (n-k)/4 bits, after the information code is interleaved, the output is k/4 bits, and the two are mixed and interleaved. The output result should be that the first 4 bits are the information code, followed by the 4-bit check code, and so on to complete the interleaving process between the check code and the information code.

利用串并转换,将k比特信息码经过串并转换后变成k/4个位宽为4比特的数据,将(n-k)比特检验码经过串并转换后变成(n-k)/4个位宽为4比特的数据。现在的处理就是要将这n/4个数据交替输出,信息码在前,接着检验码,依次类推。Using serial-to-parallel conversion, the k-bit information code is converted into k/4 data with a bit width of 4 bits after serial-to-parallel conversion, and the (n-k) bit inspection code is converted into (n-k)/4 bits after serial-to-parallel conversion Data with a width of 4 bits. The current processing is to output the n/4 data alternately, with the information code first, followed by the check code, and so on.

利用一个位宽为4,深度为n/2的简单双口分布式RAM(DRAM),将n/2个数据有规律写入,之后顺序读出即可。具体来说,写入地址的产生是顺序的,采用模n/2计数器即可,但是写入内容dina是交替变化的,dina先是信息码,之后是检验码,依次类推。Using a simple dual-port distributed RAM (DRAM) with a bit width of 4 and a depth of n/2, write n/2 data regularly, and then read them sequentially. Specifically, the write address is generated sequentially, using a modulo n/2 counter, but the write content dina changes alternately, dina is the information code first, then the check code, and so on.

步骤四具体包括:Step four specifically includes:

将第步骤三处理后的数据,按照0到7循环编号,每两个半字节调整依次顺序,对于标号为0和1,不处理直接输出,对于标号2和3,循环右移1位,对于标号4和5,循环右移2位,对于标号6和7,循环右移3位。之后的数据依次按此规律处理。之后再进行并串转换输出。具体规则如表3所示。The processed data in the third step is numbered according to the cycle from 0 to 7, and the sequence is adjusted every two nibbles. For labels 0 and 1, they are not processed and directly output. For labels 2 and 3, they are cyclically shifted to the right by 1 bit. For labels 4 and 5, rotate right by 2 bits, and for labels 6 and 7, rotate right by 3 bits. Subsequent data are processed sequentially according to this rule. Then perform parallel-serial conversion output. The specific rules are shown in Table 3.

表3table 3

输出半字节序号output nibble number 移位模式shift mode 0或10 or 1 b0b1b2b3b0b1b2b3 2或32 or 3 b3b0b1b2b3b0b1b2 4或54 or 5 b2b3b0b1b2b3b0b1 6或76 or 7 b1b2b3b0b1b2b3b0

电力线载波通信中,目前行之有效的方法是利用正交频分复用(OFDM)系统,利用多载波进行数据的传输。本发明的基于FPGA的信道交织方法可保证相邻的比特在经过OFDM调制后会落在不相邻的子载波上了,同时可以使得相邻比特映射到星座图相对重要和次重要的星座图上,从而减轻衰落信道对系统性能的影响。In the power line carrier communication, the current effective method is to use the Orthogonal Frequency Division Multiplexing (OFDM) system to transmit data by using multiple carriers. The FPGA-based channel interleaving method of the present invention can ensure that adjacent bits will fall on non-adjacent sub-carriers after OFDM modulation, and at the same time, adjacent bits can be mapped to relatively important and less important constellation diagrams , so as to alleviate the impact of fading channels on system performance.

如图2,本发明实施例提供一种基于FPGA的电力线载波通信的信道交织系统包括:As shown in Figure 2, an embodiment of the present invention provides an FPGA-based channel interleaving system for power line carrier communication including:

检验码交织单元,利用RAM和乒乓结构对检验码交织;The check code interleaving unit uses the RAM and the ping-pong structure to interleave the check code;

信息码交织单元,利用RAM和乒乓结构对信息码交织;The information code interleaving unit uses the RAM and the ping-pong structure to interleave the information code;

混合交织单元,用于串并转换,对信息码和检验码之间进行混合交织;The hybrid interleaving unit is used for serial-to-parallel conversion, and performs hybrid interleaving between the information code and the check code;

循环移位操作单元,用于进行循环移位操作,之后并串变换。The cyclic shift operation unit is used for performing a cyclic shift operation followed by a parallel-to-serial conversion.

下面结合具体实施例对本发明作进一步描述。The present invention will be further described below in conjunction with specific embodiments.

假设信道编码采用的是128比特长度,码率为1/2的编码方式,输出结果中,信息码和检验码是并行输出的。Assuming that the channel coding adopts a coding method with a length of 128 bits and a code rate of 1/2, in the output result, the information code and the check code are output in parallel.

如图1所示,本发明的实现需要经过以下步骤:As shown in Figure 1, the realization of the present invention needs to go through the following steps:

步骤一:对128比特的检验码进行交织。Step 1: Interleave the 128-bit check code.

具体来说,常见分组交织的实现一般利用RAM的读写来调整顺序实现交织功能,采用“乱序写入,顺序读出”或“顺序写入,乱序读出的”的方法。Specifically, the implementation of common packet interleaving generally uses the read and write of RAM to adjust the order to realize the interleaving function, and adopts the method of "writing out of order, reading out in order" or "writing in order, reading out in order".

本发明中,较为方便的是采用“顺序写入,乱序读出”方式。以CLK1为时钟,利用位宽为1,深度为128的RAM,将输入的检验码按照顺序存入RAM中,即依次存入RAM的地址0~地址127中,写入地址的生成单元wadd Generator可由模128计数器产生。读取地址采取“乱序读出”的方法,当读取地址使能拉高时,进行读取地址的计算。基于上述分析,检验码交织器设计的硬件实现框图如图3所示。In the present invention, it is more convenient to adopt the method of "sequential writing, random reading". Using CLK1 as the clock, using a RAM with a bit width of 1 and a depth of 128, the input check code is stored in the RAM in sequence, that is, stored in the address 0 to address 127 of the RAM in sequence, and written into the address generating unit wadd Generator Can be generated by a modulo 128 counter. The read address adopts the method of "out-of-order read". When the read address enable is pulled high, the calculation of the read address is performed. Based on the above analysis, the hardware implementation block diagram of the check code interleaver design is shown in Figure 3.

RAM读取地址的生成是整个设计的关键和难点。根据检验码交织思路以及规律的寻找,可以设计出读取地址生成单元radd Generator。核心设计如下式:The generation of RAM read address is the key and difficult point of the whole design. According to the idea of check code interleaving and the search of rules, the read address generating unit radd Generator can be designed. The core design is as follows:

wadd=cnt1+4cnt2+32cnt3\*MERGEFORMAT(1)wadd=cnt1+4cnt2+32cnt3\*MERGEFORMAT(1)

其中,cnt1位宽为2,cnt2位宽为3,cnt3位宽为2。cnt1、cnt2、cnt3的初始值均为0。cnt3的变化为0,1,2,3,然后继续按此规律循环,当cnt3为3时,cnt2加1,cnt2的变化为0,1,2,3,4,5,6,7,然后cnt2继续按此规律循环,当cnt2为7时,cnt1加1,cnt1的变化为0,1,2,3,此时实现了128个读取地址的计算。此时根据该公式可以计算出读取地址,其关键Verilog代码如下:Among them, the bit width of cnt1 is 2, the bit width of cnt2 is 3, and the bit width of cnt3 is 2. The initial values of cnt1, cnt2 and cnt3 are all 0. The change of cnt3 is 0, 1, 2, 3, and then continue to cycle according to this rule. When cnt3 is 3, add 1 to cnt2, and the change of cnt2 is 0, 1, 2, 3, 4, 5, 6, 7, and then cnt2 continues to cycle according to this rule. When cnt2 is 7, cnt1 is increased by 1, and the change of cnt1 is 0, 1, 2, 3. At this time, the calculation of 128 read addresses is realized. At this time, the read address can be calculated according to the formula, and the key Verilog code is as follows:

当读取地址计算使能拉高时,开始进行读取地址wadd的计算。通过该代码设计,可以计算出读取地址为0,32,64,96,4,36,68,100……31,63,95,127与设计思路相符合。When the read address calculation enable is pulled high, the calculation of the read address wadd starts. Through this code design, it can be calculated that the read address is 0, 32, 64, 96, 4, 36, 68, 100... 31, 63, 95, 127, which is consistent with the design idea.

由于采用“乱序写入,顺序读出”的设计,因此,在一帧数据未完全写入时,则不能进行新的数据写出,否则读出的数据将可能会受到新写入数据的影响而产生错误,因此会产生无法处理连续数据的问题。考虑到这个问题,解决的方法就是采用流水线结构,利用“乒乓结构”,采用两个位宽为1,深度为128的简单双口RAM,命名为RAM0和RAM1,通过对RAM0和RAM1写使能和读使能的控制,实现如下过程:当对RAM0进行写入数据时,同时对RAM1进行读取,当对RAM0进行读取时,同时对RAM1写入数据,这样可以保证数据的连续处理,并且不会产生错误。Due to the design of "write out of order and read out sequentially", when a frame of data is not completely written, new data cannot be written, otherwise the read data may be affected by the newly written data. Influenced by the error, it will cause the problem of not being able to handle continuous data. Considering this problem, the solution is to use the pipeline structure, use the "ping-pong structure", use two simple dual-port RAMs with a bit width of 1 and a depth of 128, named RAM0 and RAM1, and write enable to RAM0 and RAM1 And read enable control, realize the following process: when writing data to RAM0, read RAM1 at the same time, when reading RAM0, write data to RAM1 at the same time, so that the continuous processing of data can be guaranteed. and no error is generated.

步骤二:对128比特信息码进行交织。Step 2: Interleave the 128-bit information code.

信息码交织与检验码的交织非常相似,信息码交织器设计的硬件实现框图如图4所示。主要区别在于RAM读取地址的计算有些许不同。信息码交织的读取地址的计算的核心公式依然是:The information code interleaving is very similar to the check code interleaving. The hardware implementation block diagram of the information code interleaver design is shown in Figure 4. The main difference is that the calculation of the RAM read address is slightly different. The core formula for calculating the read address of information code interleaving is still:

wadd=cnt1+4cnt2+32cnt3\*MERGEFORMAT(2)wadd=cnt1+4cnt2+32cnt3\*MERGEFORMAT(2)

不过,由于信息码交织中,由于存在交织偏移值16,因此,根据设计思路,其实现上与检验码交织有一定的不同。cnt1位宽为2,cnt2位宽为3,cnt3位宽为2。cnt1、cnt3的初始值均为0,而cnt2的初始值为4。cnt3的变化为0,1,2,3,然后继续按此规律循环,当cnt3为3时,cnt2加1,cnt2的变化为4,5,6,7,0,1,2,3,然后cnt2继续按此规律循环,当cnt2为3时,cnt1加1,cnt1的变化为0,1,2,3,此时实现了128个读取地址的计算。However, due to the existence of an interleaving offset value of 16 in the information code interleaving, according to the design idea, its implementation is somewhat different from that of the check code interleaving. The bit width of cnt1 is 2, the bit width of cnt2 is 3, and the bit width of cnt3 is 2. The initial values of cnt1 and cnt3 are both 0, while the initial value of cnt2 is 4. The change of cnt3 is 0, 1, 2, 3, and then continue to cycle according to this rule. When cnt3 is 3, add 1 to cnt2, and the change of cnt2 is 4, 5, 6, 7, 0, 1, 2, 3, and then cnt2 continues to cycle according to this rule. When cnt2 is 3, cnt1 is added by 1, and the change of cnt1 is 0, 1, 2, 3. At this time, the calculation of 128 read addresses is realized.

除了cnt2初始值不同,其他计算读取地址代码与检验码相同。因此,当读取地址计算使能拉高时,开始进行读取地址wadd的计算。通过该代码设计,可以计算出读取地址为16,48,80,112……15,47,79,111与设计思路相符合。为了处理连续数据,同样利用“乒乓结构”进行处理。Except that the initial value of cnt2 is different, other calculation read address codes are the same as check codes. Therefore, when the read address calculation enable is pulled high, the calculation of the read address wadd starts. Through this code design, it can be calculated that the read address is 16, 48, 80, 112...15, 47, 79, 111, which is consistent with the design idea. In order to deal with continuous data, the same "ping-pong structure" is used for processing.

步骤三:信息码和检验码混合交织。Step 3: The information code and the check code are mixed and interleaved.

(3a)当输入时钟为CLK1时,利用串并转换,将128比特信息码经过串并转换后变成32个位宽为4比特的数据,将128比特检验码经过串并转换后变成32个位宽为4比特的数据。现在的处理就是要将这64个数据交替输出,信息码在前,接着检验码,以此类推。(3a) When the input clock is CLK1, use serial-to-parallel conversion to convert the 128-bit information code into 32 data with a bit width of 4 bits after serial-to-parallel conversion, and convert the 128-bit inspection code to 32 after serial-to-parallel conversion Data with a unit bit width of 4 bits. The current processing is to output these 64 data alternately, with the information code first, followed by the check code, and so on.

(3b)利用一个位宽为4,深度为64的简单双口分布式RAM(DRAM),将64个数据有规律写入,之后顺序读出即可。具体来说,写入地址的产生是顺序的,采用模64计数器即可,但是写入内容dina是交替变化的,dina先是信息码,之后是检验码,依次类推。经过处理后的数据是64个半字节数据,便于下一阶段的循环移位处理。写入DRAM和读取DRAM的时钟为CLK2,CLK2是CLK1的二分频。(3b) Using a simple dual-port distributed RAM (DRAM) with a bit width of 4 and a depth of 64, write 64 data regularly, and then read them sequentially. Specifically, the write address is generated sequentially, using a modulo 64 counter, but the write content dina changes alternately, dina is the information code first, then the check code, and so on. The processed data is 64 nibbles, which is convenient for the next stage of cyclic shift processing. The clock for writing DRAM and reading DRAM is CLK2, which is divided by two of CLK1.

通过以上分析,信息码和检验码交织器设计如图5所示。Through the above analysis, the design of the information code and check code interleaver is shown in Figure 5.

步骤四:循环移位处理。Step 4: cyclic shift processing.

(4a)输入时钟为CLK2,进行半字节移位处理。对于标号为0和1,不处理直接输出,对于标号2和3,循环右移1位,对于标号4和5,循环右移2位,对于标号6和7,循环右移3位。之后的数据依次按此规律处理。(4a) The input clock is CLK2, and the nibble shift processing is performed. For labels 0 and 1, the direct output is not processed, for labels 2 and 3, rotate right by 1 bit, for labels 4 and 5, rotate right by 2 bits, and for labels 6 and 7, rotate right by 3 bits. Subsequent data are processed sequentially according to this rule.

(4b)并串转换。由于信道交织输出的数据要进一步给调制模块使用,而调制方式并不固定,可能是QPSK、16QAM等,因此,信息交织输出的数据应该是串行比特流。将移位后的数据,进行并串变换后,输出串行比特流。输出时的时钟为CLK3,其频率为CLK2的四倍,为CLK1的两倍。(4b) Parallel to serial conversion. Since the data output by channel interleaving is further used by the modulation module, and the modulation method is not fixed, it may be QPSK, 16QAM, etc. Therefore, the data output by information interleaving should be a serial bit stream. After the shifted data is converted to parallel and serial, a serial bit stream is output. The clock at the output is CLK3, whose frequency is four times that of CLK2 and twice that of CLK1.

根据以上分析,循环移位的硬件实现框图如图6所示。According to the above analysis, the hardware implementation block diagram of cyclic shift is shown in Figure 6.

经过以上四步骤,利用FPGA中的RAM的写入和读取,利用串并转换、移位、并串转换等操作即可实现信道交织的整个系统。利用这些,具有逻辑简单、时延小的优点。After the above four steps, the entire system of channel interleaving can be realized by using the writing and reading of the RAM in the FPGA, and using operations such as serial-to-parallel conversion, shift, and parallel-to-serial conversion. Utilizing these has the advantages of simple logic and small time delay.

下面结合仿真实验对本发明作进一步描述。The present invention will be further described below in combination with simulation experiments.

如图7所示,给出了Verilog仿真图。该图是截取的一段仿真波形,为了便于验证是否正确,输入信息码和检验码采用特殊比特,信息码为0,1交替的128比特,检验码也是0,1交替的128比特,parity_out是检验码交织结果,data_out是信息码交织结果,da_pa_out是信息码和检验码混合交织的结果,DP_ND是交织最终输出结果。输出时钟CLK3是输入时钟CLK1的两倍,可以看到交织结果先是64比特的0,再是64比特的1,接着又是64比特的0,然后64比特的1,结果与Matlab结果一致,是正确的。As shown in Figure 7, a Verilog simulation diagram is given. The figure is an intercepted simulated waveform. In order to verify whether it is correct or not, the input information code and the check code use special bits. The information code is 128 bits alternating with 0 and 1, and the check code is also 128 bits alternated with 0 and 1. parity_out is the check Code interleaving result, data_out is the result of information code interleaving, da_pa_out is the result of mixed interleaving of information code and check code, DP_ND is the final output result of interleaving. The output clock CLK3 is twice that of the input clock CLK1. It can be seen that the interleaving result is first 64-bit 0, then 64-bit 1, then 64-bit 0, and then 64-bit 1. The result is consistent with the Matlab result. correct.

以上所述仅为本发明的特例,即信息码128比特,码率1/2,检验码128比特的情况,其他情况的实现类似,只需修改部分参数即可。The above is only a special case of the present invention, that is, the information code is 128 bits, the code rate is 1/2, and the check code is 128 bits. The realization of other cases is similar, and only some parameters need to be modified.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用全部或部分地以计算机程序产品的形式实现,所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输)。所述计算机可读取存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘SolidState Disk(SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented wholly or partly in the form of a computer program product, said computer program product comprises one or more computer instructions. When the computer program instructions are loaded or executed on the computer, the processes or functions according to the embodiments of the present invention will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center by wired (eg coaxial cable, fiber optic, digital subscriber line (DSL) or wireless (eg infrared, wireless, microwave, etc.)). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)).

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (10)

  1. A kind of 1. channel interleaving method of the power line carrier communication based on FPGA, which is characterized in that the electricity based on FPGA The channel interleaving method of powerline carrier communication is tested the mixing of the intertexture of code, the intertexture of information code, information code and check code Intertexture and cyclic shift;After interleaving treatment, adjacent bit is assigned in different sub-carrier and is transmitted, adjacent bit is reflected It is mapped in planisphere on relatively important and inferior important position;Meanwhile there will be memory to information discretization on time-domain dimension Channel is converted into memoryless channel, then coordinates the reduction bit error rate with error correcting code.
  2. 2. the channel interleaving method of the power line carrier communication based on FPGA as described in claim 1, which is characterized in that described The channel interleaving method of power line carrier communication based on FPGA specifically includes:
    Step 1 is interleaved check code processing;
    Step 2 is interleaved information code processing;
    Step 3 carries out mixing intertexture between information code and check code;
    Step 4 carries out cyclic shift processing.
  3. 3. the channel interleaving method of the power line carrier communication based on FPGA as described in claim 1, which is characterized in that described Step 1 specifically includes:
    First piece of bit of (n-k)/4 of check code is output in block 1, second piece of bit of (n-k)/4 is output in block 2, Third block (n-k)/4 bit is output in block 3, and the 4th piece of bit of (n-k)/4 is output in block 4;It is equivalent to check code The matrix of 4 row of the row of (n-k)/4 is deposited into, wherein, the first row represents block 1, and the second row represents block 2, and third block represents Block 3, fourth line represent block 4;When data are written, data are sequentially written in by row;
    When reading data, the data of four rows are read simultaneously by row, is read since arranging the 0th first, one is added on first address A reading step-length S, the sequence for the row that the first round reads is (0,2*S, 3*S ... ...), and the first round reads altogether ((n-k)/4)/S Row;
    Then, the second wheel is carried out, first address is read and adds 1, is read since arranging the 1st, plus a reading step-length on first address S, the sequence of row that the second wheel is read are (1,2*S+1,3*S+1 ... ...), and the second wheel reads altogether ((n-k)/4)/S row, with this Analogize, the reading taken turns by S reads one-hundred-percent inspection code.
  4. 4. the channel interleaving method of the power line carrier communication based on FPGA as described in claim 1, which is characterized in that described Step 2 specifically includes:
    First piece of k/4 bit of information code is output in block 1, second piece of k/4 bit is output in block 2, third block k/4 Bit is output in block 3, and the 4th piece of k/4 bit is output in block 4;It is equivalent to information code being deposited into 4 row of k/4 row Matrix, wherein, the first row represents block 1, and the second row represents block 2, and third block represents block 3, and fourth line represents block 4; When data are written, data are sequentially written in by row;
    When reading data, the data of four rows are read simultaneously by row;Wherein, T=k/4, it is inclined from one for the intertexture of information code Shifting value offset row start to read, and are read since being arranged offset first, later plus a reading step-length on first address S, the sequence for the row that the first round reads is (offset, (offset+S) mod T, (offset+2*S) mod T ... ...), and first Wheel reads (k/4)/S row altogether;
    Then, the second wheel is carried out, first address is read and adds 1, is read since arranging the 1st, later plus a reading on first address Step-length S, the sequence of row that the second wheel is read are (offset+1, (offset+S+1) mod T, (offset+2*S+1) mod T ... ...), the second wheel reads altogether (k/4)/S row, and so on, the reading taken turns by S reads all information code.
  5. 5. the channel interleaving method of the power line carrier communication based on FPGA as described in claim 1, which is characterized in that described Step 3 specifically includes:
    It after check code interweaves, exports as the bit of (n-k)/4, after information code interweaves, exports as k/4 bits, the bit of (n-k)/4 and k/ 4 bits carry out mixing intertexture;It is information code that output result, which is preceding 4 bit, then 4 bit trial code, and so on, it completes to examine Interleaving process between code and information code;
    The serioparallel exchange, including:K bit information codes are become into the data that k/4 bit wide is 4 bits after serioparallel exchange, (n-k) bit trial code is become into the data that (n-k)/4 bit wide is 4 bits after serioparallel exchange;This n/4 data is handed over For output, information code then verifies that code preceding, and so on.
  6. 6. the channel interleaving method of the power line carrier communication based on FPGA as described in claim 1, which is characterized in that described Step 4 specifically includes:
    By step 3 treated data, according to 0 to 7 numbering cycles, each two nibble adjustment sequence successively, for label For 0 and 1, direct output is not handled, for label 2 and 3, ring shift right 1, for label 4 and 5, ring shift right 2, for Label 6 and 7, ring shift right 3;And so on, carry out parallel-serial conversion output again later.
  7. 7. a kind of channel interleaving method for realizing the power line carrier communication based on FPGA described in claim 1~6 any one Computer program.
  8. 8. a kind of channel interleaving method for realizing the power line carrier communication based on FPGA described in claim 1~6 any one Information data processing terminal.
  9. 9. a kind of computer readable storage medium, including instructing, when run on a computer so that computer is performed as weighed Profit requires the channel interleaving method of the power line carrier communication based on FPGA described in 1~6 any one.
  10. 10. a kind of channel interleaving method of the power line carrier communication based on FPGA as described in claim 1 based on FPGA Power line carrier communication channel interleaving system, which is characterized in that the channel of the power line carrier communication based on FPGA Interlacing system includes:
    Check code interleave unit interweaves to check code using RAM and ping-pong structure;
    Information code interleave unit interweaves to information code using RAM and ping-pong structure;
    Interleave unit is mixed, for serioparallel exchange, mixing intertexture is carried out between information code and check code;
    Circulative shift operation unit, for carrying out circulative shift operation, parallel serial conversion later.
CN201810224147.7A 2018-03-19 2018-03-19 The channel interleaving method and system of power line carrier communication based on FPGA Pending CN108183729A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810224147.7A CN108183729A (en) 2018-03-19 2018-03-19 The channel interleaving method and system of power line carrier communication based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810224147.7A CN108183729A (en) 2018-03-19 2018-03-19 The channel interleaving method and system of power line carrier communication based on FPGA

Publications (1)

Publication Number Publication Date
CN108183729A true CN108183729A (en) 2018-06-19

Family

ID=62553830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810224147.7A Pending CN108183729A (en) 2018-03-19 2018-03-19 The channel interleaving method and system of power line carrier communication based on FPGA

Country Status (1)

Country Link
CN (1) CN108183729A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920097A (en) * 2018-06-11 2018-11-30 北京理工雷科雷达技术研究院有限公司 A kind of three-dimensional data processing method based on Laden Balance
CN112035854A (en) * 2020-08-13 2020-12-04 南京低功耗芯片技术研究院有限公司 Cyclic shift and fixed permutation table power consumption attack resisting method based on bit permutation
CN115562902A (en) * 2022-01-11 2023-01-03 荣耀终端有限公司 Encoding method, device and related equipment for a storage area

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1496052A (en) * 2001-02-13 2004-05-12 三星电子株式会社 Equipment for producing code in communication system
CN105577325A (en) * 2015-12-25 2016-05-11 广东顺德中山大学卡内基梅隆大学国际联合研究院 A Parallel Processing Interleaver Applied in OFDM Transmission System
CN106603457A (en) * 2016-12-09 2017-04-26 中国电力科学研究院 Broadband power line carrier communication physical layer signal processing method based on OFDM
CN107306166A (en) * 2016-04-25 2017-10-31 李松斌 A kind of data communications method based on OFDM and dual binary turbo code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1496052A (en) * 2001-02-13 2004-05-12 三星电子株式会社 Equipment for producing code in communication system
CN105577325A (en) * 2015-12-25 2016-05-11 广东顺德中山大学卡内基梅隆大学国际联合研究院 A Parallel Processing Interleaver Applied in OFDM Transmission System
CN107306166A (en) * 2016-04-25 2017-10-31 李松斌 A kind of data communications method based on OFDM and dual binary turbo code
CN106603457A (en) * 2016-12-09 2017-04-26 中国电力科学研究院 Broadband power line carrier communication physical layer signal processing method based on OFDM

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王磊: "多标准可配置信道交织器的研究与设计", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920097A (en) * 2018-06-11 2018-11-30 北京理工雷科雷达技术研究院有限公司 A kind of three-dimensional data processing method based on Laden Balance
CN112035854A (en) * 2020-08-13 2020-12-04 南京低功耗芯片技术研究院有限公司 Cyclic shift and fixed permutation table power consumption attack resisting method based on bit permutation
CN112035854B (en) * 2020-08-13 2024-02-23 南京低功耗芯片技术研究院有限公司 Method for resisting power consumption attack based on cyclic shift of bit permutation and fixed permutation table
CN115562902A (en) * 2022-01-11 2023-01-03 荣耀终端有限公司 Encoding method, device and related equipment for a storage area

Similar Documents

Publication Publication Date Title
CN106603457B (en) OFDM-based broadband power line carrier communication physical layer signal processing method
WO2016107160A1 (en) Data packet processing method and apparatus in ofdma system, and storage medium
CN106464270B (en) Transmission device and its deinterleaving method
CN111327400B (en) OFDM-based high-speed wireless communication physical layer transmission signal generation method and system
CN105577325B (en) A kind of parallel processing interleaver applied to orthogonal frequency division multiplex transmission system
CN1937435A (en) Digital signal processing method for power line communication system
CN108183729A (en) The channel interleaving method and system of power line carrier communication based on FPGA
CN106464271A (en) Transmitting apparatus and interleaving method thereof
CN103780341B (en) Wireless communication transmission method based on parallel coding and parallel interleaving
CN103457894B (en) A kind of deinterleaving method in ofdm system
CN104868971A (en) Interleaving mapping method of LDPC code words, and de-interleaving de-mapping method of LDPC code words
CN102694709A (en) DMT (Discrete Multi-Tone)-based transmission method and device of high-speed 1553B communication bus
CN109347777A (en) A High Frequency Band Utilization MT-MFSK Underwater Acoustic Communication Method
CN103843275B (en) Processing device, processing method and communication system of bit streams
CN111030780B (en) A configurable parallel bit block interleaver and interleaving method
CN105099614A (en) Interleaving mapping method for LDPC code word, deinterleaving demapping method
TWI819797B (en) Signal processing circuit for sub-carrier ordering and associated signal processing method
CN107306166A (en) A kind of data communications method based on OFDM and dual binary turbo code
CN103338178A (en) All phase OFDM system design based on FPGA
CN107204828A (en) The intertexture mapping method and deinterleaving de-mapping method of LDPC code word
CN102316059A (en) A kind of interleaving method and device of OFDM system
EP2119161A2 (en) Reduction of dynamic range of transmitted signals
CN110855398B (en) Deinterleaving method for G3-PLC communication standard
Liang Combining block-coded modulation codes and improved constellation extended schemes to reduce peak-to-average power ratio in orthogonal frequency-division multiplexing systems
CN108521318A (en) Interleaving and deinterleaving method suitable for SIM-OFDM system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20220909

AD01 Patent right deemed abandoned