Filter design system based on window function and method for determining filter coefficients

Through the filter design system based on window function, the selection interface and calculation module are used to determine the filter parameters, the existing filter design methods are solved, and the existing filter design methods are flexible to design filters of different bandwidths are realized, and the design accuracy and flexibility are improved.

CN119496484BActive Publication Date: 2025-04-15SHENZHEN CITY SIGLENT TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510081366.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-20
Publication Date
2025-04-15
Estimated Expiration
2045-01-20

AI Technical Summary

Technical Problem

The existing filter design methods are complex and have low flexibility, making it difficult to flexibly design filters of different bandwidths, affecting the frequency resolution capability of the spectrum analyzer.

Method used

A filter design system based on window function is provided. Through the selection interface, the window function, filter type and target bandwidth input by the user are obtained. The calculation module determines the reference transmission function and response function based on these parameters, and then determines the target cutoff frequency and filter coefficient through time-frequency transformation and error threshold adjustment.

Benefits of technology

It realizes flexible design of filters with different bandwidths, improves the flexibility and accuracy of the filter design system, and meets users' diverse bandwidth needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496484B_ABST
    Figure CN119496484B_ABST
Patent Text Reader

Abstract

The present application discloses a filter design system based on a window function and a method for determining filter coefficients, and belongs to the field of filter technology. The system includes: a selection interface, which is used to determine the target window function, the filter type and the target bandwidth of the filter in response to a click operation. A calculation module, which is used to obtain the target window function, the filter type and the target bandwidth, and determine the reference transmission function and the reference response function; determine the first coefficient function based on the reference response function and the target window function; perform time-frequency transformation on the first coefficient function to determine the target transmission function; determine the target cutoff frequency based on the first frequency point, the second frequency point, the error threshold and the target transmission function; determine the second coefficient function based on the target cutoff frequency, the reference response function and the first coefficient function. A processing module, which is used to implement a filter corresponding to the target bandwidth according to the second coefficient function. The present application can design filters of different bandwidths according to user needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of filter technology, and in particular to a filter design system based on a window function and a method for determining filter coefficients. Background Art

[0002] Spectrum analyzers mainly rely on filters to distinguish signals of different frequencies. Many key indicators of spectrum analyzers, such as measurement resolution, measurement sensitivity, measurement speed and measurement accuracy, are related to the bandwidth of the filter. Therefore, the bandwidth of the filter often affects the frequency resolution ability of the spectrum analyzer. In related technologies, the designed filters are basically 6dB bandwidth. If other bandwidth filters are to be designed, they can only be adjusted manually and observed by eye to see whether the bandwidth of the obtained filter meets the corresponding requirements. This method is more complicated and less flexible. Summary of the invention

[0003] The present application provides a filter design system based on a window function and a method for determining filter coefficients, which can not only design filters with different bandwidths, but also flexibly design corresponding filters according to user needs. The technical solution is as follows:

[0004] On the one hand, a filter design system based on a window function is provided, comprising:

[0005] A selection interface for determining a target window function, a filter type, and a target bandwidth of the filter in response to a click operation by a user;

[0006] A calculation module, used to obtain the target window function, the filter type and the target bandwidth, and determine a reference transmission function based on the filter type, and a reference response function corresponding to the reference transmission function; determine a first coefficient function of the filter based on the reference response function and the target window function; perform time-frequency transformation on the first coefficient function to determine the target transmission function of the filter; determine a target cutoff frequency based on a first frequency point, a second frequency point, an error threshold and the target transmission function, the first frequency point and the second frequency point are obtained according to a sampling rate, the sampling rate and the error threshold are obtained in advance, and the value of the first frequency point is less than the value of the second frequency point; determine a second coefficient function based on the target cutoff frequency, the reference response function and the first coefficient function;

[0007] A processing module is used to store the second coefficient function and implement a filter corresponding to the target bandwidth according to the second coefficient function.

[0008] Optionally, the calculation module determines the target cutoff frequency based on the first frequency point, the second frequency point, the error threshold and the target transfer function, including:

[0009] Determine a first cutoff frequency based on the first frequency point and the second frequency point;

[0010] Substituting the first cutoff frequency into the target transfer function to obtain a first amplitude response;

[0011] If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than the error threshold, determining the first cutoff frequency as the target cutoff frequency;

[0012] If the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, the target cutoff frequency is determined according to a magnitude relationship between the first amplitude response and the inverse of the target bandwidth.

[0013] Optionally, the calculation module determines the target cutoff frequency according to a magnitude relationship between the first amplitude response and an inverse of the target bandwidth, including:

[0014] If the first amplitude response is greater than the inverse of the target bandwidth, determining a second cutoff frequency based on the first cutoff frequency and the first frequency point;

