Windowing compensation method and device for frequency domain signal processing, electronic equipment and storage medium
By generating and compensating the correction window function sequence for time-domain windowing, the error defect problem in frequency domain signal processing is solved, and the output signal is completely consistent with the input signal, which is suitable for high-precision signal processing scenarios.
Patent Information
- Application Number
- CN202510457765.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-01
AI Technical Summary
The existing frequency domain signal processing methods have error defects in the time domain-frequency domain-time domain transformation process, resulting in inconsistent output signals and input signals, especially in high-precision application scenarios such as music signal processing, which affects the output effect.
A window compensation method is adopted to generate a window function sequence, overlapping addition, difference calculation, amplitude scaling and repeated expansion, obtain the compensation-corrected window function sequence, and perform time-domain window processing to ensure that the output signal after FFT and IFFT transformation is consistent with the input signal.
The spectrum leakage problem is eliminated, ensuring that the output signal is fully consistent with the input signal, especially in high-precision applications, the signal is not distorted and restored, and is suitable for engineering applications with high real-time requirements.
Smart Images

Figure CN120408003A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of frequency-domain signal processing, and relates to a windowing compensation method, device, electronic device and storage medium for frequency-domain signal processing. Background Art
[0002] In the field of signal processing such as system response equalization and system response identification, in order to obtain the output signal after the input signal passes through the system, the convolution operation of the input signal and the system impulse response is usually performed in the time domain. When the length of the system time-domain impulse response sequence is very large, performing the convolution operation of the long impulse response in the time domain will consume a lot of computing resources of the processor. In the case of limited computing resources of the processor, in order to reduce the computational complexity of the time-domain convolution operation, the time-domain input signal and the time-domain system impulse response are usually subjected to Fourier transform (FFT), and both are converted to the frequency domain. In this way, only the multiplication operation of the spectrum of the input signal and the spectrum of the system response is required to obtain the spectrum of the system output signal, and then the inverse Fourier transform (IFFT) is performed to obtain the time-domain output signal sequence. Performing the multiplication operation in the frequency domain will greatly reduce the computational complexity and reduce the computing power overhead of the processor compared with performing the convolution operation in the time domain.
[0003] For this processing scenario of converting time-domain convolution to frequency-domain multiplication, it is necessary to perform a chunking operation on the input signal, perform FFT transformation with a fixed number of points according to a data block of a fixed length. During the process of chunking and FFT processing of the input signal, a spectrum leakage problem will occur. As Figure 1 shown, the input signal x(n) undergoes FFT and IFFT transformations to generate the output signal y(n). As Figure 2 shown, assume that the input signal is a piece of music signal. After being chunked according to a data frame length of 128 sampling points (L = 128), the number of data blocks is 120. As Figure 3 shown, assume that the input signal has a 50% overlapping frame. If the length of the overlapping frame is also 128 sampling points, then the total length of the input signal each time is 256 sample points (N = 256). Among the 256 sample points of data input each time, 128 sample points are the data of the current updated frame, and there are also 128 sample points that are the data of the previous frame. The first input signal frame is x1(n), and after undergoing FFT and IFFT transformations, the output signal frame is y1(n). According to the principle of overlap-add in the frequency domain, the first 128 sample points of the output signal frame y out,1 (n) are obtained by adding the previous output signal frame y0(n) and the current output signal frame y1(n). The last 128 sample points of the output signal y out,1 (n) are the data of the current output signal frame y1(n). Figure 4A partial enlarged view of the curve comparison diagram of the input signal and the output signal is given. Observe Figure 4 It can be seen that after the input signal undergoes FFT and IFFT transformations, the obtained output signal y(n) does not match the time-domain waveform of the original input signal x(n). The inconsistency between the time-domain waveforms of the input signal and the output signal is due to the deviation caused by spectral leakage resulting from the frequency-domain processing of the signal in blocks.
[0004] To solve the problem of the deviation of the time-domain signal waveform caused by spectral leakage, according to the time-domain windowing method proposed in the literature, as Figure 5 shown, it is necessary to perform time-domain windowing processing on the input signal and the output signal respectively. For each input signal frame, it is necessary to first perform time-domain windowing, then perform FFT transformation, and after performing IFFT transformation, the output signal frame also needs to perform time-domain windowing processing.
[0005] As Figure 6 shown, assuming that the input signal has a 50% overlapping frame, and if the length of the overlapping frame is also 128 sampling points, then the total length of each input signal is 256 sample points (N = 256). Among the 256 sample point data input each time, 128 sample points are the data of the updated current frame, and another 128 sample points are the data of the previous frame. The first input signal frame is x1(n), and after being processed by four modules: windowing, FFT, IFFT, and windowing, the output signal frame is y1(n). According to the principle of overlap-add in the frequency domain block, the first 128 sample points of the output signal frame y out,1 (n) are obtained by adding the previous output signal frame y0(n) and the current output signal frame y1(n), and the last 128 sample points of the output signal y out,1 (n) are the data of the current output signal frame y1(n).
[0006] According to the Figure 5 and Figure 6 signal processing flow, the windowing, FFT, IFFT, windowing, and overlap-add processing are performed on each data frame of the input signal in turn to obtain each data frame of the output signal. Figure 7 A partial enlarged view of the curve comparison diagram of the input signal and the output signal is given. Observe Figure 7 It can be seen that after adding the time-domain windowing module to the input signal and the output signal, the problem of spectral leakage introduced by frequency-domain processing can be greatly reduced. Most of the waveform regions of the input signal x(n) and the output signal y(n) are in agreement, but there are still certain deviations in some local regions. Although time-domain windowing is considered, the input signal x(n) and the output signal y(n) still do not completely match.
[0007] Combined with Figure 4 、Figure 7 From the simulation results, it can be seen that when performing frequency-domain signal processing, it is usually necessary to window the segmented data to reduce the influence of spectral leakage, so as to ensure that the input signal and the output signal are approximately waveform-matched to a certain extent. However, during the process of windowing the signal, if the existing conventional windowing method is used, it will be found that the original input signal does not exactly match the output signal after FFT, windowing, IFFT, and windowing processing, and there is a certain error. This will introduce error components when returning from the frequency domain to the time domain again. In application scenarios where high precision of the output signal is required, such as the field of music signal processing, these introduced error components will cause the processed music components to be inconsistent with the original music components, resulting in tone pollution and preventing the music playback from meeting the requirements of high fidelity.
[0008] In summary, the windowing methods used in the existing literature cannot well solve the error problem introduced by segmentation, windowing, and frequency-domain processing. The error defects introduced by this windowing method will cause a certain loss of precision in many high-precision application scenarios, resulting in inconsistent waveforms of the input and output signals before and after transformation, and causing losses to the output effects of some engineering application scenarios.
[0009] The above information disclosed in the background art section is only used to enhance the understanding of the background of the present application. Therefore, it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0010] Aiming at the error defect problem generated by the time-domain - frequency-domain - time-domain transformation existing in the windowing method used in the existing frequency-domain processing, the present invention proposes a windowing compensation method, device, electronic device, and storage medium for frequency-domain signal processing, which can ensure that the input signal and the output signal are completely consistent during the time-domain - frequency-domain - time-domain transformation process, thereby eliminating the error components introduced during the signal transformation process.
[0011] The first aspect of the present invention provides a windowing compensation method for frequency-domain signal processing, which includes the following steps:
[0012] A. Generate a window function sequence with a fixed length according to the specified window function type and the length of the segmented data frame;
[0013] B. Perform overlap-add processing on the window function sequence according to the overlap length requirement of the time-domain data block to generate an overlap-added window function sequence;
[0014] C. Compare the overlap-added window function sequence with a set constant value to obtain a difference sequence between the window function sequence and the constant constant value;
[0015] D. According to the difference sequence between the window function sequence and the constant value, perform amplitude scaling and repeated extension on the difference sequence according to the overlapping length requirement, so as to generate a compensation sequence of the window function sequence;
[0016] E. According to the compensation sequence of the window function sequence, perform compensation correction on the window function sequence generated in step A, so as to obtain a compensated and corrected window function;
[0017] F. According to the compensated and corrected window function sequence, perform a square root operation to obtain the time-domain square root sequence of the compensated and corrected window function;
[0018] G. Perform time-domain windowing processing on the input signal in the time domain according to the time-domain square root sequence of the compensated and corrected window function, perform FFT transformation and IFFT transformation, and then perform time-domain windowing processing using the time-domain square root sequence of the compensated and corrected window function, so as to obtain an output signal consistent with the original input signal.
[0019] Preferably, in step A, for the window function sequence, various window function calculation formulas provided in the literature can be used to calculate and generate the window function sequence w(n). More preferably, in step A, the window function sequence includes window functions such as Hanning window, Hamming window, Blackman window, Gaussian window, triangular window, Bartlett window, etc.
[0020] Preferably, in step B, when performing the overlapping addition processing on the window function sequence, according to the window function calculation formula, the window functions w0(n), w1(n), w2(n), w3(n), w4(n),... are sequentially generated according to the specified window function sequence length. Each window function is divided into w n,L (n) and w n,H (n). According to the overlapping addition processing, the finally overlapping added window function sequence is w sum (n), and its expression is as follows:
[0021] w sum (n) = w 0,H (n) + w 1,L (n)
[0022] + w 1,H (n) + w 2,L (n)
[0023] + w 2,H (n) + w 3,L (n)
[0024] + w 3,H (n) + w 4,L (n)
[0025] +...
[0026] Preferably, in step C, the difference sequence between the window function sequence and the constant value is obtained through the following processing method:
[0027] Assume that the constant value is C, and C can take the value of 1 or other values; the difference sequence between the window function sequence and the constant value is denoted as Δw(n), then the calculation of this difference sequence is as follows:
[0028] Δw(n) = w sum (n) - C.
[0029] Preferably, in step D, according to the requirements of the overlap length, amplitude scaling and repeated extension are performed on this difference sequence, and the specific implementation is as follows:
[0030] Step 1), from the difference sequence Δw(n), a main value sequence Δw M (n) is taken according to the overlap length L; in a more preferred embodiment, this main value sequence can be taken from L elements with sequence numbers L + 1, L + 2,..., 2L of the difference sequence Δw(n). Similarly, it can also be taken from 2L + 1, 2L + 2,..., 3L, but the L elements at the head and tail of the difference sequence Δw(n) cannot be taken because the L elements at the head and tail of Δw(n) cannot be used as the main value sequence of the difference sequence Δw(n) due to insufficient overlap addition;
[0031] Step 2), according to the frame overlap rate, the main value sequence is extended; in a more preferred embodiment, if the frame overlap rate is 50%, the extended difference sequence Δw E (n) is as follows:
[0032] Δw E (n) = [ΔW M (n) ΔW M (n)];
[0033] In another more preferred embodiment, if the frame overlap rate is 75%, the extended difference sequence Δw E (n) is as follows:
[0034] Δw E (n) = [ΔW M (n) ΔW M (n) ΔW M (n) ΔW M (n)];
[0035] Step 3), according to the frame overlap rate, amplitude scaling is performed on the extended difference sequence Δw E (n). In a more preferred embodiment, if the frame overlap rate is 50%, the scaled difference sequence ΔwE,S (n) is as follows:
[0036] Δw E,S (n) = Δw E (n) × (1 / 2);
[0037] In another more preferred embodiment, if the frame overlap rate is 75%, then the scaled difference sequence Δw E,S (n) is as follows:
[0038] Δw E,S (n) = Δw E (n) × (1 / 4);
[0039] After the processing of the above steps 1), 2), and 3), a compensation sequence of the window function sequence is obtained.
[0040] Preferably, in step E, according to the compensation sequence of the window function sequence, the window function sequence generated in step A is compensated and corrected, so as to obtain the compensated and corrected window function w c (n), and its expression is as follows:
[0041] w c (n) = w(n) - Δw E,S (n).
[0042] Preferably, in step F, according to the compensated and corrected window function sequence, a square root operation is performed to obtain the square root sequence w c,h (n) of the compensated and corrected window function, and its expression is as follows:
[0043]
[0044] Preferably, in step G, the time-domain windowing process is performed on the input time-domain signal according to the time-domain square root sequence of the compensated and corrected window function, and the specific implementation is as follows:
[0045] Assume that the input signal is x(n), and the time-domain square root sequence of the compensated and corrected window function is w c,h (n), then the time-domain input signal after the time-domain windowing process is x w (n), and its expression is as follows:
[0046] x w (n) = x(n) × w c,h (n).
[0047] Preferably, in step G, the steps of performing time-domain windowing on the output signal after IFFT transformation are specifically implemented as follows:
[0048] Assume that the output signal after IFFT transformation is y(n), and the time-domain square root sequence of the window function after compensation and correction is w c,h (n). Then, the time-domain output signal after windowing the signal after IFFT transformation is y w (n), and its expression is as follows:
[0049] y w (n) = y(n) × w c,h (n).
[0050] The second aspect of the present invention provides a windowing compensation device for frequency-domain signal processing, which includes:
[0051] A window function sequence generation module, which is used to generate a window function sequence with a fixed length according to the specified window function type and the length of the segmented data frame;
[0052] A window function sequence overlap-and-add module, whose input end is electrically connected to the output end of the window function sequence generation module, and is used to perform overlap-and-add processing on the window function sequence according to the overlap length requirement of the time-domain data block, and generate an overlap-and-added window function sequence;
[0053] A difference sequence generation module, whose input end is electrically connected to the output end of the window function sequence overlap-and-add module, and is used to compare the overlap-and-added window function sequence with a set constant value to obtain a difference sequence between the window function sequence and the constant value;
[0054] A compensation sequence generation module, whose input end is electrically connected to the output end of the difference sequence generation module, and is used to perform amplitude scaling and repeated extension on the difference sequence according to the difference sequence between the window function sequence and the constant value according to the overlap length requirement, so as to generate a compensation sequence of the window function sequence;
[0055] A window function sequence compensation and correction module, whose input end is electrically connected to the output end of the compensation sequence generation module, and is used to perform compensation and correction on the window function sequence generated by the window function sequence generation module according to the compensation sequence of the window function sequence, so as to obtain a compensated and corrected window function;
[0056] A square root operation module, whose input end is electrically connected to the output end of the window function sequence compensation and correction module, and is used to perform a square root operation on the compensated and corrected window function sequence to obtain a time-domain square root sequence of the compensated and corrected window function;
[0057] A time-domain windowing processing module, whose input end is electrically connected to the output end of the square root operation module, is configured to perform time-domain windowing processing on the input signal in the time domain according to the time-domain square root sequence of the compensated and corrected window function, perform FFT transformation and IFFT transformation, and then perform time-domain windowing processing using the time-domain square root sequence of the compensated and corrected window function, so as to obtain an output signal that is consistent with the original input signal.
[0058] The third aspect of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the windowing compensation method for frequency-domain signal processing as described above is implemented.
[0059] The fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the windowing compensation method for frequency-domain signal processing as described above is implemented.
[0060] In one embodiment, the computer-readable storage medium includes FLASH (flash memory) or RAM (random access memory).
[0061] The present invention adopts the above scheme and has the following advantages compared with the prior art:
[0062] The windowing compensation method for frequency-domain signal processing proposed by the present invention can ensure that after frequency-domain processing, the output signal returned to the time domain after IFFT transformation is consistent with the original input signal, and the time-domain waveforms completely coincide. In application scenarios that require high-precision output, it can ensure the complete and distortion-free restoration of the input signal, and eliminate the spectral leakage problem existing in the FFT and IFFT transformation processes. For example, in the frequency-domain processing of music signals, through the windowing compensation method proposed by the present invention, the music signal after FFT and IFFT processing is completely consistent with the original music signal, without introducing any contaminating components, ensuring the complete restoration of the timbre. The windowing compensation method proposed by the present invention can pre-calculate the square root sequence of the window function sequence and pre-store it in FLASH and RAM, which is very suitable for application scenarios with relatively high real-time requirements, saving the overhead of computing resources and being very suitable for engineering applications in real-time scenarios. Description of the Drawings <*
[0063] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0064] Figure 1Signal processing flowchart of an existing method that performs dot multiplication in the frequency domain and does not use time-domain windowing;
[0065] Figure 2 Time-domain signal waveform diagram of an existing method that performs dot multiplication in the frequency domain and does not use time-domain windowing;
[0066] Figure 3 Overlap-and-add processing flowchart of an existing method that performs dot multiplication in the frequency domain and does not use time-domain windowing;
[0067] Figure 4 Partial enlarged view of the waveforms of the input signal and the output signal in an existing method that performs dot multiplication in the frequency domain and does not use time-domain windowing;
[0068] Figure 5 Signal processing flowchart of an existing conventional time-domain windowing method;
[0069] Figure 6 Overlap-and-add processing flowchart of an existing conventional time-domain windowing method;
[0070] Figure 7 Partial enlarged view of the waveforms of the input signal and the output signal in an existing conventional time-domain windowing method;
[0071] Figure 8 Flowchart of a windowing compensation method for frequency-domain signal processing according to an embodiment of the present invention;
[0072] Figure 9 Flowchart of overlap-and-add processing of the window function sequence for a windowing compensation method for frequency-domain signal processing according to an embodiment of the present invention;
[0073] Figure 10 Flowchart of amplitude scaling and repeated extension processing of the difference sequence for a windowing compensation method for frequency-domain signal processing according to an embodiment of the present invention;
[0074] Figure 11 Waveform diagram of the window function sequence generated by a Hanning window used in an embodiment of the present invention;
[0075] Figure 12 Waveform diagram of four Hanning window function sequences generated by moving the data frame 4 times in an embodiment of the present invention;
[0076] Figure 13 Waveform diagram of the window function sequence generated after overlap-and-add of four Hanning window function sequences in an embodiment of the present invention;
[0077] Figure 14 For Figure 13 Partial enlarged view at A in;
[0078] Figure 15 It is the time-domain waveform diagram of the difference sequence between the window function sequence and the constant value according to the embodiment of the present invention;
[0079] Figure 16 is Figure 15 The partial enlarged view of the waveform shown;
[0080] Figure 17 It is the time-domain waveform diagram of the main value sequence extracted from the difference sequence according to the embodiment of the present invention;
[0081] Figure 18 It is the time-domain waveform diagram of the extended difference sequence obtained by extending the main value sequence according to the embodiment of the present invention;
[0082] Figure 19 It is the time-domain waveform diagram of the scaled difference sequence obtained by amplitude scaling the extended difference sequence according to the embodiment of the present invention;
[0083] Figure 20 It is the comparison curve diagram of the original window function and the window function after compensation and correction according to the embodiment of the present invention;
[0084] Figure 21 It is the time-domain waveform diagram of the square root sequence of the window function after compensation and correction according to the embodiment of the present invention;
[0085] Figure 22 It is the partial enlarged view of the comparison of the time-domain waveforms of the output signal and the input signal obtained by windowing using the square root sequence of the window function after compensation and correction according to the embodiment of the present invention;
[0086] Figure 23 It is the block diagram of a windowing compensation device for frequency-domain signals according to the embodiment of the present invention. Specific embodiments
[0087] The following elaborates on the preferred embodiments of the present invention in conjunction with the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art. It should be noted here that the description of these embodiments is for helping to understand the present invention, but does not constitute a limitation to the present invention.
[0088] This embodiment provides a windowing compensation method for frequency-domain signal processing. Referring to Figure 8 shown, the windowing compensation method includes the following steps:
[0089] A. Generate a window function sequence with a fixed length according to the specified window function type and the length of the segmented data frame;
[0090] B. According to the overlapping length requirement of the time-domain data block, perform overlapping addition processing on the window function sequence to generate an overlapping-added window function sequence;
[0091] C. Compare the overlapping-added window function sequence with a set constant value (usually the constant value 1) to obtain a difference sequence between the window function sequence and the constant value;
[0092] D. According to the difference sequence between the window function sequence and the constant value, perform amplitude scaling and repeated extension on this difference sequence according to the overlapping length requirement, so as to generate a compensation sequence for the window function sequence;
[0093] E. According to the compensation sequence of the window function sequence, perform compensation correction on the window function sequence generated in step A, so as to obtain a compensated and corrected window function.
[0094] F. According to the compensated and corrected window function sequence, perform a square root operation to obtain a square root sequence of the compensated and corrected window function.
[0095] G. According to the compensated window function, perform time-domain windowing processing on the input time-domain signal in the time domain according to the time-domain square root sequence of the compensated and corrected window function. After performing FFT transformation and IFFT transformation on the input signal after block division and windowing processing, also use the time-domain square root sequence of this compensated and corrected window function to perform time-domain windowing processing on the output signal after IFFT transformation, so as to obtain an output signal that is exactly the same as the original input signal.
[0096] The processing flow of the above windowing compensation method for frequency-domain signal processing is specifically described as follows:
[0097] (1) Generate a window function sequence
[0098] Assume that the window function type is a Hanning window, the total length of the window function is 256 sample points, and the calculation formula of the Hanning window is as follows:
[0099] w(n) = 0.54 - 0.46×cos(2πn / (N - 1)), 0 ≤ n ≤ N - 1.
[0100] According to this formula, calculate the window function sequence w(n) with a length of 256 sample points, and its curve is as Figure 11 shown.
[0101] (2) Generate an overlapping addition sequence
[0102] Assume that the data frame overlapping rate of the block data is 50%, the length of the overlapping frame is 128, and the total length of the data frame is 256. Refer to Figure 9 , assume that the data frame moves 4 times to generate 4 window function sequences, as Figure 12 shown. Observe Figure 12It can be seen that each window function sequence has an overlapping part with the adjacent window function sequence. After processing by overlap-and-add, the window function sequence w sum (n) is generated by these 4 window functions, as shown in Figure 13 and Figure 14 , where Figure 14 is a partial enlarged view of the window function sequence after overlap-and-add. Observing Figure 13 and Figure 14 , it can be seen that for the window function sequence w sum (n) after overlap-and-add, its amplitude is not a constant value, but has fluctuations with peaks and valleys.
[0103] (3) Obtain the difference sequence between the window function sequence and the constant value
[0104] Assume that the constant value C is 1. According to the calculation formula of the difference sequence Δw(n) between the window function sequence w sum (n) after overlap-and-add and the constant value C:
[0105] Δw(n) = w sum (n) - C.
[0106] The difference sequence Δw(n) can be calculated, as shown in Figure 15 and Figure 16 , where Figure 16 is a partial enlarged view of the difference sequence.
[0107] (4) Generate the compensation sequence of the window function sequence
[0108] Step 1), from the difference sequence Δw(n), a principal value sequence Δw M [[ID=4 ]](n) is taken according to the overlap length L. This principal value sequence is taken from the L elements with sequence numbers L + 1, L + 2,..., 2L of the difference sequence Δw(n), as shown in Figure 17 .
[0109] Step 2), according to the 50% frame overlap rate, the principal value sequence is extended. The difference sequence Δw E (n) is extended according to the following formula:
[0110] Δw E (n) = [ΔW M (n) ΔW M (n)]
[0111] The extended difference sequence Δw E (n) is obtained, as shown in Figure 18 .
[0112] Step 3), according to the 50% frame overlap rate, for the extended difference sequence Δw E(n), perform amplitude scaling to obtain the scaled difference sequence Δw E,S (n), and its calculation formula is as follows:
[0113] Δw E,S (n) = Δw E (n) × (1 / 2)
[0114] According to the above formula, calculate the scaled difference sequence Δw E,S (n), as Figure 19 shown.
[0115] After the processing of the above steps 1), 2), and 3), the compensation sequence Δw of the window function sequence is obtained E,S (n).
[0116] (5) Generate the compensated and corrected window function
[0117] According to the compensation sequence Δw of the window function sequence E,S (n), perform compensation and correction on the window function sequence w(n) generated in step A) to obtain the compensated and corrected window function w c (n), and its calculation formula is as follows:
[0118] w c (n) = w(n) - Δw E,S (n)
[0119] According to the above formula, the compensated and corrected window function w can be obtained c (n), as Figure 20 shown. Figure 20 The comparison curve between the original window function and the compensated and corrected window function in step A) is given.
[0120] (6) The square root sequence of the compensated and corrected window function
[0121] According to the compensated and corrected window function sequence w c (n), perform square root operation to obtain the square root sequence w of the compensated and corrected window function c,h (n), and its expression is as follows:
[0122]
[0123] According to the above formula, the square root sequence w of the compensated and corrected window function can be obtained c,h (n), as Figure 21 shown.
[0124] (7) Use the square root sequence of the compensated and corrected window function to perform windowing before FFT and after IFFT
[0125] Assume that the input signal is a music signal, such as Figure 3 As shown in the figure, after the data frame length is 128 sampling points (L=128), the number of data blocks is 120. Assuming that the input signal is divided into 50% overlapping frames, if the length of the overlapping frame is also 128 sampling points, then the total length of each input signal is 256 sample points (N=256). Of the 256 sample points of each input, 128 sample points are the data of the updated current frame, and the remaining 128 sample points are the data of the previous frame. The first input signal frame is x1(n). According to Figure 7 The signal processing flow is to first use the square root sequence w of the compensation correction window function c,h (n) Windowing is performed on the input signal x1(n), and the time domain input signal after windowing is obtained as x 1,w (n), which is calculated as follows:
[0126] x 1,w (n) = x1(n) × w c,h (n).
[0127] Then the windowed time domain input signal x 1,w (n), after FFT and IFFT transformation, the output signal frame is y1(n). Similarly, according to Figure 5 The signal processing flow also uses the square root sequence w of the compensated correction window function c,h (n) Windowing is performed on the output signal y1(n), and the time domain output signal after windowing is obtained as y 1,w (n), which is expressed as follows:
[0128] y 1,w (n)=y1(n)×w c,h (n).
[0129] Then, according to the principle of overlap-add in frequency domain, the signal frame y is output. out,1 The first 128 sample points of (n) are the last output signal frame y 0,w (n) and the current output signal frame y 1,w (n) is added, the output signal y out,1 The last 128 sample points of (n) are the current output signal frame y 1,w (n) data.
[0130] According to the above processing flow, each data frame of the input signal is processed in turn to obtain each data frame of the output signal, and the input signal x(n) and the output signal y are compared. out (n) output waveform, such as Figure 22 Observation Figure 22, it can be seen that by using the square root sequence w of the compensated and corrected window function to window the time-domain signals before FFT and after IFFT, the deviation between the input signal and the output signal caused by spectral leakage can be completely eliminated, and the waveform of the output signal coincides exactly with that of the input signal. c,h (n)
[0131] Referring to Figure 23 As shown, this embodiment also provides a windowing compensation device for frequency-domain signal processing, which includes:
[0132] A window function sequence generation module 1, which is used to generate a window function sequence with a fixed length according to the specified window function type and the length of the segmented data frame;
[0133] A window function sequence overlap-and-add module 2, whose input end is electrically connected to the output end of the window function sequence generation module 1, and is used to perform overlap-and-add processing on the window function sequence according to the overlap length requirement of the time-domain data block to generate an overlap-and-added window function sequence;
[0134] A difference sequence generation module 3, whose input end is electrically connected to the output end of the window function sequence overlap-and-add module 2, and is used to compare the overlap-and-added window function sequence with a set constant value to obtain a difference sequence between the window function sequence and the constant value;
[0135] A compensation sequence generation module 4, whose input end is electrically connected to the output end of the difference sequence generation module 3, and is used to perform amplitude scaling and repeated extension on the difference sequence between the window function sequence and the constant value according to the overlap length requirement to generate a compensation sequence of the window function sequence;
[0136] A window function sequence compensation and correction module 5, whose input end is electrically connected to the output end of the compensation sequence generation module 4, and is used to compensate and correct the window function sequence generated by the window function sequence generation module according to the compensation sequence of the window function sequence to obtain a compensated and corrected window function;
[0137] A square root operation module 6, whose input end is electrically connected to the output end of the window function sequence compensation and correction module 5, and is used to perform a square root operation on the compensated and corrected window function sequence to obtain a time-domain square root sequence of the compensated and corrected window function;
[0138] A time-domain windowing processing module 7, whose input end is electrically connected to the output end of the square root operation module 6, and is used to perform time-domain windowing processing on the input signal in the time domain according to the time-domain square root sequence of the compensated and corrected window function, perform FFT transformation and IFFT transformation, and then perform time-domain windowing processing using the time-domain square root sequence of the compensated and corrected window function to obtain an output signal consistent with the original input signal.
[0139] This embodiment also provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements a windowing compensation method for frequency-domain signal processing. The electronic device can be an in-vehicle home audio device, an in-vehicle audio device, or a component thereof.
[0140] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the above-mentioned windowing compensation method for frequency-domain signal processing. The computer-readable storage medium includes, but is not limited to, FLASH memory, read-only memory, magnetic disk, or optical disc.
[0141] This embodiment can ensure the complete and distortion-free restoration of the input signal, eliminate the spectral leakage problem existing in the FFT and IFFT transformation processes, save the overhead of computing resources, and is very suitable for engineering applications in real-time scenarios.
[0142] Unless otherwise specifically defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art. If the definitions used herein conflict or are inconsistent with the definitions contained in other published documents, the definitions used herein shall prevail.
[0143] As shown in this specification and the claims, the terms "comprising" and "including" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The term "and / or" used herein includes any combination of one or more of the related listed items.
[0144] It should be understood that each part of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following well-known technologies in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0145] Those of ordinary skill in the art in this technical field can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by instructing relevant hardware through a program. The 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 embodiment.
[0146] In addition, each functional unit in the embodiments may be integrated into a processing module, may exist separately as individual units physically, or two or more units may be integrated into one module. The above integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0147] The above embodiments are only for illustrating the technical concept and features of the present invention, and are a preferred embodiment. The purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly, and it is not intended to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit and essence of the present invention should be covered within the protection scope of the present invention.
Claims
1. A windowing compensation method for frequency-domain signal processing, characterized in that The windowing compensation method includes the following steps: A. Generate a window function sequence with a fixed length according to the specified window function type and the length of the segmented data frame; B. Perform overlap-add processing on the window function sequence according to the overlap length requirement of the time-domain data block to generate an overlap-added window function sequence; C. Compare the overlap-added window function sequence with a set constant value to obtain a difference sequence between the window function sequence and the constant value; D. According to the difference sequence between the window function sequence and the constant value, perform amplitude scaling and repeated extension on the difference sequence according to the overlap length requirement, so as to generate a compensation sequence of the window function sequence; E. Perform compensation correction on the window function sequence generated in step A according to the compensation sequence of the window function sequence, so as to obtain a compensated and corrected window function; F. Perform a square root operation on the compensated and corrected window function sequence to obtain a time-domain square root sequence of the compensated and corrected window function; G. Perform time-domain windowing processing on the input signal in the time domain according to the time-domain square root sequence of the compensated and corrected window function, perform FFT transformation and IFFT transformation, and then perform time-domain windowing processing using the time-domain square root sequence of the compensated and corrected window function, so as to obtain an output signal consistent with the original input signal.
2. The windowing compensation method according to claim 1, wherein In step A, the window function sequence includes a Hanning window, a Hamming window, a Blackman window, a Gaussian window, a triangular window, or a Bartlett window.
3. The windowing compensation method according to claim 1, wherein In step B, according to the window function calculation formula, window functions w0(n), w1(n), w2(n), w3(n), w4(n),... are sequentially generated according to the specified window function sequence length. Each window function is divided into w n,L (n) and w n,H (n). Through overlapping addition processing, the window function sequence obtained is w sum (n), and its expression is as follows: w sum (n) = w 0,H (n) + w 1,L (n) + w 1,H (n) + w 2,L (n) + w 2,H (n) + w 3,L (n) + w 3,H (n) + w 4,L (n) +...。 4. The windowing compensation method according to claim 1, wherein In step C, The difference sequence between the overlap-added window function sequence and the constant value is denoted as Δw(n), which is calculated by the following formula: Δw(n) = w sum (n) - C where, w sum (n) is a window function sequence obtained by overlap-and-add processing, and C is a set constant value.
5. The windowing compensation method according to claim 1, wherein Step D specifically includes: Step 1), extract a main value sequence Δw M (n) from the difference sequence Δw(n) according to the overlapping length L, where the main value sequence is extracted from elements other than the first L elements and the last L elements of the difference sequence Δw(n); Step 2), expand the main value sequence according to the frame overlap rate to obtain an expanded difference sequence Δw E (n); Step 3), according to the frame overlap rate, scale the amplitude of the extended difference sequence Δw E (n) to obtain the scaled difference sequence Δw E,S (n); After the processing of the above steps 1), 2), and 3), the compensation sequence of the window function sequence is obtained.
6. The windowing compensation method according to claim 1, wherein In step E, the window function w c (n) has the following expression: w c (n) = w(n) - Δw E,S (n) where w(n) is the window function sequence generated in step A, and Δw E,S (n) is the compensation sequence of the window function sequence; In step F, the square root sequence w c,h (n) of the compensated and corrected window function is expressed as follows:
7. The windowing compensation method according to claim 1, wherein In step G, Assume that the input signal is x(n), and the square root sequence of the window function after compensation and correction in the time domain is w c,h (n). The time-domain input signal after windowing in the time domain is x w (n), and its expression is as follows: x w (n) = x(n) × w c, h(n) The time-domain input signal is x w (n) After FFT transformation and IFFT transformation, the output signal obtained is y(n); The time-domain square root sequence of the compensated and corrected window function is w c,h (n). After performing time-domain windowing on the output signal y(n) after IFFT transformation, the time-domain output signal obtained is y w (n), and its expression is as follows: y w (n) = y(n) × w c,h (n).
8. A windowing compensation device for frequency-domain signal processing, characterized in that, It includes: A window function sequence generation module, which is used to generate a window function sequence with a fixed length according to the specified window function type and the length of the segmented data frame; A window function sequence overlap-add module, whose input end is electrically connected to the output end of the window function sequence generation module, and is used to perform overlap-add processing on the window function sequence according to the overlap length requirement of the time-domain data block to generate an overlap-added window function sequence; A difference sequence generation module, whose input end is electrically connected to the output end of the window function sequence overlap-add module, and is used to compare the overlap-added window function sequence with a set constant value to obtain a difference sequence between the window function sequence and the constant value; A compensation sequence generation module, whose input end is electrically connected to the output end of the difference sequence generation module, and is used to perform amplitude scaling and repeated extension on the difference sequence according to the difference sequence between the window function sequence and the constant value according to the overlap length requirement, so as to generate a compensation sequence of the window function sequence; A window function sequence compensation correction module, whose input end is electrically connected to the output end of the compensation sequence generation module, and is used to perform compensation correction on the window function sequence generated by the window function sequence generation module according to the compensation sequence of the window function sequence, so as to obtain a compensated and corrected window function; A square root operation module, whose input end is electrically connected to the output end of the window function sequence compensation and correction module, is configured to perform a square root operation on the compensated and corrected window function sequence to obtain a time-domain square root sequence of the compensated and corrected window function; A time-domain windowing processing module, whose input end is electrically connected to the output end of the square root operation module, is configured to perform time-domain windowing processing on the input signal in the time domain according to the time-domain square root sequence of the compensated and corrected window function, perform FFT transformation and IFFT transformation, and then perform time-domain windowing processing using the time-domain square root sequence of the compensated and corrected window function, so as to obtain an output signal consistent with the original input signal.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the windowing compensation method for frequency-domain signal processing according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, it implements the windowing compensation method for frequency-domain signal processing according to any one of claims 1 to 7.
Citation Information
Cited By
Time domain signal windowing processing method and system, medium, equipment and program product
CN121125427A