CN115133906A - Filter design method and device and storage medium - Google Patents
Filter design method and device and storage medium Download PDFInfo
- Publication number
- CN115133906A CN115133906A CN202210788140.4A CN202210788140A CN115133906A CN 115133906 A CN115133906 A CN 115133906A CN 202210788140 A CN202210788140 A CN 202210788140A CN 115133906 A CN115133906 A CN 115133906A
- Authority
- CN
- China
- Prior art keywords
- loss
- filter
- total
- frequency bands
- design
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013461 design Methods 0.000 title claims abstract description 155
- 238000000034 method Methods 0.000 title claims abstract description 63
- 230000006870 function Effects 0.000 claims abstract description 195
- 238000012545 processing Methods 0.000 claims abstract description 13
- 230000007704 transition Effects 0.000 claims description 76
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000004891 communication Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 5
- 230000004044 response Effects 0.000 description 73
- 238000005070 sampling Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 238000011478 gradient descent method Methods 0.000 description 4
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000012938 design process Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 239000000126 substance Substances 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 description 1
- 238000009825 accumulation Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000011002 quantification Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H17/02—Frequency selective networks
- H03H17/04—Recursive filters
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H2017/0072—Theoretical filter design
- H03H2017/009—Theoretical filter design of IIR filters
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Networks Using Active Elements (AREA)
Abstract
The embodiment of the application provides a filter design method and device and a storage medium, and the method comprises the following steps: acquiring current filter parameters; respectively inputting current filter parameters into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands; determining the current filter parameter as the design parameter of the filter under the condition that the performance indexes of a plurality of frequency bands meet a plurality of corresponding design targets according to a plurality of loss values and a total loss value; the loss functions are designed according to a plurality of design targets corresponding to a plurality of frequency bands; the total loss function is a loss function designed by performing weighted summation processing on a plurality of loss functions based on a plurality of weighting factors corresponding to a plurality of frequency bands.
Description
Technical Field
The present disclosure relates to the field of filters, and in particular, to a method and an apparatus for designing a filter, and a storage medium.
Background
An Infinite Impulse Response (IIR) digital filter has the characteristics of low order and low delay, can achieve better filtering performance through a lower order, and is widely applied to a plurality of fields of digital signal processing.
At present, a design method for an IIR digital filter is performed in a digital domain, a design target is quantized into a target system function, and then a mean square error between the designed system function and the target system function is minimized to realize approximation of the designed IIR digital filter to the target system function. However, the approximation to the target system function is realized by adopting a mean square error minimization method, and the performance indexes of diversified filters cannot be met, so that the problems of low flexibility of filter design and poor performance of the designed filter are caused.
Disclosure of Invention
The embodiment of the application provides a filter design method, a filter design device and a storage medium, which can meet the diversification of filter performance indexes and improve the flexibility of filter design and the designed filter performance.
The technical scheme of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a filter design method, where the method includes:
acquiring current filter parameters; respectively 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 a filter to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands;
determining the current filter parameter as the design parameter of the filter under the condition that the performance indexes of the frequency bands meet a plurality of corresponding design targets according to the loss values and the total loss value;
wherein the plurality of loss functions are designed according to the plurality of design goals corresponding to the plurality of frequency bands;
the total loss function is a loss function designed by performing weighted summation processing on the plurality of loss functions based on a plurality of weighting factors corresponding to the plurality of frequency bands.
In a second aspect, an embodiment of the present application provides a filter design apparatus, including:
an obtaining unit, configured to obtain a current filter parameter;
a loss calculation unit, configured to input the current filter parameter into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter, respectively, to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands;
a parameter design unit, configured to determine, when it is determined that the performance indicators of the multiple frequency bands meet corresponding multiple design targets according to the multiple loss values and the total loss value, the current filter parameter as a design parameter of the filter;
wherein the plurality of loss functions are designed according to the plurality of design goals corresponding to the plurality of frequency bands;
the total loss function is a loss function designed by performing weighted summation processing on the plurality of loss functions based on a plurality of weighting factors corresponding to the plurality of frequency bands.
In a third aspect, an embodiment of the present application provides a filter design apparatus, where the filter design apparatus includes: a processor, a memory, and a communication bus; the processor implements the filter design method described above when executing the operating program stored in the memory.
In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the above filter design method.
The embodiment of the application provides a filter design method, a filter design device and a storage medium, wherein the method comprises the following steps: acquiring current filter parameters; respectively inputting current filter parameters into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands; determining the current filter parameter as the design parameter of the filter under the condition that the performance indexes of a plurality of frequency bands meet a plurality of corresponding design targets according to a plurality of loss values and a total loss value; the loss functions are designed according to a plurality of design targets corresponding to a plurality of frequency bands; the total loss function is a loss function designed by performing weighted summation processing on a plurality of loss functions based on a plurality of weighting factors corresponding to a plurality of frequency bands. By adopting the implementation scheme, based on the design target corresponding to each frequency band, designing a corresponding loss function for each frequency band, and performing weighted summation on the loss functions of a plurality of frequency bands to generate a total loss function; then, current filter parameters can be trained together based on a plurality of loss functions and total loss functions corresponding to a plurality of frequency bands, balance among design targets of different frequency bands is considered, different filter performance indexes can be met simultaneously, flexibility of filter design is improved, and performance of the designed filter is enabled to be better.
Drawings
Fig. 1 is a flowchart of a filter design method according to an embodiment of the present application;
fig. 2 is a first flowchart illustrating an exemplary filter design method according to an embodiment of the present disclosure;
fig. 3 is a second schematic flowchart corresponding to an exemplary filter design method provided in the embodiment of the present application;
FIG. 4 is a diagram illustrating comparison of results of multiple iterations of an exemplary filter design method provided by an embodiment of the present application;
FIG. 5 is a step diagram of the amplitude A and pole zero of an exemplary IIR low-pass digital filter provided by an embodiment of the present application;
FIG. 6 is a frequency domain amplitude response diagram of an exemplary IIR low-pass digital filter provided in an embodiment of the present application;
fig. 7 is a first schematic structural diagram of a filter design apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a filter design apparatus according to an embodiment of the present application.
Detailed Description
So that the manner in which the above recited features and aspects of the present invention can be understood in detail, a more particular description of the embodiments of the invention, briefly summarized above, may be had by reference to the appended drawings, which are included to illustrate, but are not intended to limit the embodiments of the invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
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" are used herein only for distinguishing similar objects and do not denote a particular order or sequence of objects, and it should be understood that "first \ second \ third" may be interchanged under appropriate circumstances such that embodiments of the present application described herein may be implemented in other sequences than those illustrated or described herein.
An embodiment of the present application provides a filter design method, as shown in fig. 1, the method may include:
s101, obtaining current filter parameters; and inputting 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 and a total loss value corresponding to the plurality of frequency bands.
The filter design method provided by the embodiment of the application is suitable for a scene of designing an IIR digital filter. The type of the IIR digital filter may include a low-pass filter, a high-pass filter, a band-stop filter, a comb filter, and the like, which may be specifically selected according to an actual situation, and the embodiment of the present application is not specifically limited.
In an embodiment of the present application, the IIR digital filter includes a plurality of frequency bands, wherein the plurality of frequency bands includes at least one pass band, at least one stop band, and at least one transition band. The specific number of pass bands, stop bands and transition bands is selected according to actual conditions, and the embodiment of the application is not specifically limited.
In the embodiment of the application, the current filter parameter is obtained according to the iteration number, when the iteration number is 0, the current filter parameter is an initial filter parameter, and when the iteration number is a positive integer which is not 0, the current filter parameter is obtained by calculation according to the filter parameter in the last iteration process.
It should be noted that, for any type of IIR digital filter, the system function represented by the z transform can be represented by formula (1):
wherein z is 0,m (0<m<M) is the zero of the system function, z p,n (0<n<N) is the pole of the system function. A is a constant, and may be a real number or a complex number.
Order:
z=e jω ;
z, z 0,m 、z p,n Substituting equation (1) results in the frequency response of the system function:
it can be seen that the process of solving the system function of formula (2) is equivalent to solving the parameter set [ a; r is 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 ]The process of (1). Wherein A is amplitude, [ r ] 0,1 ,r 0,2 ,…,r 0,M ;θ 0,1 ,θ 0,2 ,…,θ 0,M ]Is a set of poles, [ r ] p,1 ,r p,2 …,r p,N ;θ p,1 ,θ p,2 ,…θ p,N ]Is a set of zeros.
In the embodiment of the present application, the current filter parameter may be in the form of the above-mentioned parameter set composed of the amplitude, a set of poles and a set of zeros, or in the form of modeling and describing the IIR digital filter by using other methods or forms, for example, the numerator and denominator of the IIR digital filter system function directly adopt the form of polynomial. The specific method can be selected according to actual situations, and the embodiment of the present application is not particularly limited.
In the embodiment of the present application, for setting of the initial filter parameter, the filter parameter in the parameter set may be initialized to a random value within a legal range, where the parameter a needs to be initialized to a non-0 value; or may be initialized to a parameter set of an IIR digital filter obtained using other methods. The specific choice can be made according to the actual situation, and the embodiment of the present application is not specifically limited. It should be noted that for a stable IIR digital filter, it is required that the magnitude of the pole cannot exceed 1, i.e. the pole is within the unit circle.
In the embodiment of the present application, the plurality of loss functions are designed according to the degree of deviation between the amplitude responses at the plurality of band frequency points and the corresponding plurality of design targets and the loss factors at the plurality of band frequency points.
In an alternative embodiment, for the pass-band loss function, it is generally desirable in engineering applications that the magnitude response of the designed filter in the pass-band is as close as possible to an ideal magnitude response, which is the design goal of the pass-band described in this application, and the ideal magnitude response is recorded as | H d (e jω )|。
The total loss function of the designed IIR digital filter passband is recorded as:
wherein the function l p |H(e jω )|,|H d (e jω ) | b) is the amplitude response loss function at the pass band frequency ω and describes | H (e) jω ) I and H d (e jω ) The degree of deviation of. | H (e) jω ) I and H d (e jω ) The greater the deviation of l, the greater l p (|H(e jω )|,|H d (e jω ) The larger the value of i). | H (e) jω ) I and H d (e jω ) The smaller the deviation of l, the p (|H(e jω )|,|H d (e jω ) The smaller the value of i). Function l p The specific form of (x, y) is not limited herein, only that it be capable of quantifying | H (e) jω ) I and H d (e jω ) I and makes the loss function L shown in equation (3) p Parameter set [ A, r ] for IIR digital filter m ,θ m ,r n ,θ n ](0<m<M,0<n<N) can be calculated normally. Alpha is alpha p And (omega) is a loss factor at the passband frequency omega, and different weights can be given to the loss of different frequency points according to actual requirements.
And under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter corresponding to the sampling frequency in the interval of [0,2 pi ] is K.
Let the corresponding digital frequency coordinate of the lower limit of the passband frequency in the formula (3) at the sampling frequency be k p,start The digital frequency coordinate corresponding to the upper limit of the passband frequency is k p,end Then, equation (4) may be used instead of the integral operation shown in equation (3):
without loss of generality, the pass-band amplitude loss is recorded as shown in equation (5):
wherein the content of the first and second substances,the loss function of the magnitude response of a designed digital filter at the digital frequency coordinate k. The specific form of the function is not limited in the embodiments of the present application, but only requires that it be capable of quantificationDeviation from the design target and make the loss function L shown in equation (5) p Parameter set [ A, r ] for IIR digital filter m ,θ m ,r n ,θ n ](0<m<M,0<b<N) can be calculated normally.
It should be noted that, for IIR digital filters of band-stop filters and the like, the number of pass bands may be greater than 1. When the number of pass bands is greater than 1, a loss function as shown in the above-described formula (3), formula (4), and formula (5) exists separately for each pass band.
In another alternative embodiment, the requirements for the stop band loss function of the designed filter's amplitude response at the stop band are expected to be different in different application scenarios. In some scenarios, it may be desirable that the magnitude response of the stop band not exceed a certain constant threshold. In some scenarios, it may be desirable that the magnitude response of the stop band be at least some constant value lower than the magnitude response of the pass band. In some scenarios, it may be desirable that the magnitude response of the stop band not exceed meet a certain envelope curve. In some scenarios, it may be desirable to have the stopband amplitude response as close as possible to some ideal amplitude response curve, perhaps similar to the passband portion. The above-mentioned constant threshold value, constant value, specific envelope curve and/or ideal amplitude response curve are the design objectives of the stop band described in this application.
For the sake of no loss of generality, the stopband amplitude loss is recorded as in equation (6):
wherein l s (|H(e jω ) | is the amplitude response loss function at the stop band frequency ω and describes | H (e) jω ) The degree of deviation from the design target. Function l s (x) Is not limited herein, but is only required to be capable of quantifying | H (e) jω ) The degree of deviation from the design target, and the loss function L shown in (equation 6) s Parameter set [ A, r ] for IIR digital filter m ,θ m ,r n ,θ n ](0<m<M,0<n<N) can be calculated normally. Alpha is alpha s And (ω) is a loss factor at the stop band frequency ω, and different weights can be given to the loss at different frequency points according to actual requirements.
And under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter corresponding to the sampling frequency in the interval of [0,2 pi ] is K.
Let the digital frequency coordinate of the lower limit of the stop band frequency in the formula (6) corresponding to the sampling frequency be k s,start The digital frequency coordinate corresponding to the upper limit of the stop band frequency is k s,end Then, equation (7) may be used instead of the integral operation shown in equation (5):
for IIR digital filters of the band pass filter type or the like, the number of stopbands may be greater than 1. When the number of stop bands is greater than 1, a loss function as shown in the above equation (6) and equation (7) exists separately for each stop band.
In yet another alternative embodiment, similar to the stop band, for the transition band, in different application scenarios, it is desirable that the requirements of the designed filter for the amplitude response of the transition band are different. In some scenarios, it may be required that the amplitude response of the transition band does not exceed a threshold value that satisfies a constant, for example, in logarithmic coordinates, the amplitude responses of all frequency bins of the transition band are required to be lower than the minimum value of the amplitude response of the pass band. In some scenarios, it may be desirable that the magnitude response of the transition zone not exceed that which satisfies a particular envelope curve. In some scenarios, it may be desirable to have the amplitude response of the transition band as close as possible to some ideal amplitude response curve, possibly similar to the passband portion. The above-mentioned constant threshold values, constant values, specific envelope curves and/or ideal amplitude response curves are the design goals of the transition zone described in this application.
For the sake of no loss of generality, the transition band amplitude loss is written as formula (8):
wherein l t (|H(e jω ) Is the amplitude response loss function at frequency point omega, and describes the amplitude response | H (e) of the transition band jω ) And the greater the deviation degree is, the larger the value of the function is, and the smaller the deviation degree is, the smaller the value of the function is. Function l t (x) Is not limited herein, but is only required to be able to quantify the magnitude response | H (e) of the transition zone jω ) The degree of deviation of | from the design target and the loss function L shown in equation (8) t Parameter set [ A, r ] for IIR digital filter m ,θ m ,r n ,θ n ](0<m<M,0<n<N) can be calculated normally. Alpha (alpha) ("alpha") t (ω) is a loss weighting factor at the stop band frequency ω, and different weights can be given to the losses at different frequency points according to actual requirements.
And under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter corresponding to the sampling frequency in the interval of [0,2 pi ] is K.
The lower limit of the transition band frequency in the formula (8) is recorded as k under the condition of the sampling frequency, and the corresponding digital frequency coordinate is t,start And the digital frequency coordinate corresponding to the upper limit of the stop band frequency is k t,end Then, equation (9) may be used instead of the integral operation shown in equation (8):
for IIR digital filters of the band pass filter or band stop filter type, the number of transition bands may be greater than 1. When the number of transition zones is greater than 1, the loss functions as shown in the above equations (8) and (9) exist separately for each transition zone.
For example, let the total number of passbands of the designed IIR digital filter be denoted as I p The total number of stopbands is denoted as I s And the total number of transition zones is marked as I t (ii) a The total loss function is defined as the weighted sum of the loss functions of all pass, stop, and transition bands, as shown in equation (10):
wherein L is Total The weighted total loss function of all the pass band, stop band and transition band of the filter. The total loss function describes the total deviation degree between all the pass band, stop band, transition band and design target of the IIR digital filter. The balance among performance indexes of each stop band, each pass band and each transition band of the IIR digital filter can be realized by adopting the weighted total loss functions of all the pass bands, the stop bands and the transition bands as optimization targets.
Wherein the content of the first and second substances,is the ith (1 ≦ I ≦ I) p ) A weighting factor for the total loss of each pass band,is the total loss of the ith pass band, which is found according to equation (3), equation (4) or equation (5).Is the ith (1 is more than or equal to I is less than or equal to I) s ) The weighting factor of the total loss of the individual stop bands,according to the formula (6) orThe total loss of the ith stop band is found by equation (7).Is the ith (1 is more than or equal to I is less than or equal to I) t ) The weighting factor of the total loss of each transition zone,the total loss of the i-th transition zone is found according to equation (8) or equation (9).
It should be noted that, according to the design objectives of all the pass bands, stop bands, and transition bands, the loss functions of the pass bands, stop bands, and transition bands are definedWherein, I p 、I s 、I t Respectively the number of pass bands, stop bands, transition bands. Under the condition that the continuous frequency components are considered,the functional forms of (a) are shown in formula (3), formula (6) and formula (8), respectively. In the case of discrete digital frequencies representing the frequency domain amplitude response,the functional forms of (a) are shown in formula (5), formula (7) and formula (9), respectively. The specific choice can be made according to the actual situation, and the embodiment of the present application is not specifically limited.
It should be noted that, in the embodiment of the present application, specific forms of the loss functions of the pass band, the stop band, and the transition band are not particularly limited. Various different forms of loss functions describing different design objectives may be used and may be used in the design of IIR filters for various different criteria.
In the embodiment of the present application, the total loss function is a loss function designed by performing weighted summation processing on a plurality of loss functions based on a plurality of weighting factors corresponding to a plurality of frequency bands.
It should be noted that by controlling each weighting factorCan control the proportion of the loss of each pass band, stop band and transition band in the total loss.
It should be noted that, in the embodiments of the present application, no specific limitation is imposed on the design targets of the passband, the stopband, and the transition band of the IIR digital filter and the form of the loss function, and the design targets may be used to design IIR digital filters required by various indexes, and the design of the IIR digital filter may be performed for different design targets. For example, the frequency domain amplitude response of the designed filter can be made to approach some predefined ideal target curve at any pass band, stop band, or transition band. Any pass band, stop band or transition band may also be made to meet a certain threshold requirement, which may be a constant or the shape of a certain characteristic.
It should be noted that, in practical applications, the design target for the pass band is often higher than the design targets for the stop band and the transition band, different loss functions are set for the pass band, the stop band, and the transition band, different design targets of different frequency bands can be balanced, and further more design resources can be set for the design of the pass band.
In an embodiment of the present application, the current filter parameters include: the amplitude value is a real number, and the corresponding amplitude and phase of the group of zero points and the group of poles after the group of zero points and the group of poles are represented by polar coordinates are real numbers; respectively 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 to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands, comprising: determining a starting zero point and an intermediate zero point from a set of zero points; determining a zero point between the initial zero point and the middle zero point as a zero point to be input; determining a starting pole and a middle pole from a set of poles; determining a pole between the initial pole and the middle pole as a pole to be input; and respectively inputting the amplitude, the zero to be input and the pole to be input into the plurality of loss functions and the total loss function to obtain a plurality of loss values and a plurality of total loss values.
It should be noted that, for an IIR digital filter with all real filter parameters, when the number of zeros or poles is an even number, the zeros or poles must form a pairwise conjugate symmetric relationship; when the number of the zeros or poles is odd, even numbers (including 0) of the zeros or poles must be conjugate of each other, and the rest odd numbers of the zeros or poles must be real numbers. According to the characteristic, only half of parameters need to be calculated for even numbers of zeros and poles in conjugate symmetry, and the calculation amount can be reduced.
For example, 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. M and N are both non-0 even numbers, and A is a positive real number. Under this condition, the frequency response of the filter is adjusted from equation (2) to equation (11):
s102, determining the current filter parameters as the design parameters of the filter under the condition that the performance indexes of a plurality of frequency bands meet a plurality of corresponding design targets according to the plurality of loss values and the total loss value.
After the current filter parameter is respectively input into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter to obtain a plurality of loss values and total loss values corresponding to the plurality of frequency bands, whether the performance indexes of the plurality of frequency bands meet a plurality of corresponding design targets is determined according to the plurality of loss values and the total loss values, and the current filter parameter is directly determined as the design parameter of the filter under the condition that the performance indexes of the plurality of frequency bands meet the plurality of corresponding design targets according to the plurality of loss values and the total loss values.
Further, under the condition that the performance indexes of a plurality of frequency bands do not meet a plurality of corresponding design targets according to a plurality of loss values and a total loss value, solving the gradient corresponding to the current filter parameter for a total loss function to obtain a total gradient value; determining the next filter parameter according to the total gradient value and the current filter parameter; and inputting the next filter parameter into a plurality of loss functions and a total loss function respectively to calculate the loss value.
Note the bookL shown in the formula (10) Total And each component thereof Du ShiIs measured as a function of (c). On both sides of equation (10) are relatedThe formula (12) is obtained, and the total gradient value can be obtained by using the formula (12).
In the embodiment of the application, the total loss function is subjected to gradient corresponding to the current filter parameter, and the convergence parameters of a plurality of frequency bands can be detected in the process of obtaining the total gradient value; adjusting a plurality of weighting factors according to the convergence parameters to obtain a plurality of adjusted weighting factors; then, based on the adjusted weighting factors, generating an adjusted total loss function; and solving the gradient corresponding to the current filter parameter for the adjusted total loss function to obtain a total gradient value.
It should be noted that, in the formula (12), convergence parameters related to convergence conditions of the pass band, the stop band and the transition band can be detected, and each weighting factor can be controlledAnd then controlling the gradient component of each pass band, stop band and transition bandFor total gradientThe influence in (2) can further prevent the local indexes from being over-optimized, and the final design parameters can be ensured to reach the balance among different design targets. The convergence parameter may include parameters such as a convergence rate and a convergence degree, which may be specifically selected according to an actual situation, and the embodiment of the present application is not specifically limited.
In the embodiment of the present application, determining the next filter parameter according to the overall gradient value and the current filter parameter includes: determining a product value between the total gradient value and the learning step; and determining the difference value between the current filter parameter and the product value as the next filter parameter.
It should be noted that, the present application uses a gradient descent method to iteratively find the next filter parameter, and an alternative manner may refer to equation (13):
wherein alpha is (k) (α (k) >0) To learn the step size. Exemplary, α (k) The value is generally 0.01 or 0.02, which can be selected according to practical situations, and the embodiments of the present application are not particularly limited.
It should be noted that the above formula (13) is only an optional gradient descent method, and specifically, other gradient descent methods may also be selected according to the actual application requirements, such as but not limited to: small Batch Gradient Descent (MBGD), i.e. calculating Gradient componentsAndin the process, all frequency points of corresponding frequency bands are not adopted, and only the gradient accumulation of partial frequency points is countedAccumulating; momentum Gradient decline (Momentum); adaptive Gradient Descent (AdaGrad); root Mean Square Propagation (RMSProp); adaptive momentum Estimation (Adam), and the like.
It should be noted that, besides the gradient descent method, other algorithms for obtaining filter parameters of the corresponding IIR digital filter when the weighted total loss function shown in the formula (10) is minimized also belong to the protection scope of the embodiments of the present application.
For example, a filter design process corresponding to the above embodiment may be as shown in fig. 2, where the process includes:
1. determining the design targets of a pass band, a stop band and a transition band of the IIR digital filter;
2. according to the design targets of the pass band, the stop band and the transition band, defining the loss functions of the pass band, the stop band and the transition band
4. Calculating the loss of each pass band, stop band and transition band And is currentlyCorresponding total loss function L Total (k) 。
5. According toLoss of each corresponding pass band, stop band and transition bandAnd total loss L Total (k) Judging whether the performance indexes of each passband, stopband and transition band meet the design target;
6. if the performance indexes of each pass band, stop band and transition band meet the design target, outputtingAs a result of the design;
7. if the performance indexes of each pass band, stop band and transition band do not meet the design target, calculatingAnd k is k +1, and the iteration is continued by returning to the step 4.
In this embodiment of the present application, under the condition that it is determined that the performance indexes of the multiple frequency bands do not satisfy the corresponding multiple design targets according to the multiple loss values and the total loss value, solving a gradient corresponding to a current filter parameter for the total loss function to obtain a total gradient value, including: determining a first loss function corresponding to a first frequency band from a plurality of loss functions under the condition that the performance index of the first frequency band in the plurality of frequency bands is determined not to meet the corresponding first design target according to the plurality of loss values and the total loss value; solving the gradient corresponding to the current filter parameter for the first loss function to obtain a first gradient component; zeroing a second gradient component corresponding to the second frequency band; the second frequency band is a frequency band except the first frequency band in the plurality of frequency bands; and determining a total gradient value according to the plurality of weighting factors, the second gradient component after being set to zero and the first gradient component.
It should be noted that, in the iterative calculation process of the design parameters of the filter, the performance indexes of each pass band, stop band and transition band may not all meet the design target in the same iteration. Therefore, after a certain iteration, if the performance indexes of a single or a part of pass band, stop band and transition band reach the design target, 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. The method can prevent part of performance indexes from far exceeding the set design target, so that all the design performances of all the final pass bands, stop bands and transition bands reach an optimal balance. The method can omit the calculation of partial gradient components, can reduce partial calculation amount to a certain extent, and accelerates the whole calculation process.
For example, referring to fig. 2, in consideration of the scenario of gradient component zero setting, the filter design flow corresponding to the above embodiment may be as shown in fig. 3, and the flow includes:
1. determining design targets of a pass band, a stop band and a transition band of the IIR digital filter;
2. according to the design targets of the pass band, the stop band and the transition band, defining the loss functions of the pass band, the stop band and the transition band
4. Calculating the loss of each pass band, stop band and transition band And is currentlyCorresponding total loss function L Total (k) 。
5. According toLoss of each corresponding pass band, stop band and transition bandAnd total loss L Total (k) Judging whether the performance indexes of each passband, stopband and transition band meet the design target;
6. if the performance indexes of each pass band, stop band and transition band meet the design target, outputtingAs a result of the design;
7. if the performance indexes of any one of the pass band, the stop band and the transition band do not meet the design target, executing 8-16;
8. judging whether the performance index of each passband meets the corresponding design target;
9. if the ith (1. ltoreq. i.ltoreq.I) p ) If the performance index of each pass band does not meet the corresponding design target, calculating
10. If the ith (1. ltoreq. i.ltoreq.I) p ) If the performance index of each pass band meets the corresponding design target, setting
11. Judging whether the performance index of each stop band meets the corresponding design target;
12. if the ith (1. ltoreq. i.ltoreq.I) s ) If the performance index of each stop band does not meet the corresponding design target, calculating
13. If the ith (1. ltoreq. i.ltoreq.I) s ) If the performance index of each stop band meets the corresponding design target, the stop band is set
14. Judging whether the performance index of each transition zone meets the corresponding design target or not;
15、if the ith (1. ltoreq. i.ltoreq.I) t ) If the performance index of each transition zone does not meet the corresponding design target, calculating
16. If the ith (1. ltoreq. i.ltoreq.I) t ) If the performance index of each transition zone meets the corresponding design target, setting
By adopting the filter design method provided by the application, the filter parameters can better meet the design target through multiple iterations, specifically, referring to fig. 4, the initial state of the iteration, the result of 50000 iterations, the result of 100000 iterations and the result of 500000 iterations are shown, the main comparison parameter is the IIR data filter amplitude a, wherein the value of the amplitude a is a logarithm taking 10 as a base; zero and pole of IIR filter, wherein the horizontal axis is real part, and the vertical axis is imaginary part; frequency domain amplitude response of the IIR digital filter; total loss variation curve. As can be seen from fig. 4, the magnitude a, the zero and the pole of the IIR data filter all change during each iteration; along with the increase of the iteration times, the frequency domain amplitude response curve is closer to the pass band ideal amplitude vector and the stop band amplitude response threshold; the total loss becomes smaller as the number of iterations increases.
It can be understood that, based on the design target corresponding to each frequency band, a corresponding loss function is designed for each frequency band, and the loss functions of a plurality of frequency bands are weighted and summed to generate a total loss function; then, current filter parameters can be trained together based on a plurality of loss functions and total loss functions corresponding to a plurality of frequency bands, balance among design targets of different frequency bands is considered, different filter performance indexes can be met simultaneously, flexibility of filter design is improved, and performance of the designed filter is enabled to be better.
Based on the above embodiment, an exemplary design process of the present application is described by taking an IIR digital low-pass filter, which is stable and has an even number of all real parameters, zeros, and poles, as follows:
1. determining design indexes of the IIR digital filter: assume that the performance criteria of the filter to be designed are as follows:
(1) and all parameters of the system function of the IIR digital low-pass filter required to be designed are real numbers, the total number of zeros is M, and the total number of poles is N. Both M and N are non-0 even numbers. Under this condition, the frequency response of the filter can be formula (11):
in this example, assume that A is a positive real number.
(2) Assuming the initial digital frequency of the pass band is omega p,statr 0, passband cutoff number frequency ω p,end (0<ω p,end <Pi). Assuming that the desired magnitude response of the filter passband to be designed is H, within the passband d (e jω ). The ideal magnitude response of the filter in log-scale coordinates is:
|H d (e jω )| dB =10·log 10 (|H d (e jω )|) 2 dB,ω p,start ≤ω≤ω p,end (14)
(3) assuming the starting frequency of the stop band is omega s,start (ω p,end <ω s,start <Pi), stop band cut-off digital frequency is omega s,end Pi. Within the whole stop band (omega) s,start ≤ω≤ω s,end ) The amplitude response of the filter is less than a predefined threshold function delta s (ω) dB, i.e. satisfying: 10 log 10 (|H(e jω )|) 2 <δ s (ω)dB,ω s,start ≤ω≤ω s,end 。
(4) Assuming the range of digital frequencies of the transition band of the filter is omega p,end <ω<ω s,start The design goal of the frequency magnitude response of the transition band of the filter is that the magnitude response of all frequencies within the entire transition band is less than the magnitude response at the cutoff frequency of the pass band Namely, the following conditions are satisfied:ω p,end <ω<ω s,start 。
(5) and under the condition of digital frequency representation, the number of sampling points of the designed IIR digital filter corresponding to the sampling frequency in the interval of [0,2 & pi ] is K.
2. And determining loss functions of the pass band, the stop band and the transition band.
In this embodiment, all loss functions under the logarithmic coordinate condition are adopted. The magnitude response of the IIR digital filter under the logarithmic coordinate condition is as the formula (15):
1) pass band loss function
Under the current sampling rate condition, the passband starting frequency index is: k is a radical of p,start 0, passband cutoff index ofWherein ceil is rounding up.
For the design objective for the pass band described in (2) in 1, the loss function of the following equation (16) is used to measure the deviation degree of the pass band amplitude response from the design objective:
wherein the parametersβ p Which is a positive number, can be used to adjust the degree of variation of the loss function with respect to the degree of deviation of the passband magnitude response from the design target. This equation is the total loss function of the passband.
2) Stop band loss function
Under the current sampling rate condition, the stopband start frequency index is:wherein floor denotes rounding down. The stopband cut-off frequency index isceil is rounding up.
For the design objective described in (4) in fig. 1, it is assumed that the following formula (17) loss function is used to measure the deviation degree of the stop band amplitude response with respect to the stop band amplitude response threshold requirement:
wherein the parameter beta s Which is a positive number, can be used to adjust the degree to which the loss function varies with respect to the stop band amplitude response without meeting the cut-off amplitude response requirement.
3) Transition band loss function
Under the condition of the current sampling rate, the initial frequency index of the transition zone is as follows: k is a radical of t,start =k p,start +1, wherein. Transition band cut-off frequency index of k t,end =k s,start -1。
For the design objective described in (5) in fig. 1, it is assumed that the loss function of the following equation (18) measures the deviation degree of the stop band amplitude response with respect to the stop band amplitude response threshold requirement:
wherein parameter beta t Is a positive number and can be used to adjust the loss functionThe degree of change in the cutoff amplitude response requirement is not satisfied with respect to the transition band amplitude response.
4) Total loss function
The total loss function is a weighted sum of the loss functions shown in (16), (17), and (18), and is expressed by reference to equation (19):
L Total =C p ·L p +C s ·L s +C t ·L t (19)
wherein, C p 、C s 、C t A weighting factor for each loss.
3. Method for calculating gradient of loss function with respect to IIR filter parameter set
For both sides of equation (19) a set of parameters is soughtThen the total loss function is related toThe gradient of (1) is related to the pass band, stop band, transition band lossesAs shown in equation (20):
whereinRespectively, equation (16), equation (17), equation (18) aboutThe gradient of (2) is specifically determined as follows.
1) Gradient of pass band
for equation (21), L can be found by one-by-one p AboutPartial derivatives of each element of (a) to obtain L p AboutAs shown in the following equations (22-26):
2) stop band gradient
for equation (27), L can be found by one-by-one s AboutPartial derivatives of each element of (a) to obtain L s AboutAs shown in the following equations (28-32):
3) transition zone gradient
for equation (33), L can be obtained by finding L one by one t AboutPartial derivatives of each element of (a) to obtain L t AboutAs shown in the following equations (34-38):
Relating the loss of the pass band, stop band and transition band calculated in the above 1), 2) and 3) toIs substituted into equation (20), the total loss is obtainedOf the gradient of (c).
Loss functions of pass band, stop band and transition band defined by the above 1, 2 and 3 strips, and their relationThe gradient calculation method is brought into an iterative solution process, and the parameter set of the filter can be iteratively solved
It should be noted that for a stable IIR digital filter, whose poles should all be within the unit circle, then after iteration using equation (13), the magnitude r for any pole is p,n (1<n<N) if after a certain iteration r p,n (k) Is greater than 1, it can be forced to 1, or a positive number less than 1 weak, to ensure that the final filter is stable.
Fig. 5 and 6 show examples of an all-real parametric, stable IIR low-pass digital filter designed using the method described above. Wherein figure 5 is a step diagram of the magnitude a and pole zero of the IIR low-pass digital filter designed. Fig. 6 is a frequency domain amplitude response of an IIR low-pass digital filter. As can be seen from FIG. 6, at the frequency point of 0.15 pi, the error between the passband amplitude response and the passband ideal amplitude response of the IIR low-pass filter is the largest and is 0.001038961563820662dB, so that the amplitude response curve of the IIR low-pass filter approaches to the passband ideal amplitude response and the stopband amplitude response threshold.
The stable IIR low-pass digital filter with full real number parameters, which is designed by adopting the method, has the specific design targets as follows:
(1) the IIR digital low-pass filter requires a full real number coefficient and is stable; the number of zeros is 30 and the number of poles is 30.
(2) Pass band: passband digital frequencyIn a ratio range ofThe desired amplitude response within the pass band isThat is, the ideal amplitude response in the pass band is an inverse parabola whose amplitude response is at the point where the lowest frequency point ω of the pass band is 0Highest frequency point in pass bandThe amplitude response at (a) is 0 dB. The design goal of the pass band is to minimize the maximum error between the magnitude response of the designed IIR filter and the ideal magnitude response over the entire pass band.
(3) Stop band: the stopband digital frequency range isIn the first half range of stop bandWithin, the maximum amplitude response of the stop band is required to be no more than-50 dB; in the second half of the stop bandWithin, the maximum amplitude response of the stop band is required to be no greater than-70 dB.
(4) Transition zone: transition band digital frequency range ofThe maximum amplitude response is required within the whole transition band, and is not higher than the highest frequency of the pass bandThe actual amplitude response of (d).
Under the condition of the target requirements, the indexes which can be actually achieved by the IIR digital filter designed by adopting the method in one test are as follows (the (1) and (4) are met):
the maximum absolute error of the amplitude response in the pass band from the ideal amplitude response is 0.001038961563820662 dB;
the maximum amplitude response of the first half of the stop band is-50.00000001521959 dB; the maximum amplitude response of the latter half of the stop band is-70.15759515530789 dB.
It should be noted that the performance index of the IIR digital filter designed by the above method is not the limit performance index that can be achieved by the method, but is only the index that can be actually achieved in one test.
Based on the foregoing embodiments, the present application provides a filter design apparatus. As shown in fig. 7, the filter designing apparatus 1 includes:
an obtaining unit 10, configured to obtain current filter parameters;
a loss calculating unit 11, configured to input the current filter parameter into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter, respectively, to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands;
a parameter design unit 12, configured to determine, when it is determined that the performance indicators of the multiple frequency bands meet the corresponding multiple design targets according to the multiple loss values and the total loss value, the current filter parameter as a design parameter of the filter;
wherein the plurality of loss functions are designed according to the plurality of design objectives corresponding to the plurality of frequency bands;
the total loss function is a loss function designed by performing weighted summation processing on the plurality of loss functions based on a plurality of weighting factors corresponding to the plurality of frequency bands.
In some embodiments of the present application, the apparatus further comprises: a gradient calculation unit;
the gradient calculating unit is further configured to, when it is determined that the performance indexes of the multiple frequency bands do not satisfy the corresponding multiple design targets according to the multiple loss values and the total loss value, solve 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; and inputting the next filter parameter into the plurality of loss functions and the total loss function respectively for loss value calculation.
In some embodiments of the present application, the apparatus further comprises: a determination unit;
the determination unit is used for determining a product value between the total gradient value and a learning step; determining a difference between the current filter parameter and the product value as the next filter parameter.
In some embodiments of the present application, the determining unit is further configured to determine, when it is determined that the performance indicator of a first frequency band of the plurality of frequency bands does not meet a corresponding first design target according to the plurality of loss values and the total loss value, a first loss function corresponding to the first frequency band from the plurality of loss functions;
the gradient calculation unit is further configured to calculate a gradient corresponding to the current filter parameter for the first loss function to obtain a first gradient component; zeroing a second gradient component corresponding to the second frequency band; the second frequency band is a frequency band of the plurality of frequency bands except the first frequency band; and determining the total gradient value according to the plurality of weighting factors, the zeroed second gradient component and the first gradient component.
In some embodiments of the present application, the apparatus further comprises: a detection unit and an adjustment unit;
the detection unit is used for detecting convergence parameters of the plurality of frequency bands;
the adjusting unit is configured to adjust the multiple weighting factors according to the convergence parameter to obtain multiple adjusted weighting factors; generating an adjusted total loss function based on the adjusted plurality of weighting factors;
the gradient calculating unit is further configured to calculate a gradient corresponding to the current filter parameter for the adjusted total loss function, so as to obtain the total gradient value.
In some embodiments of the present application, the current filter parameters include: the amplitude value is a real number, and the corresponding amplitude and phase of the group of zero points and the group of poles after the group of zero points and the group of poles are represented by polar coordinates are real numbers;
the determining unit is further configured to determine a starting zero point and an intermediate zero point from the set of zero points; determining a zero point between the initial zero point and the middle zero point as a zero point to be input; determining a starting pole and a middle pole from the set of poles; determining a pole between the initial pole and the middle pole as a pole to be input;
the loss calculating unit 11 is further configured to input the amplitude, the zero 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.
In some embodiments of the present application, the plurality of frequency bands include at least one pass band, at least one stop band, and at least one transition band.
The filter design device provided by the embodiment of the application acquires current filter parameters; respectively inputting current filter parameters into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands; determining the current filter parameter as the design parameter of the filter under the condition that the performance indexes of a plurality of frequency bands meet a plurality of corresponding design targets according to a plurality of loss values and a total loss value; the loss functions are designed according to a plurality of design targets corresponding to a plurality of frequency bands; the total loss function is a loss function designed by performing weighted summation processing on a plurality of loss functions based on a plurality of weighting factors corresponding to a plurality of frequency bands. Therefore, the filter design device provided in this embodiment designs a corresponding loss function for each frequency band based on the design target corresponding to each frequency band, and performs weighted summation on the loss functions of multiple frequency bands to generate a total loss function; then, current filter parameters can be trained together based on a plurality of loss functions and total loss functions corresponding to a plurality of frequency bands, balance among design targets of different frequency bands is considered, different filter performance indexes can be met simultaneously, flexibility of filter design is improved, and performance of the designed filter is enabled to be better.
Fig. 8 is a schematic diagram of a second composition structure of a filter design apparatus 1 according to an embodiment of the present application, and in practical applications, based on the same disclosure concept of the foregoing embodiment, as shown in fig. 8, the filter design apparatus 1 according to the present embodiment includes: a processor 13, a memory 14, and a communication bus 15.
In a Specific embodiment, the obtaining unit 10, the loss calculating unit 11, the parameter designing unit 12, the gradient calculating unit and the determining unit may be implemented by a Processor 13 located on the filter designing apparatus 1, and the Processor 13 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal 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 is understood that the electronic device for implementing the above-mentioned processor function may be other devices, and the embodiment is not limited in particular.
In the embodiment of the present application, the communication bus 15 is used to implement connection communication between the processor 13 and the memory 14; the processor 13 implements the following filter design method when executing the operating program stored in the memory 14:
acquiring current filter parameters; respectively 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 a filter to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands;
determining the current filter parameter as the design parameter of the filter under the condition that the performance indexes of the plurality of frequency bands meet a plurality of corresponding design targets according to the plurality of loss values and the total loss value;
wherein the plurality of loss functions are designed according to the plurality of design goals corresponding to the plurality of frequency bands;
the total loss function is a loss function designed by performing weighted summation processing on the plurality of loss functions based on a plurality of weighting factors corresponding to the plurality of frequency bands.
In some embodiments of the present application, the processor 13 is further configured to, when it is determined that the performance indicators of the multiple frequency bands do not meet the corresponding multiple design targets according to the multiple loss values and the total loss value, solve the 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; and inputting the next filter parameter into the plurality of loss functions and the total loss function respectively for loss value calculation.
In some embodiments of the present application, the processor 13 is further configured to determine a product value between the total gradient value and a learning step; determining a difference between the current filter parameter and the product value as the next filter parameter.
In some embodiments of the present application, the processor 13 is further configured to determine, from the plurality of loss functions, a first loss function corresponding to a first frequency band in the plurality of frequency bands when it is determined that the performance indicator of the first frequency band does not meet a corresponding first design objective according to the plurality of loss values and the total loss value; solving a gradient corresponding to the current filter parameter for the first loss function to obtain a first gradient component; zeroing a second gradient component corresponding to the second frequency band; the second frequency band is a frequency band of the plurality of frequency bands except the first frequency band; and determining the total gradient value according to the weighting factors, the zeroed second gradient component and the first gradient component.
In some embodiments of the present application, the processor 13 is further configured to detect a convergence parameter of the plurality of frequency bands; adjusting the weighting factors according to the convergence parameters to obtain adjusted weighting factors; generating an adjusted total loss function based on the adjusted plurality of weighting factors; and solving the gradient corresponding to the current filter parameter for the adjusted total loss function to obtain the total gradient value.
In some embodiments of the present application, the current filter parameters include: the amplitude value is a real number, and the corresponding amplitude and phase of the group of zero points and the group of poles after the group of zero points and the group of poles are represented by polar coordinates are real numbers;
the processor 13 is further configured to determine a starting zero point and an intermediate zero point from the set of zero points; determining a zero point between the initial zero point and the middle zero point as a zero point to be input; determining a starting pole and an intermediate pole from the set of poles; determining a pole between the initial pole and the middle pole as a pole to be input; and inputting the amplitude, the zero to be input and the pole to be input into the loss functions and the total loss function respectively to obtain a plurality of loss values and a plurality of total loss values.
In some embodiments of the present application, the plurality of frequency bands include at least one pass band, at least one stop band, and at least one transition band.
The embodiment of the application provides a storage medium, on which a computer program is stored, wherein 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, and the computer program realizes the filter design method.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling an image display device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present disclosure.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application.
Claims (10)
1. A method of filter design, the method comprising:
acquiring current filter parameters; respectively 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 a filter to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands;
determining the current filter parameter as the design parameter of the filter under the condition that the performance indexes of the plurality of frequency bands meet a plurality of corresponding design targets according to the plurality of loss values and the total loss value;
wherein the plurality of loss functions are designed according to the plurality of design objectives corresponding to the plurality of frequency bands;
the total loss function is a loss function designed by performing weighted summation processing on the plurality of loss functions based on a plurality of weighting factors corresponding to the plurality of frequency bands.
2. The method according to claim 1, wherein after the current filter parameter is respectively input into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter, and a plurality of loss values and a total loss value corresponding to a plurality of frequency bands are obtained, the method further comprises:
under the condition that the performance indexes of the frequency bands do not meet a plurality of corresponding design targets according to the loss values and the total loss value, solving the 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;
and inputting the next filter parameter into the plurality of loss functions and the total loss function respectively to calculate the loss value.
3. The method of claim 2, wherein determining a next filter parameter based on the overall gradient value and the current filter parameter comprises:
determining a product value between the total gradient value and a learning step;
determining a difference between the current filter parameter and the product value as the next filter parameter.
4. The method according to claim 2, wherein the obtaining a total gradient value by obtaining a gradient corresponding to the current filter parameter from the total loss function when determining that the performance indicators of the plurality of frequency bands do not satisfy the corresponding plurality of design objectives according to the plurality of loss values and the total loss value comprises:
under the condition that the performance index of a first frequency band in the plurality of frequency bands is determined not to meet a corresponding first design target according to the plurality of loss values and the total loss value, determining a first loss function corresponding to the first frequency band from the plurality of loss functions;
solving a gradient corresponding to the current filter parameter for the first loss function to obtain a first gradient component;
zeroing a second gradient component corresponding to the second frequency band; the second frequency band is a frequency band of the plurality of frequency bands except the first frequency band;
and determining the total gradient value according to the weighting factors, the zeroed second gradient component and the first gradient component.
5. The method of claim 2, wherein the obtaining the gradient corresponding to the current filter parameter for the total loss function to obtain a total gradient value comprises:
detecting convergence parameters of the plurality of frequency bands;
adjusting the weighting factors according to the convergence parameters to obtain adjusted weighting factors;
generating an adjusted total loss function based on the adjusted plurality of weighting factors;
and solving the gradient corresponding to the current filter parameter for the adjusted total loss function to obtain the total gradient value.
6. The method of claim 1, wherein the current filter parameters comprise: the amplitude value is a real number, and the corresponding amplitudes and phases of the group of zero points and the group of poles after the group of zero points and the group of poles are represented by polar coordinates are real numbers; the obtaining a plurality of loss values and a total loss value corresponding to a plurality of frequency bands by inputting the current filter parameter into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter respectively includes:
determining a starting zero point and an intermediate zero point from the set of zero points; determining a zero point between the initial zero point and the middle zero point as a zero point to be input;
determining a starting pole and a middle pole from the set of poles; determining a pole between the initial pole and the middle pole as a pole to be input;
and inputting the amplitude, the zero to be input and the pole to be input into the loss functions and the total loss function respectively to obtain a plurality of loss values and a plurality of total loss values.
7. The method of claim 1, wherein the plurality of frequency bands comprise at least one pass band, at least one stop band, and at least one transition band.
8. A filter design apparatus, the filter design apparatus comprising:
an obtaining unit, configured to obtain a current filter parameter;
a loss calculation unit, configured to input the current filter parameter into a plurality of loss functions corresponding to a plurality of frequency bands and a total loss function corresponding to a filter, respectively, to obtain a plurality of loss values and a total loss value corresponding to the plurality of frequency bands;
a parameter design unit, configured to determine, when it is determined that the performance indicators of the multiple frequency bands meet corresponding multiple design targets according to the multiple loss values and the total loss value, the current filter parameter as a design parameter of the filter;
wherein the plurality of loss functions are designed according to the plurality of design goals corresponding to the plurality of frequency bands;
the total loss function is a loss function designed by performing weighted summation processing on the plurality of loss functions based on a plurality of weighting factors corresponding to the plurality of frequency bands.
9. A filter design apparatus, the filter design apparatus comprising: a processor, a memory, and a communication bus; the processor, when executing the execution program stored in the memory, implements the method of any of claims 1-7.
10. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210788140.4A CN115133906A (en) | 2022-07-04 | 2022-07-04 | Filter design method and device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210788140.4A CN115133906A (en) | 2022-07-04 | 2022-07-04 | Filter design method and device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115133906A true CN115133906A (en) | 2022-09-30 |
Family
ID=83381977
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210788140.4A Pending CN115133906A (en) | 2022-07-04 | 2022-07-04 | Filter design method and device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115133906A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10187662A (en) * | 1996-12-26 | 1998-07-21 | Ando Electric Co Ltd | Medium recorded with design program for iir digital filter |
US20050235023A1 (en) * | 2004-04-19 | 2005-10-20 | Chang Gung University | Efficient digital filter design tool for approximating an FIR filter with a low-order linear-phase IIR filter |
US20110274281A1 (en) * | 2009-01-30 | 2011-11-10 | Dolby Laboratories Licensing Corporation | Method for Determining Inverse Filter from Critically Banded Impulse Response Data |
CN102620729A (en) * | 2012-04-19 | 2012-08-01 | 北京航空航天大学 | Design method for digital filter of inertial measurement unit (IMU) of mechanically-dithered laser gyroscope |
CN104734667A (en) * | 2015-03-31 | 2015-06-24 | 山东大学 | Reorganizable filter bank of digital hearing aid based on nonlinear transformation and design method |
US20150270827A1 (en) * | 2014-03-21 | 2015-09-24 | Futurewei Technologies, Inc. | System and Method for Filter Design and Usage Thereof |
CN107659290A (en) * | 2017-08-09 | 2018-02-02 | 湖南艾科诺维科技有限公司 | Bandwidth expansion wave filter and its design method |
CN109075774A (en) * | 2016-04-30 | 2018-12-21 | 美国亚德诺半导体公司 | Design the FIR filter with the response of global minima polarization amplitude |
-
2022
- 2022-07-04 CN CN202210788140.4A patent/CN115133906A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10187662A (en) * | 1996-12-26 | 1998-07-21 | Ando Electric Co Ltd | Medium recorded with design program for iir digital filter |
US20050235023A1 (en) * | 2004-04-19 | 2005-10-20 | Chang Gung University | Efficient digital filter design tool for approximating an FIR filter with a low-order linear-phase IIR filter |
US20110274281A1 (en) * | 2009-01-30 | 2011-11-10 | Dolby Laboratories Licensing Corporation | Method for Determining Inverse Filter from Critically Banded Impulse Response Data |
CN102301742A (en) * | 2009-01-30 | 2011-12-28 | 杜比实验室特许公司 | Method for determining inverse filter from critically banded impulse response data |
CN102620729A (en) * | 2012-04-19 | 2012-08-01 | 北京航空航天大学 | Design method for digital filter of inertial measurement unit (IMU) of mechanically-dithered laser gyroscope |
US20150270827A1 (en) * | 2014-03-21 | 2015-09-24 | Futurewei Technologies, Inc. | System and Method for Filter Design and Usage Thereof |
CN104734667A (en) * | 2015-03-31 | 2015-06-24 | 山东大学 | Reorganizable filter bank of digital hearing aid based on nonlinear transformation and design method |
CN109075774A (en) * | 2016-04-30 | 2018-12-21 | 美国亚德诺半导体公司 | Design the FIR filter with the response of global minima polarization amplitude |
CN107659290A (en) * | 2017-08-09 | 2018-02-02 | 湖南艾科诺维科技有限公司 | Bandwidth expansion wave filter and its design method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018188228A1 (en) | High-precision frequency measuring system and method | |
US9837991B2 (en) | Adaptive filter for system identification | |
CN107294511B (en) | Low-complexity variable fractional delay filtering method and filter | |
CN104038181B (en) | Self-adapting filter construction method based on NLMS algorithm | |
CN105913835B (en) | Adaptive filtering method based on mathematical morphology | |
Mandal et al. | Optimal linear phase finite impulse response band pass filter design using craziness based particle swarm optimization algorithm | |
CN107342751B (en) | Variable-step SA adaptive filtering algorithm based on cross-correlation entropy | |
CN105680825A (en) | Digital filter analytical design method and filter thereof | |
WO2024099061A1 (en) | Frequency sweeping method and system for adaptive frequency point sampling, and related device | |
CN108512528B (en) | Ratio control and normalization LMP filtering method under a kind of CIM function | |
CN115133906A (en) | Filter design method and device and storage medium | |
CN108594641B (en) | Method for restraining servo resonance based on notch filter with asymmetric center frequency | |
CN114462292A (en) | Circuit parameter optimization method based on SQP algorithm | |
CN106503359A (en) | A kind of microwave window fast optimal design method based on NSGA II | |
CN107659290B (en) | Bandwidth extension filter and design method thereof | |
Thesni et al. | Implementation and performance comparison of digital filter in FPGA | |
CN115133907A (en) | Filter design method and device and storage medium | |
CN112003588A (en) | Adaptive signal filtering method based on polymorphic variable step size normalized mean square | |
CN114614797A (en) | Adaptive filtering method and system based on generalized maximum asymmetric correlation entropy criterion | |
Borah et al. | Fir low pass filter design using craziness base particle swarm optimization technique | |
Bhardwaj et al. | Approximation and analysis of single band FIR pass integrator centered around mid-band frequencies with degree k= 1, 2, 3… | |
Szopos et al. | Synthesis tool based on genetic algorithm for FIR filters with user-defined magnitude characteristics | |
CN109474258A (en) | The Optimization Method of Kernel Parameter of random Fourier feature core LMS based on nuclear polarization strategy | |
CN113919187B (en) | Method and device for determining simulation parameters of filter, electronic equipment and storage medium | |
CN115795234B (en) | Method and system for measuring and calculating total distortion of sinusoidal signals |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |