Spectrum extraction method and device of fast fourier transform, computer storage medium

By combining reverse output and radix-2 butterfly operation with ping-pong storage of true dual-port RAM, efficient parallel reordering of FFT spectrum frequency points and FFTShift operation are achieved. This solves the problems of computational latency and resource consumption in traditional FFT processing of large-point data, and improves processing speed and hardware resource utilization efficiency.

CN121412499BActive Publication Date: 2026-04-28CHINA JILIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA JILIANG UNIV
Filing Date
2025-12-29
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Traditional Fast Fourier Transform (FFT) suffers from computational latency, excessive hardware resource consumption, and low parallel processing efficiency when processing large amounts of data, making it difficult to meet the needs of 5G communication and real-time spectrum monitoring.

Method used

The FFT calculation results are processed by spectral linearization and logarithmic magnitude calculation using a reverse output method. After grouped parallel processing, the number of channels is adjusted using a radix-2 butterfly operation structure. Combined with the ping-pong storage method of true dual-port RAM, efficient parallel reordering of the spectrum and FFTShift operation are achieved.

Benefits of technology

It achieves efficient parallel reordering of FFT spectrum frequency points and FFTShift operation, which improves processing speed, reduces hardware resource consumption, and is suitable for high real-time scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121412499B_ABST
    Figure CN121412499B_ABST
Patent Text Reader

Abstract

The application discloses a spectrum extraction method and device of fast Fourier transform, and a computer storage medium, and the method comprises the following steps: adopting inverse sequence output calculation for a front-stage FFT operation, performing linear spectrum processing and logarithmic amplitude operation on a calculation result to obtain an amplitude frequency point; grouping the amplitude frequency point to obtain an amplitude grouping matrix of a preset grouping number; adopting a radix-2 butterfly operation structure to adjust a road number of the amplitude grouping matrix, and storing the amplitude grouping matrix in a sequence after the road number adjustment; dividing the stored amplitude grouping matrix to obtain an amplitude frequency point matrix; marking the position of an element in the amplitude frequency point matrix, performing a binary bit inversion operation on the marked position to obtain a rearranged position; adjusting the position sequence of the element according to the rearranged position to obtain an amplitude frequency point rearranged matrix, and obtaining a spectrum after completing spectrum sequence arrangement and FFTShift operation through serial-parallel conversion. The method realizes parallel sequence arrangement operation of large-point-number spectrum data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of spectrum processing technology, and in particular to a method and apparatus for spectrum extraction using fast Fourier transform, and a computer storage medium. Background Technology

[0002] As a core algorithm in digital signal processing, the Fast Fourier Transform (FFT) requires the zero-frequency component to be shifted to the center of the spectrum through spectrum reordering and the FFTShift operation to form a symmetrical spectrum that conforms to the physical frequency perception. Traditional implementation methods have obvious limitations: software processing schemes rely on the CPU to execute serial instructions, which faces huge computational latency when processing large-point FFTs, making it difficult to meet the high real-time requirements of scenarios such as 5G communication and real-time spectrum monitoring; while existing hardware architectures have improved, they mostly adopt a serial processing mode, and their processing cycle is proportional to the number of data points. This not only fails to fully utilize the advantages of hardware parallelism, but also suffers from problems such as excessive block memory resource consumption and complex control logic. Summary of the Invention

[0003] This application provides a method and apparatus for spectrum extraction using Fast Fourier Transform (FFT). This method enables efficient parallel reordering of FFT spectrum frequency points and FFTShift operations, thereby improving processing speed and reducing hardware resource consumption.

[0004] In a first aspect, this application provides a method for spectrum extraction using Fast Fourier Transform, the method comprising:

[0005] The preceding FFT operation is performed using a reverse output method. The reverse output calculation results are then subjected to spectral linear processing and logarithmic amplitude operation to obtain the amplitude frequency points of the FFT output.

[0006] The amplitude frequency points are grouped to obtain an amplitude grouping matrix with a preset number of groups, and each amplitude grouping matrix corresponds to a channel number.

