Digital signal filtering method and device, equipment and storage medium

By calculating the reference quantity value and updating the spectrum value, using fast Fourier transform and inverse transform, the signal distortion and rough filter particle size problems caused by FIR filters or IIR filters are solved, and accurate signal filtering and waveform recovery are achieved.

CN120301397AActive Publication Date: 2025-07-11GUANGZHOU ZHIYUAN INSTR CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202510204292.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-07-11
Estimated Expiration
2045-02-24

AI Technical Summary

Technical Problem

In the prior art, FIR filters or IIR filters are prone to distortion during signal filtering, and can only be used in special spectrum ranges, with relatively rough filtering particle size and poor filtering effect.

Method used

By obtaining the discrete data sequence of the to-process signals and the period time of the target suppression frequency point, calculating the reference number value, using fast Fourier transform and inverse transform, the spectrum value is updated to achieve accurate filtering, refine the filter particle size, and ensure waveform integrity.

Benefits of technology

Accurate filtering processing for specific frequency points is realized, signal distortion is reduced, filtering effect is improved, and the waveform is fully restored.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120301397A_ABST
    Figure CN120301397A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a digital signal filtering method and device, equipment and a storage medium, and the method comprises the steps: obtaining a discrete data sequence corresponding to a to-be-processed signal, and obtaining the period time corresponding to a target suppression frequency point, based on the first length of the discrete data sequence and a set sampling rate corresponding to the analog-to-digital converter, sampling time is calculated and obtained, the sampling time is divided by periodic time to obtain a reference quantity value, and under the condition that the reference quantity value is an integer, fast Fourier transform is carried out on the discrete data sequence to obtain a target frequency spectrum; frequency spectrum values corresponding to a target suppression frequency point in the target frequency spectrum and a mirror image frequency point associated with the target suppression frequency point are updated to be a first target frequency spectrum value corresponding to a nearest frequency point located on the right side of the target suppression frequency point, and inverse fast Fourier transform is carried out on the updated target frequency spectrum to obtain a first target waveform, filtering processing is carried out on specific frequency points, the filtering granularity is refined, it is effectively guaranteed that the target suppression frequency points are removed, and the waveform is completely restored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular, to a digital signal filtering method, apparatus, device, and storage medium. Background Art

[0002] In actual application scenarios, in order to better maintain, optimize, and troubleshoot equipment, users often need to finely separate signals containing multiple frequency components. For example, process high-frequency signals superimposed on power frequency signals. The power frequency signal, as the basic frequency component in the power system, widely exists in the operation data of various electrical equipment. However, in the actual measurement and analysis process, users often pay more attention to those high-frequency components superimposed on the power frequency signal. These high-frequency signals may represent specific operating states, fault characteristics, or external interference factors of the equipment. Therefore, it is necessary to accurately extract the high-frequency signal from the complex mixed signal to achieve separate observation and measurement of the signal.

[0003] In the related art, an FIR (Finite Impulse Response) filter or an IIR (Infinite Impulse Response) filter is used to filter out the power frequency signal. Specifically, a specific impulse response is convolved with the original signal to obtain the filtered waveform. However, the waveform obtained by using the FIR filter or the IIR filter is prone to distortion and can only be applied to signal filtering in a special frequency spectrum range. The filtering granularity is relatively rough, and the filtering effect is relatively poor. Summary of the Invention

[0004] The embodiments of the present application provide a digital signal filtering method, apparatus, device, and storage medium, which solve the problems that the waveform obtained by using the FIR filter or the IIR filter in the related art is prone to distortion, can only be applied to signal filtering in a special frequency spectrum range, the filtering granularity is relatively rough, and the filtering effect is relatively poor. It realizes filtering processing for specific frequency points, refines the filtering granularity, effectively guarantees the removal of the target suppression frequency point while completely restoring the waveform, reduces signal distortion, and improves the filtering effect.

[0005] In a first aspect, the embodiments of the present application provide a digital signal filtering method, including:

[0006] Obtain the discrete data sequence corresponding to the signal to be processed, and obtain the cycle time corresponding to the target suppression frequency point;

[0007] Calculate the sampling time based on the first length of the discrete data sequence and the sampling rate corresponding to the set analog-to-digital converter, and divide the sampling time by the cycle time to obtain a reference quantity value;

[0008] When the reference quantity value is an integer, perform a fast Fourier transform on the discrete data sequence to obtain a target spectrum, and update the spectrum values corresponding to the target suppression frequency points and their associated mirror frequency points in the target spectrum to the first target spectrum values corresponding to the nearest frequency points on the right side of the target suppression frequency points;

[0009] Perform an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

[0010] Optionally, the digital signal filtering method further includes:

[0011] When the reference quantity value is a non-integer, based on the first length, the sampling rate, and the period time, calculate the first data sequence number corresponding to the largest integer period in the discrete data sequence, and divide the discrete data sequence into a first subsequence and a second subsequence based on the first data sequence number;

[0012] Perform a fast Fourier transform on the first subsequence and the second subsequence respectively to obtain a first spectrum and a second spectrum;

[0013] Based on the period time, the sampling rate, the first length, the first data sequence number, the spectrum values corresponding to the target suppression frequency point and the nearest frequency point on its right side respectively, calculate a second target spectrum value, and update the spectrum values corresponding to the target suppression frequency point, the associated mirror frequency point, and the nearest frequency point in the first spectrum and the second spectrum to the second target spectrum value;

[0014] Perform an inverse fast Fourier transform on the updated first spectrum and the second spectrum respectively to obtain a first waveform and a second waveform, and combine the first waveform and the second waveform to obtain a second target waveform.

[0015] Optionally, the calculating the first data sequence number corresponding to the largest integer period in the discrete data sequence based on the first length, the sampling rate, and the period time includes:

[0016] Multiply the sampling rate by the period time to obtain a first calculation result;

[0017] Divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result;

[0018] Multiply the first integer result by the first calculation result to obtain a third calculation result, and round down the third calculation result to obtain the first data sequence number corresponding to the largest integer period in the discrete data sequence.

[0019] Optionally, dividing the discrete data sequence into a first subsequence and a second subsequence based on the first data sequence number includes:

[0020] Determining, as the first subsequence, the data sequence in the discrete data sequence from the starting data point to the first target data point corresponding to the first data sequence number;

[0021] Subtracting the first length from the first data sequence number to obtain a second data sequence number;

[0022] Determining, as the second subsequence, the data sequence in the discrete data sequence from the second target data point corresponding to the second data sequence number to the ending data point.

[0023] Optionally, calculating a second target spectral value based on the period time, the sampling rate, the first length, the first data sequence number, the target suppression frequency point, and the spectral values corresponding to the nearest frequency point on its right includes:

[0024] Calculating, based on the period time, the sampling rate, the first length, and the first data sequence number, the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right;

[0025] Multiplying the spectral value corresponding to the target suppression frequency point by the amplitude ratio to obtain a leakage spectral value, and subtracting the leakage spectral value from the spectral value corresponding to the nearest frequency point on the right of the target suppression frequency point to obtain the second target spectral value.

[0026] Optionally, calculating the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right based on the period time, the sampling rate, the first length, and the first data sequence number includes:

[0027] Multiplying the sampling rate by the period time to obtain a first calculation result, dividing the first length by the first calculation result to obtain a second calculation result, and rounding down the second calculation result to obtain a first integer result;

[0028] Dividing the product of the first integer result and the sampling rate by the first data sequence number to obtain a measurement frequency, taking the reciprocal of the period time to obtain a suppression frequency, and dividing the difference between the suppression frequency and the measurement frequency by the measurement frequency to obtain a frequency offset ratio;

[0029] Calculating, based on the frequency offset ratio and a set sampling function, the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0030] Optionally, calculating the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right based on the frequency offset ratio and the set sampling function includes:

[0031] Substitute the sum of the frequency offset ratio and a preset value into the set sampling function for calculation to obtain a first intermediate result;

[0032] Substitute the spectrum ratio into the set sampling function for calculation to obtain a second intermediate result;

[0033] Divide the first intermediate result by the second intermediate result to obtain the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0034] Optionally, after performing the inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform, the following is further included:

[0035] Output the first target waveform to a display unit so that the display unit displays the first target waveform, and output the first target waveform to an FPGA unit so that the FPGA unit performs preset measurement processing and preset arithmetic processing on the first target waveform.

[0036] In a second aspect, an embodiment of the present application further provides a digital signal filtering device, and the digital signal filtering device includes:

[0037] An acquisition unit configured to acquire a discrete data sequence corresponding to a signal to be processed and acquire a periodic time corresponding to a target suppression frequency point;

[0038] A reference quantity value calculation unit configured to calculate a sampling time based on a first length of the discrete data sequence and a sampling rate corresponding to a set analog-to-digital converter, and divide the sampling time by the periodic time to obtain a reference quantity value;

[0039] A first spectrum update unit configured to, when the reference quantity value is an integer, perform a fast Fourier transform on the discrete data sequence to obtain a target spectrum, and update the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to first target spectrum values corresponding to the nearest frequency point on the right of the target suppression frequency point;

[0040] A first waveform determination unit configured to perform an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

[0041] Optionally, the digital signal filtering device further includes:

[0042] A second spectrum updating unit, configured to, when the reference quantity value is a non-integer, calculate a first data serial number corresponding to the maximum integer period in the discrete data sequence based on the first length, the sampling rate, and the period time, divide the discrete data sequence into a first subsequence and a second subsequence based on the first data serial number; perform fast Fourier transforms on the first subsequence and the second subsequence respectively to obtain a first spectrum and a second spectrum; calculate a second target spectrum value based on the period time, the sampling rate, the first length, the first data serial number, the target suppression frequency point, and the spectrum values corresponding to the nearest frequency point on its right, and update the spectrum values corresponding to the target suppression frequency point, the associated mirror frequency point, and the nearest frequency point in the first spectrum and the second spectrum to the second target spectrum value;

[0043] A second waveform determining unit, configured to perform inverse fast Fourier transforms on the updated first spectrum and the second spectrum respectively to obtain a first waveform and a second waveform, and combine the first waveform and the second waveform to obtain a second target waveform.

[0044] Optionally, the second spectrum updating unit includes:

[0045] A serial number calculation module, configured to multiply the sampling rate by the period time to obtain a first calculation result; divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result; multiply the first integer result by the first calculation result, and round down the third calculation result to obtain the first data serial number corresponding to the maximum integer period in the discrete data sequence.

[0046] Optionally, the second spectrum updating unit includes:

[0047] A sequence splitting module, configured to determine the data sequence from the start data point to the first target data point corresponding to the first data serial number in the discrete data sequence as the first subsequence; subtract the first data serial number from the first length to obtain a second data serial number; and determine the data sequence from the second target data point corresponding to the second data serial number to the end data point in the discrete data sequence as the second subsequence.

[0048] Optionally, the second spectrum updating unit includes:

[0049] The spectrum value calculation module is configured to calculate, based on the cycle time, the sampling rate, the first length, and the first data sequence number, the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right; multiply the spectrum value corresponding to the target suppression frequency point by the amplitude ratio to obtain the leakage spectrum value, and subtract the leakage spectrum value from the spectrum value corresponding to the nearest frequency point on the right of the target suppression frequency point to obtain the second target spectrum value.

[0050] Optionally, the spectrum value calculation module is further configured to:

[0051] Multiply the sampling rate by the cycle time to obtain a first calculation result, divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result;

[0052] Divide the product of the first integer result and the sampling rate by the first data sequence number to obtain the measurement frequency, take the reciprocal of the cycle time to obtain the suppression frequency, and divide the difference between the suppression frequency and the measurement frequency by the measurement frequency to obtain the frequency deviation ratio;

[0053] Based on the frequency deviation ratio and the set sampling function, calculate the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0054] Optionally, the spectrum value calculation module is further configured to:

[0055] Substitute the sum of the frequency deviation ratio and a preset value into the set sampling function for calculation to obtain a first intermediate result;

[0056] Substitute the spectrum ratio into the set sampling function for calculation to obtain a second intermediate result;

[0057] Divide the first intermediate result by the second intermediate result to obtain the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0058] Optionally, it further includes a result output unit, configured to:

[0059] Output the first target waveform to the display unit so that the display unit displays the first target waveform, and output the first target waveform to the FPGA unit so that the FPGA unit performs preset measurement processing and preset arithmetic processing on the first target waveform.