[0015] If the first amplitude response is not greater than the inverse of the target bandwidth, determining a second cutoff frequency based on the first cutoff frequency and the second frequency point;

[0016] The target cutoff frequency is determined based on the second cutoff frequency, the error threshold, and the target transfer function.

[0017] Optionally, the calculation module determines the target cutoff frequency based on the second cutoff frequency, the error threshold and the target transfer function, including:

[0018] Substituting the current second cutoff frequency into the target transfer function to obtain a second amplitude response;

[0019] determining whether an absolute value of a difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold;

[0020] If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is not greater than the error threshold, determining the current second cutoff frequency as the target cutoff frequency;

[0021] If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is greater than the inverse of the target bandwidth, then based on the first frequency point, the current second cutoff frequency is updated to obtain an updated second cutoff frequency;

[0022] If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is not greater than the inverse of the target bandwidth, then based on the second frequency point, the current second cutoff frequency is updated to obtain an updated second cutoff frequency;

[0023] The updated second cutoff frequency is re-substituted into the target transfer function to obtain a second amplitude response, and it is re-determined whether the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold.

[0024] Optionally, the calculation module determines the first coefficient function of the filter based on the reference response function and the target window function, including:

[0025] The product of the reference response function and the target window function is determined as the first coefficient function.

[0026] Optionally, the processing module implements a filter corresponding to the target bandwidth according to the second coefficient function, including:

[0027] Based on the second coefficient function, determining a plurality of coefficients of the filter, the number of the plurality of coefficients of the filter being equal to the length of the filter;

[0028] An expression for the filter is determined based on a plurality of coefficients of the filter.

[0029] On the other hand, a method for determining a filter coefficient is provided, the method comprising:

[0030] Acquire a target window function, a filter type, and a target bandwidth of the filter, and determine a reference transmission function based on the filter type, and a reference response function corresponding to the reference transmission function, wherein the target window function, the filter type, and the target bandwidth are set by a user;

[0031] Determining a first coefficient function of the filter based on the reference response function and the target window function;

[0032] Performing a time-frequency transform on the first coefficient function to determine a target transfer function of the filter;

[0033] Determining a target cutoff frequency based on a first frequency point, a second frequency point, an error threshold, and the target transfer function, wherein the first frequency point and the second frequency point are obtained according to a sampling rate, the sampling rate and the error threshold are obtained in advance, and a value of the first frequency point is less than a value of the second frequency point;

[0034] A second coefficient function is determined based on the target cutoff frequency, the reference response function, and the first coefficient function.

[0035] Optionally, determining the target cutoff frequency based on the first frequency point, the second frequency point and the target transfer function includes:

[0036] Determine a first cutoff frequency based on the first frequency point and the second frequency point;

[0037] Substituting the first cutoff frequency into the target transfer function to obtain a first amplitude response;

[0038] If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than the error threshold, determining the first cutoff frequency as the target cutoff frequency;

[0039] If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, it is determined whether the first amplitude response is greater than the inverse of the target bandwidth.

[0040] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, and the computer program can be executed by a processor to implement the steps of the method for determining filter coefficients described above.

[0041] On the other hand, a computer program product comprising instructions is provided. When the instructions are executed on a computer, the computer is caused to execute the steps of the above-mentioned method for determining filter coefficients.

[0042] The technical solution provided by this application can at least bring the following beneficial effects:

[0043] The window function-based filter design system in the embodiment of the present application includes a selection interface, on which the user can independently select the window function, filter type and filter bandwidth they want to use, thereby improving the flexibility of the filter design system; moreover, the calculation module can obtain the target window function, filter type and target bandwidth, and based on the above three, determine the target cutoff frequency corresponding to the filter requirement that meets the target bandwidth, and then determine the second coefficient function corresponding to the target bandwidth, that is, the filter design system provided in the embodiment of the present application can obtain the second coefficient function corresponding to different bandwidths by changing the target bandwidth, and then design the corresponding filter. In this way, not only can filters with bandwidths other than 6dB bandwidth be designed, but also corresponding filters can be flexibly designed according to user needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A schematic diagram of the structure of a filter design system based on a window function provided in an embodiment of the present application;

[0045] Figure 2A structural schematic diagram of a selection interface provided in an embodiment of the present application;

[0046] Figure 3 It is a structural diagram of a direct filter;

[0047] Figure 4 A flowchart of a method for determining filter coefficients provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.

[0049] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0050] The serial numbers assigned to the components herein, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0051] Spectrum analyzers mainly rely on filters to distinguish signals of different frequencies. Many key indicators of spectrum analyzers, such as measurement resolution, measurement sensitivity, measurement speed and measurement accuracy, are related to the bandwidth of the filter. Therefore, the bandwidth of the filter often affects the frequency resolution capability of the spectrum analyzer. The resolution bandwidth of a spectrum analyzer generally refers to the 3dB bandwidth. However, in related technologies, the FIR (Finite Impulse Response) filter designed by the window function is basically 6dB bandwidth. If you want to design a filter with a 3dB bandwidth, you can only manually adjust the 6dB bandwidth and observe with the naked eye whether the 3dB bandwidth of the filter meets the corresponding requirements. This method is more complicated and less flexible.