[0007] A radix-2 butterfly operation structure is used to adjust the channel numbering of the amplitude grouping matrix, and the amplitude grouping matrix is ​​stored in the order after the channel numbering is adjusted.

[0008] The stored amplitude grouping matrix is ​​divided into blocks to obtain the amplitude frequency point matrix;

[0009] The positions of the elements in the amplitude frequency point matrix are marked, and the binary bits of each marked position are reversed to obtain the rearranged positions of the elements.

[0010] The order of elements is adjusted according to the rearrangement position to obtain the amplitude frequency point rearrangement matrix. The elements of the amplitude frequency point rearrangement matrix are read in parallel, and after serial-to-parallel conversion, the spectrum after spectrum reordering and FFTShift operation is obtained.

[0011] In one embodiment, the amplitude frequency points are filled into different groups according to the order of the FFT output, and the amplitude frequency points of each group satisfy the following: E i,j = X m , m = i +( j -1)* n +1;

[0012] In the formula, n Indicates the number of groups. i Indicates the route number of the group. j Represents the coordinates of the amplitude grouping matrix in the grouping. E i,j Indicates the first i The first group j One element, X m This represents the m-th amplitude frequency point.

[0013] In one embodiment, dividing the stored amplitude grouping matrix into blocks includes:

[0014] Extract a first number of amplitude frequency points from the head of the amplitude grouping matrix of each group, and construct a block amplitude frequency point matrix based on the extracted amplitude frequency points in the order after the channel number is adjusted.

[0015] The first quantity satisfies the following: the number of blocks is the same as the number of amplitude frequency points grouped, and the amplitude frequency point matrix of each block contains the same number of elements.

[0016] In one embodiment, the amplitude frequency points of the same group are taken as elements of the same row of the amplitude frequency point matrix.

[0017] The positions of the elements in the amplitude frequency point matrix are labeled, and the labeling rules satisfy the following: the position label of any element in the amplitude frequency point matrix is ​​the column number of the element in the amplitude frequency point matrix;

[0018] Alternatively, the amplitude frequency points of the same extracted group can be used as elements of the same column in the amplitude frequency point matrix.

[0019] The positions of the elements in the amplitude frequency point matrix are labeled according to the following rules: the position of any element in the amplitude frequency point matrix is ​​labeled as the row number of the element in the amplitude frequency point matrix.

[0020] In one embodiment, a radix-2 butterfly operation structure is used to adjust the number of paths in the amplitude grouping matrix. The adjusted number of paths in the amplitude grouping matrix satisfies the following:

[0021] Eordered[n] = E[bitrev4(n)];

[0022] Among them, bitrev4( ) represents a 4-bit binary bit reversal operation, n represents the number of channels in the amplitude grouping matrix before channel adjustment, n∈[0,15], and Eordered[n] represents the number of channels in the amplitude grouping matrix after channel adjustment.

[0023] In one embodiment, a true dual-port RAM is used to store and retrieve amplitude frequency points, with one port of the true dual-port RAM used for read operations and the other port used for write operations.

[0024] In one embodiment, the true dual-port RAM uses a ping-pong storage data read / write method.

[0025] In one embodiment, the address storage depth of the true dual-port RAM is twice the maximum address for writing data.

[0026] Secondly, this application also provides a spectrum extraction device based on FPGA fast Fourier transform, wherein the extraction device applies the spectrum extraction method of fast Fourier transform of the first aspect.

[0027] Thirdly, this application also provides a computer storage medium storing a computer program capable of being loaded by a processor and executing a spectrum extraction method of fast Fourier transform as described in any of the first aspects.