[0060] In a third aspect, an embodiment of the present application further provides an electronic device, which includes: one or more processors; a storage device configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the digital signal filtering method described in the embodiments of the present application.

[0061] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer-executable instructions, and the computer-executable instructions are configured to execute the digital signal filtering method described in the embodiments of the present application when executed by a computer processor.

[0062] In the embodiments of the present application, by obtaining a discrete data sequence corresponding to a signal to be processed and obtaining a periodic time corresponding to a target suppression frequency point, calculating a sampling time based on a first length of the discrete data sequence and a sampling rate corresponding to a set analog-to-digital converter, dividing the sampling time by the periodic time to obtain a reference quantity value, in the case where the reference quantity value is an integer, performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum, updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point, and performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform. In the above solution, by dividing the calculated sampling time by the periodic time to obtain a reference quantity value, it is possible to effectively determine whether the signal corresponding to the target suppression frequency point is sampled in whole periods, providing a reliable data reference for subsequent filtering operations. In the case where the reference quantity value is an integer, it can be considered that the time-domain signal corresponding to the target suppression frequency point is sampled in whole periods, and performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum can achieve filtering processing for specific frequency points in the frequency domain, refining the filtering granularity. Moreover, updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point can effectively ensure that while removing the target suppression frequency point, the waveform is completely restored, reducing signal distortion and improving the filtering effect. Description of the Drawings

[0063] Figure 1 It is a flowchart of a digital signal filtering method provided by an embodiment of the present application;

[0064] Figure 2 It is a schematic diagram of filtering out a target suppression frequency point in the frequency domain provided by an embodiment of the present application;

[0065] Figure 3 It is a flowchart of another digital signal filtering method provided by an embodiment of the present application;

[0066] Figure 4Flowchart of the specific implementation process for determining the first data sequence number corresponding to the maximum integer period in a discrete data sequence provided by an embodiment of the present application;

[0067] Figure 5 Flowchart of the specific implementation process for dividing a discrete data sequence into a first subsequence and a second subsequence provided by an embodiment of the present application;

[0068] Figure 6 Schematic diagram of splitting a discrete data sequence into a first subsequence and a second subsequence provided by an embodiment of the present application;

[0069] Figure 7 Flowchart of the specific implementation process for calculating a second target spectral value provided by an embodiment of the present application;

[0070] Figure 8 Flowchart of the specific implementation process for calculating the amplitude ratio of a target suppression frequency point relative to the nearest frequency point on its right provided by an embodiment of the present application;

[0071] Figure 9 Another schematic diagram of filtering a target suppression frequency point in the frequency domain provided by an embodiment of the present application;

[0072] Figure 10 Structural block diagram of a digital signal filtering device provided by an embodiment of the present application;

[0073] Figure 11 Structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0074] The following further elaborates on the embodiments of the present application in conjunction with the accompanying drawings and examples. It can be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than limiting the embodiments of the present application. Additionally, it should be noted that for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.

[0075] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and do not limit the number of objects. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.

[0076] In the digital signal filtering method provided by the embodiments of the present application, the execution subject of each step may be a computer device, which refers to any electronic device with data calculation, processing, and storage capabilities, such as terminal devices like PCs (Personal Computers), etc., or devices such as servers. The embodiments of the present application do not limit this.

[0077] In the process of specifically using an FIR filter or an IIR filter to separate signals of multiple frequency components, the inventors found that since using an FIR filter or an IIR filter convolves a specific impulse response with the original signal to obtain the filtered waveform, the data at its very front end is unstable and prone to error data, resulting in signal distortion in the starting part of the filtered waveform. Secondly, using an FIR filter or an IIR filter can only remove signals in certain special frequency ranges. For example, signals greater than a certain frequency or less than a certain frequency cannot specifically remove signals at a certain or several frequency points. Moreover, when the frequencies of the desired signal and the interference signal are close, the FIR or IIR filter cannot provide a good filtering effect. Therefore, the present application aims to provide a digital signal filtering method, device, equipment, and storage medium to solve the problems in the related art that the waveforms obtained by using an FIR filter or an IIR filter are prone to distortion, and can only be applied to signal filtering in special frequency spectrum ranges, with relatively coarse filtering granularity and relatively poor filtering effect.

[0078] Figure 1 It is a flowchart of a digital signal filtering method provided by the embodiments of the present application, and this digital signal filtering method can be implemented with a processor as the execution subject. As Figure 1 shown, the digital signal filtering method specifically includes the following steps:

[0079] Step S110: Obtain the discrete data sequence corresponding to the signal to be processed, and obtain the cycle time corresponding to the target suppression frequency point.

[0080] Among them, the discrete data sequence may be a digital signal obtained by an analog-to-digital converter converting the signal to be processed, and specifically includes multiple discrete data points in the time domain. It should be noted that the cycle time of the target suppression frequency point may be the cycle time corresponding to the power frequency signal that needs to be suppressed, which is preset by the developer according to the specific requirements of the actual application scenario. For example, for a 50 Hz power frequency signal, its corresponding cycle time is 0.02 s.

[0081] Step S120: Calculate the sampling time based on the first length of the discrete data sequence and the sampling rate corresponding to the set analog-to-digital converter, and divide the sampling time by the cycle time to obtain a reference quantity value.

[0082] Specifically, the first length characterizes the number of data points in the discrete data sequence, while the sampling rate corresponding to the analog-to-digital converter characterizes the number of sample data points collected by the analog-to-digital converter per second. Thus, the relevant formula for calculating the sampling time is as follows:

[0083] t s = L / F s ,

[0084] where t s is the sampling time, L is the first length, and F s is the sampling rate of the analog-to-digital converter. It can be understood that the sampling time needs to ensure that it is greater than twice the period time corresponding to the target suppression frequency point to effectively collect and remove the time-domain signal corresponding to the target suppression frequency point.

[0085] In addition, in order to effectively remove the time-domain signal corresponding to the target suppression frequency point, it is necessary to determine whether the frequency point signal is sampled in integer periods, so as to perform corresponding filtering operations. Specifically, the reference quantity value can be obtained by dividing the sampling time by the period time. The relevant formula is as follows:

