A filtering method, apparatus, device, and storage medium based on an FIR filter.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-13
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]当需要支持多种场景滤波处理时,需要多个单模滤波器分别处理对应的滤波操作,消耗了较多资源,逻辑实现的代码量较大
[0020] The filtering method, apparatus, system, and storage medium based on FIR filters provided in this application select a corresponding number of filter multiplexing units by using the filtering order and downsampling factor to perform decimation filtering of the corresponding order. This allows the filter to support a wider range of processing scenarios and reduces resource consumption and the amount of code required for logic implementation.
Smart Images

Figure CN112994652B_ABST
Abstract
Description
Technical Field
[0001] This application relates to digital signal processing technology, specifically to a filtering method, apparatus, system, and storage medium based on an FIR (Finite Impulse Response) filter. Background Technology
[0002] In the digital receiving front-end and signal processing, the high-speed analog-to-digital converter output contains both useful signals and interference signals. The digital signal processing system separates and extracts the useful signals, moves them to the baseband, and uses digital filters to filter out out-of-band interference.
[0003] When multiple scenarios of filtering need to be supported, multiple single-mode filters are required to handle the corresponding filtering operations, which consumes a lot of resources and requires a large amount of code for logic implementation. Summary of the Invention
[0004] This application provides a filtering method, apparatus, system, and storage medium for an FIR filter-based system.
[0005] This application provides a filtering method based on an FIR filter, including:
[0006] Obtain the preset filter order and preset downsampling factor;
[0007] According to the preset downsampling factor, a corresponding number of filter multiplexing units are selected as the filter multiplexing units to be used; wherein, the FIR filter includes multiple filter multiplexing units;
[0008] Configure the filter order used by the filter multiplexing unit according to the preset filter order;
[0009] According to the preset downsampling factor, the input data allocated to itself is filtered by the filter multiplexing unit, and the output unit outputs filtered data.
[0010] The filtered data from the units are then merged and output.
[0011] This application provides a filtering device based on an FIR filter, comprising:
[0012] The filter parameter acquisition module is used to obtain the preset filter order and preset downsampling factor;
[0013] The multiplexing unit selection module is used to select a corresponding number of filter multiplexing units as the filter multiplexing units to be used according to the preset downsampling factor; wherein, the FIR filter includes multiple filter multiplexing units;
[0014] The unit order configuration module is used to configure the order of filtering used by the filter multiplexing unit according to the preset filtering order;
[0015] The unit data output module is used to filter the input data allocated to itself through the filter multiplexing unit according to the preset downsampling factor, and output the unit filtered data.
[0016] The data merging module is used to merge and output the filtered data from the unit.
[0017] This application provides a device, which includes a processor and a memory;
[0018] The processor is used to execute programs stored in the memory to implement any of the methods in the embodiments of this application.
[0019] This application provides a storage medium storing a computer program, which, when executed by a processor, implements any of the methods described in this application.
[0020] The filtering method, apparatus, system, and storage medium based on FIR filters provided in this application select a corresponding number of filter multiplexing units by using the filtering order and downsampling factor to perform decimation filtering of the corresponding order. This allows the filter to support a wider range of processing scenarios and reduces resource consumption and the amount of code required for logic implementation. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the existing FIR filter structure.
[0022] Figure 2 This is a flowchart of a filtering method based on an FIR filter.
[0023] Figure 3 This is a schematic diagram of the structure of an FIR filter.
[0024] Figure 4 This is a flowchart of a filtering method based on an FIR filter.
[0025] Figure 5 This is a schematic diagram of a filtering device based on an FIR filter. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be arbitrarily combined with each other.
[0027] In high-sampling-rate radio frequency circuits, multiple stages of filters are typically required for data downsampling and anti-aliasing filtering. A single chip needs to support multiple application scenarios such as 2G, 3G, 4G, and 5G, necessitating the parallel placement of various downsampling filters along the link to handle diverse scenarios, resulting in a large number of filters required. For example... Figure 1 As shown, the existing filter setup method involves setting up multiple single-mode filters in parallel and using a data selector (multiplexer, MUX) to distribute the input data to the corresponding single-mode filters to complete the filtering operation. However, to support various scenarios, multiple single-mode filters are required, resulting in increased resource consumption and a larger amount of logic implementation code.
[0028] Figure 2 A flowchart illustrating a filtering method based on an FIR filter according to an embodiment of this application is shown, as follows: Figure 2 As shown, this method can be applied to multimode FIR filters on communication links, and the method may include:
[0029] Step S11: Obtain the preset filter order and preset downsampling factor;
[0030] Step S12: Select a corresponding number of filter multiplexing units as the filter multiplexing units to be used according to the preset downsampling factor; wherein, the FIR filter includes multiple filter multiplexing units;
[0031] Step S13: Configure the filter multiplexing unit to use the filter order according to the preset filter order;
[0032] Step S14: According to the preset downsampling factor, the input data allocated to itself is filtered by the filter multiplexing unit, and the output unit outputs filtered data.
[0033] Step S15: Combine and output the filtered data from the units.
[0034] like Figure 3 As shown in the embodiments of this application, the FIR filter includes multiple filter multiplexing units 31. Figure 3 Taking three filter multiplexing units as an example, the system also includes an input control module 32, an output control module 33, a data merging module 34, and a control and parameter configuration module 35. The filter multiplexing unit 31 can perform functions such as data timing, timing control, and multiplication and accumulation of input data and coefficients. It has its own data input control logic to control the phase and timing of the input data. The FIR filter can be configured with its decimation mode through the control and parameter configuration module 35, thereby configuring whether the filter multiplexing unit 31 is used and the order used by the filter multiplexing unit 31.
[0035] The preset filter order and preset downsampling factor are filtering parameters that the FIR filter must meet when filtering input data based on the current scenario. When filtering input data, the FIR filter distributes the input data to at least a portion of the filter multiplexing units for multiplication and accumulation of the input data and filter coefficients. Therefore, a corresponding number of filter multiplexing units need to be selected as the multiplexing units to be used, based on the preset downsampling factor. The input data will be evenly distributed to these multiplexing units according to the time sequence. Having obtained the preset filter order and determined the number of multiplexing units, each multiplexing unit needs to evenly distribute the preset filter order for filtering. When the FIR filter performs filtering, the input data will be evenly distributed to the multiplexing units according to the time sequence. After the multiplexing units complete the multiplication and accumulation of the input data and filter coefficients, they obtain the unit filtered data. The unit filtered data output from all multiplexing units are combined to obtain the final filtered data output by the FIR filter. The input data is evenly distributed to the filter multiplexing units according to the timing sequence for filtering operations. After the filter multiplexing units output their respective unit filtering data, the unit filtering data also needs to be arranged according to the timing relationship of the input data before the filtering operation, so as to realize the unit filtering data merging operation. The merged unit filtering data is used as the filtered output data of the FIR filter.
[0036] In one implementation, step S12 includes: when the preset downsampling factor is an integer, selecting the same number of filter multiplexing units as the filter multiplexing units to be used.
[0037] Accordingly, step S14 includes: using the filter multiplexing unit to perform multiplication and addition operations on the input data and the preset filter coefficient within the same clock cycle as the preset downsampling factor, and calculate the unit filter data.
[0038] In one example, if the preset downsampling factor is 3x, three filter multiplexing units can be selected as the filter multiplexing units. Within three clock cycles, these three filter multiplexing units perform multiplication and accumulation operations on the input data to obtain the unit-filtered data. Combining the unit-filtered data output from the three filter multiplexing units completes the 3x decimation filtering. The filter coefficients of the three filter multiplexing units are (0, 3, 6, 9, ...), (1, 4, 7, 10, ...), and (2, 5, 8, 11, ...). The order of the filter multiplexing units is selected according to the preset filtering order to achieve the preset filtering order. If the preset downsampling factor is 2x, two filter multiplexing units can be selected as the filter multiplexing units. Within two clock cycles, these two filter multiplexing units perform multiplication and accumulation operations on the input data to obtain the unit-filtered data. Combining the unit-filtered data output from the two filter multiplexing units completes the 2x decimation filtering. Therefore, for decimation filtering, there will be unused filter multiplexing units. When performing decimation filtering, the unused filter multiplexing units can be masked by hardware so that their output is all 0. Then, the output results of the two used filter multiplexing units are combined to obtain the decimation filtering result.
[0039] In one implementation, step S12 includes: when the preset downsampling factor is a fraction, selecting the same number of filter multiplexing units as the numerator of the preset downsampling factor as the filter multiplexing units to be used.
[0040] Accordingly, step S14 includes: using the filter multiplexing unit to perform multiplication and addition operations on the input data and the preset filter coefficient within the same clock period as the denominator of the preset downsampling factor, and to calculate the unit filtered data.
[0041] In one example, if the preset downsampling factor is 4 / 3, three filter multiplexing units can be selected as the filter multiplexing units. Within four clock cycles, these three filter multiplexing units perform multiplication and accumulation operations on the input data in the first three clock cycles, and only shift the data without filtering in the fourth clock cycle, obtaining the unit-filtered data. Combining the unit-filtered data output from the three filter multiplexing units completes the 4 / 3 decimation filtering.
[0042] In one implementation, such as Figure 4 As shown, before step S11, the following steps are also included:
[0043] Step S41: Configure the number of filter multiplexing units in the FIR filter according to at least two preset downsampling factors supported by the FIR filter; wherein the preset downsampling factors are integers and / or fractions;
[0044] Step S42: Based on the maximum order supported by the FIR filter and the number of filter multiplexing units, set the maximum order supported by the filter multiplexing unit; wherein, the filter multiplexing unit is configured to have functions including data timing, timing control, and data multiplication and accumulation with coefficients.
[0045] In one implementation, step S41 includes: if all the preset downsampling factors supported by the FIR filter are integers, configuring the number of filter multiplexing units according to the largest preset downsampling factor;
[0046] If the preset downsampling factor supported by the FIR filter includes a fraction, the number of filter multiplexing units is configured according to the preset downsampling factor that is a fraction and the preset downsampling factor that is an integer.
[0047] In one exemplary implementation, if the FIR filter supports 2x decimation filtering and 3x decimation filtering, then the FIR filter needs to be configured with 3 filter multiplexing units. If the FIR filter supports 4x / 3x decimation filtering, 2x decimation filtering, and 3x decimation filtering, then the FIR filter needs to be configured with 3 filter multiplexing units.
[0048] In one implementation, step S42 includes setting the maximum order of the unit to be greater than or equal to the quotient of the maximum order supported by the FIR filter and the number of filter multiplexing units.
[0049] In one exemplary implementation, the FIR filter needs to support 4 / 3 times (90th order), 2 times (78th order), and 3 times (54th order). Based on the requirement of supporting a maximum of 90th order and 3 times downsampling, a total of 3 groups of filter multiplexing units are designed. Each group can perform filter multiplication and addition operations up to the 30th order, and the total of 3 groups of filter multiplexing units can achieve the performance requirement of a maximum 90th order decimation filter. Data is controlled by registers to enter different filter multiplexing units, configuring different filter coefficients for each group. Finally, different combinations of multiplexing units are used to support different filtering functions. The software can flexibly define the total order of the multimode filter at the maximum order (30th order per multiplexing unit). If the order is not needed, the filter coefficients can be directly configured to 0, theoretically supporting any filter design up to the maximum order.
[0050] This FIR filter incorporates multiple filter multiplexing units. Different combinations of these units enable various filtering modes. The filter downsampling mode and order can be switched by configuring corresponding registers. Compared to existing designs using multiple single-mode filters, this approach reduces the need for data selection modules, filter parameter configuration registers, the number of single-mode filters, and corresponding logic circuits. Especially in complex scenarios, using a single multi-mode FIR filter replaces the multiple single-mode filters previously required for each scenario, reducing resource consumption and the amount of code needed for logic implementation.
[0051] Figure 5 A schematic diagram of a filtering device based on an FIR filter is shown. This device can be installed at the digital receiver front end and includes:
[0052] The filter parameter acquisition module 51 is used to acquire the preset filter order and the preset downsampling factor;
[0053] The unit selection module 52 is used to select a corresponding number of filter multiplexing units as the filter multiplexing units to be used according to the preset downsampling factor; wherein, the FIR filter includes multiple filter multiplexing units;
[0054] The unit order configuration module 53 is used to configure the order of filtering used by the filter multiplexing unit according to the preset filtering order;
[0055] Unit data output module 54 is used to filter the input data allocated to itself through the filter multiplexing unit according to the preset downsampling factor, and output unit filtered data.
[0056] The data merging module 55 is used to merge and output the filtered data from the unit.
[0057] In one embodiment, the unit selection module 52 includes:
[0058] The first selection submodule is used to select the same number of filter multiplexing units as the filter multiplexing units to be used when the preset downsampling factor is an integer.
[0059] Accordingly, the unit data output module 54 includes:
[0060] The first unit data calculation submodule is used to calculate the unit filtered data by multiplying and adding the input data and the preset filter coefficients within the same clock cycle as the preset downsampling factor through the filter multiplexing unit.
[0061] In one embodiment, the unit selection module 52 includes:
[0062] The second selection submodule is used to select the same number of filter multiplexing units as the filter multiplexing units to be used when the preset downsampling factor is a fraction.
[0063] Accordingly, the unit filter data output module 54 includes:
[0064] The second unit data calculation submodule is used to calculate the unit filtered data by multiplying and adding the input data and the preset filter coefficients within the same clock period as the denominator of the preset downsampling factor, using the same clock period as the numerator of the preset downsampling factor, through the filter multiplexing unit.
[0065] In one embodiment, the FIR-based filtering device further includes:
[0066] The unit quantity configuration module is used to configure the number of filter multiplexing units in the FIR filter according to at least two preset downsampling factors supported by the FIR filter before obtaining the preset filter order and preset downsampling factor; wherein, the preset downsampling factor is an integer and / or a fraction;
[0067] The unit order setting module is used to set the maximum unit order supported by the filter multiplexing unit according to the maximum order supported by the FIR filter and the number of filter multiplexing units; wherein, the filter multiplexing unit is configured to have functions including data timing, timing control, and data multiplication and accumulation with coefficients.
[0068] In one implementation, the unit quantity configuration module includes:
[0069] The first quantity configuration submodule is used to configure the number of filter multiplexing units according to the largest preset downsampling factor if all the preset downsampling factors supported by the FIR filter are integers.
[0070] The second quantity configuration submodule is used to configure the number of filter multiplexing units if the preset downsampling factor supported by the FIR filter includes a fraction, based on the denominator of the preset downsampling factor that is a fraction and the preset downsampling factor that is an integer.
[0071] In one implementation, the unit order setting module includes:
[0072] The unit order setting submodule is used to set the maximum order of the unit to be greater than or equal to the quotient of the maximum order supported by the FIR filter and the number of filter multiplexing units.
[0073] The functions of each module in the devices of this application embodiment can be found in the corresponding descriptions in the above method embodiments, and will not be repeated here.
[0074] This application provides a device, which includes a processor and a memory;
[0075] The processor is used to execute programs stored in the memory to implement any of the methods in the embodiments of this application.
[0076] This application provides a storage medium storing a computer program, which, when executed by a processor, implements any of the methods described in this application.
[0077] The above description is merely an exemplary embodiment of this application and is not intended to limit the scope of protection of this application.
[0078] Those skilled in the art will understand that the term user terminal encompasses any suitable type of wireless user equipment, such as mobile phones, portable data processing devices, portable web browsers, or vehicle-mounted mobile stations.
[0079] Generally, the various embodiments of this application can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. For example, some aspects can be implemented in hardware, while others can be implemented in firmware or software that can be executed by a controller, microprocessor, or other computing device, although this application is not limited thereto.
[0080] Embodiments of this application can be implemented by executing computer program instructions through the data processor of a mobile device, for example, in a processor entity, or through hardware, or through a combination of software and hardware. The computer program instructions can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.
[0081] Any block diagram of logical flow in the accompanying drawings of this application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions. The computer program may be stored in memory. The memory may be of any type suitable to the local technical environment and may be implemented using any suitable data storage technology, such as, but not limited to, read-only memory (ROM), random access memory (RAM), optical storage devices and systems (Digital Multifunction Discs, DVDs, or CDs), etc. Computer-readable media may include non-transitory storage media. The data processor may be of any type suitable to the local technical environment, such as, but not limited to, general-purpose computers, special-purpose computers, microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable logic devices (FGPAs), and processors based on multi-core processor architectures.
[0082] A detailed description of exemplary embodiments of this application has been provided above through exemplary and non-limiting examples. However, various modifications and adjustments to the above embodiments will be apparent to those skilled in the art when considered in conjunction with the accompanying drawings and claims, without departing from the scope of the invention. Therefore, the proper scope of the invention will be determined by the claims.
Claims
1. A filtering method based on an FIR filter, characterized in that, include: Obtain the preset filter order and preset downsampling factor; According to the preset downsampling factor, a corresponding number of filter multiplexing units are selected as the filter multiplexing units to be used; wherein, the FIR filter includes multiple filter multiplexing units, and the filter multiplexing units are configured to have functions including data timing, timing control, and data multiplication and accumulation with coefficients; according to the preset filtering order, the filtering order used by the filter multiplexing units is configured; According to the preset downsampling factor, the input data allocated to itself is filtered by the filter multiplexing unit, and the output unit outputs filtered data. The filtered data from the units are combined and output. Before obtaining the preset filter order and preset downsampling factor, the method further includes: The number of filter multiplexing units in the FIR filter is configured according to at least two preset downsampling factors supported by the FIR filter; wherein the preset downsampling factors are integers and / or fractions; The maximum order supported by the FIR filter and the number of filter multiplexing units are set to the maximum order supported by the filter multiplexing unit.
2. The method according to claim 1, characterized in that, The step of selecting a corresponding number of filter multiplexing units as the filter multiplexing units to be used according to the preset downsampling factor includes: When the preset downsampling factor is an integer, the same number of filter multiplexing units as the preset downsampling factor are selected as the filter multiplexing units to be used.
3. The method according to claim 2, characterized in that, The step of filtering the input data allocated to itself using the filter multiplexing unit according to the preset downsampling factor, and outputting filtered data to the output unit, includes: The filter multiplexing unit calculates the unit-filtered data by performing multiplication and addition operations on the input data and preset filter coefficients within the same clock cycle as the preset downsampling factor using the filter multiplexing unit.
4. The method according to claim 1, characterized in that, The step of selecting a corresponding number of filter multiplexing units as the filter multiplexing units to be used according to the preset downsampling factor includes: When the preset downsampling factor is a fraction, the same number of filter multiplexing units as the numerator of the preset downsampling factor are selected as the filter multiplexing units to be used.
5. The method according to claim 4, characterized in that, The step of filtering the input data allocated to itself using the filter multiplexing unit according to the preset downsampling factor, and outputting filtered data to the output unit, includes: The filter multiplexing unit calculates the unit-filtered data by performing a multiplication and addition operation on the input data and the preset filter coefficient within the same clock cycle as the denominator of the preset downsampling factor and the same clock cycle as the numerator of the preset downsampling factor.
6. The method according to claim 1, characterized in that, The step of configuring the number of filter multiplexing units in the FIR filter according to at least two preset downsampling factors supported by the FIR filter includes: If all the preset downsampling factors supported by the FIR filter are integers, the number of filter multiplexing units is configured according to the largest preset downsampling factor; If the preset downsampling factor supported by the FIR filter includes a fraction, the number of filter multiplexing units is configured according to the denominator of the preset downsampling factor that is a fraction and the preset downsampling factor that is an integer.
7. The method according to claim 1 or 6, characterized in that, The step of setting the maximum order supported by the filter multiplexing unit based on the maximum order supported by the FIR filter and the number of filter multiplexing units includes: The maximum order of the unit is set to be greater than or equal to the quotient of the maximum order supported by the FIR filter and the number of filter multiplexing units.
8. A filtering device based on an FIR filter, characterized in that, include: The filter parameter acquisition module is used to obtain the preset filter order and preset downsampling factor; The unit selection module is used to select a corresponding number of filter multiplexing units as the filter multiplexing units to be used according to the preset downsampling factor; wherein, the FIR filter includes multiple filter multiplexing units, and the filter multiplexing units are configured to have functions including data timing, timing control, and data multiplication and accumulation with coefficients; The unit order configuration module is used to configure the order of filtering used by the filter multiplexing unit according to the preset filtering order; The unit data output module is used to filter the input data allocated to itself through the filter multiplexing unit according to the preset downsampling factor, and output the unit filtered data. The data merging module is used to merge and output the filtered data from the unit. The FIR-based filtering device further includes: The unit quantity configuration module is used to configure the number of filter multiplexing units in the FIR filter according to at least two preset downsampling factors supported by the FIR filter before obtaining the preset filter order and preset downsampling factor; wherein, the preset downsampling factor is an integer and / or a fraction; The unit order setting module is used to set the maximum unit order supported by the filter multiplexing unit according to the maximum order supported by the FIR filter and the number of filter multiplexing units.
9. The apparatus according to claim 8, characterized in that, The unit selection module includes: The first selection submodule is used to select the same number of filter multiplexing units as the filter multiplexing units to be used when the preset downsampling factor is an integer.
10. The apparatus according to claim 9, characterized in that, The unit data output module includes: The first unit data calculation submodule is used to calculate the unit filtered data by multiplying and adding the input data and the preset filter coefficients within the same clock cycle as the preset downsampling factor through the filter multiplexing unit.
11. The apparatus according to claim 8, characterized in that, The unit selection module includes: The second selection submodule is used to select the same number of filter multiplexing units as the filter multiplexing units to be used when the preset downsampling factor is a fraction.
12. The apparatus according to claim 11, characterized in that, The unit data output module includes: The second unit data calculation submodule is used to calculate the unit filtered data by multiplying and adding the input data and the preset filter coefficients within the same clock period as the denominator of the preset downsampling factor, using the same clock period as the numerator of the preset downsampling factor, through the filter multiplexing unit.
13. A device, characterized in that, The device includes a processor and a memory; The processor is used to execute a program stored in the memory to implement the method according to any one of claims 1-7.
14. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
Citation Information
Patent Citations
Fractional rate resampling filter on FPGA
US8289195B1
Dynamically re-configurable signal decimation system using a finite impulse response (FIR) filter
US8589461B1
Finite impulse response filter with parallel input
US9098435B1