Data accumulation method, accumulator, chip and computer readable storage medium
By employing a jump-point step size method to extract data in the multiply-accumulate accumulator, the problem of redundant storage in traditional accumulators is solved, thereby reducing data storage volume and achieving efficient resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 北杉集成电路(深圳)有限公司
- Filing Date
- 2025-12-10
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional multiply-accumulate adders cause a surge in chip memory usage and resource waste when faced with multi-scenario functional requirements, and cannot effectively avoid redundant storage of duplicate data.
By using a preset jump point step size in the data accumulation method to extract data from the sequence data and perform item-by-item operations and accumulations, the jump point step size can be adjusted to generate a variety of operation combinations, storing only the core sequence data and avoiding redundant storage.
Significantly reduce data storage volume, reduce chip memory usage pressure, avoid waste of storage and computing resources, and achieve efficient resource utilization in multiple scenarios.
Smart Images

Figure CN122018852A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip technology, and more specifically to a data accumulation method, an accumulator, a chip, and a computer-readable storage medium. Background Technology
[0002] In the field of chip technology, multiplication-accumulation-addition (MAA) is a core computational method widely used. However, traditional MAAs only support point-by-point multiplication and accumulation of two sequences. This leads to resource consumption issues when facing multi-scenario functional requirements. On the one hand, to implement different functions, multiple sets of independent parameter data need to be stored; on the other hand, even if there is a large amount of repetition in the parameter data, the fixed point-by-point MAA pattern still requires the complete storage of all parameters, making it impossible to avoid redundant storage of duplicate data. This directly results in a surge in chip memory usage, causing a serious waste of internal chip storage and computing resources. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides a data accumulation method that can effectively reduce the amount of data stored during computation and reduce resource waste.
[0004] This application provides a data accumulation method, the data accumulation method comprising:
[0005] Acquire first sequence data and second sequence data, wherein the first sequence data includes a plurality of first sequence numbers arranged in order, and the second sequence data includes a plurality of second sequence numbers arranged in order;
[0006] Extract the first sequence number from the first sequence data according to the preset first jump point step size;
[0007] The second sequence number is extracted from the second sequence data according to the preset second jump point step size, wherein at least one of the first jump point step size and the second jump point step size is greater than 1;
[0008] The first sequence number and the second sequence number are operated on item by item according to the preset operation rules, and the operation results are accumulated.
[0009] In one aspect, both the first jump step size and the second jump step size are positive integers.
[0010] In one aspect, the first jump step size and the second jump step size are decimal values, and the decimal step size values are rounded to the nearest integer or rounded to obtain an integer value.
[0011] In one aspect, prior to the steps of acquiring the first sequence data and the second sequence data, the following are included:
[0012] The step size of the first jump point and the step size of the second jump point are set, the jump point direction is set, the jump point starting point is set, and the jump point mode is set respectively. The jump point mode setting includes unidirectional mode and loop mode.
[0013] In one aspect, the jump point direction includes a forward jump point and a reverse jump point, wherein the forward jump point is selected by jumping points sequentially from the beginning to the end of the sequence, and the reverse jump point is selected by jumping points sequentially from the end to the beginning of the sequence;
[0014] In the loop mode, when the selected jump point exceeds the end of the sequence, data is selected again from the beginning of the sequence.
[0015] In the one-way mode, data selection stops when the selected jump point exceeds the end of the sequence.
[0016] In one aspect, the preset operation rule is one of integer multiplication, floating-point multiplication, or polynomial operation of multi-point data.
[0017] In one aspect, the first jump step size is equal to the second jump step size, or the first jump step size is not equal to the second jump step size.
[0018] In addition, to solve the above problems, this application also provides an accumulator, which includes a first memory group and a second memory group;
[0019] The first storage group is used to store first sequence data. The first storage group includes a plurality of first storage points. The first sequence data includes a plurality of first sequence numbers. Each first storage point stores one first sequence number.
[0020] The second storage group is used to store the second sequence data. The second storage group includes a plurality of second storage points. The second sequence data includes a plurality of second sequence numbers. Each second storage point stores one second sequence number.
[0021] The accumulator is used to accumulate the first sequence number and the second sequence number using the data accumulation method described above.
[0022] In addition, to solve the above problems, this application also provides a chip, the chip including an accumulator, the accumulator performing data accumulation using the data accumulation method described above.
[0023] In addition, to address the aforementioned issues, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data accumulation method described above.
[0024] The beneficial effects of this invention are as follows: by acquiring sequentially arranged first and second sequence data, data is extracted from the two sequences with a preset jump point step size of at least one greater than 1, and then processed through item-by-item operation and accumulation. By adjusting the jump point step size, various required operation combinations can be derived without the need to store multiple sets of independent parameters. For scenarios where parameter data is repeated, it is not necessary to store all redundant data completely; only the core sequence needs to be stored. The required operation parameters can be covered by jump point extraction, thereby significantly reducing the amount of data storage, reducing the pressure on chip memory, avoiding the waste of storage and operation resources, and achieving efficient utilization of resources in multiple scenarios. Attached Figure Description
[0025] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0026] Figure 1 This is a schematic diagram of the data accumulation method in this application;
[0027] Figure 2 This is a schematic diagram illustrating the data extraction from jump points in the data accumulation method of this application;
[0028] Figure 3 This is a schematic diagram illustrating the process steps for setting the jump point step size, jump point direction, jump point starting point, and jump point mode in the data accumulation method of this application. Detailed Implementation
[0029] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.
[0030] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning as understood by those skilled in the art to which this invention pertains.
[0031] like Figure 1 and Figure 2 As shown, this application provides a data accumulation method, which includes:
[0032] Step S10: Obtain first sequence data and second sequence data. The first sequence data includes several sequentially arranged first sequence numbers, and the second sequence data includes several sequentially arranged second sequence numbers; determine the two sets of data required for the operation. The first and second sequence data exist in a sequentially arranged form. In practical applications, the roles of the two sets of sequence data can be flexibly defined according to specific needs. For example, in a digital filtering scenario, the first sequence data can correspond to the original digital signal to be processed, and the several first sequence numbers it contains represent the amplitude of the signal at different sampling times; the second sequence data can correspond to filter coefficients, and the several second sequence numbers represent the filter coefficient values corresponding to different orders.
[0033] Step S20: Extract the first sequence number from the first sequence data according to the preset first jump point step size; by using the preset first jump point step size, the traditional point-by-point data extraction mode is avoided. The value of the first jump point step size can be preset according to the actual calculation requirements. If the first jump point step size is 1, it is equivalent to the traditional point-by-point extraction mode, which is suitable for basic scenarios where simplified calculation is not required; if the first jump point step size is greater than 1, redundant data in the first sequence data that does not need to participate in the current calculation can be skipped, and only key data points can be extracted.
[0034] Step S30: Extract the second sequence number from the second sequence data according to the preset second jump point step size. At least one of the first and second jump point step sizes has a jump point step size greater than 1. Based on the constraint that at least one of the first and second jump point step sizes is greater than 1, jump point operations are performed on at least one set of sequence numbers, or both sets of sequence numbers are subjected to jump point operations. In scenarios requiring multi-parameter functionality, the second sequence data is typically the core parameter set, and different functions can be derived by adjusting the second jump point step size.
[0035] Step S40: Perform item-by-item operations on the first sequence number and the second sequence number based on preset operation rules, and accumulate the operation results. The preset operation rules adapt to the computational needs of different application scenarios and can be set according to data type and computational objective. Item-by-item operation involves matching and calculating the first sequence number and the second sequence number one by one in corresponding order; accumulating the operation results involves summing all the results of the item-by-item operations using an accumulator.
[0036] In this embodiment, by acquiring the first sequence data and the second sequence data arranged in sequence, data is extracted from the two sets of sequences with a preset jump point step size of at least one greater than 1. The data is then processed by item-by-item operation and accumulation. By adjusting the jump point step size, various required operation combinations can be derived without the need to store multiple sets of independent parameters. For scenarios where parameter data is repeated, it is not necessary to store all redundant data completely. Only the core sequence needs to be stored. The required operation parameters can be covered by the jump point extraction, thereby greatly reducing the amount of data storage, reducing the pressure on chip memory, avoiding the waste of storage and operation resources, and realizing the efficient use of resources in multiple scenarios.
[0037] In one embodiment of this application, both the first jump point step size and the second jump point step size are positive integers. Setting positive integer step sizes ensures that when extracting data from the first sequence of data and the second sequence of data, data points are located at integer intervals, eliminating the need for decimal conversions or interpolation. This avoids calculation errors that might be introduced by non-integer step sizes and simplifies the address generation process in the hardware circuit. For example, in a chip memory unit, target data can be quickly located directly by superimposing a positive integer step size on the starting address, eliminating the need for an additional complex decimal arithmetic module and significantly improving data extraction speed.
[0038] From a practical application perspective, positive integer step sizes can adapt to most situations. For example, in the design of multi-cutoff frequency filters, setting the jump point step size of the filter coefficient sequence to positive integers such as 2, 4, and 6 can accurately correspond to the parameter requirements of cutoff frequencies such as 1kHz, 2kHz, and 3kHz. In subband frequency division processing, positive integer step sizes can match the interval pattern of repeated coefficients in the transformation matrix, ensuring that the extracted coefficients accurately correspond to the required terms for the operation, thus guaranteeing the accuracy of the operation while achieving a balance between hardware resource consumption and computational efficiency.
[0039] In one embodiment of this application, the first jump point step size and the second jump point step size are decimal values, and the decimal step size values are rounded to integers or rounded to obtain integer values. Setting the first jump point step size and the second jump point step size to decimal values is essentially to adapt to more complex scenarios where there is a need to extract data with non-integer intervals, and at the same time, converting them to integer values by rounding or rounding to integers.
[0040] In practical applications, the ideal jump point interval may not be a positive integer in some scenarios. For example, in specific sub-band coding scenarios, to match non-standard frequency division ratios, the theoretically calculated jump point step size may be a decimal value such as 3.2 or 5.7. If it is forcibly limited to a positive integer, it may lead to data extraction deviation and affect the accuracy of the final calculation result. Allowing a decimal step size allows the theoretically optimal step size to be determined based on actual needs first. Subsequently, it can be converted to an integer value using integer rounding or rounding-in / rounding methods. This approach can closely approximate the theoretically optimal extraction interval, reducing deviation, and avoid the complex requirements of hardware address generation for non-integer step sizes. Since the addresses of chip memory units are all integers, integer step sizes can be directly used for address calculations without the need for an additional decimal arithmetic module. This ensures both computational efficiency and hardware implementation simplicity while meeting the needs of complex scenarios.
[0041] See Figure 3 As shown, before the steps of obtaining the first sequence data and the second sequence data, the following steps are included:
[0042] Step S01 involves setting the step size, direction, starting point, and mode for both the first and second jump points. The jump mode settings include unidirectional and cyclic modes. By setting these four parameters—step size, direction, starting point, and mode—for both the first and second jump points, diverse application scenarios can be accommodated. Among these parameters, the step size setting is a core parameter. The extraction interval between the two sets of sequences needs to be determined according to specific functional requirements. For example, when designing a 5kHz cutoff frequency filter, the step size of the jump point corresponding to the filter coefficient sequence needs to be set to 10. The jump point direction setting determines the order of data extraction. Forward jump points select numbers sequentially from the beginning to the end of the sequence, such as starting extraction from the first sampling point of the signal sequence. Reverse jump points select numbers from the end to the beginning of the sequence, which is suitable for special scenarios that require reverse data processing, such as some inverse filtering operations. The jump point starting point setting is used to determine the initial position of extraction. Any point in the sequence can be flexibly selected according to the operation requirements, such as starting extraction from the 5th coefficient of the filter coefficient sequence to adapt to specific signal phase requirements. The unidirectional mode and cyclic mode in the jump point mode setting are used to adapt to different sequence length requirements. In unidirectional mode, extraction stops when the jump point exceeds the end of the sequence to avoid invalid data from participating in the operation. In cyclic mode, extraction continues from the beginning of the sequence when the jump point exceeds the end, ensuring continuous and uninterrupted operation. By combining and configuring the four settings, the jump point multiplier accumulator has strong scene adaptability and can meet the data extraction needs of different scenarios such as digital filtering and subband frequency division.
[0043] In one embodiment of this application, the jump point direction includes forward jump points and reverse jump points. Forward jump points select numbers sequentially from the beginning to the end of the sequence, while reverse jump points select numbers sequentially from the end to the beginning of the sequence. The division of forward and reverse jump points in the jump point direction is also to adapt to the differentiated requirements for the sequence reading order in different data processing scenarios, ensuring that the jump point extraction can accurately match the operation logic. Among them, the forward jump point follows the rule of selecting numbers sequentially from the beginning to the end of the sequence, which conforms to the pattern of most conventional operation scenarios. For example, in digital filtering processing, the signal sequence to be processed is arranged from the beginning (first sampling point) to the end (last sampling point) in the order of sampling time. Using forward jump points, the signal sampling values can be extracted in time order, which is consistent with the operation logic of the filter coefficients, ensuring that the filtering result reflects the temporal characteristics of the signal.
[0044] The reverse jump point method selects numbers sequentially from the end of the sequence to the beginning, suitable for special scenarios requiring reverse data processing. For example, in some signal deconvolution operations, it's necessary to trace back from the last sampling point of the signal sequence; or in the reverse verification stage of subband coding, it's necessary to extract coefficients from the end of the transform matrix to verify data consistency. The design of these two jump point directions does not require changing the storage order of the sequence itself; different operational logics can be satisfied simply by adjusting the extraction direction. This simplifies data storage complexity and expands the application range of the jump point multiplier-accumulator.
[0045] In cyclic mode, when the selected jump point exceeds the end of the sequence, data is selected again from the beginning of the sequence. The difference between cyclic mode and unidirectional mode lies in the handling of the case where the jump point exceeds the end of the sequence. They are adapted to different scenarios regarding the continuity and boundary constraints of data extraction. In particular, in cyclic mode, when the selected jump point exceeds the end of the sequence, data is selected again from the beginning of the sequence. This satisfies scenarios where data needs to be periodically repeated in the operation. For example, in the transformation matrix operation of subband encoding, the matrix coefficients have a periodic repetition pattern. If the length of the filter coefficient sequence is 257, when the jump point exceeds the 258th position from the 257th coefficient, in cyclic mode, data can be directly extracted from the first coefficient without additional storage of repeated coefficients. This ensures the continuity of the operation and avoids redundant data occupying memory.
[0046] In one-way mode, data selection stops when the selected jump point exceeds the end of the sequence. This one-way mode is more suitable for scenarios where the data has clear boundaries and does not require subsequent supplementary extraction. For example, when filtering a fixed-length digital signal frame, the start and end of the signal sequence correspond to the complete time range of the single-frame signal. When the jump point exceeds the end, it means that all necessary data for that frame has been extracted. Stopping selection avoids introducing invalid data, ensuring that the calculation result corresponds only to the current processing object, and guaranteeing the accuracy and clear boundaries of data processing.
[0047] In one embodiment of this application, the preset operation rule is one of integer multiplication, floating-point multiplication, or polynomial operation on multi-point data. Integer multiplication is suitable for scenarios with low data precision requirements and a focus on computational speed, such as filtering of some simple digital signals. When both the signal sample value and the filter coefficients are integers, integer multiplication simplifies the hardware computation module, reduces resource consumption, and improves computational efficiency. Floating-point multiplication is designed for high-precision computational needs. For example, in audio and video encoding and decoding, signal amplitude and transform coefficients often need to retain decimal places to ensure data accuracy. Floating-point multiplication avoids the precision loss caused by integer truncation, ensuring that the computational result meets high-fidelity processing requirements. Polynomial operation on multi-point data is used to handle more complex computational scenarios, such as high-order filter design or complex subband transformations. It requires constructing a polynomial model based on data extracted from multiple jump points for computation to achieve more refined signal processing effects. By selecting from these three operation rules, the jump-point multiplier accumulator can adapt to different computational needs without modifying the hardware structure, simply by switching the operation rules, thus improving the flexibility of the solution.
[0048] In one embodiment of this application, the first jump point step size is equal to the second jump point step size, or the first jump point step size is unequal to the second jump point step size. Having equal or unequal first and second jump point step sizes further expands the applicability of the jump point multiplication and accumulation scheme. When both step sizes are equal, it is suitable for scenarios where the extraction rhythm of two sets of sequence data needs to be synchronized. For example, in simple convolution operations, the signal sequence and coefficient sequence extract data at the same interval, ensuring accurate matching of corresponding points and simplifying the computation logic. When the two step sizes are unequal, it can meet more complex functional requirements. For example, in the design of multi-cutoff frequency filters, the jump point step size of the first sequence is fixed at 1 to retain all effective sampling points, while different filtering parameters are achieved by adjusting the step size of the filter coefficient sequence (second sequence). Or, in sub-band frequency division processing, appropriate step sizes are set according to the repetition pattern of the transformation matrix and the sampling characteristics of the signal sequence, ensuring computational accuracy while minimizing invalid data participation in the computation.
[0049] To further illustrate the scheme of this application, examples are given below.
[0050] Add a window Taking a low-pass filter as an example, the formula for calculating the coefficients of a low-pass filter is as follows:
[0051]
[0052] in, This is the nth filter coefficient, where n = 1 to N+1, and the filter order is N+1. K is the normalization coefficient of the filter, ensuring that the sum of all filter coefficient values is 1. window is the window function. This indicates the filter's cutoff frequency and sampling frequency. The ratio. According to the sampling theorem, Value range: Generally, the infinitely long impulse response of the ideal low-pass filter is first obtained through the sinc function, and then truncated and weighted using a window function to obtain the actual filter coefficients of a finite length. This retains the function of low-pass filtering, while the window function improves the filter's smoother transition band and reduces sidelobe interference.
[0053] Suppose a digital signal x(m) with a sampling frequency of 16kHz needs filtering. We need to design low-pass filters with five cutoff frequencies: 1kHz, 2kHz, 3kHz, 5kHz, and 6kHz. Assuming each filter has an order of 257, the traditional point-by-point multiplication and accumulation method would require storing 257 × 5 = 1285 coefficient values. Using this set of 257 filter coefficients, combined with the jump point at the filter coefficient input of the jump-point multiplier accumulator, we can implement low-pass filters with these five different cutoff frequencies.
[0054] Suppose the sampling frequency is increased by inserting 15 zeros between every two points in the signal sequence. Let P = 15 + 1 = 16 represent the spacing between every two original signal points. , is the expanded target sampling frequency, and P is the difference factor.
[0055] Design a low-pass filter with a cutoff frequency of 8kHz, using a Blackman window as the window function. , The normalized cutoff frequency of the subband filter, with N set to 256, yields a 257th-order filter, with coefficients shown in the table below:
[0056] Serial Number coefficient Serial Number coefficient Serial Number coefficient Serial Number coefficient 1 3.38E-35 65 -8.28E-19 129 0.062495944 193 -8.28E-19 2 -2.65E-08 66 -0.000347306 130 0.062079814 194 0.000313175 3 -2.10E-07 67 -0.000716913 131 0.060841867 195 0.000582909 4 -6.92E-07 68 -0.001094759 132 0.058813113 196 0.000802563 5 -1.58E-06 69 -0.001464966 133 0.056044159 197 0.000968203 6 -2.93E-06 70 -0.001810383 134 0.052603639 198 0.001078506 7 -4.74E-06 71 -0.002113233 135 0.048576092 199 0.001134569 8 -6.93E-06 72 -0.002355854 136 0.044059365 200 0.001139633 9 -9.33E-06 73 -0.002521503 137 0.039161631 201 0.001098737 10 -1.17E-05 74 -0.002595191 138 0.033998118 202 0.001018328 11 -1.38E-05 75 -0.002564518 139 0.02868768 203 0.000905851 12 -1.52E-05 76 -0.002420469 140 0.023349308 204 0.000769332 13 -1.56E-05 77 -0.002158129 141 0.018098705 205 0.000616973 14 -1.46E-05 78 -0.001777281 142 0.013045044 206 0.000456784 15 -1.18E-05 79 -0.00128285 143 0.008288005 207 0.000296256 16 -7.02E-06 80 -0.000685165 144 0.003915192 208 0.000142093 17 3.56E-20 81 1.35E-18 145 2.29E-18 209 4.19E-19 18 9.30E-06 82 0.00075161 146 -0.0034 210 -0.000125459 19 2.08E-05 83 0.001543803 147 -0.006244121 211 -0.000230939 20 3.41E-05 84 0.00234656 148 -0.008509046 212 -0.000314331 21 4.89E-05 85 0.00312662 149 -0.010188739 213 -0.000374722 22 6.45E-05 86 0.0038486 150 -0.011293804 214 -0.000412299 23 8.00E-05 87 0.004476305 151 -0.011850334 215 -0.000428224 24 9.45E-05 88 0.004974174 152 -0.011898301 216 -0.000424473 25 1.07E-04 89 0.005308829 153 -0.011489571 217 -0.000403649 26 0.000115652 90 0.005450651 154 -0.010685615 218 -0.000368802 27 1.20E-04 91 0.005375332 155 -0.009555018 219 -0.00032323 28 0.000118607 92 0.005065341 156 -0.00817087 220 -0.000270307 29 1.11E-04 93 0.004511226 157 -0.006608154 221 -0.000213313 30 9.49E-05 94 0.003712704 158 -0.004941192 222 -0.000155299 31 7.13E-05 95 0.002679467 159 -0.003241274 223 -9.90E-05 32 3.96E-05 96 0.00143166 160 -0.001574511 224 -4.66E-05 33 -1.62E-19 97 -1.88E-18 161 -1.88E-18 225 -1.62E-19 34 -4.66E-05 98 -0.001574511 162 0.00143166 226 3.96E-05 35 -9.90E-05 99 -0.003241274 163 0.002679467 227 7.13E-05 36 -0.000155299 100 -0.004941192 164 0.003712704 228 9.49E-05 37 -2.13E-04 101 -0.006608154 165 0.004511226 229 0.000110511 38 -0.000270307 102 -0.00817087 166 0.005065341 230 0.000118607 39 -3.23E-04 103 -0.009555018 167 0.005375332 231 0.000119986 40 -0.000368802 104 -0.010685615 168 0.005450651 232 0.000115652 41 -4.04E-04 105 -0.011489571 169 0.005308829 233 0.000106749 42 -0.000424473 106 -0.011898301 170 0.004974174 234 9.45E-05 43 -4.28E-04 107 -0.011850334 171 0.004476305 235 8.00E-05 44 -0.000412299 108 -0.011293804 172 0.0038486 236 6.45E-05 45 -3.75E-04 109 -0.010188739 173 0.00312662 237 4.89E-05 46 -0.000314331 110 -0.008509046 174 0.00234656 238 3.41E-05 47 -2.31E-04 111 -0.006244121 175 0.001543803 239 2.08E-05 48 -0.000125459 112 -0.0034 176 0.00075161 240 9.30E-06 49 4.19E-19 113 2.29E-18 177 1.35E-18 241 3.56E-20 50 0.000142093 114 0.003915192 178 -0.000685165 242 -7.02E-06 51 2.96E-04 115 0.008288005 179 -0.00128285 243 -1.18E-05 52 0.000456784 116 0.013045044 180 -0.001777281 244 -1.46E-05 53 6.17E-04 117 0.018098705 181 -0.002158129 245 -1.56E-05 54 0.000769332 118 0.023349308 182 -0.002420469 246 -1.52E-05 55 9.06E-04 119 0.02868768 183 -0.002564518 247 -1.38E-05 56 0.001018328 120 0.033998118 184 -0.002595191 248 -1.17E-05 57 1.10E-03 121 0.039161631 185 -0.002521503 249 -9.33E-06 58 0.001139633 122 0.044059365 186 -0.002355854 250 -6.93E-06 59 1.13E-03 123 0.048576092 187 -0.002113233 251 -4.74E-06 60 0.001078506 124 0.052603639 188 -0.001810383 252 -2.93E-06 61 9.68E-04 125 0.056044159 189 -0.001464966 253 -1.58E-06 62 0.000802563 126 0.058813113 190 -0.001094759 254 -6.92E-07 63 5.83E-04 127 0.060841867 191 -0.000716913 255 -2.10E-07 64 3.13E-04 128 0.062079814 192 -0.000347306 256 -2.65E-08 257 3.38E-35
[0057] Filtering corresponds to convolution, which involves multiplying and accumulating two sets of sequences. To implement filtering with different cutoff frequencies, simply change the step size at the filter coefficient end, while setting the step size to 1 at the signal end. The termination condition for the step size is that the value of the filter sequence after the step size exceeds the filter length of 257.
[0058] The cutoff frequencies of the low-pass filters with cutoff frequencies of 1kHz, 2kHz, 3kHz, 5kHz, and 6kHz are respectively: (α=1 / 8, 2 / 8, 3 / 8, 5 / 8, 6 / 8), the jump point step size step=α*P of the filter coefficient sequence is 2, 4, 6, 10 and 12 respectively.
[0059] The low-pass filtering calculation for the 6kHz cutoff frequency is shown below:
[0060] The signal sequence, i.e., the first sequence of data:
[0061] X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 ... X22 X23
[0062] Filter sequence, i.e., the second sequence data (jump interval 12):
[0063] C1 C13 C25 C37 C49 C61 C73 C85 C97 C109 C121 ... C253 C265
[0064] The first point after signal filtering: Y1 = C1*X1 + C13*X2 + C25*X3 + ... + C265*X23
[0065] The second point after signal filtering: Y2 = C1*X2 + C13*X3 + C25*X4 + ... + C265*X24
[0066] The m-th point after signal filtering:
[0067] The calculation for low-pass filtering with a cutoff frequency of 5kHz only requires changing the jump point interval of the filter sequence to 10:
[0068] C1 C11 C21 C31 C41 C51 C61 C71 C81 C91 C101 ... C241 C251
[0069] The filtering calculation method is the same as above, and the implementation methods for other filters with different cutoff frequencies are also the same.
[0070] This application sets and flexibly configures the jump point, setting the first jump point step size (signal sequence end) to 1, a positive jump point, with the starting point being the first sampling point of the signal, and a one-way mode, to ensure complete extraction of the effective signal; the second jump point step size (filter coefficient end) is set according to the target cutoff frequency, with 1kHz corresponding to a second jump point step size of 2, 2kHz corresponding to a second jump point step size of 4, 3kHz corresponding to a second jump point step size of 6, 5kHz corresponding to a second jump point step size of 10, and 6kHz corresponding to a second jump point step size of 12, a positive jump point, with the starting point being the first coefficient, and a one-way mode, stopping extraction when the jump point exceeds the end of the coefficient sequence.
[0071] The first sequence of data is the original 16kHz sampled signal, and the second sequence of data is a set of 257-order low-pass filter coefficients with an 8kHz cutoff frequency. Effective sampling points of the signal sequence are extracted point-by-point with a first jump point step size of 1 to avoid redundant data. Target coefficients are then extracted from the coefficient sequence at intervals with a set second jump point step size. Using floating-point multiplication rules, the extracted signal sampling points are multiplied by their corresponding jump point coefficients one by one, and the accumulated result is the filtered output at the target cutoff frequency. Through this process, only 257 coefficients need to be stored, and five filtering functions can be implemented by adjusting the second jump point step size, significantly reducing memory usage and resource waste, while simplifying hardware configuration.
[0072] In summary, the above examples demonstrate that when filtering a digital signal with a sampling frequency of 16kHz, to achieve low-pass filtering at five different cutoff frequencies (1kHz, 2kHz, 3kHz, 5kHz, and 6kHz), existing solutions require designing a separate set of 257th-order filter coefficients for each cutoff frequency. Since the coefficients of each filter are independent, 257 × 5 = 1285 coefficient values need to be stored, resulting in a large memory footprint and significant resource waste. Furthermore, storing and switching multiple sets of coefficients increases the complexity of the hardware circuitry and reduces computational efficiency.
[0073] The following explanation uses the frequency division and grouping of a sub-band encoder as an example. Frequency division and grouping of a sub-band encoder require operations such as discrete cosine transform to decompose an N-point input signal into K sub-bands or synthesize a single frame output signal. Taking N=64 as an example, the transformation process requires N×(N / 2)=2048 cosine coefficients. These coefficients are presented in matrix form and contain a large number of repeated terms. However, the traditional point-by-point multiplication and accumulation scheme requires storing all 2048 coefficients to complete the calculation. The redundant storage of a large number of repeated coefficients leads to a surge in chip memory usage and significant resource waste. Furthermore, excessive data reading and processing also reduces the overall efficiency of sub-band processing.
[0074] This application extracts repeating coefficients by jumping points and simplifies the storage and calculation process. Specifically, the first jump point step size (input signal sequence end) is set to 1, with a positive jump point, the starting point being the first data point of the signal, and a one-way mode, to ensure the complete extraction of effective data for each frame of signal; the second jump point step size (coefficient matrix end) is set according to the matrix repetition pattern to adjust the interval, with a positive jump point, the starting point being the first coefficient of the key row, and a loop mode, to ensure the continuity of coefficient extraction.
[0075] The first sequence data is the N-point input signal sequence to be processed, and the second sequence data is the key row of all coefficient information in the transformation matrix, such as the 64 values in the first row of the discrete cosine transform matrix. When considering the sign, the storage is doubled to 128 values.
[0076] The signal sequence data is extracted point by point with a first jump point step size of 1 to ensure the integrity of signal processing; the target coefficients are extracted from the coefficients of the key row with a preset second jump point step size. In the loop mode, there is no need to worry about the coefficients being exhausted. All coefficients required for the operation can be covered by periodic extraction, and there is no need to store the complete matrix.
[0077] Using integer multiplication or floating-point multiplication rules, the extracted signal data is operated on item by item with the corresponding jump point coefficients, and the accumulated result is the sub-band frequency division or grouping output.
[0078] Therefore, only 64 (or 128 signed) key coefficients need to be stored to replace 2048 complete coefficients to complete the calculation, reducing the storage amount to 1 / 16 of the original, greatly reducing memory usage and resource waste, while improving calculation efficiency.
[0079] This application also provides an accumulator, which includes a first storage group and a second storage group. The first storage group stores a first sequence of data, including a plurality of first storage points. The first sequence of data includes a plurality of first sequence numbers, and each first storage point stores one first sequence number. The second storage group stores a second sequence of data, including a plurality of second storage points. The second sequence of data includes a plurality of second sequence numbers, and each second storage point stores one second sequence number. The accumulator is used to accumulate the first sequence number and the second sequence number using the above-described data accumulation method. The accumulator, through its independent storage in two storage groups and its structural design adapted to the jump-point accumulation method, provides efficient and flexible multiplication and accumulation operations, adapting to data processing in various scenarios. The first and second storage groups provide independent space for data storage, and both employ a one-to-one correspondence storage logic where one storage point corresponds to one sequence number, ensuring that the first and second sequence data are stored in their original order. The first storage group is dedicated to storing a number of sequentially arranged first sequence numbers, with each first storage point carrying only a single first sequence number to avoid data confusion. Similarly, the second storage group stores a number of second sequence numbers, ensuring independent management and rapid retrieval of coefficient or parameter data. Meanwhile, the accumulator, through preset double-hop step size, direction, starting point, and mode, accurately extracts the target data from the two storage groups, performs item-by-item operations and accumulations according to preset rules such as integer multiplication and floating-point multiplication, enabling functions such as multi-cutoff frequency filtering and sub-band frequency division and grouping. This solves the storage redundancy problem of traditional accumulators and improves data processing efficiency through the combination of structured storage and flexible computation.
[0080] This application also provides a chip, which includes an accumulator that performs data accumulation using the above-described data accumulation method.
[0081] The chip implementation method of this application refers to the implementation method and beneficial effects of the above data accumulation method, and will not be repeated here.
[0082] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described data accumulation method.
[0083] The implementation of the computer-readable storage medium in this application refers to the implementation and beneficial effects of the above-described data accumulation method, and will not be repeated here.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A data accumulation method, characterized in that, The data accumulation method includes: Acquire first sequence data and second sequence data, wherein the first sequence data includes a plurality of first sequence numbers arranged in order, and the second sequence data includes a plurality of second sequence numbers arranged in order; Extract the first sequence number from the first sequence data according to the preset first jump point step size; The second sequence number is extracted from the second sequence data according to the preset second jump point step size, wherein at least one of the first jump point step size and the second jump point step size is greater than 1; The first sequence number and the second sequence number are operated on item by item according to the preset operation rules, and the operation results are accumulated.
2. The data accumulation method according to claim 1, characterized in that, Both the first jump step size and the second jump step size are positive integers.
3. The data accumulation method according to claim 1, characterized in that, The first jump point step size and the second jump point step size are numerical values with decimals, and the numerical values with decimals are rounded to the nearest integer or rounded to obtain integer values.
4. The data accumulation method according to claim 1, characterized in that, Before the steps of obtaining the first sequence data and the second sequence data, the following are included: The step size of the first jump point and the step size of the second jump point are set, the jump point direction is set, the jump point starting point is set, and the jump point mode is set respectively. The jump point mode setting includes unidirectional mode and loop mode.
5. The data accumulation method according to claim 4, characterized in that, The jump point direction includes forward jump points and reverse jump points. The forward jump point is to select numbers by jumping points sequentially from the beginning to the end of the sequence. The reverse jump point is to select numbers by jumping points sequentially from the end to the beginning of the sequence. In the loop mode, when the selected jump point exceeds the end of the sequence, data is selected again from the beginning of the sequence. In the one-way mode, data selection stops when the selected jump point exceeds the end of the sequence.
6. The data accumulation method according to claim 1, characterized in that, The preset operation rule is one of integer multiplication, floating-point multiplication, or polynomial operation of multi-point data.
7. The data accumulation method according to claim 1, characterized in that, The first jump point step size is equal to the second jump point step size, or the first jump point step size is not equal to the second jump point step size.
8. An accumulator, characterized in that, The accumulator includes a first memory group and a second memory group; The first storage group is used to store first sequence data. The first storage group includes a plurality of first storage points. The first sequence data includes a plurality of first sequence numbers. Each first storage point stores one first sequence number. The second storage group is used to store the second sequence data. The second storage group includes a plurality of second storage points. The second sequence data includes a plurality of second sequence numbers. Each second storage point stores one second sequence number. The accumulator is used to accumulate the first sequence number and the second sequence number using the data accumulation method as described in any one of claims 1 to 7.
9. A chip, characterized in that, The chip includes an accumulator, which performs data accumulation using the data accumulation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the data accumulation method as described in any one of claims 1 to 7.