[0086] num = t s / T1,

[0087] where num is the reference quantity value, t s is the sampling time, and T1 is the period time corresponding to the target suppression frequency point. If the reference quantity value is an integer, it means that the time-domain signal corresponding to the target suppression frequency point can be sampled in integer multiples. If the reference quantity value is a non-integer, it means that the time-domain signal corresponding to the target suppression frequency point cannot be sampled in integer multiples, so different filtering processes can be adopted for different judgment results.

[0088] Step S130, when the reference quantity value is an integer, perform a fast Fourier transform on the discrete data sequence to obtain the target spectrum, and update the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum value corresponding to the nearest frequency point on the right side of the target suppression frequency point.

[0089] It should be noted that if the reference data value is an integer, it indicates that the time-domain signal corresponding to the target suppression frequency point can be sampled by an integer multiple. Therefore, the discrete data sequence can be directly subjected to a fast Fourier transform to obtain the target spectrum, and the discrete data sequence can be converted to the frequency domain for processing. Although directly removing the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum can achieve the filtering purpose, it is easy to filter out some effective components at the same time, resulting in the integrity of the finally obtained target waveform being affected. Therefore, the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point can be updated to the first target spectrum value corresponding to the nearest frequency point on the right side of the target suppression frequency point, so as to ensure that the target suppression frequency point is filtered out while ensuring the integrity of the finally obtained target waveform. Specifically, Figure 2 is a schematic diagram of filtering out the target suppression frequency point in the frequency domain provided by the embodiment of the present application, as Figure 2 shown, F1 is the target suppression frequency point, F2 is the nearest frequency point on the right side of the target suppression frequency point. By updating the spectrum value corresponding to the target suppression frequency point F1 to the first target spectrum value of this nearest frequency point F2, the purpose of filtering out this target suppression frequency point is achieved. It should be noted that the update process of the spectrum value corresponding to its associated mirror frequency point is in Figure 2 not shown.

[0090] Step S140: Perform an inverse fast Fourier transform on the updated target spectrum to obtain the first target waveform.

[0091] It can be understood that in this embodiment, the discrete data sequence corresponding to the signal to be processed is converted to the frequency domain through a fast Fourier transform for filtering processing, and restored to the time domain through an inverse fast Fourier transform, which can reduce the distortion of the target waveform and at the same time achieve the removal of individual discrete frequency points alone or several, without affecting the signals of the nearby frequency points.

[0092] Optionally, after performing an inverse fast Fourier transform on the updated target spectrum to obtain the first target waveform, it further includes:

[0093] Output the first target waveform to the display unit so that the display unit displays the first target waveform, and output the first target waveform to the FPGA unit so that the FPGA unit performs preset measurement processing and preset operation processing on the first target waveform.

[0094] It should be noted that the display unit can display the first target waveform to show the waveform after filtering out the target suppression frequency point to the user, while the FPGA unit can perform preset measurement processing and preset operation processing on the first target waveform. The preset measurement processing can be frequency measurement, amplitude measurement, phase measurement, etc., and the preset operation processing can be smoothing processing, enhancement processing, etc. The present application is not limited thereto.

[0095] As described above, by obtaining the discrete data sequence corresponding to the signal to be processed and the periodic time corresponding to the target suppression frequency point, calculating the sampling time based on the first length of the discrete data sequence and the sampling rate of the set analog-to-digital converter, dividing the sampling time by the periodic time to obtain a reference quantity value, when the reference quantity value is an integer, performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum, updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point, and performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform. In the above solution, by dividing the calculated sampling time by the periodic time to obtain a reference quantity value, it can effectively determine whether the signal corresponding to the target suppression frequency point is sampled in whole periods, providing a reliable data reference for subsequent filtering operations. When the reference quantity value is an integer, it can be considered that the signal corresponding to the target suppression frequency point is sampled in whole periods, and performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum can achieve filtering processing for specific frequency points in the frequency domain, refining the filtering granularity. Moreover, updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point can effectively ensure that while removing the target suppression frequency point, the waveform is restored completely, reducing signal distortion and improving the filtering effect.

[0096] Figure 3 The flowchart of another digital signal filtering method provided by an embodiment of the present application is shown in Figure 3 As shown, the digital signal filtering method specifically includes the following steps:

[0097] Step S210, obtaining the discrete data sequence corresponding to the signal to be processed, and obtaining the periodic time corresponding to the target suppression frequency point.

[0098] Step S220, calculating the sampling time based on the first length of the discrete data sequence and the sampling rate of the set analog-to-digital converter, and dividing the sampling time by the periodic time to obtain a reference quantity value.

[0099] Step S230, when the reference quantity value is an integer, performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum, and updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point.

[0100] Step S240, performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

[0101] Step S250: When the reference quantity value is a non-integer, based on the first length, sampling rate, and cycle time, calculate the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence, and divide the discrete data sequence into a first subsequence and a second subsequence based on the first data sequence number.

[0102] Among them, if the reference quantity value is a non-integer, it indicates that the time-domain signal corresponding to the target suppression frequency point cannot be sampled an integer number of times. The discrete data sequence needs to be split into two subsequences for separate processing to ensure that the target suppression frequency point can be completely filtered out. By combining the first length, sampling rate, and cycle time, the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence can be calculated and determined, thereby effectively splitting the discrete data sequence.

[0103] In an optional embodiment, a specific implementation process for calculating the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence based on the first length, sampling rate, and cycle time is described. Please refer to Figure 4 , which is a flowchart of a specific implementation process for determining the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence provided by the embodiment of the present application. As Figure 4 shown, the specific implementation steps for calculating the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence based on the first length, sampling rate, and cycle time are as follows:

[0104] Step S251: Multiply the sampling rate by the cycle time to obtain a first calculation result.

[0105] Step S252: Divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result.

[0106] Step S253: Multiply the first integer result by the first calculation result to obtain a third calculation result, and round down the third calculation result to obtain the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence.

[0107] It should be noted that in combination with the relevant descriptions of steps S251 - S253, the relevant formula for calculating the first data sequence number corresponding to the maximum integer cycle in the discrete data sequence is as follows:

[0108]

