A filter design method and device, and storage medium
By using the loss function and total loss function of multiple frequency bands in the IIR digital filter design, combined with the weighted summing processing technology, the problem of low flexibility in the existing filter design method is solved, and better filter performance is achieved.
Patent Information
- Application Number
- CN202210788140.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-07-04
AI Technical Summary
The existing IIR digital filter design method has low flexibility in meeting diversified filter performance indicators, resulting in poor performance of the designed filter.
By obtaining the current filter parameters and inputting them into the loss function and total loss function corresponding to multiple frequency bands, the filter design parameters are determined based on multiple loss values and total loss values, and the frequency band performance indicators meet the design goals. This method uses weighted sum to process multiple loss functions to generate a total loss function to take into account the design goals of different frequency bands.
It improves the flexibility of filter design, so that the designed filter can meet multiple performance indicators at the same time, and improves the filter performance.
Smart Images

Figure CN115133906B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of filters, and in particular to a filter design method and device, and a storage medium. Background Art
[0002] Infinite Impulse Response (IIR) digital filters have the characteristics of low order and low delay. They can achieve better filtering performance with a lower order and are widely used in many fields of digital signal processing.
[0003] At present, the design method for IIR digital filters is carried out in the digital domain, quantifying the design target into a target system function, and then minimizing the mean square error between the designed system function and the target system function to achieve the approximation of the designed IIR digital filter to the target system function. However, the method of minimizing the mean square error to achieve the approximation of the target system function cannot meet the diverse filter performance indicators, resulting in low flexibility in filter design and poor performance of the designed filter. Summary of the invention
[0004] The embodiments of the present application provide a filter design method and device, and a storage medium, which can meet the diversification of filter performance indicators and improve the flexibility of filter design and the designed filter performance.
[0005] The technical solution of this application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a filter design method, the method comprising:
[0007] Obtaining current filter parameters; and inputting the current filter parameters into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to the filter, respectively, to obtain a plurality of loss values corresponding to the plurality of frequency bands and a total loss value;
[0008] In a case where it is determined, based on the multiple loss values and the total loss value, that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives, determining the current filter parameters as the design parameters of the filter;
[0009] The multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands;
[0010] The total loss function is a loss function designed by performing weighted summation processing on the multiple loss functions based on the multiple weighting factors corresponding to the multiple frequency bands.
[0011] In a second aspect, an embodiment of the present application provides a filter design device, the filter design device comprising:
[0012] An acquisition unit, used to acquire current filter parameters;
[0013] A loss calculation unit, used to input the current filter parameters into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to the filter, respectively, to obtain a plurality of loss values corresponding to the plurality of frequency bands and a total loss value;
[0014] A parameter design unit, configured to determine the current filter parameters as the design parameters of the filter when it is determined that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives according to the multiple loss values and the total loss value;
[0015] The multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands;
[0016] The total loss function is a loss function designed by performing weighted summation processing on the multiple loss functions based on the multiple weighting factors corresponding to the multiple frequency bands.
[0017] In a third aspect, an embodiment of the present application proposes a filter design device, which includes: a processor, a memory, and a communication bus; the processor implements the above-mentioned filter design method when executing an operating program stored in the memory.
[0018] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and the computer program implements the above-mentioned filter design method when executed by a processor.
[0019] The embodiment of the present application provides a filter design method and device, and a storage medium, the method comprising: obtaining current filter parameters; and inputting the current filter parameters into multiple loss functions corresponding to multiple frequency bands and the total loss function corresponding to the filter, respectively, to obtain multiple loss values and total loss values corresponding to the multiple frequency bands; when it is determined based on the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives, the current filter parameters are determined as the design parameters of the filter; wherein the multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands; the total loss function is a loss function designed by weighted summing the multiple loss functions based on the multiple weighting factors corresponding to the multiple frequency bands. Using the above implementation scheme, based on the design objectives corresponding to each frequency band, a corresponding loss function is designed for each frequency band, and the loss functions of the multiple frequency bands are weighted summed to generate a total loss function; then, based on the multiple loss functions corresponding to the multiple frequency bands and the total loss function, the current filter parameters can be jointly trained, taking into account the balance between the design objectives of different frequency bands, and being able to simultaneously meet different filter performance indicators, improving the flexibility of filter design, and thus making the designed filter performance better. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a filter design method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a process flow corresponding to an exemplary filter design method provided in an embodiment of the present application Figure 1 ;
[0022] Figure 3 A schematic diagram of a process flow corresponding to an exemplary filter design method provided in an embodiment of the present application Figure 2 ;
[0023] Figure 4 A schematic diagram for comparing results of multiple iterations of a filter design method provided in an embodiment of the present application;
[0024] Figure 5 A step-by-step diagram of the amplitude A and poles and zeros of an exemplary IIR low-pass digital filter provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a frequency domain amplitude response of an exemplary IIR low-pass digital filter provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of a filter design device provided in an embodiment of the present application Figure 1 ;
[0027] Figure 8 A schematic diagram of a filter design device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0028] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0030] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first\second\third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0031] The present application embodiment provides a filter design method, such as Figure 1 As shown, the method may include:
[0032] S101, obtaining current filter parameters; and inputting the current filter parameters into multiple loss functions corresponding to multiple frequency bands and a total loss function corresponding to the filter, respectively, to obtain multiple loss values corresponding to the multiple frequency bands and a total loss value.
[0033] A filter design method proposed in the embodiment of the present application is applicable to the scene of designing an IIR digital filter. Among them, the types of IIR digital filters may include low-pass filters, high-pass filters, band-pass filters, band-stop filters, comb filters, etc., which can be selected according to actual conditions, and the embodiment of the present application does not make specific limitations.
[0034] In the embodiment of the present application, the IIR digital filter includes multiple frequency bands, wherein the multiple frequency bands include at least one passband, at least one stopband, and at least one transition band. The specific number of passbands, stopbands, and transition bands is selected according to actual conditions, and the embodiment of the present application does not make specific limitations.
[0035] In the embodiments of the present application, the current filter parameters are obtained according to the number of iterations. When the number of iterations is 0, the current filter parameters are the initial filter parameters. When the number of iterations is a non-zero positive integer, the current filter parameters are calculated based on the filter parameters in the previous iteration process.
[0036] It should be noted that for any type of IIR digital filter, its system function represented by the z-transform can be expressed as formula (1):
[0037]
[0038] where z 0,m (0 < m < M) are the zeros of the system function, and z p,n (0 < n < N) are the poles of the system function. A is a constant, which can be a real number or a complex number.
[0039] Let:
[0040] z = e jω ;
[0041] (r 0,m , θ 0,m are the amplitude and phase of the zero z m in polar coordinate representation);
[0042] (r p,n , θ p,n are the amplitude and phase of the pole z n in polar coordinate representation);
[0043] Substitute z, z 0,m , z p,n into formula (1), and the frequency response of the system function can be obtained:
[0044]
[0045] It can be seen that the process of obtaining the system function of formula (2) is equivalent to the process of obtaining the parameter set [A; r 0,1 , r 0,2 , …, r 0,M ; θ 0,1 , θ 0,2 , …, θ 0,M ; r p,1 , r p,2 …, r p,N ; θ p,1 , θ p,2 , …θ p,N . Among them, A is the amplitude, and [r 0,1 , r 0,2 , …, r0,M θ 0,1 ,θ 0,2 ,…,θ 0,M ] is a set of extreme points, [r p,1 ,r p,2 …,r p,N θ p,1 ,θ p,2 ,…θ p,N ] is a set of zero points.
[0046] In the embodiment of the present application, the current filter parameters may be in the form of the above-mentioned parameter set consisting of an amplitude, a set of poles and a set of zeros, or may be in the form of modeling and describing the IIR digital filter using other methods or forms, such as the numerator and denominator of the IIR digital filter system function directly using a polynomial form. The specific method may be selected according to the actual situation, and the embodiment of the present application does not make specific limitations.
[0047] In an embodiment of the present application, for the setting of the initial filter parameters, the filter parameters in the parameter set can be initialized to random values within the legal range, wherein parameter A needs to be initialized to a non-zero value; or it can be initialized to a parameter set of an IIR digital filter obtained using other methods. The specific selection can be made according to the actual situation, and the embodiment of the present application does not make specific limitations. It should be noted that for a stable IIR digital filter, the amplitude value of the pole is required not to exceed 1, that is, the pole is within the unit circle.
[0048] In the embodiment of the present application, the multiple loss functions are loss functions designed based on the degree of deviation between the amplitude response at multiple frequency bands and the corresponding multiple design targets and the loss factors at the multiple frequency bands.
[0049] In an optional embodiment, with respect to the passband loss function, in engineering applications, it is usually expected that the amplitude response of the designed filter in the passband is as close as possible to an ideal amplitude response. The ideal amplitude response is the design target of the passband described in this application. The ideal amplitude response is denoted as |H d (e jω )|.
[0050] The total loss function of the designed IIR digital filter passband is:
[0051]
[0052] The function l p |H(e jω )|,|H d (e jω )|,) is the amplitude response loss function at the passband frequency ω, describing |H(e jω)|Deviation from|H d (e jω )|. The deviation of|H(e jω )|from|H d (e jω )|is greater, the value of l p (|H(e jω )|,|H d (e jω )|) is larger.|H(e jω )|The deviation of|H(e d (e jω )|from|H p (|H(e jω )|,|H d (e jω )|) is smaller, the value of l p (x,y) is not limited in this paper, only requiring it to be able to quantify the deviation of|H(e jω )|from|H d (e jω )|, and enabling the gradient of the loss function L shown in formula (3) with respect to each parameter of the parameter set [A, r p , θ m , r m , θ n , θ n (0 < m < M, 0 < n < N) to be calculated normally. α p (ω) is the loss factor at the passband frequency ω, and different weights can be assigned to the losses at different frequency points according to actual needs.
[0053] Assume that under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter in the interval [0, 2π) corresponding to the sampling frequency is K.
[0054] Denote the digital frequency coordinate corresponding to the lower limit of the passband frequency in formula (3) at this sampling frequency as k p,start , and the digital frequency coordinate corresponding to the upper limit of the passband frequency as k p,end , then the integral operation shown in formula (3) can be replaced by formula (4):
[0055]
[0056] Without loss of generality, denote the passband amplitude loss as shown in formula (5):
[0057]
[0058] Among them, The loss function of the magnitude response of a digital filter designed at the digital frequency coordinate k. The specific form of this function is not limited in the embodiments of this application, as long as it can quantify the degree of deviation from the design target, and enables the loss function L shown in formula (5) p with respect to the parameter set [A, r m , θ m , r n , θ n (0 < m < M, 0 < b < N) to have its gradient for each parameter calculated normally.
[0059] It should be noted that for IIR digital filters such as band-stop filters, the number of passbands may be greater than 1. When the number of passbands is greater than 1, there is a separate loss function as shown in the above formulas (3), (4), and (5) for each passband.
[0060] In another alternative embodiment, for the stopband loss function, in different application scenarios, the requirements for the magnitude response of the designed filter in the stopband are different. In some scenarios, it may be required that the magnitude response in the stopband does not exceed a certain constant threshold value. In some scenarios, it may be required that the magnitude response in the stopband is at least lower than the magnitude response in the passband by a certain constant value. In some scenarios, it may be required that the magnitude response in the stopband does not exceed a certain specific envelope curve. In some scenarios, similar to the passband part, it may be required that the magnitude response in the stopband approximates an ideal magnitude response curve as closely as possible. The above constant threshold value, constant value, specific envelope curve, and / or ideal magnitude response curve are the design targets of the stopband described in this application.
[0061] Without loss of generality, denote the stopband magnitude loss as in formula (6):
[0062]
[0063] where l s (|H(e jω jω)|) is the magnitude response loss function at the stopband frequency point ω, which describes the degree of deviation of |H(e jω jω)| from the design target. The specific form of the function l s (x) is not limited in this article, as long as it can quantify the degree of deviation of |H(e jω jω)| from the design target, and enables the loss function L shown in (formula 6) s with respect to the parameter set [A, r m , θ m , r n , θ nThe gradient of each parameter (0 < m < M, 0 < n < N) can be calculated normally. α s L(ω) is the loss factor at the stopband frequency ω, and different weights can be assigned to the losses at different frequency points according to actual requirements.
[0064] Assume that under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter in the interval [0, 2π) corresponding to the sampling frequency is K.
[0065] Denote the digital frequency coordinate corresponding to the lower limit of the stopband frequency in formula (6) under this sampling frequency condition as k s,start , and the digital frequency coordinate corresponding to the upper limit of the stopband frequency as k s,end , then the integral operation shown in formula (5) can be replaced by formula (7):
[0066]
[0067] For IIR digital filters such as band-pass filters, the number of stopbands may be greater than 1. When the number of stopbands is greater than 1, for each stopband, there is a loss function as shown in formula (6) and formula (7) above.
[0068] In another alternative embodiment, similar to the stopband, for the transition band, in different application scenarios, the requirements for the magnitude response of the designed filter in the transition band are different. In some scenarios, it may be required that the magnitude response in the transition band does not exceed a certain constant threshold value. For example, in logarithmic coordinates, it is required that the magnitude response of all frequency points in the transition band is lower than the minimum value of the magnitude response in the passband. In some scenarios, it may be required that the magnitude response in the transition band does not exceed a certain specific envelope curve. In some scenarios, it may be similar to the passband part, and it is required that the magnitude response in the transition band approximates an ideal magnitude response curve as much as possible. The above constant threshold value, constant value, specific envelope curve, and / or ideal magnitude response curve are the design objectives of the transition band described in this application.
[0069] Without loss of generality, denote the transition band magnitude loss as formula (8):
[0070]
[0071] where l t (|H(e jω )|) is the magnitude response loss function at the frequency point ω, which describes the deviation degree of the magnitude response |H(e jω )| in the transition band from the design objective. The greater the deviation degree, the larger the value of this function, and the smaller the deviation degree, the smaller the value of this function. The function l t(x) is not limited in its specific form in this paper, as long as it can quantify the deviation degree of the magnitude response |H(e jω )| from the design target, and enable the normal calculation of the gradient of each parameter of the loss function L shown in formula (8) t with respect to the parameter set [A, r m , θ m , r n , θ n (0 < m < M, 0 < n < N). α t (ω) is the loss weighting factor at the stopband frequency ω, and different weights can be assigned to the losses at different frequency points according to actual requirements.
[0072] Assume that under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter in the interval [0, 2π) of the sampling frequency is K.
[0073] Denote the digital frequency coordinate corresponding to the lower limit of the transition band frequency in formula (8) under this sampling frequency condition as k t,start , and the digital frequency coordinate corresponding to the upper limit of the stopband frequency as k t,end . Then, the integral operation shown in formula (8) can be replaced by formula (9):
[0074]
[0075] For IIR digital filters such as band - pass filters or band - stop filters, the number of transition bands may be greater than 1. When the number of transition bands is greater than 1, for each transition band, there exists a loss function as shown in formulas (8) and (9) separately.
[0076] Exemplarily, assume that the total number of passbands of the designed IIR digital filter is denoted as I p , the total number of stopbands is denoted as I s , and the total number of transition bands is denoted as I t ; then the total loss function is defined as the weighted sum of the loss functions of all passbands, stopbands, and transition bands, as shown in formula (10):
[0077]
[0078] where, L Total is the weighted total loss function of all passbands, stopbands, and transition bands of the filter. This total loss function describes the overall deviation degree between all passbands, stopbands, and transition bands of the IIR digital filter and the design target. Using the weighted total loss function of all passbands, stopbands, and transition bands as the optimization target can achieve the balance between the performance indicators of each stopband, passband, and transition band of the IIR digital filter.
[0079] in, For the i-th (1≤i≤I p ) passbands, is the total loss of the ith passband obtained according to formula (3), formula (4) or formula (5). For the i-th (1≤i≤I s ) stopbands, is the total loss of the i-th stop band obtained according to formula (6) or formula (7). For the i-th (1≤i≤I t ) transition band weighting factor, is the total loss of the i-th transition band obtained according to formula (8) or formula (9).
[0080] It should be noted that according to the design objectives of all passbands, stopbands, and transition bands, the loss functions of each passband, stopband, and transition band are defined. Among them, I p ,I s ,I t are the number of passband, stopband and transition band respectively. Under the condition of considering continuous frequency components, The functional forms of are shown in formula (3), formula (6) and formula (8) respectively. Under the condition of using discrete digital frequency to represent the frequency domain amplitude response, The functional forms of are shown in formula (5), formula (7) and formula (9) respectively. The specific formula can be selected according to the actual situation, and the embodiment of the present application does not make any specific limitation.
[0081] It should be noted that the specific forms of the loss functions of the passband, stopband, and transition band are not specifically limited in the embodiments of the present application. Various forms of loss functions describing different design objectives can be used, and can be used for the design of IIR filters with various different indicators.
[0082] In the embodiment of the present application, the total loss function is a loss function designed by performing weighted summation processing on multiple loss functions based on multiple weighting factors corresponding to multiple frequency bands.
[0083] It should be noted that by controlling each weighting factor The size of can control the proportion of the loss of each passband, stopband, and transition band in the total loss.
[0084] It should be noted that the embodiments of the present application do not impose specific restrictions on the design objectives and loss function forms of the passband, stopband, and transition band of the IIR digital filter, and can be used to design IIR digital filters with various index requirements, and can design IIR digital filters for different design objectives. For example, the frequency domain amplitude response of the designed filter can be made to approach a predefined ideal target curve in any passband, stopband, or transition band. It is also possible to make any passband, stopband, or transition band meet a certain threshold requirement, which can be a constant or a certain characteristic shape.
[0085] It should be noted that in practical applications, the design target for the passband is often higher than the design targets for the stopband and transition band. Setting different loss functions for the passband, stopband, and transition band can balance the different design targets of different frequency bands, thereby reserving more design resources for the passband design.
[0086] In an embodiment of the present application, the current filter parameters include: amplitude, a group of zero points and a group of poles, wherein the amplitude is a real number, and the corresponding amplitude and phase after a group of zero points and a group of poles are represented by polar coordinates are real numbers; the current filter parameters are respectively input into multiple loss functions corresponding to multiple frequency bands and the total loss function corresponding to the filter, and multiple loss values and total loss values corresponding to the multiple frequency bands are obtained, including: determining the starting zero point and the middle zero point from a group of zero points; and determining the zero point between the starting zero point and the middle zero point as the zero point to be input; determining the starting pole and the middle pole from a group of poles; and determining the pole between the starting pole and the middle pole as the pole to be input; inputting the amplitude, the zero point to be input and the pole to be input into multiple loss functions and the total loss function, respectively, to obtain multiple loss values and a total loss value.
[0087] It should be noted that for an IIR digital filter whose filter parameters are all real numbers, when the number of zeros or poles is an even number, the zeros or poles must be in a pairwise conjugate symmetric relationship; when the number of zeros or poles is an odd number, the even number (including 0) of zeros or poles must be in a pairwise conjugate relationship, and the remaining odd number of zeros or poles must all be real numbers. Based on this characteristic, for an even number of zeros and poles with conjugate symmetry, only half of the parameters need to be calculated, which can reduce the amount of calculation.
[0088] Exemplarily, the filter parameters of the IIR digital low-pass filter to be designed are all real numbers, the total number of zeros is M, and the total number of poles is N. Both M and N are non-zero even numbers, and A is a positive real number. Under this condition, the frequency response of the filter is adjusted from formula (2) to formula (11):
[0089]
[0090] S102: When it is determined based on the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives, the current filter parameters are determined as the design parameters of the filter.
[0091] After inputting the current filter parameters into the multiple loss functions corresponding to the multiple frequency bands and the total loss function corresponding to the filter respectively, and obtaining the multiple loss values and the total loss values corresponding to the multiple frequency bands, it is necessary to determine whether the performance indicators of the multiple frequency bands meet the corresponding multiple design goals based on the multiple loss values and the total loss values. When it is determined that the performance indicators of the multiple frequency bands meet the corresponding multiple design goals based on the multiple loss values and the total loss values, the current filter parameters are directly determined as the design parameters of the filter.
[0092] Furthermore, when it is determined based on multiple loss values and the total loss value that the performance indicators of multiple frequency bands do not meet the corresponding multiple design objectives, the gradient corresponding to the current filter parameters is calculated for the total loss function to obtain the total gradient value; the next filter parameters are determined based on the total gradient value and the current filter parameters; and the next filter parameters are respectively input into the multiple loss functions and the total loss function to calculate the loss value.
[0093] remember Then L shown in formula (10) Total , and each of its components Both Function. Find the value of both sides of formula (10) The gradient of , we get formula (12), and the total gradient value can be obtained using formula (12).
[0094]
[0095] In an embodiment of the present application, in the process of obtaining the gradient corresponding to the current filter parameters of the total loss function and obtaining the total gradient value, the convergence parameters of multiple frequency bands can be detected; according to the convergence parameters, multiple weighting factors are adjusted to obtain multiple adjusted weighting factors; then, based on the adjusted multiple weighting factors, an adjusted total loss function is generated; the gradient corresponding to the current filter parameters of the adjusted total loss function is obtained to obtain the total gradient value.
[0096] It should be noted that in formula (12), the convergence parameters of the passband, stopband and transition band can be detected to control each weighting factor The size of the passband, stopband, and transition band is controlled The total gradient The influence of the local index in the optimization process is thus prevented from being over-optimized, and the final design parameters are ensured to achieve a balance between different design objectives. Among them, the convergence parameters may include parameters such as convergence speed and convergence degree, which may be selected according to actual conditions, and the embodiments of the present application do not make specific limitations.
[0097] In an embodiment of the present application, determining the next filter parameter according to the total gradient value and the current filter parameter includes: determining the product value between the total gradient value and the learning step; and determining the difference between the current filter parameter and the product value as the next filter parameter.
[0098] It should be noted that the present application uses the gradient descent method to iteratively obtain the next filter parameter. An optional method can refer to formula (13):
[0099]
[0100] Among them, α (k) (α (k) >0) is the learning step size. For example, α (k) It is generally 0.01 or 0.02, and the specific value can be selected according to the actual situation. The embodiment of the present application does not make any specific limitation.
[0101] It should be noted that the above formula (13) is only an optional gradient descent method. Other gradient descent methods can be selected according to actual application requirements, such as but not limited to: Mini-Batch Gradient Descent (MBGD), that is, calculating the gradient component and When the method is used, not all frequency points of the corresponding frequency band are used, but only the gradient accumulation of some frequency points is counted; Momentum Gradient Descent (Momentum); Adaptive Gradient Descent (AdaGrad); Root Mean Square Propagation (RMSProp); Adaptive Momentum Estimation (Adam), etc.
[0102] It should be noted that, in addition to the gradient descent method, other algorithms for obtaining the filter parameters of the corresponding IIR digital filter when minimizing the weighted total loss function shown in formula (10) also fall within the protection scope of the embodiments of the present application.
[0103] Exemplarily, the filter design process corresponding to the above embodiment can be as follows: Figure 2 As shown, the process includes:
[0104] 1. Determine the design objectives of the passband, stopband, and transition band of the IIR digital filter;
[0105] 2. Define the loss functions of each passband, stopband, and transition band according to the design goals of the passband, stopband, and transition band
[0106] 3. Initialize the iteration index k = 0; initialize the parameter set of the IIR digital filter
[0107] 4. Calculate the loss of each passband, stopband, and transition band and current The corresponding total loss function L Total (k) .
[0108] 5. According to The corresponding loss of each passband, stopband, and transition band and the total loss L Total (k) , determine whether the performance indicators of each passband, stopband, and transition band have met the design goals;
[0109] 6. If the performance indicators of each passband, stopband, and transition band meet the design goals, then the output As a result of the design;
[0110] 7. If the performance indicators of each passband, stopband, and transition band do not meet the design goals, calculate And let k=k+1, return to step 4 to continue iteration.
[0111] In an embodiment of the present application, when it is determined based on multiple loss values and a total loss value that the performance indicators of multiple frequency bands do not meet the corresponding multiple design targets, the gradient corresponding to the current filter parameter is obtained for the total loss function to obtain a total gradient value, including: when it is determined based on multiple loss values and a total loss value that the performance indicators of a first frequency band among the multiple frequency bands do not meet the corresponding first design target, a first loss function corresponding to the first frequency band is determined from multiple loss functions; the gradient corresponding to the current filter parameter is obtained for the first loss function to obtain a first gradient component; the second gradient component corresponding to the second frequency band is set to zero; the second frequency band is a frequency band among the multiple frequency bands except the first frequency band; the total gradient value is determined based on multiple weighting factors, the second gradient component set to zero, and the first gradient component.
[0112] It should be noted that, in the process of iterative calculation of the design parameters of the filter, the performance indicators of each passband, stopband, and transition band may not all meet the design goals at the same time in the same iteration. Therefore, after a certain iteration, if the performance indicators of a single or part of the passband, stopband, and transition band reach the design goals, in this iteration, the gradient iteration for the frequency band is stopped, specifically, the gradient component in the corresponding formula (12) is set to 0. This method can prevent some performance indicators from far exceeding the established design goals, so that all the design performance of all passbands, stopbands, and transition bands can reach an optimal balance. This method can save the calculation of some gradient components, can reduce some of the calculations to a certain extent, and speed up the entire calculation process.
[0113] Exemplary, reference Figure 2 Considering the scenario where the gradient component is set to zero, the filter design process corresponding to the above embodiment can be as follows: Figure 3 As shown, the process includes:
[0114] 1. Determine the design objectives of the passband, stopband, and transition band of the IIR digital filter;
[0115] 2. Define the loss functions of each passband, stopband, and transition band according to the design goals of the passband, stopband, and transition band
[0116] 3. Initialize the iteration index k = 0; initialize the parameter set of the IIR digital filter
[0117] 4. Calculate the loss of each passband, stopband, and transition band and current The corresponding total loss function L Total (k) .
[0118] 5. According to The corresponding loss of each passband, stopband, and transition band and the total loss L Total (k) , determine whether the performance indicators of each passband, stopband, and transition band have met the design goals;
[0119] 6. If the performance indicators of each passband, stopband, and transition band meet the design goals, then the output As a result of the design;
[0120] 7. If the performance index of any passband, stopband, or transition band does not meet the design target, execute 8-16;
[0121] 8. Determine whether the performance indicators of each passband meet the corresponding design goals;
[0122] 9. If the i-th (1≤i≤I p ) passband performance indicators do not meet the corresponding design goals, then calculate
[0123] 10. If the i-th (1≤i≤I p ) passband performance indicators meet the corresponding design goals, then
[0124] 11. Determine whether the performance indicators of each stopband meet the corresponding design goals;
[0125] 12. If the i-th (1≤i≤I s ) stopband performance indicators do not meet the corresponding design goals, then calculate
[0126] 13. If the i-th (1≤i≤I s ) stopband performance indicators meet the corresponding design goals, then
[0127] 14. Determine whether the performance indicators of each transition zone meet the corresponding design objectives;
[0128] 15. If the i-th (1≤i≤I t ) The performance index of the transition zone does not meet the corresponding design target, then calculate
[0129] 16. If the i-th (1≤i≤I t ) The performance index of each transition zone meets the corresponding design target, then
[0130] 17. Calculation And let k=k+1, return to step 5 to continue iteration.
[0131] Using the filter design method provided in this application for multiple iterations can make the filter parameters more consistent with the design goals. For details, see Figure 4 , showing the initial state of the iteration, the results of 50,000 iterations, the results of 100,000 iterations, and the results of 500,000 iterations. The main comparison parameters are the amplitude A of the IIR data filter, where the value of the amplitude A is the logarithm with a base of 10; the zeros and poles of the IIR filter, where the horizontal axis is the real part and the vertical axis is the imaginary part; the frequency domain amplitude response of the IIR digital filter; and the total loss change curve. Figure 4It can be seen that the amplitude A, zero points and poles of the IIR data filter change during each iteration; as the number of iterations increases, the frequency domain amplitude response curve gets closer and closer to the ideal amplitude vector of the passband and the stopband amplitude response threshold; as the number of iterations increases, the total loss becomes smaller and smaller.
[0132] It can be understood that based on the design objectives corresponding to each frequency band, a corresponding loss function is designed for each frequency band, and the loss functions of multiple frequency bands are weighted and summed to generate a total loss function; then, the current filter parameters can be jointly trained based on the multiple loss functions corresponding to the multiple frequency bands and the total loss function, which takes into account the balance between the design objectives of different frequency bands, can meet different filter performance indicators at the same time, improves the flexibility of filter design, and thus makes the designed filter performance better.
[0133] Based on the above embodiment, taking a stable IIR digital low-pass filter with all real parameters, an even number of zeros and poles as an example, an exemplary design process of the present application is described as follows:
[0134] 1. Determine the design indicators of the IIR digital filter: Assume that the performance indicators of the filter to be designed are as follows:
[0135] (1) The parameters of the system function of the IIR digital low-pass filter to be designed are all real numbers, the total number of zeros is M, and the total number of poles is N. Both M and N are non-zero even numbers. Under this condition, the frequency response of the filter can be expressed as formula (11):
[0136]
[0137] In this example, it is assumed that A is a positive real number.
[0138] (2) Assume that the starting digital frequency of the passband is ω p,statr =0, the passband cutoff digital frequency is ω p,end (0<ω p,end <π). Assume that the ideal amplitude response of the filter passband to be designed is H d (e jω ). The ideal amplitude response of the filter under logarithmic coordinate conditions is:
[0139] |H d (e jω )| dB =10·log 10 (|H d (e jω )|) 2 dB,ω p,start ≤ω≤ω p,end (14)
[0140] (3) Assume that the starting digital frequency of the stopband is ω s,start (ω p,end <ω s,start <π), the stopband cutoff digital frequency is ω s,end =π. In the entire stop band (ω s,start ≤ω≤ω s,end ), the amplitude response of the filter is less than the predefined threshold function δ s (ω)dB, that is, satisfying: 10*log 10 (|H(e jω )|) 2 <δ s (ω)dB,ω s,start ≤ω≤ω s,end .
[0141] (4) Assume that the digital frequency range of the filter transition band is ω p,end <ω<ω s,start The design goal of the frequency amplitude response of the filter transition band is that the amplitude response of all frequencies in the entire transition band is smaller than the amplitude response at the cutoff frequency of the passband. That is to satisfy: ω p,end <ω<ω s,start .
[0142] (5) Assuming that under the condition of digital frequency representation, the number of sampling points corresponding to the sampling frequency of the designed IIR digital filter in the interval [0,2·π) is K.
[0143] 2. Determine the loss functions of the passband, stopband, and transition band.
[0144] In this embodiment, all loss functions under logarithmic coordinate conditions are used. The amplitude response of the IIR digital filter under logarithmic coordinate conditions is as shown in formula (15):
[0145]
[0146] 1) Passband loss function
[0147] Under the current sampling rate conditions, the passband start frequency index is: k p,start =0, the passband cutoff frequency index is Where ceil is rounded up.
[0148] For the design goal of the passband described in (2) of 1, the loss function of formula (16) is used to measure the degree of deviation between the passband amplitude response and the design goal:
[0149]
[0150] The parameter β p is a positive number that can be used to adjust the loss function's change in the degree of deviation between the passband amplitude response and the design target. This formula is the total passband loss function.
[0151] 2) Stopband loss function
[0152] Under the current sampling rate conditions, the stopband start frequency index is: Where floor means rounding down. The stopband cutoff frequency index is ceil means round up.
[0153] For the stopband design goal described in (4) of 1, it is assumed that the loss function of the following formula (17) is used to measure the deviation of the stopband amplitude response from the cutoff amplitude response threshold requirement:
[0154]
[0155] The parameter β s It is a positive number that can be used to adjust the degree of change in the loss function regarding the stopband amplitude response not meeting the cutoff amplitude response requirements.
[0156] 3) Transition zone loss function
[0157] Under the current sampling rate conditions, the transition band start frequency index is: k t,start =k p,start +1, where the transition band cutoff frequency index is k t,end =k s,start -1.
[0158] For the stopband design goal described in (5) of 1, it is assumed that the loss function of the following formula (18) is used to measure the deviation of the stopband amplitude response from the cutoff amplitude response threshold requirement:
[0159]
[0160] The parameter β t It is a positive number and can be used to adjust the degree of change of the loss function regarding the transition band amplitude response not meeting the cutoff amplitude response requirements.
[0161] 4) Total loss function
[0162] The total loss function is the weighted sum of the loss functions shown in (16), (17), and (18), refer to formula (19):
[0163] L Total =C p ·L p +C s ·Ls +C t ·L t (19)
[0164] Among them, C p , C s , C t is the weighting factor of each loss.
[0165] 3. Calculation method of loss function with respect to the gradient of IIR filter parameter set
[0166] For both sides of formula (19), we can obtain the parameter set The gradient of , then the total loss function is about The gradient of the passband, stopband, and transition band losses is about The weighted sum of the gradients of is shown in formula (20):
[0167]
[0168] in They are respectively formula (16), formula (17), and formula (18) about The specific method for obtaining the gradient is as follows.
[0169] 1) Passband gradient
[0170] For formula (16), find The gradient of , we get formula (21):
[0171]
[0172] For formula (21), we can solve L p about The partial derivative of each element of to obtain L p about The gradient is shown in the following formula (22-26):
[0173]
[0174]
[0175]
[0176]
[0177]
[0178] 2) Stopband gradient
[0179] For formula (17), find The gradient of , we get formula (27):
[0180]
[0181] For formula (27), we can solve L s about The partial derivative of each element of to obtain L s about The gradient is shown in the following formula (28-32):
[0182]
[0183]
[0184]
[0185]
[0186]
[0187] 3) Transition zone gradient
[0188] For formula (18), find The gradient of , we get formula (33):
[0189]
[0190] For formula (33), we can solve L t about The partial derivative of each element of to obtain L t about The gradient is shown in the following formula (34-38):
[0191]
[0192]
[0193]
[0194]
[0195]
[0196] 4) Total loss about Gradient
[0197] The losses of the passband, stopband, and transition band calculated in 1), 2), and 3) above are Substitute the gradient of into formula (20), and we can get the total loss about The gradient.
[0198] 4. Calculate
[0199] According to the loss functions of the passband, stopband, and transition band defined in the above 1, 2, and 3, and the calculation method of the gradient of each loss function with respect to substitute them into the iterative solution process, and the parameter set of the filter can be iteratively obtained
[0200] It should be noted that for a stable IIR digital filter, its poles should all be inside the unit circle. After iterative calculation using formula (13), for the magnitude r of any pole p,n (1 < n < N), if r p,n (k) is greater than 1 after a certain iteration, it can be forced to 1 or a positive number slightly less than 1 to ensure the stability of the final filter.
[0201] Figure 5 and Figure 6 are examples of a fully real - parameter, stable IIR low - pass digital filter designed using the above method. Among them, Figure 5 is the amplitude A and the distribution diagram of poles and zeros of the designed IIR low - pass digital filter. Figure 6 is the frequency - domain amplitude response of the IIR low - pass digital filter. It can be seen from Figure 6 that at the frequency point of 0.15π, the maximum error between the passband amplitude response of the IIR low - pass filter and the ideal passband amplitude response is 0.001038961563820662 dB. Thus, the amplitude response curve of the IIR low - pass filter approaches the ideal passband amplitude response and the stopband amplitude response threshold.
[0202] A fully real - parameter, stable IIR low - pass digital filter designed using the above method has the following specific design objectives:
[0203] (1) The IIR digital low - pass filter requires all real coefficients and is stable; the number of zeros is 30, and the number of poles is 30.
[0204] (2) Passband: The digital frequency range of the passband is The ideal amplitude response within the passband is That is, the ideal amplitude response within the passband is an inverted parabola, and its amplitude response at the lowest passband frequency point ω = 0 is At the highest passband frequency point the amplitude response is 0 dB. The design objective of the passband is to minimize the maximum error between the amplitude response of the designed IIR filter and the ideal amplitude response throughout the passband.
[0205] (3) Stopband: The stopband digital frequency range is In the first half of the stop band The maximum amplitude response of the stopband is required to be no greater than -50dB; in the second half of the stopband The maximum amplitude response of the stop band is required to be no greater than -70dB.
[0206] (4) Transition band: The digital frequency range of the transition band is In the entire transition band, the maximum amplitude response is required, which should not be higher than the highest frequency of the passband. The actual amplitude response at .
[0207] Under the above target requirements, in an experiment, the IIR digital filter designed by the above method can actually achieve the following indicators (the above (1) and (4) are met):
[0208] The maximum absolute error between the amplitude response in the passband and the ideal amplitude response is 0.001038961563820662dB;
[0209] The maximum amplitude response in the first half of the stopband is -50.00000001521959dB; the maximum amplitude response in the second half of the stopband is -70.15759515530789dB.
[0210] It should be noted that the performance index of the IIR digital filter designed here using the above method is not the ultimate performance index that can be achieved by this method, but is only the index that can be actually achieved in one experiment.
[0211] Based on the above embodiments, the present application provides a filter design device. Figure 7 As shown, the filter design device 1 comprises:
[0212] An acquisition unit 10 is used to acquire current filter parameters;
[0213] A loss calculation unit 11, used to input the current filter parameters into multiple loss functions corresponding to multiple frequency bands and a total loss function corresponding to the filter, to obtain multiple loss values corresponding to the multiple frequency bands and a total loss value;
[0214] A parameter design unit 12, configured to determine the current filter parameters as the design parameters of the filter when it is determined that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives according to the multiple loss values and the total loss value;
[0215] The multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands;
[0216] The total loss function is a loss function designed by performing weighted summation processing on the multiple loss functions based on the multiple weighting factors corresponding to the multiple frequency bands.
[0217] In some embodiments of the present application, the apparatus further comprises: a gradient calculation unit;
[0218] The gradient calculation unit is also used to obtain the gradient corresponding to the current filter parameters for the total loss function to obtain a total gradient value when it is determined based on the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands do not meet the corresponding multiple design goals; determine the next filter parameters based on the total gradient value and the current filter parameters; and input the next filter parameters into the multiple loss functions and the total loss function respectively to calculate the loss value.
[0219] In some embodiments of the present application, the apparatus further includes: a determining unit;
[0220] The determination unit is used to determine the product value between the total gradient value and the learning step size; and determine the difference between the current filter parameter and the product value as the next filter parameter.
[0221] In some embodiments of the present application, the determining unit is further configured to, when it is determined according to the multiple loss values and the total loss value that a performance indicator of a first frequency band among the multiple frequency bands does not meet a corresponding first design target, determine a first loss function corresponding to the first frequency band from the multiple loss functions;
[0222] The gradient calculation unit is also used to obtain the gradient corresponding to the current filter parameter of the first loss function to obtain a first gradient component; set the second gradient component corresponding to the second frequency band to zero; the second frequency band is a frequency band among the multiple frequency bands except the first frequency band; and determine the total gradient value based on the multiple weighting factors, the second gradient component after being set to zero, and the first gradient component.
[0223] In some embodiments of the present application, the device further comprises: a detection unit and an adjustment unit;
[0224] The detection unit is used to detect the convergence parameters of the multiple frequency bands;
[0225] The adjusting unit is used to adjust the multiple weighting factors according to the convergence parameter to obtain the adjusted multiple weighting factors; and based on the adjusted multiple weighting factors, generate the adjusted total loss function;
[0226] The gradient calculation unit is also used to obtain the gradient corresponding to the current filter parameter of the adjusted total loss function to obtain the total gradient value.
[0227] In some embodiments of the present application, the current filter parameters include: an amplitude, a set of zero points, and a set of poles, wherein the amplitude is a real number, and the amplitude and phase corresponding to the set of zero points and the set of poles after being represented by polar coordinates are real numbers;
[0228] The determining unit is further used to determine a starting zero point and an intermediate zero point from the set of zero points; and determine the zero point between the starting zero point and the intermediate zero point as the zero point to be input; determine a starting pole point and an intermediate pole from the set of pole points; and determine the pole point between the starting pole point and the intermediate pole as the pole to be input;
[0229] The loss calculation unit 11 is further used to input the amplitude, the zero point to be input and the pole point to be input into the multiple loss functions and the total loss function respectively to obtain multiple loss values and a total loss value.
[0230] In some embodiments of the present application, the plurality of frequency bands include at least one passband, at least one stopband and at least one transition band.
[0231] The filter design device provided in the embodiment of the present application obtains the current filter parameters; and inputs the current filter parameters into the multiple loss functions corresponding to the multiple frequency bands and the total loss function corresponding to the filter, respectively, to obtain the multiple loss values and the total loss value corresponding to the multiple frequency bands; when it is determined that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives according to the multiple loss values and the total loss value, the current filter parameters are determined as the design parameters of the filter; wherein the multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands; the total loss function is a loss function designed by weighted summing the multiple loss functions based on the multiple weighting factors corresponding to the multiple frequency bands. It can be seen that the filter design device proposed in this embodiment designs the corresponding loss function for each frequency band based on the design objectives corresponding to each frequency band, and performs weighted summing on the loss functions of the multiple frequency bands to generate the total loss function; then, the current filter parameters can be jointly trained based on the multiple loss functions corresponding to the multiple frequency bands and the total loss function, taking into account the balance between the design objectives of different frequency bands, and being able to meet different filter performance indicators at the same time, improving the flexibility of filter design, and thus making the designed filter performance better.
[0232] Figure 8 A schematic diagram of the structure of a filter design device 1 provided in an embodiment of the present application Figure 2 In practical applications, based on the same disclosure concept of the above embodiments, Figure 8 As shown, the filter design device 1 of this embodiment includes: a processor 13 , a memory 14 and a communication bus 15 .
[0233] In the process of a specific embodiment, the acquisition unit 10, the loss calculation unit 11, the parameter design unit 12, the gradient calculation unit and the determination unit can be implemented by a processor 13 located on the filter design device 1, and the processor 13 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing image processing device (DSPD), a programmable logic image processing device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and this embodiment does not specifically limit it.
[0234] In the embodiment of the present application, the communication bus 15 is used to realize the connection communication between the processor 13 and the memory 14; when the processor 13 executes the running program stored in the memory 14, the following filter design method is implemented:
[0235] Obtaining current filter parameters; and inputting the current filter parameters into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to the filter, respectively, to obtain a plurality of loss values corresponding to the plurality of frequency bands and a total loss value;
[0236] When it is determined according to the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives, determining the current filter parameters as the design parameters of the filter;
[0237] The multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands;
[0238] The total loss function is a loss function designed by performing weighted summation processing on the multiple loss functions based on the multiple weighting factors corresponding to the multiple frequency bands.
[0239] In some embodiments of the present application, the processor 13 is also used to, when it is determined based on the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands do not meet the corresponding multiple design goals, obtain the gradient corresponding to the current filter parameters for the total loss function to obtain the total gradient value; determine the next filter parameters based on the total gradient value and the current filter parameters; and input the next filter parameters into the multiple loss functions and the total loss function respectively to calculate the loss value.
[0240] In some embodiments of the present application, the processor 13 is further used to determine a product value between the total gradient value and the learning step; and determine a difference between the current filter parameter and the product value as the next filter parameter.
[0241] In some embodiments of the present application, the processor 13 is also used to determine, from the multiple loss functions, a first loss function corresponding to the first frequency band when it is determined that the performance index of the first frequency band among the multiple frequency bands does not meet the corresponding first design target based on the multiple loss values and the total loss value; obtain the gradient corresponding to the current filter parameter for the first loss function to obtain a first gradient component; set the second gradient component corresponding to the second frequency band to zero; the second frequency band is a frequency band among the multiple frequency bands except the first frequency band; and determine the total gradient value based on the multiple weighting factors, the second gradient component after being set to zero, and the first gradient component.
[0242] In some embodiments of the present application, the processor 13 is also used to detect the convergence parameters of the multiple frequency bands; adjust the multiple weighting factors according to the convergence parameters to obtain the adjusted multiple weighting factors; generate an adjusted total loss function based on the adjusted multiple weighting factors; and obtain the gradient corresponding to the current filter parameters of the adjusted total loss function to obtain the total gradient value.
[0243] In some embodiments of the present application, the current filter parameters include: an amplitude, a set of zero points, and a set of poles, wherein the amplitude is a real number, and the amplitude and phase corresponding to the set of zero points and the set of poles after being represented by polar coordinates are real numbers;
[0244] The processor 13 is also used to determine the starting zero point and the intermediate zero point from the group of zero points; and determine the zero points between the starting zero point and the intermediate zero point as the zero points to be input; determine the starting pole and the intermediate pole from the group of poles; and determine the poles between the starting pole and the intermediate pole as the poles to be input; input the amplitude, the zero point to be input and the pole to be input into the multiple loss functions and the total loss function, respectively, to obtain multiple loss values and a total loss value.
[0245] In some embodiments of the present application, the plurality of frequency bands include at least one passband, at least one stopband and at least one transition band.
[0246] An embodiment of the present application provides a storage medium having a computer program stored thereon. The computer-readable storage medium stores one or more programs. The one or more programs can be executed by one or more processors and applied to a filter design device. The computer program implements the filter design method as described above.
[0247] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0248] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for enabling an image display device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0249] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A filter design method, characterized in that: The method comprises: Determining a plurality of design objectives corresponding to a plurality of frequency bands in a digital filter; the plurality of frequency bands comprising at least one passband, at least one stopband, and at least one transition band; Iteratively obtain current filter parameters; and input the current filter parameters into a plurality of loss functions corresponding to the plurality of frequency bands and a total loss function corresponding to the filter, respectively, to obtain a plurality of loss values corresponding to the plurality of frequency bands and a total loss value; In a case where it is determined, based on the multiple loss values and the total loss value, that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives, determining the current filter parameters as the design parameters of the filter; The multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands; The total loss function is a loss function designed by performing weighted summation processing on the multiple loss functions based on multiple weighting factors corresponding to the multiple frequency bands; Wherein, the method further comprises: When it is determined according to the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands do not meet the corresponding multiple design objectives, obtaining a gradient corresponding to the current filter parameter for the total loss function to obtain a total gradient value; Determining a next filter parameter according to the total gradient value and the current filter parameter; Inputting the next filter parameter into the multiple loss functions and the total loss function respectively to calculate the loss value; Wherein, when it is determined according to the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands do not meet the corresponding multiple design goals, the total loss function is calculated to obtain the gradient corresponding to the current filter parameter to obtain the total gradient value, including: When it is determined according to the multiple loss values and the total loss value that the performance indicator of a first frequency band among the multiple frequency bands does not meet the corresponding first design target, determining a first loss function corresponding to the first frequency band from the multiple loss functions; Calculating the gradient of the first loss function corresponding to the current filter parameter to obtain a first gradient component; Setting a second gradient component corresponding to a second frequency band to zero; the second frequency band is a frequency band among the multiple frequency bands except the first frequency band; The total gradient value is determined according to the multiple weighting factors, the second gradient component after being reset to zero, and the first gradient component.
2. The method according to claim 1, characterized in that The step of determining a next filter parameter according to the total gradient value and the current filter parameter comprises: Determine a product value between the total gradient value and the learning step size; The difference between the current filter parameter and the product value is determined as the next filter parameter.
3. The method according to claim 1, characterized in that The step of obtaining the gradient corresponding to the current filter parameter of the total loss function to obtain a total gradient value includes: detecting convergence parameters of the plurality of frequency bands; According to the convergence parameter, adjusting the multiple weighting factors to obtain multiple adjusted weighting factors; Based on the adjusted multiple weighting factors, generating an adjusted total loss function; The adjusted total loss function is used to obtain the gradient corresponding to the current filter parameter to obtain the total gradient value.
4. The method according to claim 1, characterized in that: The current filter parameters include: amplitude, a set of zero points and a set of poles, wherein the amplitude is a real number, and the amplitude and phase corresponding to the set of zero points and the set of poles after being represented by polar coordinates are real numbers; the current filter parameters are respectively input into the multiple loss functions corresponding to the multiple frequency bands and the total loss function corresponding to the filter to obtain the multiple loss values corresponding to the multiple frequency bands and the total loss value, including: Determine a starting zero point and an intermediate zero point from the set of zero points; and determine the zero point between the starting zero point and the intermediate zero point as the zero point to be input; Determine a starting pole and an intermediate pole from the group of poles; and determine the poles between the starting pole and the intermediate pole as the poles to be input; The amplitude, the zero point to be input, and the pole point to be input are respectively input into the multiple loss functions and the total loss function to obtain multiple loss values and a total loss value.
5. A filter design device, characterized in that: The filter design device comprises: A processing unit, configured to determine a plurality of design objectives corresponding to a plurality of frequency bands in a digital filter; the plurality of frequency bands comprising at least one passband, at least one stopband and at least one transition band; An acquisition unit, used for iteratively acquiring current filter parameters; A loss calculation unit, used to input the current filter parameters into the multiple loss functions corresponding to the multiple frequency bands and the total loss function corresponding to the filter, respectively, to obtain the multiple loss values corresponding to the multiple frequency bands and the total loss value; a parameter design unit, configured to determine the current filter parameters as the design parameters of the filter when it is determined, based on the multiple loss values and the total loss value, that the performance indicators of the multiple frequency bands meet the corresponding multiple design objectives; The multiple loss functions are loss functions designed according to the multiple design objectives corresponding to the multiple frequency bands; The total loss function is a loss function designed by performing weighted summation processing on the multiple loss functions based on multiple weighting factors corresponding to the multiple frequency bands; A gradient calculation unit is used to obtain the gradient corresponding to the current filter parameter for the total loss function to obtain a total gradient value when it is determined according to the multiple loss values and the total loss value that the performance indicators of the multiple frequency bands do not meet the corresponding multiple design goals; determine the next filter parameter according to the total gradient value and the current filter parameter; and input the next filter parameter into the multiple loss functions and the total loss function respectively to calculate the loss value; The gradient calculation unit is also used to obtain the gradient corresponding to the current filter parameter of the first loss function to obtain a first gradient component; set the second gradient component corresponding to the second frequency band to zero; the second frequency band is a frequency band among the multiple frequency bands except the first frequency band; and determine the total gradient value based on the multiple weighting factors, the second gradient component after being set to zero, and the first gradient component.
6. A filter design device, characterized in that: The filter design device comprises: a processor, a memory and a communication bus; when the processor executes the running program stored in the memory, the method according to any one of claims 1 to 4 is implemented.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Design method for digital filter of inertial measurement unit (IMU) of mechanically-dithered laser gyroscope
CN102620729A