[0028] The aforementioned Fast Fourier Transform (FFT) spectrum extraction method performs linear spectral processing and logarithmic amplitude calculation on the FFT results from the previous stage (which uses a reverse-order output structure) to obtain amplitude frequency points. These amplitude frequency points are then distributed into a preset number of groups according to modulo operations, forming amplitude grouping matrices, each corresponding to a channel number. The channel numbers are remapped using the bit-inversion property of radix-2 butterfly operations, enabling parallel routing adjustment of data groups. The reassembled data is then divided into blocks to construct amplitude frequency point matrices. By labeling the matrix element positions and performing binary bit-inversion operations, the rearranged position of each element is obtained. Data is read according to the rearranged positions to form an amplitude frequency point rearrangement matrix. After parallel reading and serial-to-parallel conversion, the ordered spectrum is output. This method, through a multi-level parallel processing architecture and an innovative address mapping mechanism, transforms the complex data handling in traditional spectrum ordering and FFTShift operations into efficient address addressing, significantly reducing algorithm complexity. Attached Figure Description

[0029] Figure 1 This is a flowchart of a spectrum extraction method using Fast Fourier Transform in one embodiment;

[0030] Figure 2 This is a schematic diagram of the amplitude grouping matrix in one embodiment;

[0031] Figure 3 This is a schematic diagram of the path numbering before and after adjustment in one embodiment;

[0032] Figure 4 This is a schematic diagram of the amplitude frequency point matrix after adjusting the channel number in one embodiment;

[0033] Figure 5 This is a schematic diagram illustrating the rearrangement of the amplitude frequency point matrix in one embodiment;

[0034] Figure 6 This is a spectrum display diagram from one embodiment. Detailed Implementation

[0035] The present application will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present application. Any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the protection scope of the present application.

[0036] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0037] In one embodiment, such as Figure 1 As shown, a method for spectrum extraction using Fast Fourier Transform is provided, which includes the following steps:

[0038] Step 101: The previous FFT operation is performed in reverse order. The result of the reverse order output is subjected to spectral linear processing and logarithmic amplitude operation to obtain the amplitude frequency point of the FFT output.

[0039] Specifically, the reverse-order output results are not arranged in the order of natural frequencies, but have undergone bit reversal, resulting in zero-frequency components located at both ends of the spectral sequence, and the entire frequency domain exhibits a reverse distribution.

[0040] The calculation results of the reverse-order output are subjected to spectral linearization, that is, the magnitude of each complex frequency point is calculated, transforming it from a complex form containing phase information into a real linear amplitude that only represents the signal intensity distribution. It should be noted that the intensity of different frequency components in a real signal may differ by several orders of magnitude. For ease of observation and analysis, logarithmic amplitude calculation is further performed to compress the huge dynamic range of the linear amplitude to a logarithmic scale, thus enabling the simultaneous clear representation of both weak and strong signals. The reverse-order arrangement of the amplitude frequency points in the frequency domain of the calculated FFT output remains unchanged.

[0041] Step 102: Group the amplitude frequency points to obtain an amplitude grouping matrix with a preset number of groups, and each amplitude grouping matrix corresponds to a channel number;

[0042] Specifically, the total length N=131072 amplitude frequency points are divided into M=16 data groups, each containing K=8192 amplitude frequency points, satisfying the quantitative relationship N=M×K. For example, the amplitude frequency points can be allocated using a cyclic interval sampling method, that is, the original spectrum sequence is traversed sequentially, the first amplitude frequency point is assigned to group 0, the second amplitude frequency point to group 1, and so on until the 16th amplitude frequency point is assigned to group 15; then the 17th amplitude frequency point is reassigned to group 0, the 18th amplitude frequency point to group 1, and so on, with a period of 16, until all 131072 amplitude frequency points have been allocated.

[0043] For example, such as Figure 2 As shown, 16 data groups are formed. Group E0 contains amplitude frequency points with indices X1, X17, X33...X131057, group E1 contains amplitude frequency points with indices X2, X18, X34...X131058, and so on. Each data group contains 8192 amplitude frequency points uniformly sampled from the full spectrum range, forming a complete spectrum microcosm. The 16 data groups are assigned independent channel numbers from E0 to E15 as their identification in the parallel processing architecture, enabling all data groups to simultaneously perform subsequent reordering and FFTShift operations in their corresponding 16 processing channels.

