Filtering method and related device
By combining hardware and software filtering, the problem of low filtering accuracy in hardware filtering circuits is solved, thereby improving filtering performance and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, hardware filtering circuits have low filtering accuracy, resulting in poor filtering performance. They cannot adapt to dynamic changes in the switching frequency of power devices, increasing costs and maintenance difficulty.
A combination of hardware and software filtering is used. Hardware filtering is used to remove glitches, while software filtering dynamically adjusts the filter cutoff frequency according to the switching frequency, and the controller is used to filter out high-order harmonics.
It improves filtering accuracy, reduces the types of hardware filtering circuits, lowers storage and maintenance costs, and enhances filtering performance.
Smart Images

Figure CN121749947A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of filtering, and more specifically, to a filtering method and related apparatus. Background Technology
[0002] In power electronic systems, sampling circuits are typically used to sample signals such as voltage and current in order to detect operational reliability.
[0003] For sampling circuits of signals such as voltage and current, a hardware filter circuit is usually added after the sampling circuit to filter out glitches and high-order harmonics in the circuit and prevent them from affecting the sampling results. However, the filtering accuracy of hardware filter circuits is low, resulting in poor filtering effect. Summary of the Invention
[0004] In view of this, this application provides a filtering method and related apparatus to solve the problem of low filtering accuracy.
[0005] To solve the above-mentioned technical problems, this application adopts the following technical solution:
[0006] A filtering method, the filtering method comprising:
[0007] Receive the first signal obtained by hardware filtering an analog signal; the hardware filtering cutoff frequency used during hardware filtering is greater than a preset threshold.
[0008] After determining that the switching frequency of the power device has changed, the software filter cutoff frequency determined based on the adjusted switching frequency is obtained.
[0009] The first signal is subjected to software filtering using the software filter cutoff frequency to obtain the second signal.
[0010] Optionally, obtaining the software filter cutoff frequency determined based on the adjusted switching frequency includes:
[0011] Obtain the adjusted switching frequency;
[0012] Based on the correspondence between the switching frequency and the software filter cutoff frequency, the software filter cutoff frequency corresponding to the adjusted switching frequency is determined; in the correspondence, the software filter cutoff frequency changes dynamically with the switching frequency and is positively correlated with the switching frequency.
[0013] Optionally, the process of determining the correspondence includes:
[0014] Obtain the minimum order of the higher harmonics to be filtered out as pre-configured;
[0015] The filtering factor in the corresponding relationship is determined based on the minimum order of the higher harmonics.
[0016] The corresponding relationship is generated based on the filtering factor.
[0017] Optionally, the first signal is subjected to software filtering using the software filter cutoff frequency to obtain the second signal, including:
[0018] Obtain the intermediate signal obtained by performing AD sampling on the first signal;
[0019] Based on the software filter cutoff frequency, the intermediate signal is filtered using a pre-selected software filtering algorithm.
[0020] Optionally, acquiring the intermediate signal obtained by performing an AD sampling operation on the first signal includes:
[0021] Receive the intermediate signal obtained by the AD sampling chip performing AD sampling operation on the first signal;
[0022] Alternatively, the intermediate signal can be obtained by performing AD sampling on the first signal using the AD sampling circuit inside the controller.
[0023] A filtering device, comprising:
[0024] The signal receiving module is used to receive the first signal obtained by hardware filtering the analog signal; the hardware filtering cutoff frequency used in the hardware filtering is greater than a preset threshold.
[0025] The frequency acquisition module is used to acquire the software filter cutoff frequency determined based on the adjusted switching frequency after it is determined that the switching frequency of the power device has changed.
[0026] The software filtering module is used to perform software filtering on the first signal using the software filtering cutoff frequency to obtain the second signal.
[0027] Optionally, the frequency acquisition module includes:
[0028] The switching frequency acquisition submodule is used to acquire the adjusted switching frequency;
[0029] The frequency determination submodule is used to determine the software filter cutoff frequency corresponding to the adjusted switching frequency based on the correspondence between the switching frequency and the software filter cutoff frequency; in the correspondence, the software filter cutoff frequency changes dynamically with the switching frequency and is positively correlated with the switching frequency.
[0030] A filtering system includes a controller for performing the filtering method described above.
[0031] Optionally, it also includes:
[0032] Hardware filtering circuit;
[0033] The output terminal of the hardware filtering circuit is connected to the input terminal of the controller, and the hardware filtering cutoff frequency used by the hardware filtering circuit is greater than a preset threshold.
[0034] The hardware filtering circuit is used to perform hardware filtering on the received analog signal to obtain a first signal, and output the first signal to the controller.
[0035] Optionally, it also includes:
[0036] AD sampling chip;
[0037] The AD sampling chip is located between the hardware filtering circuit and the controller, and is used to perform AD sampling on the first signal and transmit the sampled intermediate signal to the controller.
[0038] This application provides a filtering method and related apparatus. In this application, the hardware filtering cutoff frequency used is greater than a preset threshold to achieve a filtering effect that removes glitches. Based on hardware filtering, software filtering is implemented through a controller. The software filtering cutoff frequency is determined based on the adjusted switching frequency. Therefore, a suitable software filtering cutoff frequency can be appropriately determined according to the adjustment of the switching frequency, thereby filtering out higher harmonics. In other words, this application improves filtering accuracy and thus enhances the filtering effect by combining hardware and software filtering. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0040] Figure 1 A flowchart of a filtering method provided in an embodiment of this application;
[0041] Figure 2 A schematic diagram of a filtering method provided in an embodiment of this application;
[0042] Figure 3 A schematic diagram illustrating another filtering method provided in an embodiment of this application;
[0043] Figure 4 A flowchart illustrating a method for determining the filter cutoff frequency provided in an embodiment of this application;
[0044] Figure 5A schematic diagram of a correspondence provided for an embodiment of this application;
[0045] Figure 6 A flowchart illustrating a correspondence generation method provided in this application embodiment;
[0046] Figure 7 A flowchart of a filtering method provided in an embodiment of this application;
[0047] Figure 8 This is a schematic diagram of the structure of a filtering device provided in an embodiment of this application;
[0048] Figure 9 This is a schematic diagram of the structure of a controller provided in an embodiment of this application. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] In power electronic systems, sampling circuits are typically used to sample signals such as voltage and current in order to detect operational reliability.
[0051] For sampling circuits of signals such as voltage and current, a hardware filter circuit is usually added after the sampling circuit to filter out glitches and high-order harmonics in the circuit and avoid affecting the sampling results. The cutoff frequency of the filter circuit is often designed according to the switching frequency of the power device. For example, if the switching frequency is 3kHz, in order to avoid the influence of harmonics above the third order on the sampling, the cutoff frequency of the filter circuit is designed to be 7.5kHz to filter out the influence of harmonics of 9kHz and above.
[0052] However, in actual use of hardware filtering, it was found that:
[0053] 1. To improve load capacity, the switching frequency of power devices is generally set to 1.5KHz, with a corresponding filter cutoff frequency of 3.75KHz. During high-voltage / low-voltage power grid ride-through, to improve control performance, the switching frequency of the power devices is temporarily increased to 3KHz. At this time, the corresponding third harmonic frequency increases from 4.5KHz to 9KHz. However, the hardware filter cutoff frequency remains at 3.75KHz. Since the filter cutoff frequency is close to the switching frequency, the required waveform will also be filtered out, resulting in a worse filtering effect and affecting control performance.
[0054] 2. For scenarios with high-power motor loads and synchronous modulation mode, as the motor frequency changes, the switching frequency of the power devices also changes. At this time, the cutoff frequency of the sampling circuit remains unchanged, and the filtering performance is difficult to meet the control requirements.
[0055] 3. In actual products, multiple systems (such as various energy storage systems, frequency converters, etc.) may share the same set of single boards. However, due to the difference in switching frequency, the filter cutoff frequency of the corresponding filter circuits on the single boards is different. Consequently, the hardware filter circuits need to be adjusted accordingly, which requires the production of multiple hardware filter circuits, resulting in different BOM (Bill of Materials) branches, increasing warehousing costs and subsequent maintenance costs.
[0056] As can be seen from the above, using hardware filtering methods will result in low filtering accuracy, leading to poor filtering effects.
[0057] To address the issues of low filtering accuracy and increased cost caused by the inability of the filter circuit's cutoff frequency to dynamically change with the switching frequency of power devices, this embodiment employs a combination of hardware and software filtering. For the hardware filter circuit, a larger cutoff frequency is set so that it is solely used for filtering circuit glitches and is independent of the switching frequency. The controller software adds filtering functionality, with filtering coefficients dynamically adjusting the cutoff frequency to match the switching frequency, thus meeting the filtering requirements of practical applications. Furthermore, since the software filtering adapts to different switching frequencies, fewer hardware filter circuits are needed, reducing BOM branches and lowering storage and maintenance costs.
[0058] Based on the above, one embodiment of this application provides a filtering method, in which the executing entity can be a controller, which can be an MCU (Microcontroller Unit). In specific implementations, the MCU can be a DSP (Digital Signal Processor), FPGA (Field Programmable Gate Array), ARM (Advanced RISC Machines), etc.
[0059] Reference Figure 1 A filtering method may include:
[0060] S11. Receive the first signal obtained by hardware filtering the analog signal.
[0061] In practical applications, voltage sampling can be performed using PT (Potential Transformer) sampling or high-voltage resistor sampling. Current sampling can be performed using CT (Current Transformer) sampling or sensor sampling. Other data can be obtained through corresponding sampling methods.
[0062] Reference Figure 2 and Figure 3 The signal sampled by the sampling circuit is an analog signal, which is then input to the hardware filtering circuit for hardware filtering.
[0063] This hardware filter circuit can be constructed from operational amplifiers, resistors, capacitors, and other components. Different circuit structures can achieve single-order, second-order, or higher-order filtering characteristics. In practice, to achieve the desired effect, multiple filter circuits are typically cascaded, with each stage having a different order, bandpass characteristics (low-pass, high-pass, bandpass), and cutoff frequency.
[0064] It should be noted that the hardware filter circuit can use different stages and orders without affecting the function of this filter system.
[0065] In addition, in specific implementations, the hardware circuit can also be equipped with an amplification function. When the filtering system is applied to low signal-to-noise ratio (SNR) applications, it can improve the SNR of the signal and avoid distortion of the effective signal when processing low SNR signals, so that the subsequent processor can process the signal more accurately.
[0066] In a hardware filter circuit, a cutoff frequency point is set, namely the hardware cutoff frequency. Since the hardware filter circuit is implemented through electronic components, the structure of the hardware filter circuit is fixed after it is completed, so that the hardware filter cutoff frequency used during hardware filtering remains unchanged.
[0067] In this embodiment, a hardware filtering circuit is used to filter out glitches, and a software filter is used to filter out high-order harmonics. Since glitches generally have a high frequency, in this embodiment, the hardware filter cutoff frequency used for hardware filtering is set to be greater than a preset threshold. The preset threshold is configured according to the actual situation. For example, if the preset threshold is configured to 50KHz, the hardware filter cutoff frequency can be 60KHz, 70KHz, or 80KHz, etc.
[0068] After the hardware filtering circuit performs hardware filtering on the analog signal, the hardware-filtered analog signal is obtained, which is referred to as the first signal in this embodiment.
[0069] like Figure 2As shown, the first signal can be input to an AD (Analog to Digital) sampling chip for AD sampling operation to obtain a digital signal that the controller can recognize.
[0070] In addition, such as Figure 3 As shown, the first signal can also be directly input into the controller, and AD sampling operation is performed through the built-in AD sampling circuit in the controller to obtain a digital signal that the controller can recognize.
[0071] S12. After determining that the switching frequency of the power device has changed, obtain the software filter cutoff frequency determined based on the adjusted switching frequency.
[0072] In this embodiment, the controller can dynamically adjust the switching frequency of the power devices according to the actual operating conditions. For example, the switching frequency of the power devices is generally set to 1.5 kHz. During high-voltage / low-voltage ride-through of the power grid, the controller will temporarily increase the switching frequency of the power devices to 3 kHz to improve control performance. In addition, for scenarios with high-power motor loads and using synchronous modulation mode, the controller needs to adjust the switching frequency of the power devices accordingly as the motor frequency changes.
[0073] If the switching frequency of the power devices used in the controller changes during operation, the adjusted switching frequency can be obtained. For example, if the switching frequency of the power devices is adjusted from 1.5kHz to 3kHz, the adjusted switching frequency is 3kHz. A new software filter cutoff frequency is then determined based on 3kHz. Because the switching frequency changes, the software filter cutoff frequency will also change.
[0074] S13. The first signal is subjected to software filtering operation using the software filtering cutoff frequency to obtain the second signal.
[0075] Specifically, after obtaining the software filter cutoff frequency through step S12, the first signal obtained after hardware filtering can be subjected to software filtering. Generally, software filtering is used to filter out higher harmonics, such as filtering out harmonics above the 3rd harmonic or the 5th harmonic.
[0076] After the first signal is filtered by software, the second signal is obtained. The second signal is a digital signal, which can be used for subsequent data analysis operations.
[0077] If the second signal is a current signal, it can be used to analyze whether there are abnormal current phenomena such as overcurrent. Similarly, if the second signal is a voltage signal, it can be used to analyze whether there are abnormal phenomena such as excessively low or high voltage. Furthermore, frequency values can be calculated based on the current and voltage signals to analyze whether there are low-frequency or high-frequency phenomena.
[0078] In this embodiment, the hardware filtering cutoff frequency used in hardware filtering is greater than a preset threshold, achieving a filtering effect that removes glitches. Based on hardware filtering, software filtering is implemented through a controller, and the software filtering cutoff frequency is determined based on the adjusted switching frequency. This allows for the appropriate software filtering cutoff frequency to be determined according to the adjustment of the switching frequency, thereby filtering out higher harmonics. In other words, this application improves filtering accuracy and thus enhances filtering effect by combining hardware and software filtering.
[0079] The above embodiments mentioned determining the software filter cutoff frequency. The specific implementation of "obtaining the software filter cutoff frequency determined based on the adjusted switching frequency" will now be described. (Refer to...) Figure 4 It can include:
[0080] S21. Obtain the adjusted switching frequency.
[0081] After the controller adjusts the switching frequency according to the actual operation, the controller can obtain the adjusted switching frequency.
[0082] S22. Based on the correspondence between the switching frequency and the software filter cutoff frequency, determine the software filter cutoff frequency corresponding to the adjusted switching frequency.
[0083] In practical applications, the correspondence between the switching frequency and the software filter cutoff frequency can be pre-configured. This correspondence can be as follows: Figure 5 As shown, the horizontal axis represents the switching frequency, and the vertical axis represents the filter cutoff frequency. In this embodiment, the filter cutoff frequency is the software filter cutoff frequency.
[0084] Figure 5 In the aforementioned correspondence, the software filter cutoff frequency dynamically changes in accordance with the switching frequency.
[0085] In practical implementation, the higher the switching frequency, the higher the frequency of its higher harmonics, and the higher the set software filter cutoff frequency. Therefore, the software filter cutoff frequency is positively correlated with the switching frequency. For example, if the filter cutoff frequency is represented by y and the switching frequency by x, then y = kx.
[0086] Where k is the filtering factor. In practical applications, determining the value of k allows us to determine the correspondence between the software filter cutoff frequency and the switching frequency.
[0087] In another implementation of this application, refer to Figure 6 The process of determining the correspondence includes:
[0088] S31. Obtain the minimum order of the high-order harmonics to be filtered out as pre-configured.
[0089] In practical applications, since software filtering is used to remove higher harmonics, the value of k in this embodiment is related to the order of the higher harmonics to be filtered. In this embodiment, the order of the higher harmonics can be, for example, the 3rd, 5th, or 7th order. If the goal is to filter out harmonics of the 3rd order or higher, the minimum order of the higher harmonics is 3rd; if the goal is to filter out harmonics of the 5th order or higher, the minimum order of the higher harmonics is 5th.
[0090] S32. Based on the minimum order of the higher harmonics, determine the filtering factor in the correspondence.
[0091] Specifically, since the 3rd harmonic is three times the switching frequency and the 5th harmonic is five times the switching frequency, in general, kx represents k times the switching frequency. Therefore, in order to filter harmonics with a minimum order of n (n is 3rd, 5th, 7th, etc.), k should be less than n and close to n.
[0092] In practical applications, k can be set to nm. Experimental studies have shown that m is a value less than 1, such as m = 0.3, 0.5, 0.7, etc.
[0093] For example, if the goal is to filter out harmonics of the 3rd order and above, k can be set to 2.5. If the goal is to filter out harmonics of the 5th order and above, k can be set to 4.5.
[0094] S33. Generate the corresponding relationship based on the filtering factor.
[0095] In this embodiment, after determining the filtering factor k, the corresponding relationship y=kx can be obtained, such as y=2.5x. When the switching frequency is 1.5KHz, the filter cutoff frequency is 3.75KHz, and when the switching frequency is 3KHz, the filter cutoff frequency is 7.5KHz.
[0096] In another implementation of this application, the correspondence can also be set as y=kx+b, where b is a filtering parameter. b can be configured according to actual conditions, such as 0.2, 0.3, etc. In this embodiment, b is set to ensure the adjustability of the filter and to perform adaptive filtering adjustments based on user needs.
[0097] In this embodiment, the filtering factor in the correspondence is determined based on the minimum order of the higher harmonics to be filtered out, so that the determined correspondence can be adaptively adjusted according to the higher harmonics to be filtered out, thereby improving the accuracy of the correspondence determination and effectively filtering out higher harmonics.
[0098] In another implementation of this application, when performing software filtering on the first signal using the software filter cutoff frequency to obtain the second signal, refer to... Figure 7 It may include the following steps:
[0099] S41. Obtain the intermediate signal obtained by performing AD sampling on the first signal.
[0100] In practical applications, an AD sampling chip independent of the hardware filtering circuit and controller can be used to perform AD sampling on the first signal to obtain the intermediate signal, such as... Figure 2 As shown, the output of the hardware filtering circuit is connected to the input of the AD sampling chip, and the output of the AD sampling chip is connected to the input of the controller through digital communication. Thus, the intermediate signal output by the AD sampling chip is transmitted to the controller through digital communication.
[0101] In addition, such as Figure 3 As shown, the first signal can also be transmitted to the AD sampling circuit of the controller by a hardware filtering circuit, and the first signal can be sampled by the AD sampling circuit inside the controller to obtain an intermediate signal.
[0102] In practical applications, if modifications to the controller are permissible, the AD sampling circuit can be integrated into the controller. If modifications to the controller are not permitted, a separate AD sampling chip can be used, depending on the specific configuration.
[0103] S42. Based on the software filter cutoff frequency, the intermediate signal is filtered using a pre-selected software filtering algorithm.
[0104] In this embodiment, the software filtering algorithm can be such as first-order filtering, sliding filtering, or other filtering algorithms.
[0105] like Figure 2 As shown, the software filtering algorithm requires the configuration of the software filtering cutoff frequency. Therefore, inside the controller, when the switching frequency is adjusted, the software filtering cutoff frequency can be determined based on the switching frequency, and the software filtering cutoff frequency of the software filtering algorithm can be configured online so that the algorithm can use the software filtering cutoff frequency to perform filtering operations.
[0106] For example, to improve load capacity, the switching frequency of power devices is generally set to 1.5kHz, and the corresponding filter cutoff frequency is 3.75kHz. During high-voltage / low-voltage ride-through of the power grid, in order to improve control performance, the switching frequency of the power devices will be temporarily increased to 3kHz. At this time, the corresponding third harmonic frequency increases from 4.5kHz to 9kHz. The cutoff frequency of the software filter can be set to 7.5kHz to filter out higher harmonics of 9kHz and above. Figure 3 The software filtering implementation method is similar.
[0107] To enable those skilled in the art to better understand the hardware filtering and software filtering in this application, examples are provided below.
[0108] Taking the dynamic switching frequency between 3kHz and 1.5kHz as an example, the hardware filter's cutoff frequency is designed to be 80kHz to filter out glitches. This cutoff frequency is much higher than the switching frequency, so its harmonic impact on the switching frequency level is negligible. After hardware filtering, the signal is acquired by the controller (DSP / ARM / FPGA, etc.) through an AD sampling chip or the controller's built-in AD sampling circuit. A software filter is then used in the controller to remove harmonics from the signal.
[0109] The software filter can choose to use first-order filtering, sliding filtering, or other filtering algorithms. Based on the actual switching frequency during operation, the filter cutoff frequency is adjusted in real time, and the filter coefficients are configured online to ensure filtering performance.
[0110] As can be seen from the above, the cutoff frequency of hardware filtering is greater than that of software filtering. Therefore, hardware filtering uses a high cutoff frequency, while software filtering uses a low cutoff frequency.
[0111] Additionally, taking an adjustment of the switching frequency between 1.5kHz and 3kHz, and a cutoff frequency set to 2.5 times the switching frequency, as an example, the MCU adjustment method is as follows: Figure 5 As shown. When the switching frequency is 1.5kHz, the filter cutoff frequency is 3.75kHz, and when the switching frequency is 3kHz, the filter cutoff frequency is 7.5kHz.
[0112] In this embodiment, during system operation, when the switching frequency is dynamically adjusted, it can be ensured that the filter cutoff frequency is positively correlated with the switching frequency, and the sampling circuit can effectively eliminate the influence and improve the control performance.
[0113] In addition, using the embodiments of this application, the filtering frequency of the hardware filtering circuit is fixed, and different software filtering cutoff frequencies can be configured by software to suit different switching frequencies, thereby reducing the types of hardware filtering circuits, maintaining the uniformity of the single-board hardware BOM, and reducing the number of single boards and storage and maintenance costs.
[0114] Another implementation of this application provides a filtering device, including:
[0115] Signal receiving module 11 is used to receive a first signal obtained by hardware filtering an analog signal; the hardware filtering cutoff frequency used during hardware filtering is greater than a preset threshold.
[0116] The frequency acquisition module 12 is used to acquire the software filter cutoff frequency determined based on the adjusted switching frequency after it is determined that the switching frequency of the power device has changed.
[0117] The software filtering module 13 is used to perform software filtering on the first signal using the software filtering cutoff frequency to obtain the second signal.
[0118] In one implementation, the frequency acquisition module includes:
[0119] The switching frequency acquisition submodule is used to acquire the adjusted switching frequency;
[0120] The frequency determination submodule is used to determine the software filter cutoff frequency corresponding to the adjusted switching frequency based on the correspondence between the switching frequency and the software filter cutoff frequency; in the correspondence, the software filter cutoff frequency changes dynamically with the switching frequency and is positively correlated with the switching frequency.
[0121] In one implementation, the module further includes a correspondence determination module, which includes:
[0122] The frequency acquisition submodule is used to obtain the minimum frequency of the pre-configured higher harmonics to be filtered out;
[0123] The multiple determination submodule is used to determine the filtering multiple in the corresponding relationship based on the minimum order of the higher harmonics;
[0124] The relationship generation submodule is used to generate the corresponding relationship based on the filtering factor.
[0125] In one implementation, the software filtering module 13 includes:
[0126] The signal acquisition submodule is used to acquire the intermediate signal obtained by performing AD sampling on the first signal;
[0127] The filtering submodule is used to filter the intermediate signal based on the software filtering cutoff frequency and using a pre-selected software filtering algorithm.
[0128] In one implementation, the signal acquisition submodule is specifically used for:
[0129] Receive the intermediate signal obtained by the AD sampling chip performing AD sampling operation on the first signal;
[0130] Alternatively, the intermediate signal can be obtained by performing AD sampling on the first signal using the AD sampling circuit inside the controller.
[0131] In this embodiment, the hardware filtering cutoff frequency used in hardware filtering is greater than a preset threshold, achieving a filtering effect that removes glitches. Based on hardware filtering, software filtering is implemented through a controller, and the software filtering cutoff frequency is determined based on the adjusted switching frequency. This allows for the appropriate software filtering cutoff frequency to be determined adaptively according to the adjustment of the switching frequency, thereby filtering out higher harmonics. In other words, this embodiment improves filtering accuracy and thus enhances the filtering effect by combining hardware and software filtering.
[0132] It should be noted that the working process of each module and sub-module in this embodiment is described in the corresponding descriptions in the above embodiments, and will not be repeated here.
[0133] In another implementation of this application, a filtering system is provided, including a controller for performing the filtering method described above.
[0134] Specifically, the controller structure can be as follows: Figure 9 As shown. Reference Figure 9 The diagram illustrates a suitable structural schematic for implementing the controller in the embodiments of this application. The controller in the embodiments of this application may include, but is not limited to, fixed terminals such as MCUs, mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 9 The controller shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0135] like Figure 9 As shown, the controller may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the controller is powered on, the RAM 603 also stores various programs and data required for controller operation. The processing device 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0136] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 608 including, for example, memory card, hard disk, etc.; and communication devices 609. Communication device 609 allows the controller to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 A controller with various devices is shown; however, it should be understood that implementation or possession of all the devices shown is not required. More or fewer devices may be implemented alternatively.
[0137] In another implementation of this application, the filtering system further includes:
[0138] Hardware filtering circuit;
[0139] The output terminal of the hardware filtering circuit is connected to the input terminal of the controller, and the hardware filtering cutoff frequency used by the hardware filtering circuit is greater than a preset threshold.
[0140] The hardware filtering circuit is used to perform hardware filtering on the received analog signal to obtain a first signal, and output the first signal to the controller.
[0141] In another implementation of this application, the filtering system further includes:
[0142] AD sampling chip;
[0143] The AD sampling chip is located between the hardware filtering circuit and the controller, and is used to perform AD sampling on the first signal and transmit the sampled intermediate signal to the controller.
[0144] The connection relationship and specific interaction process between the hardware filtering circuit, the AD sampling chip, and the controller can be found in [reference needed]. Figure 2 And the corresponding explanations above.
[0145] In this embodiment, the hardware filtering cutoff frequency used in hardware filtering is greater than a preset threshold, achieving a filtering effect that removes glitches. Based on hardware filtering, software filtering is implemented through a controller, and the software filtering cutoff frequency is determined based on the adjusted switching frequency. This allows for the appropriate software filtering cutoff frequency to be determined adaptively according to the adjustment of the switching frequency, thereby filtering out higher harmonics. In other words, this embodiment improves filtering accuracy and thus enhances the filtering effect by combining hardware and software filtering.
[0146] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the filtering methods provided in this application.
[0147] This application also provides a computer-readable storage cutoff, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the filtering methods provided in this application.
[0148] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A filtering method, characterized in that, The filtering method includes: Receive the first signal obtained by hardware filtering an analog signal; the hardware filtering cutoff frequency used during hardware filtering is greater than a preset threshold. After determining that the switching frequency of the power device has changed, the software filter cutoff frequency determined based on the adjusted switching frequency is obtained. The first signal is subjected to software filtering using the software filter cutoff frequency to obtain the second signal.
2. The filtering method according to claim 1, characterized in that, Obtain the software filter cutoff frequency determined based on the adjusted switching frequency, including: Obtain the adjusted switching frequency; Based on the correspondence between the switching frequency and the software filter cutoff frequency, the software filter cutoff frequency corresponding to the adjusted switching frequency is determined; in the correspondence, the software filter cutoff frequency changes dynamically with the switching frequency and is positively correlated with the switching frequency.
3. The filtering method according to claim 2, characterized in that, The process of determining the correspondence includes: Obtain the minimum order of the higher harmonics to be filtered out as pre-configured; The filtering factor in the corresponding relationship is determined based on the minimum order of the higher harmonics. The corresponding relationship is generated based on the filtering factor.
4. The filtering method according to claim 1, characterized in that, The first signal is subjected to software filtering using the software filter cutoff frequency to obtain the second signal, including: Obtain the intermediate signal obtained by performing AD sampling on the first signal; Based on the software filter cutoff frequency, the intermediate signal is filtered using a pre-selected software filtering algorithm.
5. The filtering method according to claim 4, characterized in that, Acquiring the intermediate signal obtained by performing an AD sampling operation on the first signal includes: Receive the intermediate signal obtained by the AD sampling chip performing AD sampling operation on the first signal; Alternatively, the intermediate signal can be obtained by performing AD sampling on the first signal using the AD sampling circuit inside the controller.
6. A filtering device, characterized in that, include: The signal receiving module is used to receive the first signal obtained by performing hardware filtering on the analog signal; The hardware filter cutoff frequency used in hardware filtering is greater than a preset threshold. The frequency acquisition module is used to acquire the software filter cutoff frequency determined based on the adjusted switching frequency after it is determined that the switching frequency of the power device has changed. The software filtering module is used to perform software filtering on the first signal using the software filtering cutoff frequency to obtain the second signal.
7. The filtering device according to claim 6, characterized in that, The frequency acquisition module includes: The switching frequency acquisition submodule is used to acquire the adjusted switching frequency; The frequency determination submodule is used to determine the software filter cutoff frequency corresponding to the adjusted switching frequency based on the correspondence between the switching frequency and the software filter cutoff frequency; in the correspondence, the software filter cutoff frequency changes dynamically with the switching frequency and is positively correlated with the switching frequency.
8. A filtering system, characterized in that, Includes a controller for performing the filtering method as described in any one of claims 1-5.
9. The filtering system according to claim 8, characterized in that, Also includes: Hardware filtering circuit; The output terminal of the hardware filtering circuit is connected to the input terminal of the controller, and the hardware filtering cutoff frequency used by the hardware filtering circuit is greater than a preset threshold. The hardware filtering circuit is used to perform hardware filtering on the received analog signal to obtain a first signal, and output the first signal to the controller.
10. The filtering system according to claim 9, characterized in that, Also includes: AD sampling chip; The AD sampling chip is located between the hardware filtering circuit and the controller, and is used to perform AD sampling on the first signal and transmit the sampled intermediate signal to the controller.