Method and device for realizing spectrum analysis processing based on FFT (Fast Fourier Transform) and frequency sweeping combination mode, processor and computer readable storage medium
By combining FFT with frequency sweep, the problem of slow scanning speed under large scan width and high frequency resolution is solved, realizing fast spectrum analysis and significantly improving the output display effect.
Patent Information
- Application Number
- CN202510965806.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-14
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies have slow scanning speeds when dealing with large scan widths and high frequency resolutions, making it difficult to achieve rapid spectral analysis.
A spectrum analysis is achieved by combining FFT and frequency sweep, through intermediate frequency signal mixing with NCO, low-pass filter bank decimation, windowing, FFT operation, truncation sorting, and detection processing.
The scanning speed is improved with a large scan width and high frequency resolution, and the output display effect is obvious. The higher the frequency resolution, the more significant the effect.
Smart Images

Figure CN120870666A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless communication testing, and more particularly to the field of wireless communication signal spectrum analysis. Specifically, it relates to a method, apparatus, processor, and computer-readable storage medium for spectrum analysis processing based on a combination of FFT and frequency sweeping. Background Technology
[0002] The most fundamental aspect of wireless communication testing is spectrum analysis, typically using a scanning-tuned superheterodyne spectrum analyzer. Early frequency scanning and filters employed analog devices, but with the development of digital technology, many functions have been digitized, such as digital filters, which significantly improve the bandwidth selectivity of filters. This change is most evident in the intermediate frequency (IF) section of the spectrum analyzer. Digital IF greatly enhances the performance of spectrum analyzers, significantly improving their measurement speed, accuracy, and ability to measure complex signals using high-performance DSP technology.
[0003] Because of its fast processing speed and low computational complexity, the FFT can quickly display the spectrum of a signal within a bandwidth, making it well-suited for digital intermediate frequency (IF) signal processing. As frequency resolution increases, the length of the FFT increases accordingly, allowing hardware resources to be used to save computation time and ensuring processing speed. This overcomes the drawback of traditional sweep frequency spectrum analysis, which suffers from very slow scanning speed under large sweep width and high frequency resolution conditions. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, apparatus, processor and computer-readable storage medium for spectrum analysis processing based on a combination of FFT and frequency sweep, which satisfies the requirements of large scan width, high frequency resolution and fast scanning speed.
[0005] To achieve the above objectives, the present invention provides a method, apparatus, processor, and computer-readable storage medium for spectrum analysis processing based on a combination of FFT and frequency sweeping, as follows:
[0006] The method for spectrum analysis and processing based on a combination of FFT and frequency sweep is characterized by the following steps:
[0007] (1) Mix the intermediate frequency signal with the NCO, and the front-end radio frequency converts the signal to a fixed intermediate frequency IF and intermediate frequency bandwidth. Switch the NCO frequency point within the fixed intermediate frequency bandwidth and control the switching through the scanning control state machine.
[0008] (2) By extracting the low-pass filter bank, the mixed data is filtered according to the frequency resolution bandwidth to extract the IQ data to the corresponding rate and bandwidth.
[0009] (3) Window the extracted IQ data in the time domain;
[0010] (4) Perform FFT Fourier operation on the windowed IQ data;
[0011] (5) Calculate the FFT data truncation length, truncate the FFT result data length, and perform swap sorting on the truncated FFT data;
[0012] (6) Calculate the IQ data amplitude from the truncated and sorted FFT data to obtain the voltage value of the IQ data;
[0013] (7) Perform detection processing on the amplitude data, compress the data length, and output the display.
[0014] Preferably, the step (1) of switching control via scanning the control state machine specifically includes the following steps:
[0015] (1.1) The FPGA receives the calculated parameters and begins scanning;
[0016] (1.2) Set the external local oscillator frequency and send the parameters of the frequency control word to the RF front end;
[0017] (1.3) Wait for the external local oscillator to lock in, and the RF front end will convert the signal to a fixed intermediate frequency (IF) and intermediate frequency bandwidth;
[0018] (1.4) Set the frequency of the NCO, scanning from the start frequency to the end frequency;
[0019] (1.5) Input the windowed data stream into the FFT, and the state machine waits for the FFT calculation to complete;
[0020] (1.6) Determine if the intermediate frequency bandwidth scan has ended. If not, jump to (1.4) to continue scanning. If it has ended, jump to (1.7).
[0021] (1.7) Determine whether the local oscillator switching has ended. If not, jump to (1.2) switch to the next local oscillator frequency range and wait for local oscillator locking. If completed, the entire scan ends.
[0022] Preferably, step (1) further includes calculating the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw, specifically:
[0023] The number of NCO frequency switching points within the intermediate frequency bandwidth bw is calculated using the following formula:
[0024]
[0025] Among them, bw fft The FFT bandwidth is equivalent to the data rate f after decimation by the low-pass filter. d .
[0026] Preferably, step (1) further includes the step of calculating the start and end frequencies of the NCO frequency point, specifically:
[0027] Calculate the number of times the start and end frequencies of the NCO frequency point are calculated using the following formula:
[0028]
[0029] Where fc is the frequency of the fixed intermediate frequency (IF), and n fft This represents the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw.
[0030] Preferably, step (2) specifically includes the following steps:
[0031] (2.1) Calculate the extracted data rate based on the frequency resolution bandwidth;
[0032] (2.2) Calculate the decimation rate of the decimation low-pass filter;
[0033] (2.3) Select the corresponding decimation filter according to the frequency resolution bandwidth.
[0034] Preferably, the calculated data rate after extraction is specifically as follows:
[0035] The extracted data rate is calculated using the following formula:
[0036]
[0037] The calculation of the decimation rate of the decimation low-pass filter is specifically as follows:
[0038] The decimation rate of the low-pass filter is calculated using the following formula:
[0039]
[0040] Among them, f d l represents the data rate after extraction. fft is the FFT length, bin is the frequency spacing between two adjacent points in the FFT, RBW is the frequency resolution bandwidth, and f s It is the sampling rate before signal extraction, and k is the relationship between bin and RBW, bin = RBW / k.
[0041] Preferably, the calculation of the FFT data truncation length in step (5) is specifically as follows:
[0042] Calculate the FFT data truncation length using the following formula:
[0043]
[0044] Where, n fft The number of FFT calculations is given, and bin is the frequency interval between two adjacent points in the FFT.
[0045] Preferably, the swapping and sorting process in step (5) specifically includes the following steps:
[0046] (5.1) Exchange the second half of the data with the first half of the data;
[0047] (2) Reverse sort the FFT results.
[0048] Preferably, the calculation of the IQ data amplitude in step (6) is specifically as follows:
[0049] Calculate the IQ data amplitude using the following formula:
[0050]
[0051] Where I and Q are the in-phase (I) component and quadrature (Q) component of the FFT output, respectively.
[0052] Preferably, step (7) specifically includes the following steps:
[0053] (7.1) Calculate the total number of FFT scan points;
[0054] (7.2) Map the total number of FFT scan points to the number of spectral data points n disp This yields the number of points assigned to each data collection unit after mapping;
[0055] (7.3) Calculate the actual number of points n displayed. disp This yields the adjusted total number of scan points;
[0056] (7.4) Calculate the total number of FFT points;
[0057] (7.5) Adjust the data length of the last data collection unit;
[0058] (7.6) Detect and output the FFT sweep frequency splicing.
[0059] Preferably, the calculation of the adjusted total number of scan points in step (7.3) is specifically as follows:
[0060] The adjusted total number of scan points is calculated using the following formula:
[0061] n sweep =n disp ·n buc ;
[0062] Where, n disp n represents the actual number of points displayed.buc The number of points assigned to each data collection unit after mapping.
[0063] Preferably, the data length of the last data collection unit obtained in step (7.5) is specifically as follows:
[0064] The data length of the last data collection unit can be obtained using the following formula:
[0065] n last_buc =n fft_total -(n disp -1)·n buc ;
[0066] Where, n fft_total n is the total number of FFT points. disp n represents the actual number of points displayed. buc The number of points assigned to each data collection unit after mapping.
[0067] The main feature of this device for implementing spectrum analysis processing based on a combination of FFT and frequency sweep is that the device comprises:
[0068] A processor is configured to execute computer-executable instructions;
[0069] The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the various steps of the above-described method for spectrum analysis processing based on a combination of FFT and frequency sweeping.
[0070] The processor used to implement spectrum analysis processing based on a combination of FFT and frequency sweep is characterized in that the processor is configured to execute computer-executable instructions, which, when executed by the processor, implement the various steps of the above-mentioned method for spectrum analysis processing based on a combination of FFT and frequency sweep.
[0071] The main feature of this computer-readable storage medium is that it stores a computer program thereon, which can be executed by a processor to implement the various steps of the above-described method for spectrum analysis processing based on a combination of FFT and frequency sweeping.
[0072] The present invention employs a method, apparatus, processor, and computer-readable storage medium for spectrum analysis processing based on a combination of FFT and frequency sweeping. Under conditions of wide sweep width and high frequency resolution, the front-end RF first converts the signal to a fixed intermediate frequency (IF) and IF bandwidth. Then, within the IF bandwidth, the NCO frequency point is switched, and an FFT is performed for each switch. After truncation and sorting, all FFT data are concatenated to form the corresponding spectrum. Finally, the data volume is compressed and the output is displayed. Besides being faster than traditional frequency sweeping, FFT frequency sweeping has a significant characteristic: FFT continuously inputs a segment of data, processes it for a period of time, and then continuously outputs the data. The display shows a segment of FFT data concatenated, unlike the continuous scanning effect of traditional frequency sweeping. The higher the frequency resolution, the more pronounced the effect. Attached Figure Description
[0073] Figure 1 This is a data flow diagram of the spectrum analysis and processing method based on the combination of FFT and frequency sweeping of the present invention.
[0074] Figure 2 This is a flowchart of the scanning control state machine control method for spectrum analysis processing based on the combination of FFT and frequency sweeping according to the present invention.
[0075] Figure 3a The image shows the FFT calculation results of the truncation and sorting module of the spectrum analysis and processing method based on the combination of FFT and frequency sweeping of the present invention.
[0076] Figure 3b This is a schematic diagram illustrating the data segment sorting method to be extracted when the radio frequency front-end is in high local oscillator mode according to the present invention.
[0077] Figure 3c This is a schematic diagram illustrating the data segment sorting method to be extracted when the radio frequency front-end is in low local oscillator mode according to the present invention. Detailed Implementation
[0078] To more clearly describe the technical content of the present invention, the following description is provided in conjunction with specific embodiments.
[0079] The present invention provides a method for spectrum analysis processing based on a combination of FFT and frequency sweeping, comprising the following steps:
[0080] (1) Mix the intermediate frequency signal with the NCO, and the front-end radio frequency converts the signal to a fixed intermediate frequency IF and intermediate frequency bandwidth. Switch the NCO frequency point within the fixed intermediate frequency bandwidth and control the switching through the scanning control state machine.
[0081] (2) By extracting the low-pass filter bank, the mixed data is filtered according to the frequency resolution bandwidth to extract the IQ data to the corresponding rate and bandwidth.
[0082] (3) Window the extracted IQ data in the time domain;
[0083] (4) Perform FFT Fourier operation on the windowed IQ data;
[0084] (5) Calculate the FFT data truncation length, truncate the FFT result data length, and perform swap sorting on the truncated FFT data;
[0085] (6) Calculate the IQ data amplitude from the truncated and sorted FFT data to obtain the voltage value of the IQ data;
[0086] (7) Perform detection processing on the amplitude data, compress the data length, and output the display.
[0087] In a preferred embodiment of the present invention, the step (1) of switching control via scanning control state machine specifically includes the following steps:
[0088] (1.1) The FPGA receives the calculated parameters and begins scanning;
[0089] (1.2) Set the external local oscillator frequency and send the parameters of the frequency control word to the RF front end;
[0090] (1.3) Wait for the external local oscillator to lock in, and the RF front end will convert the signal to a fixed intermediate frequency (IF) and intermediate frequency bandwidth;
[0091] (1.4) Set the frequency of the NCO, scanning from the start frequency to the end frequency;
[0092] (1.5) Input the windowed data stream into the FFT, and the state machine waits for the FFT calculation to complete;
[0093] (1.6) Determine if the intermediate frequency bandwidth scan has ended. If not, jump to (1.4) to continue scanning. If it has ended, jump to (1.7).
[0094] (1.7) Determine whether the local oscillator switching has ended. If not, jump to (1.2) switch to the next local oscillator frequency range and wait for local oscillator locking. If completed, the entire scan ends.
[0095] In a preferred embodiment of the present invention, step (1) further includes the step of calculating the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw, specifically:
[0096] The number of NCO frequency switching points within the intermediate frequency bandwidth bw is calculated using the following formula:
[0097]
[0098] Among them, bwfft The FFT bandwidth is equivalent to the data rate f after decimation by the low-pass filter. d .
[0099] In a preferred embodiment of the present invention, step (1) further includes the step of calculating the start and end frequencies of the NCO frequency point, specifically:
[0100] Calculate the number of times the start and end frequencies of the NCO frequency point are calculated using the following formula:
[0101]
[0102] Where fc is the frequency of the fixed intermediate frequency (IF), and n fft This represents the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw.
[0103] In a preferred embodiment of the present invention, step (2) specifically includes the following steps:
[0104] (2.1) Calculate the extracted data rate based on the frequency resolution bandwidth;
[0105] (2.2) Calculate the decimation rate of the decimation low-pass filter;
[0106] (2.3) Select the corresponding decimation filter according to the frequency resolution bandwidth.
[0107] In a preferred embodiment of the present invention, the calculation of the extracted data rate specifically includes:
[0108] The extracted data rate is calculated using the following formula:
[0109]
[0110] The calculation of the decimation rate of the decimation low-pass filter is specifically as follows:
[0111] The decimation rate of the low-pass filter is calculated using the following formula:
[0112]
[0113] Among them, f d l represents the data rate after extraction. fft is the FFT length, bin is the frequency spacing between two adjacent points in the FFT, RBW is the frequency resolution bandwidth, and f s It is the sampling rate before signal extraction, and k is the relationship between bin and RBW, bin = RBW / k.
[0114] In a preferred embodiment of the present invention, the calculation of the FFT data truncation length in step (5) specifically involves:
[0115] Calculate the FFT data truncation length using the following formula:
[0116]
[0117] Where, n fft The number of FFT calculations is given, and bin is the frequency interval between two adjacent points in the FFT.
[0118] In a preferred embodiment of the present invention, the exchange sorting process in step (5) specifically includes the following steps:
[0119] (5.1) Exchange the second half of the data with the first half of the data;
[0120] (2) Reverse sort the FFT results.
[0121] In a preferred embodiment of the present invention, the calculation of the IQ data amplitude in step (6) specifically includes:
[0122] Calculate the IQ data amplitude using the following formula:
[0123]
[0124] Where I and Q are the in-phase (I) component and quadrature (Q) component of the FFT output, respectively.
[0125] In a preferred embodiment of the present invention, step (7) specifically includes the following steps:
[0126] (7.1) Calculate the total number of FFT scan points;
[0127] (7.2) Map the total number of FFT scan points to the number of spectral data points n disp This yields the number of points assigned to each data collection unit after mapping;
[0128] (7.3) Calculate the actual number of points n displayed. disp This yields the adjusted total number of scan points;
[0129] (7.4) Calculate the total number of FFT points;
[0130] (7.5) Adjust the data length of the last data collection unit;
[0131] (7.6) Detect and output the FFT sweep frequency splicing.
[0132] In a preferred embodiment of the present invention, the calculation of the adjusted total number of scan points in step (7.3) specifically involves:
[0133] The adjusted total number of scan points is calculated using the following formula:
[0134] n sweep =n disp ·n buc ;
[0135] Where, n disp n represents the actual number of points displayed. buc The number of points assigned to each data collection unit after mapping.
[0136] In a preferred embodiment of the present invention, the data length of the last data collection unit obtained in step (7.5) is specifically as follows:
[0137] The data length of the last data collection unit can be obtained using the following formula:
[0138] n last_buc =n fft_total -(n disp -1)·n buc ;
[0139] Where, n fft_total n is the total number of FFT points. disp n represents the actual number of points displayed. buc The number of points assigned to each data collection unit after mapping.
[0140] The apparatus of the present invention for implementing spectrum analysis processing based on a combination of FFT and frequency sweep, wherein the apparatus comprises:
[0141] A processor is configured to execute computer-executable instructions;
[0142] The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the various steps of the above-described method for spectrum analysis processing based on a combination of FFT and frequency sweeping.
[0143] The present invention provides a processor for implementing spectrum analysis processing based on a combination of FFT and frequency sweep, wherein the processor is configured to execute computer-executable instructions, and when the computer-executable instructions are executed by the processor, the various steps of the above-described method for implementing spectrum analysis processing based on a combination of FFT and frequency sweep are implemented.
[0144] The computer-readable storage medium of the present invention stores a computer program that can be executed by a processor to implement the various steps of the above-described method for spectrum analysis processing based on a combination of FFT and frequency sweeping.
[0145] This invention combines FFT with frequency sweep to realize the principle of FFT data stitching under large sweep width. It needs to solve the characteristics of FFT spectrum aliasing and spectrum leakage, as well as the FFT data sorting method under different high and low local oscillator conditions.
[0146] In a specific embodiment of the present invention, a spectrum analysis method combining FFT and frequency sweep is proposed, the data flow diagram of which is shown below. Figure 1 As shown. The components of the data flow diagram are described below:
[0147] 1. The intermediate frequency signal is mixed with the NCO. The front-end RF converts the signal to a fixed intermediate frequency (IF) and intermediate frequency bandwidth (e.g., 5MHz). Since the FFT bandwidth is inversely proportional to the frequency resolution, the higher the frequency resolution (e.g., 1Hz), the smaller the FFT bandwidth (e.g., 500KHz). The NCO frequency point needs to be switched within the fixed intermediate frequency bandwidth (e.g., switched 10 times). The switching control is performed by the scan control state machine.
[0148] 2. The mixed data is then processed by a low-pass filter bank. Different filters are selected according to different frequency resolutions to extract the IQ data to the corresponding rate and bandwidth (e.g., 500KHz).
[0149] 3. Windowing is applied to the extracted IQ data in the time domain to suppress FFT spectrum leakage.
[0150] 4. Perform FFT Fourier operation on the windowed IQ data; the length of FFT is proportional to the frequency resolution, the higher the frequency resolution, the longer the FFT length.
[0151] 5. Based on the different Span and FFT bandwidths, the length of the FFT result data is truncated. Furthermore, the FFT result data is symmetric about the Nyquist frequency axis and is divided into high and low local oscillator bands. The truncated FFT data also needs to be swapped and sorted.
[0152] 6. Calculate the amplitude of the truncated and sorted FFT data to obtain the voltage value of the IQ data;
[0153] 7. The amplitude data is processed by detection, the data length is compressed, and finally the output is displayed.
[0154] This invention proposes a spectrum analysis method that combines FFT and frequency sweeping, which has the advantage of being faster than traditional frequency sweeping spectrum analysis under the conditions of large sweep width and high frequency resolution.
[0155] The specific logic design and parameter calculation methods are explained below.
[0156] 1. Design of the scan control state machine. First, calculate the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw (which is also the number of FFT calculations):
[0157]
[0158] in, It rounds up, bw fft It is the FFT bandwidth, equivalent to the data rate f after decimation by the low-pass filter. d The calculation formula is shown in step 2. This formula means that when the FFT bandwidth bw... fft When the frequency is less than the intermediate frequency bandwidth bw, the number of switching operations required is the ratio of the two. If it is not an integer multiple, it is rounded up. Then, in step 3, the FFT data length is truncated to fit bw. When bw fft When the value is greater than or equal to bw, only one FFT needs to be calculated.
[0159] The frequency step for NCO frequency switching is:
[0160]
[0161] The start and end frequencies of the NCO frequency point are:
[0162]
[0163] Where fc is the fixed intermediate frequency (IF). When the RF front-end is in high local oscillator mode, the state machine controls the NCO to change from fc to fc. nco_start Scan to f nco_stop The frequency step is f nco_step When the RF front-end is in low local oscillator mode, the state machine controls the NCO to switch from f... nco_stop Scan to f nco_start The frequency step is -f nco_step .
[0164] The control flow diagram of the entire scan control state machine is as follows: Figure 2 As shown.
[0165] (1) The software calculates the parameters and sends them to the FPGA to start scanning;
[0166] (2) Set the external local oscillator frequency and send parameters such as the frequency control word to the RF front end;
[0167] (3) Wait for the external local oscillator lock to complete, and the RF front end will convert the signal to a fixed intermediate frequency (IF) and intermediate frequency bandwidth;
[0168] (4) Set the frequency of the NCO, and scan from the start frequency to the end frequency;
[0169] (5) The windowed data stream is input to the FFT, and the state machine waits for the FFT calculation to complete;
[0170] (6) Determine whether the intermediate frequency bandwidth scan has ended. If not, jump to (4) to continue scanning. If it has ended, jump to (7).
[0171] (7) Determine whether the local oscillator switching has ended. If not, jump to (2) switch to the next local oscillator frequency range and wait for local oscillator locking. If completed, the entire scan ends.
[0172] 2. Design of the decimation low-pass filter. The decimation rate is directly related to the frequency resolution bandwidth (RBW). In FFT mode, the 3dB bandwidth of the RBW is determined by the shape of the window function. Commonly used window functions include the Hamming window, Hanning window, Gaussian window, and Blackman window. The ratio between the RBW and bin (the frequency interval between two adjacent points in the FFT) varies for different window functions, and will not be listed here.
[0173] RBW = k·bin
[0174]
[0175] First, calculate the extracted data rate based on RBW:
[0176]
[0177] The formula for calculating the decimation rate of a decimation low-pass filter is:
[0178]
[0179] Among them, the extracted data rate f d This also covers the entire bandwidth range of the FFT. fft It equals the frequency interval bin between two adjacent points of the FFT multiplied by the FFT length l. fft .
[0180] Depending on the different RBW (Reference Load Wave) levels, corresponding decimation filters need to be designed and selected based on the RBW. Due to the different decimation rates, different RBWs have different data rates and scan times.
[0181] Where k is the relationship between bin and RBW, bin = RBW / k, and the value of k is related to the type of FFT window function. This invention uses a 4th-order Blackman-Harris window, k = 1.913.
[0182] 3. Design of the Time-Domain Windowing Module. Time-domain windowing multiplies the IQ data with a window function in the time domain to suppress FFT spectral leakage. Commonly used window functions include Hamming windows, Hanning windows, Gaussian windows, and Blackman windows. Window function coefficients can be dynamically loaded. The software sends the window function coefficients to the FPGA's BRAM, and the state machine controls the reading of the window function coefficients from the BRAM and multiplication with the IQ data.
[0183] 4. Design of the truncation and sorting module. The formula for calculating the FFT data truncation length is:
[0184]
[0185] The formula means that the intermediate frequency bandwidth bw divided by the number of FFT calculations n fft The bandwidth required for each FFT is obtained, and then the bandwidth is divided by the FFT frequency interval bin to obtain the FFT data truncation length.
[0186] After determining the truncation length of the FFT data, the FFT data is then sorted. The purpose of sorting is:
[0187] (1) Since the FFT result data is symmetric about the Nyquist frequency axis, the second half of the data needs to be swapped with the first half of the data;
[0188] (2) Due to the division of high and low local oscillator bands, the FFT results of the low local oscillator band are arranged in ascending order; the FFT results of the high local oscillator band are arranged in descending order, so the FFT results need to be reversed.
[0189] Let the FFT data indices be 0 to (l fft -1) When the RF front-end is in high local oscillator mode, the data segments to be extracted need to be sorted as follows:
[0190]
[0191] When the RF front-end is in low local oscillator mode, the data segments to be extracted need to be sorted as follows:
[0192]
[0193] The schematic diagram of the truncation and sorting module is shown in Figure 3. For example, the FFT length l fft =32, FFT truncation length l trunc =12, the FFT calculation result is as follows Figure 3a As shown, the arrows indicate the locations where the signal appears. When the RF front-end is in high local oscillator mode, the data segments to be extracted should be ordered as follows: Figure 3b As shown, the sorting method is 26~31, 0~5; when the RF front-end is in low local oscillator mode, the sorting method of the data segments to be intercepted is as follows. Figure 3cAs shown, the sorting method is 5~0, 31~26.
[0194] 5. Design of the amplitude calculation module. The formula for calculating the IQ data amplitude is:
[0195]
[0196] 6. Design of the detection module. The detector processes data at intervals according to a certain algorithm (positive peak value, negative peak value, root mean square, average value, etc.) to achieve the purpose of compressing the overall data.
[0197] First, calculate the total number of FFT scan points:
[0198]
[0199] Where SPAN represents the total sweep width for spectral analysis.
[0200] Next, the total number of scan points n sweep Number of spectral data points mapped to (number of detector points) n disp The number of points allocated to each Bucket (data collection unit) after mapping is:
[0201]
[0202] Where [] represents rounding. After rounding, the actual number of points n to be displayed needs to be recalculated. disp :
[0203]
[0204] The adjusted total number of scan points is:
[0205] n sweep =n disp ·n buc
[0206] The number of FFT calculations n within the intermediate frequency bandwidth bw obtained in step 1 fft Multiply by the FFT data truncation length obtained in step 4 l trunc Then multiply by the number of intermediate frequency bandwidths bw, n. bw The total number of FFT points is obtained as follows:
[0207] n fft_total =n fft ·l trunc ·n bw
[0208] For a fixed n buc n sweep With n fft_totalThere is an error. This is because the length after FFT concatenation cannot be equally divided into integer n. buc This is caused by... The method used here is to adjust the data length of the last bucket:
[0209] n last_buc =n fft_total -(n disp -1)·n buc
[0210] Ultimately, the detection and output of FFT frequency sweep splicing are achieved.
[0211] For the specific implementation scheme of this embodiment, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0212] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0213] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.
[0214] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0215] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0216] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The corresponding program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0217] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0218] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0219] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0220] The present invention employs a method, apparatus, processor, and computer-readable storage medium for spectrum analysis processing based on a combination of FFT and frequency sweeping. Under conditions of wide sweep width and high frequency resolution, the front-end RF first converts the signal to a fixed intermediate frequency (IF) and IF bandwidth. Then, within the IF bandwidth, the NCO frequency point is switched, and an FFT is performed for each switch. After truncation and sorting, all FFT data are concatenated to form the corresponding spectrum. Finally, the data volume is compressed and the output is displayed. Besides being faster than traditional frequency sweeping, FFT frequency sweeping has a significant characteristic: FFT continuously inputs a segment of data, processes it for a period of time, and then continuously outputs the data. The display shows a segment of FFT data concatenated, unlike the continuous scanning effect of traditional frequency sweeping. The higher the frequency resolution, the more pronounced the effect.
[0221] In this specification, the invention has been described with reference to specific embodiments thereof. However, it will be apparent that various modifications and variations can be made without departing from the spirit and scope of the invention. Therefore, the specification and drawings should be considered illustrative rather than restrictive.
Claims
1. A method for spectrum analysis and processing based on a combination of FFT and frequency sweeping, characterized in that, The method includes the following steps: (1) Mix the intermediate frequency signal with the NCO, and the front-end radio frequency converts the signal to a fixed intermediate frequency IF and intermediate frequency bandwidth. Switch the NCO frequency point within the fixed intermediate frequency bandwidth and control the switching through the scanning control state machine. (2) By extracting the low-pass filter bank, the mixed data is filtered according to the frequency resolution bandwidth to extract the IQ data to the corresponding rate and bandwidth. (3) Window the extracted IQ data in the time domain; (4) Perform FFT Fourier operation on the windowed IQ data; (5) Calculate the FFT data truncation length, truncate the FFT result data length, and perform swap sorting on the truncated FFT data; (6) Calculate the IQ data amplitude from the truncated and sorted FFT data to obtain the voltage value of the IQ data; (7) Perform detection processing on the amplitude data, compress the data length, and output the display.
2. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, The step (1) of switching control via scanning the control state machine specifically includes the following steps: (1.1) The FPGA receives the calculated parameters and begins scanning; (1.2) Set the external local oscillator frequency and send the parameters of the frequency control word to the RF front end; (1.3) Wait for the external local oscillator to lock in, and the RF front end will convert the signal to a fixed intermediate frequency (IF) and intermediate frequency bandwidth; (1.4) Set the frequency of the NCO, scanning from the start frequency to the end frequency; (1.5) Input the windowed data stream into the FFT, and the state machine waits for the FFT calculation to complete; (1.6) Determine whether the intermediate frequency bandwidth scan has ended. If not, jump to (1.4) to continue scanning. If it has ended, jump to (1.7). (1.7) Determine whether the local oscillator switching has ended. If not, jump to (1.2) switch to the next local oscillator frequency range and wait for local oscillator locking. If completed, the entire scan ends.
3. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, Step (1) further includes calculating the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw, specifically: The number of NCO frequency switching points within the intermediate frequency bandwidth bw is calculated using the following formula: Among them, bw fft The FFT bandwidth is equivalent to the data rate f after decimation by the low-pass filter. d .
4. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, Step (1) further includes the step of calculating the start and end frequencies of the NCO frequency point, specifically: Calculate the number of times the start and end frequencies of the NCO frequency point are calculated using the following formula: Where fc is the frequency of the fixed intermediate frequency (IF), and n fft This represents the number of times the NCO frequency point is switched within the intermediate frequency bandwidth bw.
5. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, Step (2) specifically includes the following steps: (2.1) Calculate the extracted data rate based on the frequency resolution bandwidth; (2.2) Calculate the decimation rate of the decimation low-pass filter; (2.3) Select the corresponding decimation filter according to the frequency resolution bandwidth.
6. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 5, characterized in that, The calculation of the extracted data rate is specifically as follows: The extracted data rate is calculated using the following formula: The calculation of the decimation rate of the decimation low-pass filter is specifically as follows: The decimation rate of the low-pass filter is calculated using the following formula: Among them, f d l represents the data rate after extraction. fft is the FFT length, bin is the frequency spacing between two adjacent points in the FFT, RBW is the frequency resolution bandwidth, and f s It is the sampling rate before signal extraction, and k is the relationship between bin and RBW, bin = RBW / k.
7. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, The calculation of the FFT data truncation length in step (5) is specifically as follows: Calculate the FFT data truncation length using the following formula: Where, n fft The number of FFT calculations is given, and bin is the frequency interval between two adjacent points in the FFT.
8. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, The swapping and sorting process in step (5) includes the following steps: (5.1) Exchange the second half of the data with the first half of the data; (2) Reverse sort the FFT results.
9. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, The calculation of the IQ data amplitude in step (6) is specifically as follows: Calculate the IQ data amplitude using the following formula: Where I and Q are the in-phase (I) component and quadrature (Q) component of the FFT output, respectively.
10. The method for implementing spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 1, characterized in that, Step (7) specifically includes the following steps: (7.1) Calculate the total number of FFT scan points; (7.2) Map the total number of FFT scan points to the number of spectral data points n disp This yields the number of points assigned to each data collection unit after mapping; (7.3) Calculate the actual number of points n displayed. disp This yields the adjusted total number of scan points; (7.4) Calculate the total number of FFT points; (7.5) Adjust the data length of the last data collection unit; (7.6) Detect and output the FFT sweep frequency splicing.
11. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 10, characterized in that, The calculation of the adjusted total number of scan points in step (7.3) is as follows: The adjusted total number of scan points is calculated using the following formula: n sweep =n disp ·n buc ; Where, n disp n represents the actual number of points displayed. buc The number of points assigned to each data collection unit after mapping.
12. The method for spectrum analysis and processing based on a combination of FFT and frequency sweeping as described in claim 10, characterized in that, The data length of the last data collection unit obtained in step (7.5) is specifically as follows: The data length of the last data collection unit can be obtained using the following formula: n last_buc =n fft_total -(n disp -1)·n buc ; Where, n fft_total n is the total number of FFT points. disp n represents the actual number of points displayed. buc The number of points assigned to each data collection unit after mapping.
13. An apparatus for implementing spectrum analysis processing based on a combination of FFT and frequency sweeping, characterized in that, The device includes: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the steps of the method for spectrum analysis processing based on the combination of FFT and frequency sweep as described in any one of claims 1 to 12.
14. A processor for implementing spectrum analysis processing based on a combination of FFT and frequency sweep, characterized in that, The processor is configured to execute computer-executable instructions, which, when executed by the processor, implement the steps of the method for spectrum analysis processing based on a combination of FFT and frequency sweep as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, It stores a computer program that can be executed by a processor to implement the steps of the method for spectrum analysis processing based on the combination of FFT and frequency sweep as described in any one of claims 1 to 12.