[0052] Based on this, the embodiment of the present application provides a filter design system based on a window function and a method for determining filter coefficients, which can not only design filters with a 3dB bandwidth or filters with other bandwidths, but also flexibly design corresponding filters according to user needs.

[0053] Next, the filter design system based on window function provided in the embodiment of the present application will be introduced in detail.

[0054] Please refer to Figure 1 , Figure 1 It is a structural schematic diagram of a filter design system based on a window function provided by an embodiment of the present application. The filter design system based on the window function includes: a selection interface 1, which is used to determine the target window function, the filter type, and the target bandwidth of the filter in response to the user's click operation. A calculation module 2 is used to obtain the target window function, the filter type and the target bandwidth, and determine the reference transmission function based on the filter type, and the reference response function corresponding to the reference transmission function; then, based on the reference response function and the target window function, the first coefficient function of the filter is determined, and the first coefficient function is transformed in time and frequency to determine the target transmission function of the filter; then, based on the first frequency point, the second frequency point, the error threshold and the target transmission function, the target cutoff frequency is determined, the first frequency point and the second frequency point are obtained according to the sampling rate, the sampling rate and the error threshold are obtained in advance, and the value of the first frequency point is less than the value of the second frequency point; then, based on the target cutoff frequency, the reference response function and the first coefficient function, the second coefficient function is determined. A processing module 3 is used to store the second coefficient function, and according to the second coefficient function, a filter corresponding to the target bandwidth is realized.

[0055] In some embodiments, please refer to Figure 2, the selection interface 1 includes an input box corresponding to the window function, an input box corresponding to the filter type, an input box corresponding to the bandwidth, and a confirmation option. In this way, the user can enter the name of the window function used in the input box corresponding to the window function, such as Gaussian window, flat-top window, etc.; the user can also enter the type of filter to be designed in the input box corresponding to the filter type, such as low-pass filter, high-pass filter, etc.; in addition, the user can also enter the required filter bandwidth in the input box corresponding to the bandwidth, such as 3dB or other bandwidths, so that the required filters with different bandwidths can be designed, improving the flexibility of the filter design system.

[0056] Continuing with the above description, after the user enters the type of window function, filter type and bandwidth in the corresponding input boxes, the user can click the OK option in the selection interface 1, so that the selection interface 1 will determine the function corresponding to the name of the window function entered by the user in the input box corresponding to the window function as the target window function, and the type of filter entered by the user in the input box corresponding to the filter type as the filter type, and the bandwidth entered by the user in the input box corresponding to the bandwidth as the target bandwidth.

[0057] It should be noted that the above is explained based on the selection interface 1 including an input box corresponding to the window function, an input box corresponding to the filter type, an input box corresponding to the bandwidth, and a confirmation option. Alternatively, the selection interface may also include a selection box corresponding to the window function, a selection box corresponding to the filter type, a selection box corresponding to the bandwidth, and a confirmation option. Thus, when the user clicks the selection box, multiple corresponding options may appear for the user to select. Alternatively, the selection interface may also include other parts, which is not limited to the embodiments of the present application.

[0058] After the target window function, filter type and target bandwidth are determined in the selection interface 1, the target window function, the filter type and the target bandwidth can be obtained by the calculation module 2. Since different filter types correspond to different transfer functions, the calculation module 2 can determine the transfer function of the filter in an ideal state based on the filter type, and determine the transfer function in the ideal state as the reference transfer function.

[0059] As an example, the filter type is a low-pass filter, and its transfer function in an ideal state, that is, the transfer function of an ideal low-pass filter, can be determined as a reference transfer function, and the reference transfer function is shown in the following formula (1);

[0060] (1)

[0061] in, represents the reference transfer function, ω represents the frequency variable, ωc represents the cutoff frequency, and τ represents the time delay (phase shift). When |ω| is less than ωc, it means that the frequency range is within the passband and the phase shift factor is ; When |ω| is greater than ωc and less than or equal to π, it means that the frequency range is within the stop band and the signal will be completely attenuated to 0.

[0062] After the reference transmission function is determined, an inverse time-frequency transform may be performed on the reference transmission function to obtain a reference response function corresponding to the reference function.

[0063] As an example, assuming that the above formula (1) is a reference transmission function, performing an inverse Fourier transform on it can obtain a function shown in the following formula (2), and the calculation module 2 can determine the function as a reference response function;

[0064] (2)

[0065] where hd(n) represents the reference response function.