[0109] Among them, numsimple is the first data sequence number, F s is the sampling rate corresponding to the analog-to-digital converter, T1 is the cycle time corresponding to the target suppression frequency point, L is the first length of the discrete data sequence, is the floor function.

[0110] In an optional embodiment, a specific implementation process of dividing a discrete data sequence into a first subsequence and a second subsequence based on a first data sequence number is described. Please refer to Figure 5 , which is a flowchart of a specific implementation process of dividing a discrete data sequence into a first subsequence and a second subsequence provided by an embodiment of the present application. As shown in Figure 5 , the specific implementation steps of dividing a discrete data sequence into a first subsequence and a second subsequence based on a first data sequence number are as follows:

[0111] Step S254: Determine the data sequence from the start data point to the first target data point corresponding to the first data sequence number in the discrete data sequence as the first subsequence.

[0112] Step S255: Subtract the first length from the first data sequence number to obtain a second data sequence number;

[0113] Step S256: Determine the data sequence from the second target data point corresponding to the second data sequence number to the end data point in the discrete data sequence as the second subsequence.

[0114] It should be noted that the relevant formulas for determining the first subsequence and the second subsequence are as follows:

[0115] Data_adc1 = Data_adc[:numsimple],

[0116] Data_adc2 = Data_adc[L - numsimple:],

[0117] Among them, Data_adc1 is the first subsequence, Data_adc2 is the second subsequence, Data_adc is the discrete data sequence, L is the first length, numsimple is the first data sequence number, :numsimple means from the start data point to the first target data point. It can be understood that the second data sequence number can be obtained from the first length L and the first data sequence number numsimple, and L - numsimple: means from the second target data point to the end data point. Specifically, Figure 6 is a schematic diagram of splitting a discrete data sequence into a first subsequence and a second subsequence provided by an embodiment of the present application. As shown in Figure 6 , the discrete data sequence 101 can be split into a first subsequence 102 and a second subsequence 103 based on the first data sequence number.

[0118] Step S260: Perform fast Fourier transform on the first subsequence and the second subsequence respectively to obtain a first spectrum and a second spectrum.

[0119] Among them, by performing fast Fourier transform on the first subsequence and the second subsequence, the first subsequence and the second subsequence can be converted into the frequency domain for processing.

[0120] Step S270: Based on the periodic time, sampling rate, first length, first data sequence number, target suppression frequency point, and the spectral values corresponding to the nearest frequency point on its right, calculate the second target spectral value, and update the spectral values corresponding to the target suppression frequency point, the associated mirror frequency point, and the nearest frequency point in the first spectrum and the second spectrum to the second target spectral value.

[0121] In an optional embodiment, a specific implementation process for calculating the second target spectral value based on the periodic time, sampling rate, first length, first data sequence number, target suppression frequency point, and the spectral values corresponding to the nearest frequency point on its right is described. Please refer to Figure 7 , which is a flowchart of a specific implementation process for calculating the second target spectral value provided by the embodiment of the present application. As Figure 7 shown, the specific implementation steps for calculating the second target spectral value based on the periodic time, sampling rate, first length, first data sequence number, target suppression frequency point, and the spectral values corresponding to the nearest frequency point on its right are as follows:

[0122] Step S271: Based on the periodic time, sampling rate, first length, and first data sequence number, calculate the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0123] In a specific embodiment, Figure 8 is a flowchart of a specific implementation process for calculating the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right provided by the embodiment of the present application. As Figure 8 shown, it specifically includes the following steps:

[0124] Step S2711: Multiply the sampling rate by the periodic time to obtain a first calculation result, divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result.

[0125] Step S2712: Divide the product of the first integer result and the sampling rate by the first data sequence number to obtain the measurement frequency, take the reciprocal of the periodic time to obtain the suppression frequency, and divide the difference between the suppression frequency and the measurement frequency by the measurement frequency to obtain the frequency offset ratio.

[0126] Specifically, the calculation formula for the suppression frequency is as follows:

[0127]

[0128] Among them, F1 is the suppression frequency, and T1 is the periodic time of the target suppression frequency point.

[0129] The calculation formula for the measurement frequency is as follows:

[0130]

[0131] Wherein, F m is the measurement frequency, F s is the sampling rate corresponding to the analog-to-digital converter, T1 is the period time corresponding to the target suppression frequency point, L is the first length of the discrete data sequence, numsimple is the first data serial number corresponding to the maximum integer period in the discrete data sequence, is the floor function. It should be noted that this measurement frequency is obtained by converting the discrete data sequence into the frequency domain through the fast Fourier transform for measurement, and there is a deviation from the theoretically suppressed frequency.

[0132] The calculation formula for the frequency deviation ratio is as follows:

[0133]

[0134] Wherein, k is the frequency deviation ratio, F1 is the suppression frequency, F m is the measurement frequency.

[0135] Step S2713: Calculate the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right based on the frequency deviation ratio and the set sampling function.

[0136] Specifically, the sampling function can adopt the sinc() function. The specific calculation process for calculating the amplitude ratio based on the frequency deviation ratio and the set sampling function is as follows:

[0137] Substitute the sum of the frequency deviation ratio and the preset value into the set sampling function for calculation to obtain the first intermediate result, substitute the spectrum ratio into the set sampling function for calculation to obtain the second intermediate result, and divide the first intermediate result by the second intermediate result to obtain the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0138] Correspondingly, the calculation formula for the amplitude ratio is as follows:

[0139]

[0140] Wherein, k amp is the amplitude ratio, and k is the frequency deviation ratio.

[0141] Step S272: Multiply the spectrum value corresponding to the target suppression frequency point by the amplitude ratio to obtain the leakage spectrum value, and subtract the leakage spectrum value from the spectrum value corresponding to the nearest frequency point on the right of the target suppression frequency point to obtain the second target spectrum value.

[0142] It should be noted that since the reference quantity value is a non-integer, the time-domain signal of the target suppression frequency point may not be fully sampled, and the energy corresponding to the target suppression frequency point may leak to the nearest frequency point. Therefore, by calculating the leaked spectrum value, the component of the spectrum value corresponding to the target suppression frequency point leaking to the nearest frequency point can be obtained, and it is necessary to remove it in order to restore the true spectrum value of the nearest frequency point, otherwise it will cause distortion of the target waveform obtained subsequently.