[0044] Step 103: Adjust the channel numbering of the amplitude grouping matrix using a radix-2 butterfly operation structure, and store the amplitude grouping matrix in the order after the channel numbering adjustment;

[0045] Specifically, when the number of parallel paths M is a power of 2 (e.g., M=16, or 2^4), the original number (0 to 15) of each path can be represented as a 4-bit binary number. The adjustment rule here is to perform a 4-bit bit reversal operation on the path number. For example, the path with the original number 1 (binary 0001) becomes 8 (binary 1000) after bit reversal; the path with the original number 2 (binary 0010) becomes 4 (binary 0100) after reversal. After this operation, the path numbers of all data groups are remapped, and the entire amplitude grouping matrix is ​​stored according to the adjusted new order of path numbers.

[0046] For example, such as Figure 3 As shown, the path numbers before adjustment are [E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12, E13, E14, E15]. After performing a bit reversal operation on these path numbers, the adjusted path numbers are [E0, E2, E4, E12, E2, E10, E6, E14, E1, E9, E5, E13, E3, E11, E7, E15].

[0047] Step 104: Divide the stored amplitude grouping matrix into blocks to obtain the amplitude frequency point matrix;

[0048] For example, after adjusting the channel number, each data group includes 8192 amplitude frequency points. Each data group is further divided into multiple consecutive data blocks according to a fixed block size (e.g., 512 amplitude frequency points). A new amplitude frequency point matrix can be constructed through the block operation. The rows of the new amplitude frequency point matrix can correspond to the adjusted channel number, and the columns of the new amplitude frequency point matrix can be formed by arranging the elements in each data block in sequence.

[0049] For example, such as Figure 4 As shown, the adjusted channel numbers are [E0, E2, E4, E12, E2, E10, E6, E14, E1, E9, E5, E13, E3, E11, E7, E15]. Among them, group E0 contains amplitude frequency points with indices X1, X17, X33...X131057, group E8 contains amplitude frequency points X9, X25, X41...X131065, and so on. Each data group contains 8192 amplitude frequency points uniformly sampled from the full spectrum range.

[0050] Step 105: Mark the positions of the elements in the amplitude frequency point matrix, and perform a binary bit reversal operation on the marked positions of each element to obtain the rearranged positions of the elements;

[0051] Specifically, each element in the amplitude frequency point matrix is ​​assigned a unique position number, which corresponds to the linear address index of each element in the matrix. Furthermore, the FFT algorithm is used to perform a bit-reversal operation on the position number.

[0052] For example, when processing a data block with 512 amplitude frequency points (corresponding to 9-bit binary addresses), the high and low bits of the 9-bit binary representation at each position are reversed to generate a rearranged position. For example... Figure 5 As shown, the position of each column is marked and a unique position number is assigned to each column. Furthermore, a binary bit reversal operation is performed on each column. For example, position 1 (binary 000000001) in the sequence becomes position 256 (binary 100000000) after binary reversal.

[0053] Step 106: Adjust the position order of the elements according to the rearrangement position to obtain the amplitude frequency point rearrangement matrix. Read the elements of the amplitude frequency point rearrangement matrix in parallel and obtain the spectrum after serial-to-parallel conversion. The spectrum has been sorted and FFTShift operation completed.

[0054] Specifically, the rearranged position obtained by bit reversal calculation is used as the read address. By controlling the read sequence of the memory unit, elements are extracted from the memory according to the new read address order, thereby completing the rearrangement of the data position and forming an amplitude frequency point rearrangement matrix.

[0055] Furthermore, the elements at each position in the matrix are read simultaneously through a multi-parallel interface, and these parallel data streams are integrated into a continuous serial data stream output through a serial-to-parallel conversion module to obtain spectrum data centered at zero frequency and conforming to the natural frequency order, and the spectrum of spectrum sorting and FFTShift operation are completed simultaneously.