[0066] Continuing with the above description, after obtaining the reference response function, the calculation module 2 may also determine the first coefficient function of the filter according to the reference response function and the target window function.

[0067] In some embodiments, the calculation module 2 may determine the product of the reference response function and the target window function as the first coefficient function, that is, the reference response function is windowed to obtain the first coefficient function.

[0068] Continuing with the above example, the first coefficient function may be as shown in the following formula (3):

[0069] (3)

[0070] Wherein, h(n) represents the first coefficient function, and w(n) represents the target window function.

[0071] After obtaining the first coefficient function, the calculation module 2 may also perform a time-frequency transform on the first coefficient function to obtain a target transfer function of the filter.

[0072] As an example, assuming that the first coefficient function is as shown in the above formula (3), the process of performing Fourier transform on the first coefficient function to obtain the target transfer function can be shown in the following formula (4);

[0073]

[0074] (4)

[0075] Among them, H(ω) represents the target transfer function, Hd(ω) represents the transfer function of the ideal low-pass filter, and Hw(ω) represents the transfer function of the target window function.

[0076] It can be seen from the above formula (4) that the target transfer function of the filter is related to the cutoff frequency. For example, if the cutoff frequency increases, the bandwidth of the filter will also increase accordingly. In other words, the frequency range that the filter can pass will become wider, allowing more frequency components to pass, which may cause the frequency range of the filter to not meet the filter requirements of the corresponding bandwidth. Therefore, it is necessary to determine the target cutoff frequency to meet the filter requirements corresponding to the target bandwidth, that is, the value of the target transfer function corresponding to the target bandwidth should be close to the inverse of the target bandwidth.

[0077] In some embodiments, an accurate target cutoff frequency can be determined based on the first frequency point, the second frequency point, the error threshold and the target transfer function to meet the filter requirements corresponding to the target bandwidth. The first frequency point and the second frequency point are obtained according to the sampling rate, so the calculation module 2 needs to obtain the sampling rate in advance. For example, the selection interface 1 can also include an input box corresponding to the sampling rate, so that the user can enter the sampling rate in the input box, so that the calculation module 2 can obtain the sampling rate input by the user.

[0078] After the calculation module 2 obtains the sampling rate, the first frequency point and the second frequency point can be obtained according to the sampling rate. For example, the first frequency point can be the lowest frequency that the filter can process, such as 0, and the second frequency point can be the highest frequency that the filter can process, such as, where is the sampling rate.

[0079] It should be noted that the calculation module 2 may determine the first frequency point and the second frequency point by binary division, or, in an application, the calculation module 2 may determine the first frequency point and the second frequency point by other methods. This embodiment of the application does not limit this.

[0080] The error threshold is also pre-acquired by the calculation module 2. As an example, the selection interface 1 may also include an input box corresponding to the error threshold, whereby the user inputs the error threshold in the input box, so that the calculation module 2 acquires the corresponding error threshold for subsequent processes.

[0081] In some embodiments, the calculation module 2 may determine the target cutoff frequency according to the following steps (1)-(4).

[0082] (1) Determine a first cutoff frequency based on the first frequency point and the second frequency point.

[0083] As an example, the first cutoff frequency may be determined according to the following formula (5);

[0084] (5)

[0085] Wherein, ωc1 represents the first cutoff frequency, ωmin represents the first frequency point, and ωmax represents the second frequency point.

[0086] It should be noted that the above formula (5) is only an example, and in application, the first cutoff frequency may be determined by other methods, which are not limited in the embodiment of the present application.

[0087] (2) Substitute the first cutoff frequency into the target transfer function to obtain the first amplitude response.

[0088] Based on the above description, it can be known that the determined target cutoff frequency must satisfy the requirement that the value of the target transfer function corresponding to the target bandwidth is close to the inverse of the target bandwidth. Therefore, the determined first cutoff frequency must be substituted into the target transfer function to obtain a first amplitude response, so as to determine whether the first cutoff frequency meets the requirement in the subsequent process.

[0089] (3) If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than the error threshold, the first cutoff frequency is determined as the target cutoff frequency.

[0090] Continuing with the above description, after obtaining the first amplitude response, the calculation module 2 can determine whether the first cutoff frequency can be determined as the target cutoff frequency based on the first amplitude response, the target bandwidth and the error threshold, wherein the error threshold is the maximum difference allowed between the obtained amplitude response and the inverse of the target bandwidth.

[0091] When the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than the error threshold, that is, when the absolute value of the value obtained by subtracting the inverse of the target bandwidth (or the first amplitude response) from the first amplitude response (or the inverse of the target bandwidth) is less than or equal to the error threshold, it means that the first cutoff frequency corresponding to the first amplitude response at this time satisfies the requirement of making the value of the target transfer function corresponding to the target bandwidth close to the inverse of the target bandwidth, that is, if the target cutoff frequency is the first cutoff frequency, the filter of the target bandwidth meets the corresponding requirement, and therefore, the first cutoff frequency can be determined as the target cutoff frequency.