[0143] Specifically, Figure 9 FIG. is another schematic diagram for filtering the target suppression frequency point in the frequency domain provided by the embodiment of the present application. As Figure 9 shown, F1 is the target suppression frequency point, F2 is the nearest frequency point on the right side of the target suppression frequency point, and the spectrum value corresponding to the target suppression frequency point F1 is multiplied by the amplitude ratio k amp to obtain the leaked spectrum value Δ. Subtracting the leaked spectrum value Δ from the amplitude value corresponding to the nearest frequency point F2 can obtain the second target spectrum value. By updating the spectrum value corresponding to the target suppression frequency point F1 to the second target spectrum value of the nearest frequency point F2, the purpose of filtering the target suppression frequency point F1 is achieved. It should be noted that the update process of the spectrum value corresponding to its associated mirror frequency point is not shown in Figure 9 FIG.

[0144] Step S280: Perform inverse fast Fourier transforms on the updated first spectrum and second spectrum respectively to obtain a first waveform and a second waveform, and combine the first waveform and the second waveform to obtain a second target waveform.

[0145] In one embodiment, the relevant formula for combining the first waveform and the second waveform is as follows:

[0146] Data_highfir[] = Data_highfir1[:] + Data_highfir2[2*numsimple - L:],

[0147] wherein, Data_highfir[] is the second target waveform, Data_highfir1[] is the first waveform, and Data_highfir2[] is the second waveform. It should be noted that in order to restore the second target waveform with a length of L, Data_highfir1[:] represents extracting all data points of the first waveform, and Data_highfir2[2*numsimple - L:] represents extracting all data points from the middle data point with the data sequence number of 2*numsimple - L to the end data point of the second waveform.

[0148] In another embodiment, the first waveform and the second waveform can also be weighted and combined to obtain a second target waveform with a first length, which is not limited in this application.

[0149] Optionally, after combining the first waveform and the second waveform to obtain a second target waveform, the method further includes:

[0150] Outputting the second target waveform to a display unit to enable the display unit to display the second target waveform, and outputting the second target waveform to an FPGA unit to enable the FPGA unit to perform preset measurement processing and preset arithmetic processing on the second target waveform.

[0151] It should be noted that the display unit can display the second target waveform to show the waveform after filtering the target suppression frequency points to the user, while the FPGA unit can perform preset measurement processing and preset arithmetic processing on the second target waveform. The preset measurement processing can be frequency measurement, amplitude measurement, phase measurement, etc., and the preset arithmetic processing can be smoothing processing, enhancement processing, etc. This application does not make limitations here.

[0152] As described above, when the reference quantity value is a non-integer, it can be considered that the time-domain signal corresponding to the target suppression frequency point is not sampled in a whole period. It is necessary to intercept the discrete data sequence before and after according to the whole period of the target suppression frequency point, and perform frequency-domain processing respectively. While removing the leakage amount of the target suppression frequency point at the nearest frequency point, update the spectrum value corresponding to the target suppression frequency point to the second target spectrum value corresponding to the nearest frequency point, so as to ensure that no spectrum leakage occurs while removing the target suppression frequency point, restoring the waveform completely, and reducing signal distortion.

[0153] Figure 10 The figure is a structural block diagram of a digital signal filtering device provided by an embodiment of the present application. The device is configured to execute the digital signal filtering method provided by the above embodiment, and has corresponding functional modules and beneficial effects for executing the method. As Figure 10 shown, the digital signal filtering device specifically includes:

[0154] An acquisition unit 201, configured to acquire a discrete data sequence corresponding to a signal to be processed, and acquire a cycle time corresponding to a target suppression frequency point;

[0155] A reference quantity value calculation unit 202, configured to calculate a sampling time based on a first length of the discrete data sequence and a sampling rate corresponding to a set analog-to-digital converter, and divide the sampling time by the cycle time to obtain a reference quantity value;

[0156] A first spectrum update unit 203, configured to perform a fast Fourier transform on the discrete data sequence to obtain a target spectrum when the reference quantity value is an integer, and update the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum values corresponding to the nearest frequency points on the right side of the target suppression frequency point;

[0157] The first waveform determination unit 204 is configured to perform an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

[0158] As described above, by obtaining the discrete data sequence corresponding to the signal to be processed and the periodic time corresponding to the target suppression frequency point, calculating the sampling time based on the first length of the discrete data sequence and the sampling rate corresponding to the set analog-to-digital converter, dividing the sampling time by the periodic time to obtain a reference quantity value, when the reference quantity value is an integer, performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum, updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point, and performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform. In the above solution, by dividing the calculated sampling time by the periodic time to obtain a reference quantity value, it can effectively determine whether the signal corresponding to the target suppression frequency point is sampled in whole periods, providing a reliable data reference for the subsequent filtering operation. When the reference quantity value is an integer, it can be considered that the signal corresponding to the target suppression frequency point is sampled in whole periods, and performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum can achieve filtering processing for specific frequency points in the frequency domain, refining the filtering granularity. Moreover, updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum values corresponding to the nearest frequency point on the right side of the target suppression frequency point can effectively ensure that while removing the target suppression frequency point, the waveform is restored completely, reducing signal distortion and improving the filtering effect.

[0159] In a possible embodiment, it further includes:

[0160] A second spectrum update unit configured to, when the reference quantity value is non-integer, calculate a first data sequence number corresponding to the maximum whole period in the discrete data sequence based on the first length, sampling rate, and periodic time, divide the discrete data sequence into a first subsequence and a second subsequence based on the first data sequence number; perform a fast Fourier transform on the first subsequence and the second subsequence respectively to obtain a first spectrum and a second spectrum; calculate second target spectrum values based on the periodic time, sampling rate, first length, first data sequence number, the spectrum values corresponding to the target suppression frequency point and the nearest frequency point on its right side, and update the spectrum values corresponding to the target suppression frequency point, the associated mirror frequency point, and the nearest frequency point in the first spectrum and the second spectrum to the second target spectrum values;

[0161] A second waveform determination unit configured to perform an inverse fast Fourier transform on the updated first spectrum and second spectrum respectively to obtain a first waveform and a second waveform, and combine the first waveform and the second waveform to obtain a second target waveform.

