CN115133906A - Filter design method and device and storage medium - Google Patents

Filter design method and device and storage medium Download PDF

Info

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
Application number
CN202210788140.4A
Other languages
Chinese (zh)
Inventor
魏天才
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210788140.4A priority Critical patent/CN115133906A/en
Publication of CN115133906A publication Critical patent/CN115133906A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H17/02Frequency selective networks
    • H03H17/04Recursive filters
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H17/00Networks using digital techniques
    • H03H2017/0072Theoretical filter design
    • H03H2017/009Theoretical 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

Filter design method and device and storage medium
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):
Figure BDA0003729454950000031
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
Figure BDA0003729454950000041
(r 0,m 、θ 0,m zero point z respectively in polar coordinate m Amplitude and phase of);
Figure BDA0003729454950000042
(r p,n 、θ p,n pole z respectively represented in polar coordinates n Amplitude and phase of);
z, z 0,m 、z p,n Substituting equation (1) results in the frequency response of the system function:
Figure BDA0003729454950000043
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,10,2 ,…,θ 0,M ;r p,1 ,r p,2 …,r p,N ;θ p,1p,2 ,…θ p,N ]The process of (1). Wherein A is amplitude, [ r ] 0,1 ,r 0,2 ,…,r 0,M ;θ 0,10,2 ,…,θ 0,M ]Is a set of poles, [ r ] p,1 ,r p,2 …,r p,N ;θ p,1p,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 )|。
The total loss function of the designed IIR digital filter passband is recorded as:
Figure BDA0003729454950000044
wherein the function l p |H(e )|,|H d (e ) | b) is the amplitude response loss function at the pass band frequency ω and describes | H (e) ) I and H d (e ) The degree of deviation of. | H (e) ) I and H d (e ) The greater the deviation of l, the greater l p (|H(e )|,|H d (e ) The larger the value of i). | H (e) ) I and H d (e ) The smaller the deviation of l, the p (|H(e )|,|H d (e ) 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) ) I and H d (e ) I and makes the loss function L shown in equation (3) p Parameter set [ A, r ] for IIR digital filter mm ,r nn ](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):
Figure BDA0003729454950000051
without loss of generality, the pass-band amplitude loss is recorded as shown in equation (5):
Figure BDA0003729454950000052
wherein the content of the first and second substances,
Figure BDA0003729454950000053
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 quantification
Figure BDA0003729454950000054
Deviation from the design target and make the loss function L shown in equation (5) p Parameter set [ A, r ] for IIR digital filter mm ,r nn ](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):
Figure BDA0003729454950000055
wherein l s (|H(e ) | is the amplitude response loss function at the stop band frequency ω and describes | H (e) ) 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) ) 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 mm ,r nn ](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):
Figure BDA0003729454950000056
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):
Figure BDA0003729454950000061
wherein l t (|H(e ) Is the amplitude response loss function at frequency point omega, and describes the amplitude response | H (e) of the transition band ) 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 ) 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 mm ,r nn ](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):
Figure BDA0003729454950000062
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):
Figure BDA0003729454950000063
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,
Figure BDA0003729454950000064
is the ith (1 ≦ I ≦ I) p ) A weighting factor for the total loss of each pass band,
Figure BDA0003729454950000065
is the total loss of the ith pass band, which is found according to equation (3), equation (4) or equation (5).
Figure BDA0003729454950000071
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,
Figure BDA0003729454950000072
according to the formula (6) orThe total loss of the ith stop band is found by equation (7).
Figure BDA0003729454950000073
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,
Figure BDA0003729454950000074
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 defined
Figure BDA0003729454950000075
Wherein, 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,
Figure BDA0003729454950000076
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,
Figure BDA0003729454950000077
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 factor
Figure BDA0003729454950000078
Can 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):
Figure BDA0003729454950000081
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 book
Figure BDA0003729454950000082
L shown in the formula (10) Total And each component thereof
Figure BDA0003729454950000083
Figure BDA0003729454950000084
Du Shi
Figure BDA0003729454950000085
Is measured as a function of (c). On both sides of equation (10) are related
Figure BDA0003729454950000086
The formula (12) is obtained, and the total gradient value can be obtained by using the formula (12).
Figure BDA0003729454950000087
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 controlled
Figure BDA0003729454950000088
And then controlling the gradient component of each pass band, stop band and transition band
Figure BDA0003729454950000089
For total gradient
Figure BDA00037294549500000810
The 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):
Figure BDA0003729454950000091
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 components
Figure BDA0003729454950000092
And
Figure BDA0003729454950000093
in 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
Figure BDA0003729454950000094
3. Initializing an iteration index k as 0; initializing parameter sets of an IIR digital filter
Figure BDA0003729454950000095
4. Calculating the loss of each pass band, stop band and transition band
Figure BDA0003729454950000096
Figure BDA0003729454950000097
And is currently
Figure BDA0003729454950000098
Corresponding total loss function L Total (k)
5. According to
Figure BDA0003729454950000099
Loss of each corresponding pass band, stop band and transition band
Figure BDA00037294549500000910
And 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, outputting
Figure BDA00037294549500000911
As 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, calculating
Figure BDA00037294549500000912
And 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
Figure BDA0003729454950000101
3. Initializing an iteration index k as 0; initializing parameter sets of an IIR digital filter
Figure BDA0003729454950000102
4. Calculating the loss of each pass band, stop band and transition band
Figure BDA0003729454950000103
Figure BDA0003729454950000104
And is currently
Figure BDA0003729454950000105
Corresponding total loss function L Total (k)
5. According to
Figure BDA0003729454950000106
Loss of each corresponding pass band, stop band and transition band
Figure BDA0003729454950000107
And 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, outputting
Figure BDA0003729454950000108
As 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
Figure BDA0003729454950000109
10. If the ith (1. ltoreq. i.ltoreq.I) p ) If the performance index of each pass band meets the corresponding design target, setting
Figure BDA00037294549500001010
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
Figure BDA00037294549500001011
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
Figure BDA00037294549500001012
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
Figure BDA00037294549500001013
16. If the ith (1. ltoreq. i.ltoreq.I) t ) If the performance index of each transition zone meets the corresponding design target, setting
Figure BDA00037294549500001014
17. Computing
Figure BDA00037294549500001015
And k is k +1, and the iteration is continued by returning to the step 5.
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):
Figure BDA0003729454950000111
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 ). The ideal magnitude response of the filter in log-scale coordinates is:
|H d (e )| dB =10·log 10 (|H d (e )|) 2 dB,ω p,start ≤ω≤ω p,end (14)
(3) assuming the starting frequency of the stop band is omega s,startp,ends,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 )|) 2s (ω)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
Figure BDA0003729454950000112
Figure BDA0003729454950000114
Namely, the following conditions are satisfied:
Figure BDA0003729454950000113
ω 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):
Figure BDA0003729454950000121
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 of
Figure BDA0003729454950000122
Wherein 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:
Figure BDA0003729454950000123
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:
Figure BDA0003729454950000124
wherein floor denotes rounding down. The stopband cut-off frequency index is
Figure BDA0003729454950000125
ceil 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:
Figure BDA0003729454950000126
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:
Figure BDA0003729454950000127
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 sought
Figure BDA0003729454950000131
Then the total loss function is related to
Figure BDA0003729454950000132
The gradient of (1) is related to the pass band, stop band, transition band losses
Figure BDA0003729454950000133
As shown in equation (20):
Figure BDA0003729454950000134
wherein
Figure BDA0003729454950000135
Respectively, equation (16), equation (17), equation (18) about
Figure BDA0003729454950000136
The gradient of (2) is specifically determined as follows.
1) Gradient of pass band
For equation (16) to
Figure BDA0003729454950000137
The formula (21):
Figure BDA0003729454950000138
for equation (21), L can be found by one-by-one p About
Figure BDA0003729454950000139
Partial derivatives of each element of (a) to obtain L p About
Figure BDA00037294549500001310
As shown in the following equations (22-26):
Figure BDA00037294549500001311
Figure BDA00037294549500001312
Figure BDA00037294549500001313
Figure BDA00037294549500001314
Figure BDA0003729454950000141
Figure BDA0003729454950000142
2) stop band gradient
To find out about formula (17)
Figure BDA0003729454950000143
The formula (27):
Figure BDA0003729454950000144
for equation (27), L can be found by one-by-one s About
Figure BDA0003729454950000145
Partial derivatives of each element of (a) to obtain L s About
Figure BDA0003729454950000146
As shown in the following equations (28-32):
Figure BDA0003729454950000147
Figure BDA0003729454950000148
Figure BDA0003729454950000149
Figure BDA00037294549500001410
Figure BDA00037294549500001411
3) transition zone gradient
Solving equation (18) for
Figure BDA00037294549500001412
Of formula (33):
Figure BDA0003729454950000151
for equation (33), L can be obtained by finding L one by one t About
Figure BDA0003729454950000152
Partial derivatives of each element of (a) to obtain L t About
Figure BDA0003729454950000153
As shown in the following equations (34-38):
Figure BDA0003729454950000154
Figure BDA0003729454950000155
Figure BDA0003729454950000156
Figure BDA0003729454950000157
Figure BDA0003729454950000158
4) total loss related to
Figure BDA0003729454950000159
Gradient of (2)
Relating the loss of the pass band, stop band and transition band calculated in the above 1), 2) and 3) to
Figure BDA00037294549500001510
Is substituted into equation (20), the total loss is obtained
Figure BDA00037294549500001511
Of the gradient of (c).
4. Computing
Figure BDA00037294549500001512
Loss functions of pass band, stop band and transition band defined by the above 1, 2 and 3 strips, and their relation
Figure BDA00037294549500001513
The gradient calculation method is brought into an iterative solution process, and the parameter set of the filter can be iteratively solved
Figure BDA00037294549500001514
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 of
Figure BDA0003729454950000161
The desired amplitude response within the pass band is
Figure BDA0003729454950000162
That 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 0
Figure BDA0003729454950000163
Highest frequency point in pass band
Figure BDA0003729454950000164
The 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 is
Figure BDA0003729454950000165
In the first half range of stop band
Figure BDA0003729454950000166
Within, the maximum amplitude response of the stop band is required to be no more than-50 dB; in the second half of the stop band
Figure BDA0003729454950000167
Within, 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 of
Figure BDA0003729454950000168
The maximum amplitude response is required within the whole transition band, and is not higher than the highest frequency of the pass band
Figure BDA0003729454950000169
The 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.
CN202210788140.4A 2022-07-04 2022-07-04 Filter design method and device and storage medium Pending CN115133906A (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (9)

* Cited by examiner, † Cited by third party
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