[0056] In this embodiment, the method performs spectral linear processing and logarithmic amplitude calculation on the FFT operation results with a reverse output structure in the previous stage to obtain amplitude frequency points. The amplitude frequency points are then allocated to a preset number of groups according to the modulo operation rules, forming an amplitude grouping matrix, with each matrix corresponding to a path number. The path numbering is remapped using the bit-inversion property of radix-2 butterfly operation to achieve parallel routing adjustment of data groups. The reassembled data is divided into blocks to construct an amplitude frequency point matrix. By marking the positions of matrix elements and performing binary bit-inversion operations, the rearranged position of each element is obtained. Data is read according to the rearranged position to form an amplitude frequency point rearrangement matrix. After parallel reading and serial-to-parallel conversion, the ordered spectrum is output. This method, through a multi-level parallel processing architecture and an innovative address mapping mechanism, transforms the complex data handling in traditional spectrum ordering and FFTShift operations into efficient address addressing, significantly reducing the algorithm complexity.

[0057] In one embodiment, the amplitude frequency points are filled into different groups according to the order of the FFT output, and the amplitude frequency points of each group satisfy the following: E i,j = X m , m = i +( j -1)* n +1;

[0058] In the formula, n Indicates the number of groups. i Indicates the route number of the group. i =0,1,2,3,…,(n-1), j Represents the coordinates of the amplitude grouping matrix in the grouping. j =1, 2, 3…, E i,j Indicates the first i The first group j One element, X m This represents the m-th amplitude frequency point.

[0059] For example, consider dividing the amplitude frequency points with a total length of N=131072 into M=16 data groups:

[0060] When i=0, according to m = i +( j -1)* n +1 calculation, j=1 corresponds to m=1, resulting in E 0,1 =X1, that is, the first element of the E0 group is X1; when i=0, j=2, corresponding to m=17, we get E 0,2 =X 17 That is, the second element of group E0 is X. 17 When i=0 and j=3, the corresponding value for m=33 is E. 0,3 =X 33 That is, the third element of group E0 is X. 33 ; and so on, forming the E0th data group as [X1, X... 17 X 33 , ...X 131057 ].

[0061] When i=1 and j=1, corresponding to m=2, we get E 1,1 =X2, that is, the first element of group E1 is X2; when i=1, j=2, corresponding to m=18, we get E 1,2 =X 18 That is, the second element of group E1 is X. 18When i=1 and j=3, the corresponding m=34, we get E 1,3 =X 34 That is, the third element of group E1 is X. 34 ; and so on, forming the E1 data group as [X2, X 18 X 34 , ...X 131058 ].

[0062] In one embodiment, a radix-2 butterfly operation structure is used to adjust the number of paths in the amplitude grouping matrix. The adjusted number of paths in the amplitude grouping matrix satisfies the following:

[0063] Eordered[n] = E[bitrev4(n)];

[0064] Among them, bitrev4( ) represents a 4-bit binary bit reversal operation, n represents the number of channels in the amplitude grouping matrix before channel adjustment, n∈[0,15], and Eordered[n] represents the number of channels in the amplitude grouping matrix after channel adjustment.

[0065] For example, taking 16-way parallel processing as an example, the data group numbers before adjustment are E[0] to E

[15] , and the nth data after adjustment will be taken from the bitrev4(n) data before adjustment.

[0066] For example, when n=1 (binary 0001), the binary bits are reversed to 1000 (decimal 8), i.e., Eordered[1]=E[8]; when n=2 (binary 0010), the binary bits are reversed to 0100 (decimal 4), i.e., Eordered[2]=E[4].

[0067] In one embodiment, dividing the stored amplitude grouping matrix into blocks includes:

[0068] Extract a first number of amplitude frequency points from the head of the amplitude grouping matrix of each group, and construct a block amplitude frequency point matrix based on the extracted amplitude frequency points in the order after the channel number is adjusted.

[0069] The first quantity satisfies the following: the number of blocks is the same as the number of amplitude frequency points grouped, and the amplitude frequency point matrix of each block contains the same number of elements.

[0070] Specifically, a fixed number of consecutive amplitude frequency points are extracted from the beginning of the data group after the channel number is adjusted, and this number is called the first quantity. The setting of the first quantity needs to meet two constraints: first, the total number of blocks formed in the end must be consistent with the number of groups in the system (e.g., 16 channels); second, all blocks must contain exactly the same number of elements.

[0071] For example, assuming each data group contains 8192 amplitude frequency points, and it is divided into 16 data blocks, then each data block contains 512 frequency points (i.e., the first quantity 512). Further, according to the new path numbering order after bit reversal adjustment, the data blocks extracted from each group are reorganized to construct the amplitude frequency point matrix of the blocks.

[0072] In one embodiment, the amplitude frequency points of the same group are taken as elements of the same row of the amplitude frequency point matrix.

[0073] The positions of the elements in the amplitude frequency point matrix are labeled, and the labeling rules satisfy the following: the position label of any element in the amplitude frequency point matrix is ​​the column number of the element in the amplitude frequency point matrix;

[0074] Alternatively, the amplitude frequency points of the same extracted group can be used as elements of the same column in the amplitude frequency point matrix.

[0075] The positions of the elements in the amplitude frequency point matrix are labeled according to the following rules: the position of any element in the amplitude frequency point matrix is ​​labeled as the row number of the element in the amplitude frequency point matrix.

[0076] Specifically, two equivalent logical mapping schemes are provided when constructing the block-based amplitude-frequency point matrix:

[0077] The first approach is to arrange the amplitude frequency points extracted from the same group as elements in the same row of the amplitude frequency point matrix (e.g., ...). Figure 5 As shown in the figure, each independent row corresponds to a processing channel, and the position labeling rule can be defined as taking the column number of the element as its position identifier.

[0078] The second approach is to arrange the amplitude frequency points of the same group as the elements of the same column of the amplitude frequency point matrix. In this case, the position labeling rule is changed to taking the number of the row where the element is located as the position identifier.

[0079] It should be noted that although the two schemes construct matrices with different dimensions (2×3 and 3×2), the linearized position labeling sequences generated by the interchange mapping of row numbers and column numbers are completely identical.

[0080] In one embodiment, a true dual-port RAM is used to store and retrieve amplitude frequency points. One port of the true dual-port RAM is used for read operations, and the other port is used for write operations. The true dual-port RAM uses a ping-pong storage data read and write method. The address storage depth of the true dual-port RAM is twice the maximum address for writing data.

[0081] Specifically, in a true dual-port RAM, one independent port is dedicated to write operations, continuously receiving the data stream from the preceding stage; the other independent port is dedicated to read operations, providing data for subsequent processing. The two ports are completely independent, allowing simultaneous read and write access to different locations in the memory, achieving high-throughput parallel processing.

[0082] To ensure that read and write operations do not conflict or cause data loss during continuous data frame processing, a ping-pong storage data read / write method is adopted. That is, the entire storage space is logically divided into two buffers of equal size (Buffer A and Buffer B). When one buffer (e.g., Buffer A) is being filled with current data through the write port, the other buffer (Buffer B) outputs the data stored in the previous frame to the subsequent module through the read port; in the next clock cycle, the roles of the two buffers are reversed. To implement the ping-pong storage data read / write method, the address storage depth of the true dual-port RAM is set to twice the maximum address for writing data. When the write address is in the range of 0-511 and writes the current data block to Buffer A, the read address can simultaneously read the previously stored data block from Buffer B in the range of 512-1023; when the write address reaches 511, it indicates that the current block has been written, and in the next cycle, the write address will jump to 512 to start writing a new data block to Buffer B, while the read address jumps back to 0 to start reading data from the just-filled Buffer A.