[0162] In a possible embodiment, the second spectrum update unit includes:

[0163] A sequence number calculation module configured to multiply the sampling rate by the period time to obtain a first calculation result; divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result; multiply the first integer result by the first calculation result, and round down the third calculation result to obtain the first data sequence number corresponding to the largest integer period in the discrete data sequence.

[0164] In a possible embodiment, the second spectrum update unit includes:

[0165] A sequence splitting module configured to determine the data sequence from the start data point to the first target data point corresponding to the first data sequence number in the discrete data sequence as the first subsequence; subtract the first data sequence number from the first length to obtain a second data sequence number; determine the data sequence from the second target data point corresponding to the second data sequence number to the end data point in the discrete data sequence as the second subsequence.

[0166] In a possible embodiment, the second spectrum update unit includes:

[0167] A spectrum value calculation module configured to calculate, based on the period time, the sampling rate, the first length, and the first data sequence number, the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right; multiply the spectrum value corresponding to the target suppression frequency point by the amplitude ratio to obtain a leakage spectrum value, and subtract the leakage spectrum value from the spectrum value corresponding to the nearest frequency point on the right of the target suppression frequency point to obtain a second target spectrum value.

[0168] In a possible embodiment, the spectrum value calculation module is further configured to:

[0169] Multiply the sampling rate by the period time to obtain a first calculation result, divide the first length by the first calculation result to obtain a second calculation result, and round down the second calculation result to obtain a first integer result;

[0170] Divide the product of the first integer result and the sampling rate by the first data sequence number to obtain a measurement frequency, take the reciprocal of the period time to obtain a suppression frequency, and divide the difference between the suppression frequency and the measurement frequency by the measurement frequency to obtain a frequency deviation ratio;

[0171] Calculate, based on the frequency deviation ratio and the set sampling function, the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0172] In a possible embodiment, the spectrum value calculation module is further configured to:

[0173] Substitute the sum of the frequency offset ratio and a preset value into the set sampling function for calculation to obtain a first intermediate result;

[0174] Substitute the spectrum ratio into the set sampling function for calculation to obtain a second intermediate result;

[0175] Divide the first intermediate result by the second intermediate result to obtain the amplitude ratio of the target suppression frequency point relative to the nearest frequency point on its right.

[0176] In a possible embodiment, it further includes a result output unit configured to:

[0177] Output the first target waveform to a display unit so that the display unit displays the first target waveform, and output the first target waveform to an FPGA unit so that the FPGA unit performs preset measurement processing and preset arithmetic processing on the first target waveform.

[0178] Figure 11 The structural schematic diagram of an electronic device provided by an embodiment of the present application is shown as Figure 11 shown. The device includes a processor 301, a memory 302, an input device 303, and an output device 304; the number of processors 301 in the device can be one or more, Figure 11 taking one processor 301 as an example; the processor 301, memory 302, input device 303, and output device 304 in the device can be connected through a bus or other means, Figure 11Take the bus connection as an example. The memory 302, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the digital signal filtering method in the embodiments of the present application. The processor 301 executes various functional applications and data processing of the device by running the software programs, instructions, and modules stored in the memory 302, that is, implements the above-mentioned digital signal filtering method. The input device 303 can be configured to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the device. The output device 304 can include display devices such as a display screen. Specifically, the electronic device can be an oscilloscope, and the oscilloscope can include an analog conditioning unit, an analog-to-digital converter, an FPGA unit, a processor unit, a first storage unit, a second storage unit, and a display device. Among them, the analog conditioning unit can be used to receive the signal to be processed and transmit it to the analog-to-digital converter. The analog-to-digital converter can convert the signal to be processed into a discrete data sequence and transmit the discrete data sequence to the FPGA unit. The FPGA unit can store the discrete data sequence in the first storage unit and transmit the discrete data sequence to the processor unit. The processor unit can perform filtering processing on the discrete data sequence and transmit the obtained waveform result to the display device and the FPGA unit. The display device can display the waveform result, and the FPGA unit can perform measurement processing and arithmetic processing on the waveform result.

[0179] The above-provided electronic device can be used to execute the digital signal filtering method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0180] The embodiments of the present application further provide a non-volatile storage medium containing computer-executable instructions. The computer-executable instructions are configured to execute a digital signal filtering method described in any of the above embodiments when executed by a computer processor. Among them, the digital signal filtering method includes: obtaining a discrete data sequence corresponding to the signal to be processed, and obtaining the periodic time corresponding to the target suppression frequency point; calculating the sampling time based on the first length of the discrete data sequence and the sampling rate corresponding to the set analog-to-digital converter, and dividing the sampling time by the periodic time to obtain a reference quantity value; in the case where the reference quantity value is an integer, performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum, and updating the spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to the first target spectrum value corresponding to the nearest frequency point on the right side of the target suppression frequency point; performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

[0181] Storage medium - Any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media, and optical storage; registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. Additionally, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system that is connected to the first computer system via a network such as the Internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions executable by one or more processors (e.g., embodied as a computer program).

[0182] Of course, for a storage medium containing computer-executable instructions provided by an embodiment of the present application, the computer-executable instructions are not limited to the digital signal filtering method as described above, and can also perform related operations in the digital signal filtering methods provided by any embodiment of the present application.

[0183] It should be noted that in the embodiments of the above digital signal filtering device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of mutual distinction and are not configured to limit the protection scope of the embodiments of the present application.

[0184] It should be noted that the numbering of each step in this solution is only used to describe the overall design framework of this solution and does not represent an inevitable sequence between steps. On the basis that the overall implementation process conforms to the overall design framework of this solution, it all belongs to the protection scope of this solution. The sequential order in the form of words during description is not an exclusive limitation on the specific implementation process of this solution. Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0185] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent in such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, commodity or device comprising the element.

[0186] Note that the above is only the preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments here, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A digital signal filtering method, characterized in that, Including: Obtaining a discrete data sequence corresponding to a signal to be processed, and obtaining a periodic time corresponding to a target suppression frequency point; Calculating a sampling time based on a first length of the discrete data sequence and a sampling rate corresponding to a set analog-to-digital converter, and dividing the sampling time by the periodic time to obtain a reference quantity value; When the reference quantity value is an integer, performing a fast Fourier transform on the discrete data sequence to obtain a target spectrum, and updating spectrum values corresponding to the target suppression frequency point and its associated mirror frequency point in the target spectrum to first target spectrum values corresponding to the nearest frequency point to the right of the target suppression frequency point; Performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