[0092] (4) If the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, the target cutoff frequency is determined according to the magnitude relationship between the first amplitude response and the inverse of the target bandwidth.

[0093] When the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, that is, when the absolute value of the value obtained by subtracting the inverse of the target bandwidth (or the first amplitude response) from the first amplitude response (or the inverse of the target bandwidth) is greater than the error threshold, it means that the first cutoff frequency corresponding to the first amplitude response does not meet the requirement that the target transmission value corresponding to the target bandwidth is close to the inverse of the target bandwidth, that is, if the target cutoff frequency is the first cutoff frequency, the filter of the target bandwidth does not meet the corresponding requirement.

[0094] Therefore, the calculation module 2 also needs to determine the target cutoff frequency according to the magnitude relationship between the first amplitude response and the inverse of the target bandwidth, so that the filter of the target bandwidth meets the corresponding requirements.

[0095] In some embodiments, the implementation process of the calculation module 2 determining the target cutoff frequency according to the size relationship between the first amplitude response and the inverse of the target bandwidth is as follows: if the first amplitude response is greater than the inverse of the target bandwidth, the second cutoff frequency is determined based on the first cutoff frequency and the first frequency point; if the first amplitude response is not greater than the inverse of the target bandwidth, the second cutoff frequency is determined based on the first cutoff frequency and the second frequency point; then, the target cutoff frequency is determined based on the second cutoff frequency, the error threshold and the target transfer function.

[0096] That is to say, when the first amplitude response is greater than the inverse of the target bandwidth, the calculation module 2 can determine half of the sum of the first cutoff frequency and the first frequency point as the second cutoff frequency; this is equivalent to making the new second frequency point equal to the first cutoff frequency, the first frequency point remains unchanged, and then determining the second cutoff frequency based on the second frequency point and the first frequency point. For example, the second cutoff frequency can be determined according to formula (5).

[0097] When the first amplitude response is less than or equal to the inverse of the target bandwidth, the calculation module 2 may determine half of the sum of the first cutoff frequency and the second frequency point as the second cutoff frequency, which is equivalent to making the new first frequency point equal to the first cutoff frequency and the second frequency point unchanged, and then determining the second cutoff frequency based on the first frequency point and the second frequency point. For example, the second cutoff frequency may be determined according to formula (5).

[0098] After determining the second cutoff frequency, in order to determine whether the second cutoff frequency meets the corresponding requirements of the filter of the target bandwidth, and then determine whether to update the second cutoff frequency or determine the current second cutoff frequency as the target cutoff frequency, the calculation module 2 also needs to determine the target cutoff frequency based on the second cutoff frequency, the error threshold and the target transfer function.

[0099] In some embodiments, the calculation module determines the target cutoff frequency based on the second cutoff frequency, the error threshold and the target transfer function in the following implementation process: bringing the current second cutoff frequency into the target transfer function to obtain the second amplitude response; judging whether the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold; if the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is not greater than the error threshold, determining the current second cutoff frequency as the target cutoff frequency; if the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is greater than the inverse of the target bandwidth, updating the current second cutoff frequency based on the first frequency point to obtain an updated second cutoff frequency; if the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is not greater than the inverse of the target bandwidth, updating the current second cutoff frequency based on the second frequency point to obtain an updated second cutoff frequency; bringing the updated second cutoff frequency back into the target transfer function to obtain the second amplitude response, and re-judging whether the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold.

[0100] Based on the above description, it can be known that the determined target cutoff frequency must satisfy the requirement that the value of the target transfer function corresponding to the target bandwidth is close to the inverse of the target bandwidth. Therefore, the current second cutoff frequency must be brought into the target transfer function to obtain the second amplitude response, so as to determine whether the current second cutoff frequency meets the requirement in the subsequent process.

[0101] Continuing with the above description, after obtaining the second amplitude response, it is necessary to determine whether the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold to determine whether the second cutoff frequency corresponding to the current second amplitude response meets the requirements corresponding to the filter of the target bandwidth.

[0102] When the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is not greater than the error threshold, that is, the absolute value of the value obtained by subtracting the inverse of the target bandwidth (or the second amplitude response) from the second amplitude response (or the inverse of the target bandwidth) is less than or equal to the error threshold, it means that the second cutoff frequency corresponding to the second amplitude response at this time meets the requirement of making the value of the target transfer function corresponding to the target bandwidth close to the inverse of the target bandwidth, that is, if the target cutoff frequency is the current second cutoff frequency, the filter of the target bandwidth meets the corresponding requirement, and therefore, the current second cutoff frequency can be determined as the target cutoff frequency.