[0083] For example, if each path needs to continuously write 512 data entries, the write address range is 0 to 511, and the total address depth of the RAM is designed to be 1024. This extra double depth is intended to physically accommodate two buffers that can work alternately, thereby achieving seamless data flow in time. This ensures the continuity and high real-time performance of the processing, which is key to building an efficient pipeline.

[0084] In one embodiment, the rearranged position of the elements can be obtained using the inverse derivation method of FFT, that is, by leveraging the bit-reversal relationship between the input and output indices in the radix-2 FFT algorithm. For the entire 131072 amplitude frequency points, the goal is to convert their output order to a natural order. All amplitude frequency points are decomposed into 16 parallel channels and 512-point data blocks within each channel. Using a single 512-point (2... 9Taking the data block as an example, the internal amplitude frequency reordering completely follows the bit reversal rule of the 9-bit binary address. For example, position 1 (binary 000000001) in the sequence becomes position 256 (binary 100000000) after bit reversal; position 3 (binary 000000011) becomes position 384 (binary 110000000). After multiple levels of operation, the output sequence will be arranged in natural order, that is, X[1], X[2], ..., X

[512] correspond to the frequency components from 0 to 511Hz respectively.

[0085] The .coe files pre-stored in ROM contain the results of all similar mapping relationships. A large and complex one-dimensional global rearrangement problem with N=131072 points is decomposed into 16 parallel, regular local rearrangement problems with N=512 points each. During the data reading phase, data is read from each RAM block in a time-sharing manner and precisely concatenated in timing to form a complete and continuous parallel data stream. (RAM diagram)

[0086] To adapt to host computers or display devices that typically require serial data input, the parallel data stream needs to pass through a serial-to-parallel conversion module to be reassembled into a standard serial data stream. Once reassembled into a standard serial data stream, the spectrum reordering and FFTShift operation are complete. At this point, the output spectrum data has its zero-frequency component centered, the negative and positive half-axis data have undergone quadrant swapping, and the frequency order exhibits a natural physical sequence from -fs / 2 to 0 and then to +fs / 2, thus enabling direct use for clear spectrum visualization and analysis.

[0087] The spectrum display effect diagram is as follows: Figure 6 As shown, its horizontal axis represents frequency (range 0-14×10⁻⁶). 4 Hz, i.e., 0-140kHz), the vertical axis represents the signal amplitude (on the order of 10). 9 The zero-frequency component of the spectrum in the figure is shifted to the center position of 70kHz, forming a physical frequency distribution symmetrical with respect to the zero frequency (-70kHz~0~+70kHz), thereby improving the intuitiveness of applications such as spectrum leakage analysis and harmonic detection.

[0088] Based on the same concept, this application also provides a spectrum extraction device based on FPGA fast Fourier transform, which applies the above-mentioned fast Fourier transform spectrum extraction method.

[0089] Specifically, the series of operations in the Fast Fourier Transform (FFT) spectrum extraction method, including inverse FFT processing, parallel grouping, path number adjustment, block storage, address mapping, and serial-to-parallel conversion, are implemented as dedicated hardware logic circuits within the FPGA. Therefore, all the technical features, functions, and effects achieved by this device are defined by the aforementioned method and are a direct manifestation of this method on a hardware platform.

[0090] Based on the same concept, this application also provides a computer storage medium storing a computer program that can be loaded by a processor and executed as described above for spectrum extraction using the fast Fourier transform.

[0091] Computer storage media can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or solid-state drives (SSDs), etc.

