Apparatus and method for calculating hyperbolic function in BP decoding of polar code
By dividing the domain of the hyperbolic function into three intervals and using different approximation functions for calculation, the problem of high computational complexity of the hyperbolic function in the BP decoding algorithm is solved, achieving high-precision and low-complexity decoding performance, which is suitable for polar code BP decoding in 5G communication.
Patent Information
- Application Number
- CN202210311751.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In existing technologies, the approximate calculation accuracy of the hyperbolic function in the BP decoding algorithm is not high or there are too many segments, which leads to high hardware implementation complexity of the decoder, large computation delay, and affects decoding performance.
The domain of the hyperbolic function is divided into three intervals, and different approximation functions are used for calculation in each interval. The first interval uses a predetermined function, the second interval uses a Taylor polynomial function, and the third interval uses a second predetermined function, which simplifies the calculation process and reduces computational complexity.
It improves decoding performance, reduces the implementation complexity of computing devices, reduces storage space requirements, and balances computational latency and accuracy to meet 5G decoding requirements.
Smart Images

Figure CN114665889B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of channel decoding, and particularly to a device and method for calculating hyperbolic functions in BP decoding of polar codes. BACKGROUND
[0002] In 2016, 3GPP decided to use polar codes as the channel coding scheme for control channels in 5G. The decoding algorithms for polar codes mainly include the successive cancellation (SC) decoding algorithm and the belief propagation (BP) decoding algorithm.
[0003] The SC decoding has low computational complexity and good error correction performance, but due to the serial operation structure of the SC algorithm, it has a long decoding delay. Compared with the SC decoding, the BP decoding has much smaller decoding delay due to its inherent parallel structure.
[0004] Figure 5 A factor graph of the conventional BP decoding is schematically shown. As shown in Figure 5 , the polar code is decoded by n-stage factor iteration (n=3 in the figure). Figure 6 A processing unit in the factor graph of Figure 5 is shown, which includes a set of connected "+" and "=" factors and four nodes connected thereto, where i and j represent the numbers of the nodes, and N is the dimension of the polar code.
[0005] In the BP decoding process, each node is accompanied by two types of messages, the left-propagating message L and the right-propagating message R, which are also called belief messages. As shown in Figure 5 , during decoding, the latest message R is first calculated from the leftmost node to the right, until it propagates to the rightmost node, and then the latest message L is calculated from the right to the left, until it propagates to the leftmost node. One round of propagation is counted as one iteration. After each iteration, the messages R and L are updated according to the following formula:
[0006]
[0007] where 1≤i≤n,1≤j≤N,N=2 n The iteration update function g(x1,x2)=2arctanh(tanh(x1 / 2)tanh(x2 / 2)) involves the calculation of the hyperbolic tangent function and the inverse hyperbolic tangent function. The hyperbolic tangent function is with a domain of (-∞, +∞); and the inverse hyperbolic tangent function is
[0008] The BP decoding needs multiple iterations to obtain reliable decoding results, but each iteration includes a large number of calculations of hyperbolic tangent functions and inverse hyperbolic tangent functions, which is relatively complex, resulting in high hardware implementation complexity of the decoder, which is not conducive to practical application.
[0009] A digital signal processor (DSP) is usually used for decoding processing in a communication system. In order to reduce the processing complexity of the DSP device, a segmented linear expression is usually used to approximate the hyperbolic tangent function and the inverse hyperbolic tangent function. If the segmentation is less, the accuracy is not high enough, which affects the performance of the decoding algorithm. In order to achieve high accuracy, if the segmentation is more, the judgment is complex and the calculation delay is large. SUMMARY
[0010] The purpose of the present application is to provide a device and method for calculating hyperbolic functions in BP decoding of polar codes, which solves the problem of low accuracy or too many segments in the approximation calculation of hyperbolic functions in the prior art BP decoding algorithm.
[0011] The technical solutions provided by the present application are as follows:
[0012] A device for calculating hyperbolic functions in BP decoding of polar codes, comprising: dividing the positive domain of the hyperbolic function into three interval segments, namely a first interval segment, a second interval segment and a third interval segment;
[0013] The positive domain calculation module comprises a first interval calculation unit, a second interval calculation unit and a third interval calculation unit;
[0014] The first interval calculation unit is configured to obtain the function value of the hyperbolic function at the input x according to a first preset function if the input x is located in the first interval segment;
[0015] The second interval calculation unit is configured to generate a corresponding Taylor polynomial function according to the input x and a pre-prepared parameter table of the second interval segment if the input x is located in the second interval segment, and obtain the function value of the hyperbolic function at the input x according to the Taylor polynomial function;
[0016] The third interval calculation unit is configured to obtain the function value of the hyperbolic function at the input x according to a second preset function if the input x is located in the third interval segment;
[0017] The first preset function, the Taylor polynomial function and the second preset function all only involve addition, subtraction and multiplication operations.
[0018] Further, if the hyperbolic function is a hyperbolic tangent function, the first preset function is:
[0019] y=x-x 3 / 3;
[0020] If the hyperbolic function is inverse hyperbolic tangent function, the first preset function is:
[0021] y=x+x 3 / 3.
[0022] Further, the storage unit is further included;
[0023] The storage unit is configured to pre-store a prefabricated parameter table of the second interval segment.
[0024] The second interval calculation unit is further configured to find a discrete point x0 closest to the input x and parameter information of the discrete point x0 from the prefabricated parameter table, the parameter information of the discrete point x0 including a function value and a first derivative value of the hyperbolic function at the discrete point x0, and generate a corresponding Taylor polynomial function according to the discrete point x0 and the parameter information thereof.
[0025] Further, the second interval calculation unit is further configured to find an index sequence number of the discrete point x0 closest to the input x in the prefabricated parameter table according to the following formula:
[0026] index=floor((x-Min)*N) / (Max-Min));
[0027] Wherein, Max is a maximum value of a preset interval range, Min is a minimum value of the preset interval range, and N is a number of equal divisions of the preset interval range.
[0028] The discrete point x0 and the parameter information thereof are obtained from the prefabricated parameter table according to the index sequence number.
[0029] Further, if the hyperbolic function is hyperbolic tangent function, the second preset function is y=first hyperbolic tangent value; if the hyperbolic function is inverse hyperbolic tangent function, the second preset function is y=first inverse hyperbolic tangent value.
[0030] Further, the method further includes: a symbol acquisition module configured to acquire a sign bit and an absolute value of the first input value.
[0031] The positive definition domain calculation module is configured to calculate a function value of the hyperbolic function at the absolute value.
[0032] The function value calculation module is configured to obtain a function value of the hyperbolic function at the first input value according to the sign bit and the function value of the absolute value.
[0033] Further, the method further includes: a zero judgment module configured to, if the first input value is equal to 0, set the function value of the hyperbolic function at the first input value as a preset value.
[0034] The symbol obtaining module is further configured to, if the first input value is not equal to 0, obtain a sign bit and an absolute value of the first input value.
[0035] The application further provides a method for calculating a hyperbolic function in BP decoding of a polar code, based on the aforementioned device for calculating a hyperbolic function in BP decoding of a polar code, comprising: if an input x is located in a first interval segment, obtaining a function value of the hyperbolic function at the input x according to a first preset function; if the input x is located in a second interval segment, generating a corresponding Taylor polynomial function according to the input x and a pre-prepared parameter table of the second interval segment, and obtaining the function value of the hyperbolic function at the input x according to the Taylor polynomial function; and if the input x is located in a third interval segment, obtaining the function value of the hyperbolic function at the input x according to a second preset function.
[0036] Further, if the hyperbolic function is a hyperbolic tangent function, the first preset function is:
[0037] y=x-x 3 / 3;
[0038] If the hyperbolic function is an inverse hyperbolic tangent function, the first preset function is:
[0039] y=x+x 3 / 3.
[0040] Further, the generating of the corresponding Taylor polynomial function according to the input x and the pre-prepared parameter table of the second interval segment specifically comprises:
[0041] pre-storing a pre-prepared parameter table of the second interval segment;
[0042] finding a discrete point x0 closest to the input x and parameter information of the discrete point x0 from the pre-prepared parameter table, wherein the parameter information of the discrete point x0 comprises a function value and a first derivative value of the hyperbolic function at the discrete point x0;
[0043] generating a corresponding Taylor polynomial function according to the discrete point x0 and the parameter information thereof.
[0044] The device and method for calculating a hyperbolic function in BP decoding of a polar code provided by the application can at least bring the following beneficial effects:
[0045] 1. The application divides the positive definition domain of a hyperbolic function into three interval segments, and uses respective suitable functions to fit different interval segments, wherein the fitting functions only have addition, subtraction and multiplication operations, which not only ensures the fitting accuracy, but also greatly reduces the implementation complexity of the calculation device, thereby improving the decoding performance and realizing the 5G decoding requirement at low cost.
[0046] 2. Since the Taylor polynomial function fitting needs to consume certain storage space, the application reduces the demand amount of the storage space of the computing device by using the Taylor polynomial function fitting only in the second interval segment and using a determined function fitting in other interval segments. BRIEF DESCRIPTION OF DRAWINGS
[0047] The above features, technical characteristics, advantages and implementation manners of the computing device and method of hyperbolic function in BP decoding of a polar code will be further described in a clear and understandable manner in combination with the preferred embodiments and the accompanying drawings.
[0048] Figure 1 is a structural schematic diagram of one embodiment of the computing device of hyperbolic function in BP decoding of a polar code of the application;
[0049] Figure 2 is a flowchart of one embodiment of the computing method of hyperbolic function in BP decoding of a polar code of the application;
[0050] Figure 3 is a flowchart of one embodiment of step S200 in Figure 2
[0051] Figure 4 is a flowchart of one embodiment of step S220 in Figure 3
[0052] Figure 5 is a factor graph of the conventional BP decoding in the prior art;
[0053] Figure 6 is a processing unit in the factor graph of Figure 5 DETAILED DESCRIPTION
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, specific implementation manners of the application will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings in the following description only represent some embodiments of the application, and for those skilled in the art, other drawings can be obtained from these drawings without any creative effort, and other embodiments can also be obtained.
[0055] In order to make the drawings simple, only the parts related to the application are schematically shown in each drawing, and they do not represent the actual structure of the product. In addition, in order to make the drawings simple and easy to understand, in some drawings, only one of the components with the same structure or function is schematically shown, or only one of them is marked. In this document, “one” not only means “only one”, but also means “more than one”.
[0056] As described above, the 5G communication uses the polar code, and the BP decoding is a mainstream decoding mode for the polar code, but the BP decoding contains a large number of calculations of nonlinear functions such as hyperbolic tangent functions and inverse hyperbolic tangent functions, and the algorithm has high computational complexity, which is not conducive to implementation on a processor such as a DSP. The prior art often uses a segmented linear expression to approximate the hyperbolic function, and if the number of segments is small, the calculation accuracy is not enough, which affects the performance of the corresponding algorithm, and if the number of segments is large, the calculation delay is large.
[0057] To solve the above problems, in the embodiments of the present application, the positive domain of the hyperbolic function f(x) in the BP decoding is divided into three interval segments, and a different approximation function is used to calculate the value of f(x) in each interval segment, the first interval segment is approximated by a determined first preset function, the second interval segment is approximated by a corresponding Taylor polynomial function according to the input x, and the third interval segment is approximated by a second preset function. The second interval segment uses Taylor polynomial function fitting, which improves the fitting accuracy. In addition, the number of segments is small, and the approximation function of each interval segment only has addition, subtraction and multiplication operations, which greatly reduces the computational complexity of the hyperbolic function.
[0058] The Taylor polynomial function fitting needs to consume a certain amount of storage space, and by using the Taylor polynomial function fitting only in the second interval segment and using a determined function fitting in the other interval segments, the consumption of storage space is reduced. The present application uses a small number of segments, adds a small amount of memory and multipliers, facilitates the implementation of a DSP processor or hardware, and balances the operation delay and improves the operation accuracy.
[0059] An embodiment of the present application, as shown in Figure 1 A device for calculating a hyperbolic function in BP decoding of a polar code, comprising a symbol acquisition module 100, a positive domain calculation module 200 and a function value calculation module 300.
[0060] The symbol acquisition module 100 is used to acquire the sign bit and the absolute value of the first input value.
[0061] The positive domain calculation module 200 is used to calculate the function value of the hyperbolic function at the absolute value.
[0062] The function value calculation module 300 is used to obtain the function value of the hyperbolic function at the first input value according to the sign bit and the function value of the absolute value.
[0063] Specifically, the first input value is generally in binary form in the processor, and the highest bit of the binary number of the first input value can obtain the sign bit of the first input value. If the highest bit of the binary number is 0, it indicates that the first input value is not less than 0; if the highest bit of the binary number is 1, it indicates that the first input value is less than 0, i.e. the first input value is a negative number.
[0064] By using the parity of the hyperbolic function, according to the sign bit of the first input value and the function value of the hyperbolic function at the absolute value of the first input value, the function value of the hyperbolic function at the first input value can be obtained.
[0065] Suppose the hyperbolic function is the inverse hyperbolic tangent function or the hyperbolic tangent function, the inverse hyperbolic tangent function and the hyperbolic tangent function are both odd functions, if x<0, then the hyperbolic function f(x)=-f(|x|), |x| represents the absolute value of x.
[0066] Further, the zero judgment module 400 is introduced to simplify the operation. The zero judgment module 400 is used to obtain a preset value of the function value of the hyperbolic function at the first input value if the first input value is equal to 0. The sign obtaining module 100 is further used to obtain the sign bit and the absolute value of the first input value if the first input value is not equal to 0.
[0067] In the domain of the hyperbolic function, the region not less than 0 can be regarded as the positive domain; if the zero judgment module 400 is introduced, the region greater than 0 can be regarded as the positive domain.
[0068] The function value calculation of the hyperbolic function in the positive domain is described in detail as follows:
[0069] The positive domain of the hyperbolic function is divided into three segments, which are the first interval segment, the second interval segment and the third interval segment.
[0070] The positive domain calculation module 200 includes the first interval calculation unit 210, the second interval calculation unit 220 and the third interval calculation unit 230.
[0071] The first interval calculation unit is used to obtain the function value of the hyperbolic function at the input x according to the first preset function if the input x is located in the first interval segment.
[0072] The second interval calculation unit is used to generate a corresponding Taylor polynomial function according to the input x and the pre-prepared parameter table of the second interval segment if the input x is located in the second interval segment, and obtain the function value of the hyperbolic function at the input x according to the Taylor polynomial function.
[0073] The third interval calculation unit is used to obtain the function value of the hyperbolic function at the input x according to the second preset function if the input x is located in the third interval segment.
[0074] The first preset function, the Taylor polynomial function and the second preset function all only involve addition, subtraction and multiplication operations.
[0075] Specifically, the input x is the absolute value of the first input value. The three interval ranges can be set according to error requirements. For example, the first interval range is determined according to the error between the first preset function and the hyperbolic function value, the third interval range is determined according to the error between the second preset function and the hyperbolic function value, and the remaining is the second interval range.
[0076] In one embodiment, the first preset function and the second preset function are linear functions of x.
[0077] In one embodiment, the hyperbolic function is the hyperbolic tangent function, and the positive domain is divided into three segments, i.e., the first interval range (0, 0.4713), the second interval range [0.4713, 6], and the third interval range (6, positive infinity).
[0078] The first preset function y = x - x 3 / 3 is used to approximate the hyperbolic function of the first interval range, and the second preset function y = the first hyperbolic tangent value (the first hyperbolic tangent value = 0.9999999) is used to approximate the hyperbolic function of the third interval range.
[0079] In one embodiment, the hyperbolic function is the inverse hyperbolic tangent function, and the positive domain is divided into three segments, i.e., the first interval range (0, 0.82), the second interval range [0.82, 0.999998], and the third interval range (0.999998, 1).
[0080] The first preset function y = x + x 3 / 3 is used to approximate the hyperbolic function of the first interval range, and the second preset function y = the first hyperbolic inverse tangent value (the first hyperbolic inverse tangent value = 7) is used to approximate the hyperbolic function of the third interval range.
[0081] The second interval calculation unit uses a Taylor polynomial function to approximate the hyperbolic function.
[0082] The Taylor formula is a formula for describing the values of a function in its vicinity using the information of the function at a certain point. If the function is smooth enough, the Taylor formula can use the derivative values at a certain point to construct a polynomial approximation function, and obtain the values in the neighborhood of the point.
[0083] Taking the first-order approximation as an example, according to the Taylor formula, for a function f(x) that is derivable at any x0 point, the following approximation can be made: f(x) = f(x0) + f'(x0)*(x-x0) + o(x-x0); f'(x0) represents the derivative of f(x) at x0, and o() represents an infinitesimal. The closer x is to x0, the smaller the deviation between the value calculated by the above polynomial and the actual function value, i.e., the higher the calculation accuracy.
[0084] The function f(x) can be approximated by a Taylor polynomial of degree one, two,... n. The more the degree, the higher the precision of approximation. In practical applications, the required degree can be determined according to the precision requirement.
[0085] The computing device further comprises a storage unit, which is configured to pre-store a pre-prepared parameter table of the second interval segment; the second interval computing unit is configured to find the discrete point x0 closest to the input x and the parameter information of the discrete point x0 from the pre-prepared parameter table, the parameter information of the discrete point x0 comprising the function value and the first derivative value of the hyperbolic function at the discrete point x0; generate a corresponding Taylor polynomial function according to the discrete point x0 and the parameter information thereof; and obtain the function value of the hyperbolic function at the input x according to the Taylor polynomial function.
[0086] A preset interval range is determined according to the second interval segment. The preset interval range can be equal to the second interval segment or greater than the second interval segment.
[0087] The preset interval range can be equally divided by a preset equal division value N, and the equally divided points are taken as the discrete points of the preset interval range. The preset equal division value can be set as required. The greater the preset equal division value, the greater the number of discrete points, the greater the pre-prepared parameter table, and the greater the required storage space, but the result of calculating the hyperbolic function will be more accurate. A suitable N value can be selected according to the precision requirement.
[0088] The function value of the hyperbolic function at the discrete points and the derivative value of a preset order are calculated. The function value and the derivative value of each order of each discrete point constitute the parameter information of the discrete point; and all the discrete points and the parameter information thereof constitute the pre-prepared parameter table of the hyperbolic function at the second interval segment.
[0089] In the use of the pre-prepared parameter table, the index serial number index of the discrete point x0 closest to the input x in the pre-prepared parameter table is found according to the following formula:
[0090] index = floor((x-Min)*N) / (Max-Min));
[0091] Wherein, Max is the maximum value of the preset interval range, Min is the minimum value of the preset interval range, and N is the equal division number of the preset interval range.
[0092] The discrete point x0 and the parameter information thereof are obtained from the pre-prepared parameter table according to the index serial number index; and the Taylor polynomial function corresponding to the input x is generated again according to the discrete point x0 and the parameter information thereof.
[0093] In the embodiment, the positive definition domain is divided into three interval segments, and different functions are used to approximate calculation respectively, the calculation complexity is simplified by the less segmentation; in the second interval segment, the discrete point x0 and its parameter information closest to the input x are obtained by looking up the table, and the matching Taylor polynomial function is constructed according to the information, so that the hyperbolic function is approximated, and the fitting precision is improved; in other interval segments, the determined function is used for fitting, and the consumption of storage space is reduced.
[0094] As shown in the embodiment of the present application, Figure 2 、 Figure 3 、 Figure 4 A method for calculating a hyperbolic function in BP decoding of a polar code, based on the aforementioned device for calculating a hyperbolic function in BP decoding of a polar code, comprising:
[0095] Step S100 obtains the sign bit and the absolute value of the first input value;
[0096] Step S200 calculates the function value of the hyperbolic function at the absolute value;
[0097] Step S300 obtains the function value of the hyperbolic function at the first input value according to the sign bit and the function value of the hyperbolic function at the absolute value.
[0098] Specifically, according to the sign bit of the first input value and the function value of the hyperbolic function at the absolute value of the first input value, the function value of the hyperbolic function at the first input value can be obtained by using the parity of the hyperbolic function.
[0099] In order to further simplify the operation, step S100 can be optimized as:
[0100] Step S110 if the first input value is equal to 0, the function value of the hyperbolic function at the first input value is a preset value;
[0101] Step S120 if the first input value is not 0, the sign bit and the absolute value of the first input value are obtained.
[0102] In the definition domain of the hyperbolic function, the region not less than 0 can be regarded as the positive definition domain; if step S110 is introduced, the region greater than 0 can be regarded as the positive definition domain.
[0103] The positive definition domain of the hyperbolic function is divided into three segments, which are the first interval segment, the second interval segment and the third interval segment.
[0104] Step S210 if the input x is located in the first interval segment, the function value of the hyperbolic function at the input x is obtained according to the first preset function;
[0105] Step S220 if the input x is located in the second interval segment, the corresponding Taylor polynomial function is generated according to the input x and the pre-prepared parameter table of the second interval segment, and the function value of the hyperbolic function at the input x is obtained according to the Taylor polynomial function.
[0106] If the input x is located in the third interval segment, the function value of the hyperbolic function at the input x is obtained according to the second preset function.
[0107] Specifically, the input x is the absolute value of the first input value. The range of the three interval segments can be set according to the error requirement.
[0108] For example, the hyperbolic function is the hyperbolic tangent function, and the positive domain is divided into three segments, i.e., the first interval segment (0, 0.4713), the second interval segment [0.4713, 6], and the third interval segment (6, positive infinity).
[0109] The first preset function y = x - x 3 / 3 is used to approximate the hyperbolic function in the first interval segment, and the second preset function y = the first hyperbolic tangent value (the first hyperbolic tangent value = 0.9999999) is used to approximate the hyperbolic function in the third interval segment.
[0110] For example, the hyperbolic function is the inverse hyperbolic tangent function, and the positive domain is divided into three segments, i.e., the first interval segment (0, 0.82), the second interval segment [0.82, 0.999998], and the third interval segment (0.999998, 1).
[0111] The first preset function y = x + x 3 / 3 is used to approximate the hyperbolic function in the first interval segment, and the second preset function y = the first hyperbolic inverse tangent value (the first hyperbolic inverse tangent value = 7) is used to approximate the hyperbolic function in the third interval segment.
[0112] The hyperbolic function in the second interval segment is approximated by a Taylor polynomial function.
[0113] The step S220 specifically includes:
[0114] The step S221 pre-stores a pre-prepared parameter table of the second interval segment.
[0115] The step S222 finds the discrete point x0 closest to the input x and the parameter information of the discrete point x0 from the pre-prepared parameter table, and the parameter information of the discrete point x0 includes the function value and the first derivative value of the hyperbolic function at the discrete point x0.
[0116] The step S223 generates a corresponding Taylor polynomial function according to the discrete point x0 and the parameter information thereof.
[0117] The step S224 obtains the function value of the hyperbolic function at the input x according to the Taylor polynomial function.
[0118] A corresponding preset interval range is determined according to the second interval segment. The preset interval range can be equal to the second interval segment or greater than the second interval segment.
[0119] The preset interval range can be equally divided by a preset equalization value N, and the equally divided points are taken as the discrete points of the preset interval range. The preset equalization value can be set as required. The greater the preset equalization value, the greater the number of discrete points, the greater the corresponding pre-prepared parameter table, and the greater the required storage space, but the result of calculating the hyperbolic function will be more accurate, and a suitable N value can be selected according to the calculation accuracy requirement.
[0120] The function value of the hyperbolic function at the discrete points and the derivative value of the preset order are calculated. The function value and the derivative value of each order of each discrete point constitute the parameter information of the discrete point; all the discrete points and the parameter information thereof constitute the pre-prepared parameter table of the hyperbolic function in the second interval segment.
[0121] In the use of the pre-prepared parameter table, the index serial number index of the discrete point x0 closest to the input x in the pre-prepared parameter table is found according to the following formula:
[0122] index = floor((x-Min)*N) / (Max-Min));
[0123] Wherein, Max is the maximum value of the preset interval range, Min is the minimum value of the preset interval range, and N is the equalization number of the preset interval range.
[0124] The discrete point x0 and the parameter information thereof are obtained from the pre-prepared parameter table according to the index serial number index, and the Taylor polynomial function corresponding to the input x is regenerated according to the discrete point x0 and the parameter information thereof.
[0125] In this embodiment, the positive definition domain is divided into three interval segments, and different functions are used to approximate calculation, the number of segments is small, and the calculation complexity is simplified; in the second interval segment, the discrete point x0 closest to the input x and the parameter information thereof are obtained by table lookup, and the matching Taylor polynomial function is constructed according to the information, the hyperbolic function is approximated by the function, and the fitting accuracy is improved; in other interval segments, a certain function is used for fitting, and the consumption of storage space is reduced.
[0126] Since the embodiment of the method for calculating the hyperbolic function in the BP decoding of the polar code provided by the application and the embodiment of the device for calculating the hyperbolic function in the BP decoding of the polar code provided by the application are based on the same inventive concept, the same technical effects can be achieved. Thus, other specific contents of the embodiment of the method for calculating the hyperbolic function in the BP decoding of the polar code can be referred to the description of the embodiment of the device for calculating the hyperbolic function in the BP decoding of the polar code.
[0127] This invention also provides specific implementation scenario examples, applying the function calculation method and device provided in this application to the BP decoding of polar codes in 5G communication, mainly realizing the calculation of tanh(x) and arctanh(x) of g(x1,x2)=2arctanh(tanh(x1 / 2)tanh(x2 / 2)).
[0128] The domain of the hyperbolic tangent function tanh(x) is (negative infinity, positive infinity). tanh(x) is an odd function, and the general steps for calculating its value are as follows:
[0129] 1. Calculation of function value with a value of 0: tanh(0) = 0;
[0130] 2. If the input value is non-zero, calculate its sign bit and absolute value.
[0131] 3. Calculate the function value of absolute value;
[0132] 4. Obtain the function value of the input value based on the sign bit and the function value of the absolute value.
[0133] The approach to calculating tanh(x) in its positive domain is as follows: Divide the positive domain into three segments: the first interval (0, 0.4713), the second interval [0.4713, 6], and the third interval (6, positive infinity). For the interval [0.4713, 6], approximate the tanh(x) function using a first-order Taylor polynomial function.
[0134] Specifically, the second interval [0.4713, 6] corresponds to the preset interval range [0, 2π]. This range is then divided into 64 equal intervals, and the value x at each division point is calculated. i and its hyperbolic tangent function value (tanh(x) i The first derivative of the hyperbolic tangent function (tanh'(x)) i ), i = 0 ~ 63. xi, tanh(x i ), tanh'(x i This constitutes a prefabricated parameter table, which can consist of a single table recording xi, tanh(x) and tanh(x). i ), tanh'(x i It can also consist of multiple tables, such as table data_text1 recording tanh(x) i The table data_text2 records tanh'(x) i ), data_text3 records x i Each table is categorized by x i Arranged in ascending order. The pre-formulated parameter table in this embodiment adopts the latter.
[0135] The specific steps of calculating tanh(x1) are as follows:
[0136] Step S1, if x1=a1=0, then c1=tanh(a1)=0, and the calculation is completed. Otherwise, step S2 is performed.
[0137] Step S2, the sign f of the input data a1 is obtained, and its absolute value b1 (b1=|a1|) is obtained.
[0138] Step S3, calculate tanh(b1);
[0139] Step S3 includes:
[0140] Step S31, if b1>6, then tanh(b1)=0.9999999, jump to step S4;
[0141] Step S32, if b1<0.4713, then tanh(b1)=b1-b1^3 / 3, jump to step S4;
[0142] Step S33, if 6>=b1>=0.4713, calculate the index of the discrete point m1 closest to b1 according to the following formula:
[0143] index=floor((b1*64) / 2 / pi), pi=π, floor() is the floor function;
[0144] Step S34, according to index, obtain tanh(m1), tanh'(m1), m1 from tables data_text1, data_text2, data_text3 respectively, and calculate tanh(b1) according to the following formula:
[0145] tanh(b1)=data_text1(index)+data_text2(index)*(b1-data_text3(index)); where data_text1(index)=tanh(m1), data_text2(index)=tanh'(m1), data_text3(index)=m1;
[0146] Step S4, according to the sign f and tanh(b1), obtain tanh(x1).
[0147] The domain of the inverse hyperbolic tangent function arctanh(x) is (-1,1), and the calculation steps of the function value are as follows:
[0148] 1. Function value calculation of 0 value: arctanh(0)=0;
[0149] 2. If the input value is a non-zero value, calculate its sign bit and absolute value.
[0150] 3. Calculate the function value of the absolute value;
[0151] 4. Obtain the function value of the input value according to the function value of the sign bit and the absolute value.
[0152] The calculation idea of arctanh(x) in the positive domain: divide the positive domain into three segments, namely the first interval segment (0, 0.82), the second interval segment [0.82, 0.999998], and the third interval segment (0.999998, 1). For [0.82, 0.999998], use a Taylor polynomial function to approximate the arctanh(x) function.
[0153] Specifically, the second interval segment [0.82, 0.999998] is taken as the preset interval range, which is divided into 64 equal parts, and the value x i and the inverse hyperbolic tangent function value (arctanh(x i )), the first derivative value of the inverse hyperbolic tangent function (arctanh'(x i )) of each equal point are calculated, i = 0 ~ 63. xi, arctanh(x i ), arctanh'(x i ) constitute a pre-prepared parameter table, which can be composed of a table, recording xi, arctanh(x i ), arctanh'(x i ); or composed of multiple tables, such as table data_text4 recording arctanh(x i ), table data_text5 recording arctanh'(x i ), and data_text6 recording x i , each table is arranged in ascending order of x i . The pre-prepared parameter table of the present embodiment adopts the latter.
[0154] The specific steps of calculating arctanh(x2) are as follows:
[0155] Step S10, if x2 = a2 = 0, then c2 = tanh(a2) = 0, and the calculation is completed. Otherwise, step S20 is executed.
[0156] Step S20, find the sign f2 of the input data a2, and obtain its absolute value b2 (b2 = |a2|).
[0157] Step S30, calculate arctanh(b2);
[0158] Step S30 comprises:
[0159] Step S301, if b2>0.999998, arctanh(b2)=7, jump to step S40;
[0160] Step S302, if b2<0.82, arctanh(b2)=b2+(b2)^3 / 3, jump to step S40;
[0161] Step S303, if 0.999998>=b2>=0.82, calculate the index sequence number index of the discrete point m2 closest to b2 according to the following formula:
[0162] index=floor((b2-0.82)*64) / (0.999998-0.82));
[0163] Step S34, according to index, obtain arctanh(m2), arctanh'(m2), m2 from the tables data_text4, data_text5, data_text6 respectively, and calculate arctanh(b2) according to the following formula: arctanh(b2)=data_text4(index)+data_text5(index)*(b2-data_text6(index)); wherein, data_text4(index)=arctanh(m2), data_text5(index)=arctanh'(m2), data_text6(index)=m2;
[0164] Step S4, obtain arctanh(x2) according to the sign f2 and arctanh(b2).
[0165] It should be noted that the above embodiments can be freely combined as needed. The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, can make a number of improvements and refinements, these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A device for calculating hyperbolic functions in BP decoding of polar codes, characterized in that, Includes a positive domain calculation module; The hyperbolic function is either a hyperbolic tangent function or an inverse hyperbolic tangent function; Divide the positive domain of the hyperbolic function into three intervals: the first interval, the second interval, and the third interval. The positive domain calculation module includes a first interval calculation unit, a second interval calculation unit, and a third interval calculation unit; The first interval calculation unit is used to obtain the function value of the hyperbolic function at the input x according to the first preset function if the input x is located in the first interval segment; The second interval calculation unit is used to generate a corresponding Taylor polynomial function based on the input x and a pre-stored pre-defined parameter table of the second interval if the input x is located in the second interval segment, and to obtain the function value of the hyperbolic function at the input x based on the Taylor polynomial function; The pre-set parameter table includes several discrete points of the second interval segment and their parameter information. The parameter information of the discrete points includes the function value of the hyperbolic function at the discrete point and the derivative value of its preset order. The second interval calculation unit is also used to find the discrete point x0 that is closest to the input x and the parameter information of the discrete point x0 from the pre-made parameter table, and generate a corresponding Taylor polynomial function based on the discrete point x0 and its parameter information, wherein the parameter information of the discrete point x0 is the coefficient of the Taylor polynomial function. The third interval calculation unit is used to obtain the function value of the hyperbolic function at the input x according to the second preset function if the input x is located in the third interval segment; Among them, the first preset function, the Taylor polynomial function, and the second preset function all involve only addition, subtraction, and multiplication operations.
2. The apparatus for calculating the hyperbolic function in the BP decoding of polar codes according to claim 1, characterized in that: If the hyperbolic function is a hyperbolic tangent function, then the first preset function is: y=x-x 3 / 3; If the hyperbolic function is an inverse hyperbolic tangent function, then the first preset function is: y=x+x 3 / 3。 3. The apparatus for calculating the hyperbolic function in the BP decoding of polar codes according to claim 1, characterized in that, It also includes storage units; The storage unit is used to pre-store the pre-formulated parameter table of the second interval segment.
4. The apparatus for calculating the hyperbolic function in the BP decoding of polar codes according to claim 3, characterized in that: The second interval calculation unit is also used to find the index number of the discrete point x0 that is closest to the input x in the pre-made parameter table according to the following formula; index=floor((x-Min)*N) / (Max-Min)); Where Max is the maximum value of the preset interval range, Min is the minimum value of the preset interval range, and N is the number of equal parts of the preset interval range; The discrete point x0 and its parameter information are obtained from the pre-made parameter table according to the index number.
5. The apparatus for calculating the hyperbolic function in the BP decoding of polar codes according to claim 1, characterized in that: If the hyperbolic function is a hyperbolic tangent function, then the second preset function is: y = the first hyperbolic tangent; If the hyperbolic function is an inverse hyperbolic tangent function, then the second preset function is: y = the first hyperbolic arctangent value.
6. The apparatus for calculating the hyperbolic function in the BP decoding of polar codes according to claim 1, characterized in that, Also includes: The sign acquisition module is used to acquire the sign bit and absolute value of the first input value. The positive domain calculation module is used to calculate the function value of the hyperbolic function at the absolute value; The function value calculation module is used to obtain the function value of the hyperbolic function at the first input value based on the function value of the sign bit and the absolute value.
7. The apparatus for calculating the hyperbolic function in the BP decoding of polar codes according to claim 6, characterized in that, Also includes: The zero-determination module is used to determine if the first input value is equal to 0, and if so, the function value of the hyperbolic function at the first input value is a preset value. The sign acquisition module is further configured to acquire the sign bit and absolute value of the first input value if the first input value is not equal to 0.
8. A method for calculating the hyperbolic function in BP decoding of polar codes, characterized in that, The computing device according to claim 1 includes: If the input x is located in the first interval, the function value of the hyperbolic function at the input x is obtained according to the first preset function; If the input x is located in the second interval, a corresponding Taylor polynomial function is generated according to the input x and the pre-defined parameter table of the second interval, and the function value of the hyperbolic function at the input x is obtained according to the Taylor polynomial function. The pre-set parameter table includes several discrete points of the second interval segment and their parameter information. The parameter information of the discrete points includes the function value of the hyperbolic function at the discrete point and the derivative value of its preset order. The step of generating the corresponding Taylor polynomial function based on the input x and the pre-defined parameter table of the second interval segment includes: Find the discrete point x0 that is closest to the input x and the parameter information of the discrete point x0 from the pre-made parameter table, and generate the corresponding Taylor polynomial function based on the discrete point x0 and its parameter information, wherein the parameter information of the discrete point x0 is the coefficient of the Taylor polynomial function. If the input x is located in the third interval, the function value of the hyperbolic function at the input x is obtained according to the second preset function.
9. The method for calculating the hyperbolic function in the BP decoding of polar codes according to claim 8, characterized in that: If the hyperbolic function is a hyperbolic tangent function, then the first preset function is: y=x-x 3 / 3; If the hyperbolic function is an inverse hyperbolic tangent function, then the first preset function is: y=x+x 3 / 3。 10. The method for calculating the hyperbolic function in the BP decoding of polar codes according to claim 8, characterized in that, Before generating the corresponding Taylor polynomial function based on the input x and the pre-defined parameter table of the second interval, the method further includes: The pre-constructed parameter table for the second interval segment is stored in advance.
Citation Information
Patent Citations
Implementation of floating-point trigonometric functions in an integrated circuit device
CN108804076A
Efficient fixed-point data processing method based on subdivision table look-up technology
CN112947676A