[0103] When the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, it means that the current second cutoff frequency does not meet the requirements corresponding to the filter of the target bandwidth. Therefore, the second cutoff frequency needs to be updated according to the size relationship between the second amplitude response and the inverse of the target bandwidth.

[0104] Continuing with the above description, if the second amplitude response is greater than the inverse of the target bandwidth, the current second cutoff frequency is updated based on the first frequency point. As an example, the calculation module 2 can determine half of the sum of the current second cutoff frequency and the first frequency point as the new second cutoff frequency to obtain the updated second cutoff frequency; this is equivalent to making the new second frequency point equal to the current second cutoff frequency, the first frequency point remains unchanged, and then, according to formula (5), the updated second cutoff frequency is obtained based on the second frequency point and the first frequency point.

[0105] If the second amplitude response is less than or equal to the inverse of the target bandwidth, the current second cutoff frequency is updated based on the second frequency point. As an example, the calculation module 2 can determine half of the sum of the current second cutoff frequency and the second frequency point as the new second cutoff frequency to obtain the updated cutoff frequency; this is equivalent to making the new first frequency point equal to the current second cutoff frequency, the second frequency point remains unchanged, and then, according to formula (5), the updated second cutoff frequency is obtained based on the first frequency point and the second frequency point.

[0106] Continuing with the above description, after obtaining the updated second cutoff frequency, it is necessary to return to the step of bringing the cutoff frequency into the target transfer function to obtain the amplitude response, and making a judgment based on the amplitude response. That is, it is necessary to bring the updated second cutoff frequency back into the target transfer function to obtain the second amplitude response, and then re-judge whether the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold. If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is not greater than the error threshold, the updated second cutoff frequency is determined as the target cutoff frequency; if the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is greater than the inverse of the target bandwidth, then based on the first frequency point, the second cutoff frequency is updated again to obtain the second cutoff frequency after being updated again; if the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is not greater than the inverse of the target bandwidth, then based on the second frequency point, the second cutoff frequency is updated again to obtain the second cutoff frequency after being updated again; the second cutoff frequency after being updated again is brought back into the target transfer function to obtain the second amplitude response, and it is re-judged whether the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold.

[0107] That is to say, if the current second cutoff frequency does not meet the requirements corresponding to the filter of the target bandwidth, it is necessary to update the current second cutoff frequency to obtain an updated second cutoff frequency; if the updated second cutoff frequency does not meet the requirements corresponding to the filter of the target bandwidth, it is necessary to update the second cutoff frequency again to obtain an updated second cutoff frequency; if the updated second cutoff frequency still does not meet the requirements corresponding to the filter of the target bandwidth, it is necessary to update the second cutoff frequency again until the obtained second cutoff frequency meets the requirements corresponding to the filter of the target bandwidth, and the second cutoff frequency that meets the requirements is determined as the target cutoff frequency.

[0108] After determining the target cutoff frequency, since the reference response function includes the target cutoff frequency and the first coefficient function is obtained by windowing the reference response function, it is necessary to determine the second coefficient function based on the target cutoff frequency, the reference response function and the first coefficient function.

[0109] In some embodiments, the determined target cutoff frequency may be substituted into a reference response function to obtain a new reference response function, and then the new reference response function may be substituted into the first coefficient function to obtain a second coefficient function.

[0110] In some embodiments, the second coefficient function may be determined first, and the amplitude response may be obtained according to the coefficient function, and then the target cutoff frequency may be obtained using a dichotomy method.

[0111] Continuing with the above description, after the calculation module 2 obtains the second coefficient function, the second coefficient function can be sent to the processing module 3, so that the processing module 3 obtains the second coefficient function and stores the second coefficient function. As an example, the processing module 3 can store the second coefficient function through RAM (Random-access memory). The processing module 3 can also implement a corresponding filter based on the second coefficient function, and the bandwidth of the designed filter is the target bandwidth and meets the corresponding requirements.

[0112] In some embodiments, the processing module 3 can implement the corresponding filter according to the following steps (1)-(2).

[0113] (1) Based on the second coefficient function, a plurality of coefficients of a filter are determined, wherein the number of the plurality of coefficients of the filter is equal to the length of the filter.

[0114] Based on the above description, it can be known that the second coefficient function is obtained by bringing the reference response function with the target cutoff frequency into the first coefficient function. That is, the second coefficient function is obtained by windowing the reference response function with the target cutoff frequency. The length corresponding to the target window function (i.e., the length of the filter) is equal to the number of coefficients of the filter, that is, if the length corresponding to the target window function is equal to N, then the filter has N coefficients.

[0115] In some embodiments, based on the second coefficient function, h(0), h(1), h(2), and up to h(N-1), a total of N filter coefficients, can be obtained.

