Digital filter, parameter configuration method and chip
By combining multi-order sinc filters and multi-order comb filters, and configuring the filter order, downsampling rate, and weighting coefficients, the problem of insufficient flexibility of sinc filters in balancing high-frequency roll-off rate and dynamic response speed is solved, enabling flexible processing of coded signals and adapting to diverse application scenarios.
Patent Information
- Application Number
- CN202511617073.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-10
AI Technical Summary
Existing sinc filters lack flexibility in balancing high-frequency roll-off rate and dynamic response speed, making them unable to adapt to changing application scenarios, especially with limited filtering capabilities at specific frequency points.
By combining multi-order sinc filters and multi-order comb filters, and by configuring the filter order, downsampling rate, and weighting coefficients, flexible processing of the coded signal can be achieved, and specific frequency signals can be filtered out.
It improves the filter's balance between high-frequency roll-off rate and dynamic response speed, enhances its adaptability to different application scenarios, and meets more general application needs.
Smart Images

Figure CN121508490A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power management chips, in particular to a digital filter, a parameter configuration method and a chip. BACKGROUND
[0002] In the field of signal demodulation and modulation of a Delta-Sigma analog to digital converter (ADC), the encoding signal generated by the Delta-Sigma modulator is a bit stream, that is, a digital signal composed of 0 and 1, and the digital circuit needs to perform down-sampling and filtering processing on the bit stream to obtain the data after decoding of the ADC. In this application, a sinc filter is usually used as a component for down-sampling and filtering processing. For some special application scenarios, for example, it is necessary to filter out specific frequency components in the input signal, and a sinc filter is also needed to achieve this.
[0003] The sinc filter is a filter structure composed of an integrator, a down-sampling circuit and a differentiator. With the increase of the order of the sinc filter, the corresponding high-frequency roll-off rate will be higher, but the corresponding delay will also increase, resulting in slower dynamic response.
[0004] The related technology provides a filter with faster dynamic response characteristics or higher high-frequency roll-off rate, but there is no zero gain characteristic at some frequency points, so the filtering ability of these frequency points is limited. Therefore, the filter product can only adapt to special application scenarios where the input signal does not include frequency points that cannot be filtered out, and its flexibility is poor, and it cannot adapt to more general application scenarios. SUMMARY
[0005] The present application provides a digital filter, a parameter configuration method and a chip to provide higher flexibility.
[0006] In a first aspect, the present application provides a digital filter, which comprises: a multi-order sinc filter and a multi-order comb filter connected in series; the order N of the multi-order sinc filter, the down-sampling rate of the multi-order sinc filter, the order b of the multi-order comb filter and a plurality of weight coefficients corresponding to the multi-order comb filter are determined and configured in advance according to the frequency to be filtered out; wherein the multi-order comb filter comprises one first signal processing unit, b second signal processing units and an accumulator, the plurality of weight coefficients comprise a first weight coefficient and b second weight coefficients, the first weight coefficient corresponds to the first signal processing unit, and the b second weight coefficients correspond to the b second signal processing units one by one. The multi-order sinc filter is used to receive the encoded signal and sample the encoded signal N times according to the preset downsampling rate to obtain N sampling results. The average value is calculated for each sampling result to obtain the mean signal. The mean signal includes the average value corresponding to each of the N sampling results. The multi-order comb filter is used to process the mean signal and the first weight coefficient through the first signal processing unit to obtain a first processing result, and to delay the mean signal through the b second signal processing units and then multiply it by the corresponding second weight coefficient to obtain b second processing results. The first processing result and the b second processing results are then summed through the accumulator to obtain an output signal. The output signal is an encoded signal after filtering out the signal with the frequency to be filtered out.
[0007] In one possible design, the multi-order sinc filter includes: N integrators, a downsampling circuit, and N differentiators; The N integrators are connected in series, and the N differentiators are connected in series; the output of the Nth integrator is electrically connected to the input of the downsampling circuit, and the output of the downsampling circuit is electrically connected to the input of the first differentiator among the N differentiators. The input terminal of the first integrator among the N integrators serves as the input terminal of the multi-order sinc filter, used to input the encoded signal; the output terminal of the Nth differentiator among the N differentiators serves as the output terminal of the multi-order sinc filter, used to output the mean signal.
[0008] In one possible design, the integrator includes: an adder and a first delay unit; The first input terminal of the adder is electrically connected to the input terminal of the integrator, and the second input terminal of the adder is electrically connected to the output terminal of the first delay unit; The output of the adder is electrically connected to the input of the first delay unit and the output of the integrator, respectively.
[0009] In one possible design, the differentiator includes: a subtractor and a second delay unit; The first input terminal of the subtractor is electrically connected to the input terminal of the differentiator and the input terminal of the second delay unit, respectively, and the second input terminal of the subtractor is electrically connected to the output terminal of the second delay unit; The output of the subtractor is electrically connected to the output of the differentiator.
[0010] In one possible design, the first signal processing unit includes a first multiplier; Each of the second signal processing units includes: a delay unit and a second multiplier, wherein the output terminal of the delay unit is electrically connected to the input terminal of the second multiplier; The output of the multi-order sinc filter is electrically connected to the input of each of the delay units and the input of the first multiplier; the accumulator includes b+1 inputs. The output of the first multiplier and the outputs of each of the second multipliers are electrically connected to the b+1 inputs of the accumulator. The output of the accumulator serves as the output of the digital filter and is used to output the output signal.
[0011] Secondly, this application provides a parameter configuration method for configuring a digital filter as described in the first aspect, the method comprising: Based on the frequency to be filtered out, determine the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter. The digital filter is configured based on the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter.
[0012] In one possible design, determining the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter based on the frequency to be filtered out includes: Determine the maximum fundamental frequency based on the frequency to be filtered; The oversampling rate (OSR) is calculated based on the preset sampling frequency and the maximum fundamental frequency, wherein the preset sampling frequency is the current sampling frequency of the modulator that generates the coded signal; The order N of the multi-order sinc filter is determined according to the preset high-frequency roll-off rate. Based on the frequency to be filtered out, the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients are determined; wherein, the downsampling rate of the multi-order sinc filter is determined based on the oversampling rate OSR and the upsampling ratio m; Based on the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients, the multiple weighting coefficients corresponding to the multi-order comb filter are calculated.
[0013] In one possible design, based on the frequency to be filtered out, the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients are determined, including: The harmonic order to be filtered out is determined based on the frequency to be filtered out. The harmonic order to be filtered is converted into a target form to obtain the conversion result, wherein the target form is expressed by the formula m*k+g. b , m is the upsampling ratio, g b The offset coefficient is k, where k is an integer; Based on the conversion result, the upsampling ratio m, the order b of the multi-order comb filter, and the plurality of offset coefficients are determined.
[0014] In one possible design, calculating the multiple weighting coefficients corresponding to the multi-order comb filter based on the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients includes: A gain expression is constructed based on the relationship between the multiple weighting coefficients, the DC gain of the multi-order comb filter, the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients. Based on the determined upsampling ratio m, the order b of the multi-order comb filter, and the values of the multiple offset coefficients, the multiple weighting coefficients corresponding to the multi-order comb filter are calculated based on the gain expression.
[0015] Thirdly, this application provides a chip comprising: a digital filter as described in the first aspect.
[0016] In this embodiment, the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter are predetermined and configured based on the frequency to be filtered. Users can determine the parameters of the digital filter based on the frequency to be filtered in the current application scenario according to different application scenarios, so as to flexibly configure the parameters of the digital filter. This provides high flexibility while taking into account the high-frequency roll-off rate and dynamic response speed, so as to adapt to the needs of more general application scenarios. In addition, the average value of the received coded signal is repeatedly calculated N times by the multi-order sinc filter to obtain the mean signal. Then, the mean signal is first delayed by the multi-order comb filter, and finally a weighted summation operation is performed to achieve downsampling and filtering of the coded signal, thereby filtering out the signal of the frequency to be filtered in the coded signal. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0018] Figure 1A schematic diagram of a sinc filter structure is provided for related technologies; Figure 2(a) shows the amplitude-frequency curve of a first-order sinc filter sinc1 provided by related technologies; Figure 2(b) shows the amplitude-frequency curve of a second-order sinc filter sinc2 provided by related technologies; Figure 2(c) shows the amplitude-frequency curve of a third-order sinc filter sinc3 provided by related technologies; Figure 3 An amplitude-frequency curve of a sincfast filter is provided for related technologies; Figure 4 This is a schematic diagram of the structure of a digital filter provided in an embodiment of this application; Figure 5 The amplitude-frequency curves corresponding to a digital filter composed of sinc filters and comb filters of different orders are provided in the embodiments of this application. Figure 6 This is a schematic diagram of a comb filter signal processing method provided in an embodiment of this application; Figure 7 A flowchart of a parameter configuration method provided in an embodiment of this application; Figure 8 The amplitude-frequency curves of a digital filter corresponding to frequencies of 50Hz and 60Hz are provided for embodiments of this application. Detailed Implementation
[0019] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c alone can mean: a alone, b alone, c alone, a combination of a and b, a combination of a and c, a combination of b and c, or a, b, and c, where a, b, and c can be single or multiple. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0020] The terms “center,” “longitudinal,” “lateral,” “up,” “down,” “left,” “right,” “front,” and “rear,” etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0021] The terms "connected" and "connected" should be interpreted broadly. For example, in circuit structures, "connected" or "connected" can refer not only to physical connections but also to electrical or signal connections. This could be a direct connection (physical connection) or an indirect connection via at least one intermediate component, as long as the circuit is connected. It could also refer to the internal connection between two components. Similarly, a signal connection can refer to a connection via a circuit or a medium, such as radio waves. Those skilled in the art will understand the specific meaning of these terms in this application based on the specific circumstances.
[0022] See Figure 1 , Figure 1 A schematic diagram of a sinc filter structure is provided for related technologies, such as... Figure 1 As shown, the sinc filter includes n integrators, a downsampling module, and n differentiators. After filtering and downsampling the input digital signal, it produces the output filtered signal. Here, n is the order of the sinc filter, i.e., the number of integrators or differentiators. The downsampling rate of the downsampling module is the same as the downsampling rate of the sinc filter. Let the downsampling rate of the sinc filter be OSR0. The downsampling rate of the sinc filter means that the downsampling module updates the average value every OSR0 points. Through the downsampling processing of the downsampling module, the storage overhead of the subsequent differentiator can be reduced.
[0023] The related technology provides a filter that includes three sinc filters of different orders for users to flexibly configure: a first-order sinc filter sinc1, a second-order sinc filter sinc2, and a third-order sinc filter sinc3.
[0024] Taking a first-order sinc filter sinc1 as an example, let's set the downsampling rate of the first-order sinc filter sinc1 to OSR0, and OSR0 equals 32. The sampling frequency f of the first-order sinc filter sinc1 is... s0 If the frequency is equal to 10MHz, then the first-order sinc filter sinc1 is based on a sampling frequency f of 10MHz. s0 Calculate the average value of 32 points. At this time, the sampling period T s0 =1 / f s0=100ns, then the fundamental frequency f of the first-order sinc filter sinc1 is... 10 =10MHz / 32=312.5KHz.
[0025] See Figures 2(a), 2(b), and 2(c). Figure 2(a) shows the amplitude-frequency curve of a first-order sinc filter sinc1 provided by the related technology. Figure 2(b) shows the amplitude-frequency curve of a second-order sinc filter sinc2 provided by the related technology. Figure 2(c) shows the amplitude-frequency curve of a third-order sinc filter sinc3 provided by the related technology.
[0026] Referring to Figures 2(a), 2(b), and 2(c), comparing the envelopes of the amplitude-frequency curves in the figures, it can be seen that the higher the order of the sinc filter, the higher the corresponding high-frequency roll-off rate. The high-frequency roll-off rate is used to characterize the speed of signal attenuation. For example, the envelope of the curve in Figure 2(c) attenuates faster than the envelope of the curve in Figure 2(b), so the high-frequency roll-off rate of the third-order sinc filter sinc3 is higher than that of the second-order sinc filter sinc2. Similarly, the envelope of the curve in Figure 2(b) attenuates faster than the envelope of the curve in Figure 2(a), so the high-frequency roll-off rate of the second-order sinc filter sinc2 is higher than that of the first-order sinc filter sinc1.
[0027] On the other hand, the higher the order of the sinc filter, the more integrators and differentiators there will be. The increase in the number of integrators and differentiators will lead to an increase in delay, which in turn will slow down the dynamic response.
[0028] The Z-domain transfer functions of the first-order sinc filter sinc1, the second-order sinc filter sinc2, and the third-order sinc filter sinc3 can be described by the following formula (1), where the Z-domain is the complex frequency domain after the discrete signal is transformed from the time domain by the Z-transform, and the transfer function in this application refers to the Z-domain transfer function: (1) In formula (1), OSR0 is the downsampling rate of the first-order sinc filter sinc1, the second-order sinc filter sinc2, or the third-order sinc filter sinc3, and n is the order of the sinc filter, which can be 1, 2, or 3. When n is 1, formula (1) represents the Z-domain transfer function of the first-order sinc filter sinc1; when n is 2, formula (1) represents the Z-domain transfer function of the second-order sinc filter sinc2; and when n is 3, formula (1) represents the Z-domain transfer function of the third-order sinc filter sinc3.
[0029] In addition, the related technology also provides a sincfast filter. Compared with the sinc filter mentioned above, the sincfast filter reduces the downsampling rate from OSR0 to OSR0 / 4, shortening the delay time and making the dynamic response faster. However, the sincfast filter reduces the downsampling rate, which means that the frequency points where the gain is 0 when the downsampling rate is OSR0 will not have a gain of 0 when the downsampling rate is reduced to OSR0 / 4, thus causing the gain to rebound. In order to compensate for the gain rebound problem caused by the reduction of the downsampling rate, the sincfast filter provided by the related technology also adds a comb filter to suppress the gain at some integer frequency points and their vicinity. The transfer function of the sincfast filter can be described by the following formula (2): (2) Since the sincfast filter reduces the downsampling rate from OSR0 to OSR0 / 4 compared to the sinc filter described above, OSR0 is replaced with OSR0 / 4 in formula (2) compared to formula (1). Specifically, in formula (2)... This is the transfer function corresponding to the comb filter section.
[0030] Comparing formulas (1) and (2), since in formula (2) If the order is 2, then the sincfast filter provided by the related technology has the same high-frequency roll-off rate as the second-order sinc filter sinc2. On the other hand, referring to formula (2), the total delay of the sincfast filter provided by the related technology is... Partial delay and The sum of partial delays, of which, The partial delay is OSR0 / 2. If the partial delay is OSR0 / 2, then the total delay of the sincfast filter provided by the related technology is 1 times OSR0. Therefore, the sincfast filter provided by the related technology has the same dynamic response as the first-order sinc filter sinc1.
[0031] See Figure 3 , Figure 3 The amplitude-frequency curve of a sincfast filter provided for related technologies, such as Figure 3 As shown, the sincfast filter has notch characteristics at frequencies of 312.5 kHz, 937.5 kHz, and 1562.5 kHz, which makes the gain of the sincfast filter zero at these frequencies, thus filtering out signals at these frequencies.
[0032] Referring to Figures 2(a), 2(b), and 2(c), the first-order sinc filter sinc1, the second-order sinc filter sinc2, and the third-order sinc filter sinc3 all exhibit notch characteristics at the frequency points of 312.5 kHz, 625 kHz, 937.5 kHz, and 1562.5 kHz, making the gain of the sinc filter zero at these frequency points, thus filtering out signals at these frequency points.
[0033] Will Figure 3 A comparison with Figures 2(a), 2(b), and 2(c) reveals that the sincfast filter provided by the related technology lacks notch characteristics at the 625kHz frequency point, resulting in a non-zero gain at this frequency and an inability to filter out signals at that point. Compared to the first-order sinc filter sinc1 and the second-order sinc filter sinc2 mentioned above, the sincfast filter provided by the related technology has limited filtering capability at the 625kHz frequency point.
[0034] If the input signal in the application scenario does not include signals at or near the 625kHz frequency point, the aforementioned Sincfast filter can be used. In this case, even though the filtering capability of the Sincfast filter is limited at the 625kHz frequency point, it still possesses fast dynamic response characteristics and a high high-frequency roll-off rate. However, in general, users' application scenarios are not fixed, and it is uncertain whether their input signal includes signals at or near the 625kHz frequency point. Therefore, the Sincfast filter provided by the aforementioned technologies has poor flexibility and cannot adapt to more common application scenario requirements.
[0035] In summary, the filters provided by related technologies include sinc filters of different orders, namely, first-order sinc filter sinc1, second-order sinc filter sinc2, third-order sinc filter sinc3, and sincfast filter. Different orders of sinc filters can provide different high-frequency roll-off rates and dynamic response speeds depending on the order chosen. Although the sincfast filter does not have a zero-gain characteristic at the frequency point of 312.5kHz*(4K+2), limiting its filtering capability (where K is an integer, and when K is 0, the frequency point is 625kHz), it possesses the same high-frequency roll-off rate as the second-order sinc filter sinc2 and the same dynamic response as the first-order sinc filter sinc1. The sincfast filter is only suitable for special application scenarios where the input signal does not include frequencies that cannot be filtered out. It can improve the high-frequency roll-off rate and dynamic response speed under specific harmonic frequency distributions, but its flexibility is poor and it cannot adapt to more general application needs.
[0036] To improve the high-frequency roll-off rate and dynamic response speed of filters while also enhancing their application configuration flexibility, this application provides a digital filter, see [link to relevant documentation]. Figure 4 , Figure 4 A schematic diagram of the structure of a digital filter provided in an embodiment of this application is shown below. Figure 4 As shown, the digital filter 1000 may include: a multi-order sinc filter 100 and a multi-order comb filter 200 connected in series; the order N of the multi-order sinc filter 100, the downsampling rate of the multi-order sinc filter 100, the order b of the multi-order comb filter 200, and the multiple weighting coefficients corresponding to the multi-order comb filter 200 are predetermined and configured according to the frequency to be filtered out; wherein, the multi-order comb filter 200 includes one first signal processing unit 201, b second signal processing units 202, and an accumulator 203, and the multiple weighting coefficients include the first weighting coefficient. and b second weight coefficients First weighting coefficient Corresponding to the first signal processing unit 201, b second weighting coefficients Each of the b second signal processing units 202 corresponds to one of them.
[0037] A multi-order sinc filter 100 is used to receive the encoded signal and sample the encoded signal N times according to a preset downsampling rate to obtain N sampling results. The average value is calculated for each sampling result to obtain the mean signal. The mean signal includes the average value corresponding to each of the N sampling results.
[0038] A multi-order comb filter 200 is used to process the mean signal and the first weighting coefficients through the first signal processing unit 201. The signal is processed to obtain a first processing result. Then, the mean signal is delayed by b second signal processing units 202, and then compared with the corresponding second weighting coefficients. Multiply the results to obtain b second processing results. Then, use an accumulator to sum the first processing result and the b second processing results to obtain the output signal. The output signal is the encoded signal after filtering out the frequency to be filtered out.
[0039] See Figure 4 The downsampling rate of a multi-order sinc filter can be determined based on the oversampling rate OSR and the upsampling ratio m. The downsampling rate of a multi-order sinc filter is the ratio of the oversampling rate OSR to the upsampling ratio m, i.e., OSR / m.
[0040] The input signal to the digital filter in this application is an encoded signal. The encoded signal can be a bitstream, i.e., a digital signal composed of 0s and 1s. The digital filter performs downsampling and filtering on the encoded signal to obtain the output signal. Alternatively, the encoded signal can be a real signal or a complex signal. The digital filter filters out unwanted frequency points. In one example, the encoded signal can be generated by a Delta-Sigma modulator, and after downsampling and filtering by the digital filter, the data decoded by the ADC is obtained.
[0041] The digital filters in this application include: interconnected multi-order sinc filters and multi-order comb filters. The amplitude-frequency curves corresponding to interconnected sinc filters and comb filters of different orders will be illustrated below. (See attached image) Figure 5 , Figure 5 The amplitude-frequency curves of a digital filter composed of sinc filters and comb filters of different orders are provided in the embodiments of this application.
[0042] A sinc filter can filter out specific frequency components in an input signal. This will be illustrated using a first-order sinc filter with an OSR / 4 downsampling rate as an example. (See [link to documentation]). Figure 5 A first-order sinc filter with a downsampling rate of OSR / 4 can filter out the frequency component with a harmonic order of 4k, that is, a harmonic frequency of 312.5KHz*4k, where k is an integer and 312.5KHz is the fundamental frequency. Figure 5 The "×" indicates that the frequency components of the corresponding harmonic order can be filtered out, while the "√" indicates that the frequency components of the corresponding harmonic order cannot be filtered out. For example, see Figure 5When k is 1, a first-order sinc filter with a downsampling rate of OSR / 4 can filter out frequency components with a harmonic order of 4k.
[0043] like Figure 5 As shown, when the order of the comb filter is OSR / 2, the function of the comb filter is to shift the phase of the input signal by half a fundamental frequency window before adding it to the original input signal. Therefore, the odd harmonic components and even harmonic components of the input signal can be analyzed separately.
[0044] See Figure 6 , Figure 6 This is a schematic diagram of a comb filter signal processing method provided in an embodiment of this application, as shown below. Figure 6 As shown, when the frequency of the input signal is an odd multiple of 312.5 kHz (i.e., 2k+1), shifting the input signal by half a fundamental frequency window (i.e., an integer period followed by 180 degrees) cancels it out when added to the original input signal, thus filtering out odd-order harmonic components. When the frequency of the input signal is an even multiple of 312.5 kHz (i.e., 2k), shifting it by half a fundamental frequency window plus 0 degrees (an integer period) results in a signal that is twice the original input signal when added to it, meaning even-order harmonic components cannot be filtered out. For example, see [link to example]. Figure 5 A comb filter can filter out frequency components with harmonic frequencies of 312.5kHz*(4k+1) and 312.5kHz*(4k+3), that is, frequency components with harmonic orders of (4k+1) and (4k+3) (i.e., odd harmonic components).
[0045] like Figure 5 As shown, a filter composed of a first-order sinc filter and a comb filter is used for illustration. This filter can filter out the frequency component with a harmonic frequency of 312.5KHz*4k, that is, the frequency component with a harmonic order of 4k, as well as the frequency components with harmonic frequencies of 312.5KHz*(4k+1) and 312.5KHz*(4k+3), that is, the frequency components with harmonic orders of (4k+1) and (4k+3) (i.e., odd harmonic components). It cannot filter out the frequency component with a harmonic frequency of 312.5KHz*(4k+2), that is, the frequency component with a harmonic order of (4k+2) (i.e., even harmonic components).
[0046] Similarly, such as Figure 5As shown, a filter composed of a second-order sinc filter and a comb filter is used for illustration. This filter can filter out frequency components with a harmonic frequency of 312.5KHz*4k, i.e., frequency components with a harmonic order of 4k, as well as frequency components with harmonic frequencies of 312.5KHz*(4k+1) and 312.5KHz*(4k+3), i.e., frequency components with harmonic orders of (4k+1) and (4k+3) (i.e., odd-order harmonic components). It cannot filter out frequency components with a harmonic order of 312.5KHz*(4k+2), i.e., frequency components with harmonic orders of (4k+2) (i.e., even-order harmonic components).
[0047] Based on the above description of the functions of filters composed of sinc filters and comb filters of different orders, it can be seen that a sinc filter can filter out frequency components in the input signal whose harmonic order is a multiple of the harmonic order. After adding a comb filter, it can also filter out frequency components whose harmonic order is an odd number of the harmonic order, without increasing the order of the sinc filter.
[0048] Based on the sincfast filter provided by related technologies, this application aims to improve the high-frequency roll-off rate and dynamic response speed of the filter while also enhancing its application configuration flexibility to adapt to more general application scenarios. The digital filter provided includes a multi-order sinc filter and a multi-order comb filter. The application specifies the order N of the multi-order sinc filter, the downsampling rate OSR / m of the multi-order sinc filter, the order b of the multi-order comb filter, and multiple weighting coefficients corresponding to the multi-order comb filter. All parameters are configured and provide corresponding software interfaces, allowing users to determine the frequency to be filtered according to the application scenario, determine the parameters in the digital filter based on the frequency to be filtered, and flexibly configure the digital filter through the software interface. This provides high flexibility while taking into account the high-frequency roll-off rate and dynamic response speed, so as to achieve the best digital filter performance expected by users.
[0049] For ease of description, the digital filter provided in this application is defined as an Esinc filter. The transfer function of the digital filter (i.e., the Esinc filter) provided in this application can be described by the following formula (3): (3) Among them, in formula (3) The transfer function of the corresponding multi-order sinc filter is given by N, where N is the order of the multi-order sinc filter and OSR / m is the downsampling rate of the multi-order sinc filter.
[0050] In formula (3) The transfer function of the corresponding multi-order comb filter, where b is the order of the multi-order comb filter. These are the multiple weighting coefficients corresponding to a multi-order comb filter.
[0051] In order to perform downsampling and filtering on the encoded signal, the digital filter in this application can be divided into an averaging part and a delay-weighted summation part from a mathematical processing perspective. The averaging process is performed by a multi-order sinc filter, and the delay-weighted summation process is performed by a multi-order comb filter.
[0052] Specifically, the parameters of a multi-order sinc filter include: order N, downsampling rate OSR / m, where the downsampling rate OSR / m is the ratio of the oversampling rate OSR to the upsampling ratio m.
[0053] The meaning of each of the above parameters will be explained below: The order N represents the number of times the averaging part is repeatedly calculated. For example, in an N-order filter, the order is 2, meaning the averaging part is calculated twice. Furthermore, the order N is also related to the performance of multi-order sinc filters. A higher order N corresponds to a higher high-frequency roll-off rate, which increases latency and slows down the dynamic response.
[0054] Oversampling rate (OSR) is the downsampling rate of a first-order sinc filter, used to characterize the number of sampling points per fundamental frequency period. For example, an OSR of 32 indicates that the number of sampling points per fundamental frequency period is 32.
[0055] In addition, in order to accelerate the dynamic response speed, the Esinc filter in this application needs to be upsampled based on the first-order sinc filter. The upsampling ratio is m, so that the downsampling of the multi-order sinc filter (i.e. the average value part) in the Esinc filter is OSR / m. For example, when the upsampling ratio m is equal to 4 and the oversampling rate OSR is equal to 32, the downsampling rate of the Esinc filter is OSR / m, that is, 32 / 4=8, which means that the Esinc filter updates the average value once every 8 sampling points.
[0056] The parameters of a multi-order comb filter include: the order b and multiple weighting coefficients. The order b corresponds to the number of second signal processing units, and the first weighting coefficient... Corresponding to the first signal processing unit 201, b second weighting coefficients Each of the b second signal processing units 202 corresponds one-to-one. Multiple weighting coefficients. It can be configured according to the harmonic order that needs to be filtered out in the user's application scenario, for example, Equal to 1 equal to 0 Equal to 1 It equals 0.
[0057] In addition, digital filters define two parameters: delay ratio and integer harmonic rejection ratio. The delay ratio is expressed as (N+b) / m, where N is the order of the multi-order sinc filter, b is the order of the multi-order comb filter, and m is the upsampling ratio. The delay ratio is the ratio of the total delay of the Esinc filter to the total delay of the first-order sinc filter. For example, when the order N equals 2, the order b equals 2, and the upsampling ratio m equals 4, the delay ratio is (2+2) / 4, which equals 1. See formula (2) for an example. The introduced latency ratio is 2 / 4. The partial latency ratio is 2 / 4, and the total latency ratio is 2 / 4 + 2 / 4 = 1.
[0058] The expression for the integer harmonic rejection ratio is (1+b) / m. The integer harmonic rejection ratio is the proportion of all integer frequency points with a gain of 0 to all integer frequency points in an Esinc filter. For example, if the order b of the comb filter is 2 and the upsampling ratio m is 4, then the integer harmonic rejection ratio is (1+2) / 4, which equals 3 / 4. For instance, when the filter can remove frequency components with harmonic orders of 4k, (4k+1), and (4k+3), then the proportion to all integer frequency points is 3 / 4.
[0059] In practical applications, users can determine the delay ratio and integer harmonic filtering ratio according to the actual application scenario. During the design process, if there are no requirements for the performance of a certain parameter, the performance of that parameter can be given way to other performance indicators.
[0060] A multi-order sinc filter is used to receive the encoded signal and repeatedly calculate the average value N times. Specifically, the encoded signal is first received, and then sampled N times according to a preset downsampling rate OSR / m, i.e., downsampling is performed to obtain N sampling results. The average value is calculated for each sampling result to obtain the mean signal. The mean signal includes the average values corresponding to the N sampling results.
[0061] A multi-order comb filter is used to first delay the mean signal and then perform a weighted summation operation to filter out signals of the frequencies to be filtered out. Specifically, the first signal processing unit 201 processes the mean signal and the first weighting coefficients... The signal is processed to obtain a first processing result. Then, the mean signal is delayed by b second signal processing units 202, and then compared with the corresponding second weighting coefficients. Multiply the results to obtain b second processing results. Then, use an accumulator to sum the first processing result and the b second processing results to obtain the output signal. The output signal is the encoded signal after filtering out the frequency to be filtered out.
[0062] In this embodiment, the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter are predetermined and configured based on the frequency to be filtered. Users can determine the parameters of the digital filter based on the frequency to be filtered in the current application scenario according to different application scenarios, so as to flexibly configure the parameters of the digital filter. This provides high flexibility while taking into account the high-frequency roll-off rate and dynamic response speed, so as to adapt to the needs of more general application scenarios. In addition, the average value of the received coded signal is repeatedly calculated N times by the multi-order sinc filter to obtain the mean signal. Then, the mean signal is first delayed by the multi-order comb filter, and finally a weighted summation operation is performed to achieve downsampling and filtering of the coded signal, thereby filtering out the signal of the frequency to be filtered in the coded signal.
[0063] In one possible embodiment, see Figure 4 The multi-order sinc filter 100 includes: N integrators 101, a downsampling circuit, and N differentiators 102.
[0064] N integrators are connected in series, and N differentiators are connected in series. The output of the Nth integrator is electrically connected to the input of the downsampling circuit, and the output of the downsampling circuit is electrically connected to the input of the first differentiator among the N differentiators.
[0065] The input of the first integrator among the N integrators serves as the input of the multi-order sinc filter 100, used to input the encoded signal; the output of the Nth differentiator among the N differentiators serves as the output of the multi-order sinc filter 100, used to output the mean signal.
[0066] See Figure 4 The multi-order sinc filter 100 includes an integrator, a downsampling circuit, and a differentiator. The order of the multi-order sinc filter 100 is N. Correspondingly, the number of integrators 101 is N, and the number of differentiators 102 is also N. The downsampling rate of the downsampling circuit is OSR / m.
[0067] The multi-order sinc filter 100, serving as the averaging part of the digital filter in this application, is used to receive the encoded signal. The average value of the received encoded signal is calculated N times to obtain the mean signal. Downsampling processing via the downsampling circuit reduces the storage overhead of the subsequent differentiator.
[0068] In one possible embodiment, see Figure 4 For any integrator 101, the integrator 101 may include an adder and a first delay unit.
[0069] The first input terminal of the adder is electrically connected to the input terminal of the integrator 101, and the second input terminal of the adder is electrically connected to the output terminal of the first delay unit.
[0070] The output of the adder is electrically connected to the input of the first delay unit and the output of the integrator 101, respectively.
[0071] See Figure 4 The multi-order sinc filter 100 includes N integrators 101 connected in series. Each integrator 101 may include an adder and a first delay unit. Thus, the multi-order sinc filter 100 may include N adders, namely, the first adder add1, the second adder add2, ..., the Nth adder addN. The multi-order sinc filter 100 may also include N first delay units, namely, the first first delay unit D1_1, the second first delay unit D1_2, ..., the Nth first delay unit D1_N.
[0072] In one possible embodiment, see Figure 4 For any differentiator 102, the differentiator 102 may include: a subtractor and a second delay unit.
[0073] The first input terminal of the subtractor is electrically connected to the input terminal of the differentiator 102 and the input terminal of the second delay unit, respectively, and the second input terminal of the subtractor is electrically connected to the output terminal of the second delay unit.
[0074] The output of the subtractor is electrically connected to the output of the differentiator 102.
[0075] See Figure 4 The multi-order sinc filter 100 includes N differentiators 102 connected in series. Each differentiator 102 may include a subtractor and a second delay unit. Thus, the multi-order sinc filter 100 may include N subtractors, namely, a first subtractor sub1, a second subtractor sub2, ..., an Nth subtractor subN. The multi-order sinc filter 100 may also include N second delay units, namely, a first second delay unit D2_1, a second second delay unit D2_2, ..., an Nth second delay unit D2_N.
[0076] In one possible embodiment, see Figure 4 The first signal processing unit 201 may include a first multiplier mu0.
[0077] Each of the second signal processing units 202 includes: a delay unit and a second multiplier, wherein the output terminal of the delay unit is electrically connected to the input terminal of the second multiplier.
[0078] The output of the multi-order sinc filter 100 is electrically connected to the input of each delay unit and the input of the first multiplier, respectively; the accumulator sum includes b+1 inputs.
[0079] The output terminal mu0 of the first multiplier and the output terminals of each second multiplier (i.e., the first second multiplier mu_1, the second second multiplier mu_2, ... the bth second multiplier mu_b) are electrically connected to the b+1 input terminals of the accumulator sum. The output terminal of the accumulator sum serves as the output terminal of the digital filter 1000, used to output the output signal.
[0080] See Figure 4 The multi-order comb filter 200 includes one first signal processing unit 201, b second signal processing units 202, and an accumulator sum, wherein the accumulator sum includes b+1 input terminals. For each second signal processing unit 202, which includes a delay unit and a second multiplier, the multi-order comb filter 200 may include b delay units and b second multipliers. The b delay units are: first delay unit D3_1, second delay unit D3_2, ..., b-th delay unit D3_b; the b second multipliers are: first second multiplier mu_1, second second multiplier mu_2, ..., b-th second multiplier mu_b.
[0081] Multiple weighting coefficients, including the first weighting coefficient and b second weight coefficients First weighting coefficient Corresponding to the first signal processing unit 201, b second weighting coefficients Each of the b second signal processing units 203 corresponds one-to-one, that is, the first second multiplier mu_1 corresponds to the first second weighting coefficient. Corresponding to the second multiplier mu_2 and the second weight coefficient Corresponding to... the b-th second multiplier mu_b and the b-th second weight coefficient correspond.
[0082] The output of the multi-order sinc filter is the mean signal, which is then transmitted to the input of the first multiplier mu0, the input of the first delay D3_1, the input of the second delay D3_2, ..., the input of the b-th delay D3_b. The mean signal is multiplied by the first weighting coefficient by the first multiplier mu0. The first processing result is obtained; the mean signal is delayed by the first delay unit D3_1, the second delay unit D3_2, ..., the b-th delay unit D3_b, and the delayed result is transmitted to the corresponding second multiplier. The delayed result is multiplied by the corresponding second weighting coefficient by the first second multiplier mu_1, the second second multiplier mu_2, ..., the b-th second multiplier mu_b. For example, the delayed result is multiplied by the first second weighting coefficient through the first second multiplier mu_1. The delayed result is multiplied by the second second weighting coefficient through the second second multiplier mu_2. ...The delayed result is multiplied by the b-th second weight coefficient through the b-th second multiplier mu_b. We obtain b second processing results; then, we sum the first processing result and the b second processing results using the accumulator sum to obtain the output signal.
[0083] It should be noted that the b delay units in this application correspond to different orders, that is, the first delay unit D3_1, the second delay unit D3_2, ..., the b-th delay unit D3_b have different orders, and the first delay unit D3_1 is a first-order delay unit. -1 The second delay D3_1 is a second-order delay z. -2 ...The b-th delay D3_b is the b-th order delay z. -b In specific project applications, the second-order delay z -2 It can be achieved through two first-order delays z -1 The superposition can also be achieved using a second-order delay z. -2 Similarly, for the b-order delay z... -b It can be achieved by using b first-order delays z -1 The superposition can also be achieved using b-2 first-order delays z. -1 and a second-order delay z -2 The stacking of delays is implemented by combining different orders of delays. This application does not specifically limit the combination of the b delays; users can choose the order of the delays for stacking as needed.
[0084] The structure of the digital filter in this application is designed based on a pre-designed transfer function. That is, based on the transfer function of the digital filter (i.e., the Esinc filter) provided in the above formula (3), a multi-order sinc filter and a multi-order comb filter are designed, as well as the internal structure of the multi-order sinc filter and the internal structure of the multi-order comb filter.
[0085] The parameters of the digital filter provided in this application can be flexibly configured according to the user's application scenario, namely the order N and downsampling rate OSR / m of the multi-order sinc filter, the order b of the multi-order comb filter, and multiple weighting coefficients. Both can be flexibly configured according to the harmonic orders that need to be filtered out in the user's application scenario. To this end, this application also provides a parameter configuration method, which allows users to calculate the parameters of the digital filter based on the harmonic frequencies that need to be filtered out in their application scenario, and configure the parameters of the digital filter through the corresponding software interface.
[0086] See Figure 7 , Figure 7 A flowchart of a parameter configuration method provided in an embodiment of this application is shown below. Figure 7 As shown, the method may include: S1, based on the frequency to be filtered, determine the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter.
[0087] S2, configure the digital filter based on the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter.
[0088] Digital filters typically include a software interface. After the user determines the parameters of the digital filter based on the frequencies to be filtered out in the application scenario, they configure these parameters using the software interface. Due to hardware resource limitations, all of the above parameters have configuration limits. The sampling rate OSR / m is determined based on the oversampling rate OSR and the upsampling ratio m. In this application, the upper limit for the oversampling rate OSR is 1024, the upper limit for the upsampling ratio m is 12, the upper limit for the order N of the multi-order sinc filter is 3, and the upper limit for the order b of the first-order comb filter is 11.
[0089] In this embodiment, by setting the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weight coefficients corresponding to the multi-order comb filter to be configurable, the digital filter can be flexibly configured according to different application scenarios of the user to achieve the best digital filter performance expected by the user.
[0090] In one possible embodiment, step S1 above may include: S11, determine the maximum fundamental frequency based on the frequency to be filtered.
[0091] To clearly explain how this application determines the parameters of multi-order sinc filters and multi-order comb filters based on the frequencies to be filtered out in the application scenario, the following uses a specific industrial application scenario as an example to illustrate the parameter determination process for digital filters (i.e., Esinc filters).
[0092] In power facility applications, such as power plants generating 220V AC mains power at frequencies of 50Hz or 60Hz, interference can occur at either 50Hz or 60Hz with surrounding equipment. Therefore, digital filters need to have notch filtering characteristics at both 50Hz and 60Hz to filter out signals at these frequencies, helping to suppress grid frequencies and maintain efficient system power supply suppression capabilities.
[0093] First, in this application scenario, the frequencies to be filtered are identified as 50Hz and 60Hz. Second, these two frequency points are treated as integer harmonics to determine the maximum fundamental frequency. f 1. Maximum fundamental frequency f 1 can be the greatest common divisor of the frequencies to be filtered out, i.e., the greatest common divisor of 50Hz and 60Hz, then the maximum fundamental frequency is... f 1 = 10Hz.
[0094] S12, calculate the oversampling rate OSR based on the preset sampling frequency and the maximum fundamental frequency, where the preset sampling frequency is the current sampling frequency of the modulator that generates the coded signal.
[0095] Based on oversampling rate OSR and preset sampling frequency f s and maximum fundamental frequency f The relationship is 1, i.e., OSR = f s / f 1. The oversampling rate (OSR) can be calculated. For example, the coded signal is generated using a Delta-Sigma modulator, and the fundamental frequency is... f Taking 1=10Hz as an example, if the current sampling frequency of the Delta-Sigma modulator is 10kHz, then... f s =10kHz, f s and f Substituting 1 into the formula, we get OSR = f s / f 1 = 10kHz / 10Hz = 1000.
[0096] S13, determine the order N of the multi-order sinc filter based on the preset high-frequency roll-off rate.
[0097] The preset high-frequency roll-off rate can be set according to the user's design needs. Based on the relationship between the high-frequency roll-off rate and the order N of the multi-order sinc filter: high-frequency roll-off rate = N*20dB / dec, where dB / dec is the unit of high-frequency roll-off rate, representing the attenuation per ten octave, in decibels (dB).
[0098] For example, if the preset high-frequency roll-off rate is 40dB / dec, then the order N of the multi-order sinc filter is equal to 2; if the preset high-frequency roll-off rate is 60dB / dec, then the order N of the multi-order sinc filter is equal to 3.
[0099] S14. Based on the frequency to be filtered, determine the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients; wherein, the downsampling rate of the multi-order sinc filter is determined based on the oversampling rate OSR and the upsampling ratio m.
[0100] By transforming the frequency to be filtered into a form that includes the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients, the values of the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients can be determined.
[0101] The downsampling rate of the multi-order sinc filter is the ratio of the oversampling rate (OSR) to the upsampling ratio (m). Once the values of the OSR and the upsampling ratio (m) are known, the value of the downsampling rate of the multi-order sinc filter is also determined.
[0102] S15. Calculate the multiple weighting coefficients corresponding to the multi-order comb filter based on the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients.
[0103] Based on the filtering characteristics of digital filters, setting the DC gain of the multi-order comb filter to 1 yields the first relational expression, which is related to multiple weighting coefficients of the multi-order comb filter. Setting the gain of the harmonic order to be filtered out of the multi-order comb filter to 0 yields multiple second relational expressions, each of which is related to the upsampling ratio m, the order b of the multi-order comb filter, multiple offset coefficients, and multiple weighting coefficients of the multi-order comb filter.
[0104] Based on the first relation and multiple second relations, and according to the known upsampling ratio m, the order b of the multi-order comb filter, and the values of multiple offset coefficients, the multiple weight coefficients corresponding to the multi-order comb filter can be solved.
[0105] In one possible embodiment, step S14 above includes: S141, Determine the harmonic order to be filtered based on the frequency to be filtered.
[0106] Based on the frequency to be filtered in the application scenario, we will still take 50Hz and 60Hz as examples in the above embodiments. As can be seen from the above embodiments, when the frequency to be filtered is 50Hz and 60Hz, the maximum fundamental frequency can be obtained by finding the greatest common divisor of 50Hz and 60Hz. f 1 = 10Hz.
[0107] The number of harmonics to be filtered is equal to the frequency to be filtered divided by the maximum fundamental frequency. Therefore, the number of harmonics to be filtered is equal to 50Hz and 60Hz divided by 10Hz, which means the number of harmonics to be filtered is 5 and 6. Since any sine wave signal with a frequency of 50Hz in the time domain has two frequency points in the frequency domain, ±50Hz, the number of harmonics to be filtered is ±5 and ±6.
[0108] S142, convert the harmonic order to be filtered into the target form to obtain the conversion result, where the target form is expressed by the formula m*k+g. b m is the upsampling ratio, g b is the offset coefficient, and k is an integer.
[0109] Convert the harmonic order to be filtered into the target form m*k+g b Therefore, the harmonic orders to be filtered are ±5 and ±6, which can be converted into the target form m*k+g b The resulting conversion is {6k, 6k+1, 6k+5}, which covers the frequencies to be filtered. In one example, when k is 1, 6k equals 6, meaning the harmonic order to be filtered is 6, and the frequency to be filtered is 60Hz, which can be covered. When k is -1, 6k+1 equals -5, meaning the harmonic order to be filtered is -5, and the frequency to be filtered is -50Hz, which can be covered. When k is 0, 6k+5 equals 5, meaning the harmonic order to be filtered is 5, and the frequency to be filtered is +50Hz, which can be covered.
[0110] S143, based on the conversion results, determine the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients.
[0111] Based on the target form m*k+g b The conversion results can determine the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients. In one example, based on the above steps, the harmonic orders to be filtered out are ±5 and ±6, which are converted to the target form m*k+g. bThe resulting transformation is {6k, 6k+1, 6k+5}, where the target form for 6k is 6k+g0, the target form for 6k+1 is 6k+g1, and the target form for 6k+5 is 6k+g2. By comparison, we can see that m=6, the order of the multi-order comb filter is b=2, and the multiple offset coefficients are g0=0, g1=1, and g2=5.
[0112] In one possible embodiment, step S15 above includes: S151. Based on the relationship between multiple weighting coefficients, the DC gain of the multi-order comb filter, the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients, a gain expression is constructed.
[0113] In this application, in order for the digital filter to filter out the signal of the frequency to be filtered out and achieve the filtering effect, referring to the above formula (3), the gain of the harmonic order to be filtered out of the multi-order comb filter is set to 0, and the DC gain of the multi-order comb filter is set to 1, according to multiple weighting coefficients. The DC gain, upsampling ratio m, order b of the multi-order comb filter, and multiple offset coefficients g0, g1, g2...g of the multi-order comb filter. b Based on the relationship between the parameters, a gain expression is constructed. The specific process is as follows: Assuming the DC gain of the multi-order comb filter is set to 1, the first relationship is obtained through coefficient normalization: .
[0114] Based on the harmonic order to be filtered, the gain of the harmonic order to be filtered is set to 0, i.e. This allows us to obtain multiple second relations.
[0115] Specifically, when it is necessary to filter out the m*k+g1th harmonic, let Where Ω is the fundamental angular frequency, and since there are OSR sampling points in each fundamental period, Ω can be defined as... / OSR, i.e., Ω= / OSR, since the multi-order sinc filter is downsampled, and the downsampling rate is OSR / m, then Ω = / OSR*OSR / m= / m. (This appears to be a fragment of a larger text, possibly related to a product or service.) After conversion, we can obtain: ,in, =1. (The rest of the text appears to be incomplete and requires further context.) Bring into In this process, a second relation is obtained.
[0116] Similarly, when m*k+g is needed... b When the second harmonic is present, let Where Ω is the fundamental angular frequency, and since there are OSR sampling points in each fundamental period, Ω can be defined as... / OSR, i.e., Ω= / OSR, since the multi-order sinc filter is downsampled, and the downsampling rate is OSR / m, then Ω = / OSR*OSR / m= / m. (This appears to be a fragment of a larger text, possibly related to a product or service.) After conversion, we can obtain: ,in, =1. (The rest of the text appears to be incomplete and requires further context.) Bring into In this process, a second relation is obtained.
[0117] By analogy, based on the harmonic order to be filtered out, multiple second relations can be obtained, and the gain expression can be constructed using the first relation and multiple second relations.
[0118] It is understandable that in the gain expression, the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients g0, g1, g2...g b All are known numbers, with multiple weighting coefficients. Since all variables are unknowns, the weighting coefficients corresponding to the multi-order comb filter can be calculated by solving the gain expression. .
[0119] S152, based on the determined upsampling ratio m, the order b of the multi-order comb filter, and the values of multiple offset coefficients, calculate the multiple weighting coefficients corresponding to the multi-order comb filter based on the gain expression.
[0120] The first relation and multiple second relations construct a gain expression that can be a system of equations. This is based on a determined upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients g0, g1, g2...g... b The value of the weight coefficients corresponding to the multi-order comb filter can be calculated by solving the system of equations based on the gain expression. .
[0121] The gain expression, constructed from the first relation and multiple second relations, can also be in matrix form, as shown in the following matrix:
[0122] It is understandable that, although the matrix includes an imaginary number j, when considering the positive and negative frequencies in the frequency domain symmetrically, the resulting multiple weighting coefficients will... All are real numbers.
[0123] Let's continue with the example of frequencies to be filtered out: 50Hz and 60Hz. Based on the conversion results {6k, 6k+1, 6k+5}, since the upsampling ratio m=6, the order of the multi-order comb filter is b=2, and multiple offset coefficients g0=0, g1=1, and g2=5. Substituting these values into the matrix above, we can obtain: Solving the matrix yields multiple weight coefficients, which are: =1、 = -1、 =1.
[0124] In summary, based on the frequency to be filtered and the above steps, all parameters of the digital filter in this application can be obtained, namely the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter. The digital filter is then configured based on these parameters.
[0125] Taking the frequencies to be filtered as 50Hz and 60Hz as examples, and setting the preset high-frequency roll-off rate to 40dB / dec, the order of the multi-order sinc filter is N=2. Based on the above calculation results, the upsampling ratio m=6, the order of the multi-order comb filter is b=2, and the downsampling rate OSR / m of the multi-order sinc filter is 1000 / 6. The multiple weighting coefficients are as follows: =1、 = -1、 =1. Based on the above parameters, configure the digital filter and obtain its amplitude-frequency curve, see [reference needed]. Figure 8 , Figure 8 The amplitude-frequency curves of the digital filters corresponding to the frequencies to be filtered out are shown below, such as... Figure 8 As shown, after processing by the digital filter, the 50Hz and 60Hz frequency points exhibit notch characteristics, which effectively suppresses the signal at these frequency points.
[0126] This application also provides a chip, including: a digital filter as described above.
[0127] The chip may include, but is not limited to, a power supply chip, a motor driver chip, or an audio processing chip.
[0128] This application also provides an electronic device, including: the chip as described above.
[0129] In this application, electronic devices may include, but are not limited to: chargers, tablets, smart home devices, vehicles, and wearable devices.
[0130] Finally, it should be noted that the above embodiments are merely specific implementations of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A digital filter, characterized in that, The digital filter includes a multi-order sinc filter and a multi-order comb filter connected together. The order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and multiple weighting coefficients corresponding to the multi-order comb filter are predetermined and configured according to the frequency to be filtered. The multi-order comb filter includes one first signal processing unit, b second signal processing units, and an accumulator. The multiple weighting coefficients include a first weighting coefficient and b second weighting coefficients. The first weighting coefficient corresponds to the first signal processing unit, and the b second weighting coefficients correspond one-to-one with the b second signal processing units. The multi-order sinc filter is used to receive the encoded signal and sample the encoded signal N times according to the preset downsampling rate to obtain N sampling results. The average value is calculated for each sampling result to obtain the mean signal. The mean signal includes the average value corresponding to each of the N sampling results. The multi-order comb filter is used to process the mean signal and the first weight coefficient through the first signal processing unit to obtain a first processing result, and to delay the mean signal through the b second signal processing units and then multiply it by the corresponding second weight coefficient to obtain b second processing results. The first processing result and the b second processing results are then summed through the accumulator to obtain an output signal. The output signal is an encoded signal after filtering out the signal with the frequency to be filtered out.
2. The digital filter according to claim 1, characterized in that, The multi-order sinc filter includes: N integrators, a downsampling circuit, and N differentiators; The N integrators are connected in series, and the N differentiators are connected in series; the output of the Nth integrator is electrically connected to the input of the downsampling circuit, and the output of the downsampling circuit is electrically connected to the input of the first differentiator among the N differentiators. The input terminal of the first integrator among the N integrators serves as the input terminal of the multi-order sinc filter, used to input the encoded signal; the output terminal of the Nth differentiator among the N differentiators serves as the output terminal of the multi-order sinc filter, used to output the mean signal.
3. The digital filter according to claim 2, characterized in that, The integrator includes: an adder and a first delay unit; The first input terminal of the adder is electrically connected to the input terminal of the integrator, and the second input terminal of the adder is electrically connected to the output terminal of the first delay unit; The output of the adder is electrically connected to the input of the first delay unit and the output of the integrator, respectively.
4. The digital filter according to claim 2, characterized in that, The differentiator includes: a subtractor and a second delay unit; The first input terminal of the subtractor is electrically connected to the input terminal of the differentiator and the input terminal of the second delay unit, respectively, and the second input terminal of the subtractor is electrically connected to the output terminal of the second delay unit; The output of the subtractor is electrically connected to the output of the differentiator.
5. The digital filter according to claim 1, characterized in that, The first signal processing unit includes a first multiplier; Each of the second signal processing units includes: a delay unit and a second multiplier, wherein the output terminal of the delay unit is electrically connected to the input terminal of the second multiplier; The output of the multi-order sinc filter is electrically connected to the input of each of the delay units and the input of the first multiplier; the accumulator includes b+1 inputs. The output of the first multiplier and the outputs of each of the second multipliers are electrically connected to the b+1 inputs of the accumulator. The output of the accumulator serves as the output of the digital filter and is used to output the output signal.
6. A parameter configuration method, characterized in that, The method is used to configure a digital filter as described in any one of claims 1 to 5, the method comprising: Based on the frequency to be filtered out, determine the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter. The digital filter is configured based on the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and the multiple weighting coefficients corresponding to the multi-order comb filter.
7. The parameter configuration method according to claim 6, characterized in that, The process of determining the order N of the multi-order sinc filter, the downsampling rate of the multi-order sinc filter, the order b of the multi-order comb filter, and multiple weighting coefficients corresponding to the multi-order comb filter based on the frequency to be filtered includes: Determine the maximum fundamental frequency based on the frequency to be filtered; The oversampling rate (OSR) is calculated based on the preset sampling frequency and the maximum fundamental frequency, wherein the preset sampling frequency is the current sampling frequency of the modulator that generates the coded signal; The order N of the multi-order sinc filter is determined according to the preset high-frequency roll-off rate. Based on the frequency to be filtered out, the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients are determined; wherein, the downsampling rate of the multi-order sinc filter is determined based on the oversampling rate OSR and the upsampling ratio m; Based on the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients, the multiple weighting coefficients corresponding to the multi-order comb filter are calculated.
8. The parameter configuration method according to claim 7, characterized in that, Based on the frequency to be filtered out, the upsampling ratio m, the order b of the multi-order comb filter, and multiple offset coefficients are determined, including: The harmonic order to be filtered out is determined based on the frequency to be filtered out. The harmonic order to be filtered is converted into a target form to obtain the conversion result, wherein the target form is expressed by the formula m*k+g. b , m is the upsampling ratio, g b The offset coefficient is k, where k is an integer; Based on the conversion result, the upsampling ratio m, the order b of the multi-order comb filter, and the plurality of offset coefficients are determined.
9. The parameter configuration method according to claim 7, characterized in that, The step of calculating multiple weighting coefficients corresponding to the multi-order comb filter based on the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients includes: A gain expression is constructed based on the relationship between the multiple weighting coefficients, the DC gain of the multi-order comb filter, the upsampling ratio m, the order b of the multi-order comb filter, and the multiple offset coefficients. Based on the determined upsampling ratio m, the order b of the multi-order comb filter, and the values of the multiple offset coefficients, the multiple weighting coefficients corresponding to the multi-order comb filter are calculated based on the gain expression.
10. A chip, characterized in that, include: The digital filter as described in any one of claims 1 to 5.