[0092] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0093] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The above are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A method for spectrum extraction using Fast Fourier Transform, characterized in that, The method includes the following steps: The preceding FFT operation is performed using a reverse output method. The reverse output is arranged as follows: the binary representation of the sequence index is bit-reversed, and the calculation results of the reverse output are subjected to spectral linear processing and logarithmic amplitude operation to obtain the amplitude frequency point of the FFT output. The amplitude frequency points are grouped to obtain an amplitude grouping matrix with a preset number of groups, and each amplitude grouping matrix corresponds to a channel number; The path numbering of the amplitude grouping matrix is ​​adjusted using a radix-2 butterfly operation structure, and the amplitude grouping matrix is ​​stored in the order after the path numbering is adjusted. The stored amplitude grouping matrix is ​​divided into blocks to obtain the amplitude frequency point matrix; The positions of the elements in the amplitude frequency point matrix are marked, and the binary bits of each marked position are reversed to obtain the rearranged positions of the elements. The position order of the elements is adjusted according to the rearrangement position to obtain the amplitude frequency point rearrangement matrix. The elements of the amplitude frequency point rearrangement matrix are read in parallel and the spectrum is obtained after serial-to-parallel conversion. The grouping of the amplitude frequency points includes filling the amplitude frequency points into different groups according to the order of the FFT output, wherein the amplitude frequency points in each group satisfy the following: E i,j = X m , m = i +( j -1)* n +1; In the formula, n Indicates the number of groups. i Indicates the route number of the group. j Represents the coordinates of the amplitude grouping matrix in the grouping. E i,j Indicates the first i The first group j One element, X m This represents the m-th amplitude frequency point; The amplitude grouping matrix is ​​adjusted using a radix-2 butterfly operation structure, and the adjusted number of channels satisfies the following: Eordered[n] = E[bitrev4(n)]; Among them, bitrev4( ) represents a 4-bit binary bit reversal operation, and n represents the number of channels in the amplitude grouping matrix before channel adjustment, n∈[0,15].

2. The spectrum extraction method of Fast Fourier Transform according to claim 1, characterized in that, The step of dividing the stored amplitude grouping matrix into blocks includes: A first number of amplitude frequency points are extracted from the head of the amplitude grouping matrix of each group, and a block-based amplitude frequency point matrix is ​​constructed based on the extracted amplitude frequency points in the order after the channel number is adjusted. The first quantity satisfies the following: the number of blocks is the same as the number of groups of amplitude frequency points, and the amplitude frequency point matrix of each block contains the same number of elements.

3. The spectrum extraction method of Fast Fourier Transform according to claim 2, characterized in that, The amplitude frequency points of the same group are taken as elements of the same row of the amplitude frequency point matrix. The positions of the elements in the amplitude frequency point matrix are marked, and the marking rules satisfy the following: the position of any element in the amplitude frequency point matrix is ​​marked by the column number of the element in the amplitude frequency point matrix; Alternatively, the amplitude frequency points of the same extracted group can be used as elements of the same column of the amplitude frequency point matrix. The positions of the elements in the amplitude frequency point matrix are labeled, and the labeling rule satisfies that: the position label of any element in the amplitude frequency point matrix is ​​the row number of the element in the amplitude frequency point matrix.

4. The spectrum extraction method of Fast Fourier Transform according to claim 1, characterized in that, A true dual-port RAM is used to store and retrieve amplitude frequency points, where one port of the true dual-port RAM is used for read operations and the other port is used for write operations.

5. The spectrum extraction method of Fast Fourier Transform according to claim 4, characterized in that, The true dual-port RAM uses a ping-pong storage data read / write method.

6. The spectrum extraction method of Fast Fourier Transform according to claim 5, characterized in that, The address storage depth of the true dual-port RAM is twice the maximum address for writing data.

7. A spectrum extraction device based on FPGA fast Fourier transform, characterized in that, The spectrum extraction device uses the spectrum extraction method of Fast Fourier Transform as described in any one of claims 1 to 6.

8. A computer storage medium, characterized in that, The computer program stores a method for extracting the spectrum using the fast Fourier transform as described in any one of claims 1 to 6, which can be loaded by a processor.

Citation Information

Patent Citations

  • Multifunctional FFT (Fast Fourier Transform) hardware acceleration architecture capable of configuring software in real time

    CN120744289A

  • Fast fourier transforming apparatus and method, variable bit reverse circuit, inverse fast fourier transforming apparatus and method, and OFDM receiver and transmitter

    US6115728A