[0116] (2) Based on the multiple coefficients of the filter, determine the expression of the filter.

[0117] As an example, the processing module 3 can use a direct structure to implement the filter. Figure 3 , Figure 3 is the structure diagram of the direct filter, Figure 3 The unit delay unit in represents a unit delay unit, that is, the signal is delayed by one sampling period. Figure 3 From the structure diagram shown, the expression of the filter can be obtained, which is shown in the following formula (6);

[0118] (6)

[0119] Among them, y(n) represents the expression of the filter (i.e., the output signal), h(k) represents the coefficient of the filter, and x(Nk) represents the input signal.

[0120] It should be noted that the above description is based on the fact that the processing module 3 uses a direct structure to implement the filter. Of course, in practical applications, the processing module 3 may also use other structures to implement the filter. This embodiment of the application does not limit this.

[0121] In addition, in some embodiments, the processing module 3 may be a Field-Programmable Gate Array (FPGA).

[0122] The filter design system based on window function in the embodiment of the present application includes a selection interface, and the user can select the window function, filter type and filter bandwidth that he wants to use on the selection interface, so as to improve the flexibility of the filter design system; moreover, the calculation module can obtain the target window function, filter type and target bandwidth, and determine the target cutoff frequency corresponding to the filter that meets the target bandwidth based on the above three, and then determine the second coefficient function corresponding to the target bandwidth, that is, the filter design system provided by the embodiment of the present application can obtain the second coefficient function corresponding to different bandwidths by changing the target bandwidth, and then design the corresponding filter, so that not only can design filters of other bandwidths except 6dB bandwidth, but also can flexibly design the corresponding filter according to the needs of the user. Moreover, in the case where the current second cutoff frequency does not meet the requirements, the current second cutoff frequency will also be updated until the obtained second cutoff frequency meets the corresponding needs of the filter of the target bandwidth, compared to manually adjusting and visually observing to design the filter, the filter design system provided by the embodiment of the present application can improve the precision of the designed filter.

[0123] Next, the method for determining the filter coefficients provided in the embodiment of the present application is introduced in detail.

[0124] Figure 4 is a flow chart of a method for determining filter coefficients provided in an embodiment of the present application, the method comprising:

[0125] Step 401: Obtain a target window function, a filter type, and a target bandwidth of the filter, and determine a reference transmission function based on the filter type, and a reference response function corresponding to the reference transmission function. The target window function, the filter type, and the target bandwidth are selected by the user.

[0126] The process of the above step 401 has been described in detail above. Please refer to the above related content and will not be repeated here.

[0127] Step 402: Determine a first coefficient function of a filter based on a reference response function and a target window function.

[0128] The process of the above step 402 has been described in detail above. Please refer to the relevant content above and will not be repeated here.

[0129] Step 403: Perform time-frequency transformation on the first coefficient function to determine the target transfer function of the filter.

[0130] The process of the above step 403 has been described in detail above. Please refer to the above related content and will not be repeated here.

[0131] Step 404: Determine the target cutoff frequency based on the first frequency point, the second frequency point, the error threshold and the target transfer function, wherein the first frequency point and the second frequency point are obtained according to the sampling rate, the sampling rate and the error threshold are acquired in advance, and the value of the first frequency point is smaller than the value of the second frequency point.

[0132] In some embodiments, the target cutoff frequency may be determined according to the following steps (1)-(4).

[0133] (1) Determine a first cutoff frequency based on the first frequency point and the second frequency point.

[0134] (2) Substitute the first cutoff frequency into the target transfer function to obtain the first amplitude response.

[0135] (3) If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than the error threshold, the first cutoff frequency is determined as the target cutoff frequency.

[0136] (4) If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, it is determined whether the first amplitude response is greater than the inverse of the target bandwidth.

[0137] The process of the above step 404 has been described in detail above. Please refer to the relevant content above and will not be repeated here.

[0138] Step 405: Determine a second coefficient function based on the target cutoff frequency, the reference response function and the first coefficient function.

[0139] The process of the above step 405 has been described in detail above. Please refer to the above related content and will not be repeated here.

[0140] The embodiment of the present application obtains the target window function, the filter type and the target bandwidth, and determines the target cutoff frequency corresponding to the filter that meets the target bandwidth based on the above three, and then determines the second coefficient function corresponding to the target bandwidth, that is, the method provided by the embodiment of the present application can obtain the second coefficient function corresponding to different bandwidths by changing the target bandwidth, and then design the corresponding filter. In this way, not only can filters with other bandwidths other than the 6dB bandwidth be designed, but also the second coefficient function can be flexibly determined according to the needs of the user. In addition, if the current second cutoff frequency does not meet the requirements, the current second cutoff frequency will be updated until the obtained second cutoff frequency meets the requirements corresponding to the filter of the target bandwidth, which can improve the accuracy of the designed filter.