2. The digital signal filtering method according to claim 1, wherein Also including: When the reference quantity value is a non-integer, calculating a first data sequence number corresponding to the maximum integer period in the discrete data sequence based on the first length, the sampling rate, and the periodic time, and dividing the discrete data sequence into a first subsequence and a second subsequence based on the first data sequence number; Performing a fast Fourier transform on the first subsequence and the second subsequence respectively to obtain a first spectrum and a second spectrum; Calculating a second target spectrum value based on the periodic time, the sampling rate, the first length, the first data sequence number, spectrum values corresponding to the target suppression frequency point and the nearest frequency point to its right, and updating spectrum values corresponding to the target suppression frequency point, its associated mirror frequency point, and the nearest frequency point in the first spectrum and the second spectrum to the second target spectrum value; Performing an inverse fast Fourier transform on the updated first spectrum and the second spectrum respectively to obtain a first waveform and a second waveform, and combining the first waveform and the second waveform to obtain a second target waveform.

3. The digital signal filtering method according to claim 2, wherein The calculating the first data sequence number corresponding to the maximum integer period in the discrete data sequence based on the first length, the sampling rate, and the periodic time includes: Multiplying the sampling rate by the periodic time to obtain a first calculation result; Dividing the first length by the first calculation result to obtain a second calculation result, and rounding down the second calculation result to obtain a first integer result; Multiplying the first integer result by the first calculation result, and rounding down the third calculation result to obtain the first data sequence number corresponding to the maximum integer period in the discrete data sequence.

4. The digital signal filtering method according to claim 2, characterized in that The dividing the discrete data sequence into a first subsequence and a second subsequence based on the first data sequence number includes: Determining a data sequence of the discrete data sequence from the starting data point to the first target data point corresponding to the first data sequence number as the first subsequence; Subtracting the first data sequence number from the first length to obtain a second data sequence number; Determining a data sequence of the discrete data sequence from the second target data point corresponding to the second data sequence number to the end data point as the second subsequence.

5. The digital signal filtering method according to claim 2, characterized in that, Calculating a second target spectrum value based on the spectral values corresponding to the cycle time, the sampling rate, the first length, the first data sequence number, the target suppression frequency point, and the nearest frequency point to its right, includes: Calculating an amplitude ratio of the target suppression frequency point relative to the nearest frequency point to its right based on the cycle time, the sampling rate, the first length, and the first data sequence number; Multiplying the spectral value corresponding to the target suppression frequency point by the amplitude ratio to obtain a leakage spectral value, and subtracting the leakage spectral value from the spectral value corresponding to the nearest frequency point to the right of the target suppression frequency point to obtain the second target spectrum value.

6. The digital signal filtering method according to claim 5, wherein The calculating an amplitude ratio of the target suppression frequency point relative to the nearest frequency point to its right based on the cycle time, the sampling rate, the first length, and the first data sequence number, includes: Multiplying the sampling rate by the cycle time to obtain a first calculation result, dividing the first length by the first calculation result to obtain a second calculation result, and rounding down the second calculation result to obtain a first integer result; Dividing the product of the first integer result and the sampling rate by the first data sequence number to obtain a measured frequency, taking the reciprocal of the cycle time to obtain a suppression frequency, and dividing the difference between the suppression frequency and the measured frequency by the measured frequency to obtain a frequency offset ratio; Calculating an amplitude ratio of the target suppression frequency point relative to the nearest frequency point to its right based on the frequency offset ratio and a set sampling function.

7. The digital signal filtering method according to claim 6, wherein The calculating an amplitude ratio of the target suppression frequency point relative to the nearest frequency point to its right based on the frequency offset ratio and a set sampling function, includes: Substituting the sum of the frequency offset ratio and a preset value into the set sampling function for calculation to obtain a first intermediate result; Substituting the spectral ratio into the set sampling function for calculation to obtain a second intermediate result; Dividing the first intermediate result by the second intermediate result to obtain an amplitude ratio of the target suppression frequency point relative to the nearest frequency point to its right.

8. The digital signal filtering method according to claim 1, wherein After performing an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform, it further includes: Outputting the first target waveform to a display unit to enable the display unit to display the first target waveform, and outputting the first target waveform to an FPGA unit to enable the FPGA unit to perform preset measurement processing and preset arithmetic processing on the first target waveform.

9. A digital signal filtering device, characterized in that, Including: An acquisition unit configured to acquire a discrete data sequence corresponding to a signal to be processed and acquire a cycle time corresponding to a target suppression frequency point; A reference quantity value calculation unit configured to calculate a sampling time based on a first length of the discrete data sequence and a sampling rate corresponding to a set analog-to-digital converter, and divide the sampling time by the cycle time to obtain a reference quantity value; A first spectrum updating unit, configured to, when the reference quantity value is an integer, perform a fast Fourier transform on the discrete data sequence to obtain a target spectrum, and update the spectrum values corresponding to the target suppression frequency points and their associated mirror frequency points in the target spectrum to first target spectrum values corresponding to the nearest frequency points located on the right side of the target suppression frequency points; A first waveform determining unit, configured to perform an inverse fast Fourier transform on the updated target spectrum to obtain a first target waveform.

10. An electronic device, the device comprising: One or more processors; A storage device, configured to store one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the digital signal filtering method according to any one of claims 1-8.

11. A non-volatile storage medium storing computer-executable instructions, which are configured to execute the digital signal filtering method according to any one of claims 1-8 when executed by a computer processor.

Citation Information

Patent Citations

  • Digital down-conversion implementation method and storage medium

    CN111800091A

  • Hydroelectric generating set state monitoring waveform signal digital filtering method based on frequency domain characteristics

    CN114548163A

  • Polarization space-time anti-interference distortion compensation method and device based on homomorphic filtering

    CN117008157A

  • Signal sampling rate conversion method and device, electronic equipment and storage medium

    CN118449522A

  • Low-frequency noise data processing method and device, electronic equipment and vehicle

    CN119164479A