[0141] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0142] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.

Claims

1. A filter design system based on window function, characterized in that: include: A selection interface for determining a target window function, a filter type, and a target bandwidth of the filter in response to a click operation by a user; A calculation module, used to obtain the target window function, the filter type and the target bandwidth, and determine a reference transmission function and a reference response function corresponding to the reference transmission function based on the filter type; determine a first coefficient function of the filter based on the reference response function and the target window function; perform time-frequency transformation on the first coefficient function to determine the target transmission function of the filter; determine a first cutoff frequency based on a first frequency point and a second frequency point, substitute the first cutoff frequency into the target transmission function to obtain a first amplitude response, if the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than an error threshold, determine the first cutoff frequency as the target cutoff frequency, if the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, determine the target cutoff frequency according to the magnitude relationship between the first amplitude response and the inverse of the target bandwidth, the first frequency point and the second frequency point are obtained according to a sampling rate, the sampling rate and the error threshold are obtained in advance, and the value of the first frequency point is less than the value of the second frequency point; determining a second coefficient function based on the target cutoff frequency, the reference response function, and the first coefficient function; A processing module is used to store the second coefficient function and implement a filter corresponding to the target bandwidth according to the second coefficient function.

2. The filter design system based on window function as claimed in claim 1, characterized in that: The calculation module determines the target cutoff frequency according to the magnitude relationship between the first amplitude response and the inverse of the target bandwidth, including: If the first amplitude response is greater than the inverse of the target bandwidth, determining a second cutoff frequency based on the first cutoff frequency and the first frequency point; If the first amplitude response is not greater than the inverse of the target bandwidth, determining a second cutoff frequency based on the first cutoff frequency and the second frequency point; The target cutoff frequency is determined based on the second cutoff frequency, the error threshold, and the target transfer function.

3. The filter design system based on window function as claimed in claim 2, characterized in that: The calculation module determines the target cutoff frequency based on the second cutoff frequency, the error threshold and the target transfer function, including: Substituting the current second cutoff frequency into the target transfer function to obtain a second amplitude response; determining whether an absolute value of a difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold; If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is not greater than the error threshold, determining the current second cutoff frequency as the target cutoff frequency; If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is greater than the inverse of the target bandwidth, then based on the first frequency point, the current second cutoff frequency is updated to obtain an updated second cutoff frequency; If the absolute value of the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold, and the second amplitude response is not greater than the inverse of the target bandwidth, then based on the second frequency point, the current second cutoff frequency is updated to obtain an updated second cutoff frequency; The updated second cutoff frequency is re-substituted into the target transfer function to obtain a second amplitude response, and it is re-determined whether the difference between the second amplitude response and the inverse of the target bandwidth is greater than the error threshold.

4. The filter design system based on window function as claimed in claim 1, characterized in that: The calculation module determines a first coefficient function of the filter based on the reference response function and the target window function, including: The product of the reference response function and the target window function is determined as the first coefficient function.

5. The filter design system based on window function as claimed in claim 1, characterized in that: The processing module implements a filter corresponding to the target bandwidth according to the second coefficient function, including: Based on the second coefficient function, determining a plurality of coefficients of the filter, the number of the plurality of coefficients of the filter being equal to the length of the filter; An expression for the filter is determined based on a plurality of coefficients of the filter.

6. A method for determining filter coefficients, characterized in that: include: Acquire a target window function, a filter type, and a target bandwidth of the filter, and determine a reference transmission function based on the filter type, and a reference response function corresponding to the reference transmission function, wherein the target window function, the filter type, and the target bandwidth are set by a user; Determining a first coefficient function of the filter based on the reference response function and the target window function; Performing a time-frequency transform on the first coefficient function to determine a target transfer function of the filter; Based on a first frequency point and a second frequency point, a first cutoff frequency is determined, and the first cutoff frequency is substituted into the target transfer function to obtain a first amplitude response. If the absolute value of the difference between the first amplitude response and the inverse of the target bandwidth is not greater than an error threshold, the first cutoff frequency is determined as the target cutoff frequency. If the difference between the first amplitude response and the inverse of the target bandwidth is greater than the error threshold, the target cutoff frequency is determined according to a magnitude relationship between the first amplitude response and the inverse of the target bandwidth. The first frequency point and the second frequency point are obtained according to a sampling rate. The sampling rate and the error threshold are obtained in advance. The value of the first frequency point is less than the value of the second frequency point. A second coefficient function is determined based on the target cutoff frequency, the reference response function, and the first coefficient function.

7. A computer-readable storage medium, characterized in that: The medium stores a computer program, which can be executed by a processor to implement the method according to claim 6.

8. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the method according to claim 6 is implemented.

Citation Information

Patent Citations

  • Implementation method of passband-selectable digital filter

    CN112968688A