Digital filter sampling rate conversion method

Through the Matlab program and bilinear transformation method, the filter sampling rate conversion process is simplified, the complex and inaccurate problems in the existing technology are solved, fast and accurate filter sampling rate conversion is achieved, and multiple filter parameter formats are supported.

CN120811323APending Publication Date: 2025-10-17CHANGSHA HOTONE AUDIO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510936233.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing filter sampling rate conversion methods are complex and have low accuracy, especially when changing the sampling rate, digital modeling needs to be re-performed, and digital filter coefficients with filter parameters cannot be processed.

Method used

By obtaining the target and current sampling rate of the filter and the digital filter coefficients, the data preprocessing and bilinear transformation are performed using the MATLAB program to realize the format conversion of the filter coefficients. It supports multiple filter parameter formats and is suitable for different types of filter designs.

Benefits of technology

It simplifies the filter sampling rate conversion process, achieves fast and accurate sampling rate conversion, supports multiple filter parameter formats, is suitable for different types of filter designs, and can quickly complete the conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120811323A_ABST
    Figure CN120811323A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of digital signal processing, and relates to a digital filter sampling rate conversion method, which comprises the following steps: acquiring a target sampling rate and a current sampling rate of a filter and a digital filter coefficient under the current sampling rate; copying the digital filter coefficient under the current sampling rate to a text document to obtain a coefficient document; according to the current sampling rate, the target sampling rate and the filter parameters, designing a program to read a coefficient document, and converting the format of the coefficient document to obtain coefficient characters; using a complex frequency variable of the bilinear transformation method as an auxiliary parameter, and converting the coefficient character to obtain an analog filter coefficient; converting the analog filter coefficient to obtain a digital filter coefficient under the target sampling rate; and converting the digital filter coefficient under the target sampling rate into characters in an engineering format and outputting the characters to obtain a sampling rate conversion result. According to the invention, the sampling rate conversion of the digital filter can be rapidly and accurately realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of digital signal processing, in particular to a digital filter sampling rate conversion method. BACKGROUND

[0002] With the development of science and technology and the progress of technology, filters have been studied more and more. In signal processing engineering, the design of a filter is often based on a specific sampling rate. However, in actual applications, due to changes in system requirements, it is often necessary to convert the sampling rate of the filter.

[0003] In the prior art, the filter sampling rate conversion method includes: using a forward modeling technology, which is a modeling technology based on CDCM, dividing, analyzing and digitally modeling the original circuit according to the signal flow direction of the original circuit diagram to realize the conversion of the sampling rate.

[0004] However, the existing filter sampling rate conversion method is based on the sampling rate for digital modeling, and the sampling rate is not open. If the sampling rate is changed, digital modeling needs to be performed again. If some modeling data is lost, the algorithm also needs to find modeling circuit diagrams and other data again, so the process is complex, the steps are tedious, and the accuracy is not high. SUMMARY

[0005] Therefore, it is necessary to provide a digital filter sampling rate conversion method to quickly and accurately realize digital filter sampling rate conversion.

[0006] A digital filter sampling rate conversion method comprises: obtaining a target sampling rate, a current sampling rate and a digital filter coefficient under the current sampling rate of a filter; the digital filter coefficient comprises a filter parameter; copying the digital filter coefficient under the current sampling rate to a text document to obtain a coefficient document; designing a matlab program according to the current sampling rate, the target sampling rate and the filter parameter to read the coefficient document and convert the format of the coefficient document to obtain matlab executable characters as coefficient characters; using the complex frequency variable of the bilinear transformation method as an auxiliary parameter, converting the coefficient characters according to the current sampling rate, the filter parameter and the auxiliary parameter to obtain analog filter coefficients; converting the analog filter coefficients according to the target sampling rate and the auxiliary parameter to obtain the digital filter coefficients under the target sampling rate; converting the digital filter coefficients under the target sampling rate into characters in an engineering format and outputting to obtain a sampling rate conversion result.

[0007] In one embodiment, the digital filter coefficients at the current sampling rate of the filter are obtained, including: The filter parameters and the values of the filter parameters at the current sampling rate are obtained to form a coefficient polynomial, and the coefficient polynomial is taken as the digital filter coefficients.

[0008] In one embodiment, the conversion of the coefficient characters and the conversion of the analog filter coefficients are both implemented by using a bilinear transformation method.

[0009] In one embodiment, a matlab program is designed to read the coefficient document and convert the format of the coefficient document to obtain matlab executable characters as the coefficient characters, including: The matlab program is designed; The coefficient document is read by using the matlab program to perform data preprocessing and mark the steps of the data preprocessing, so as to convert the format of the coefficient document to obtain matlab executable characters as the coefficient characters.

[0010] In one embodiment, the data preprocessing includes the following steps performed in sequence: multi-dimensional array processing, structure processing, normalization processing and format matching processing. In one embodiment, the multi-dimensional array processing includes: The array dimension of the digital initial coefficients of the filter is detected, and the array operation function of MATLAB is used for processing.

[0011] In one embodiment, the structure processing includes: The digital initial coefficients of the filter after the multi-dimensional array processing are detected, and it is judged whether the digital initial coefficients have a structure; When the digital initial coefficients have a structure, it is marked that there is a structure, the structure character is retained, and the structure character in the filter coefficient characters is deleted; When the digital initial coefficients do not have a structure, it is marked that there is no structure.

[0012] In one embodiment, the normalization processing includes: According to the filter coefficient characters, it is judged whether the filter has been subjected to normalization processing; If the normalization processing has been performed, it is marked that the normalization processing has been performed, and the filter coefficient characters are converted into filter coefficient characters which have not been subjected to normalization processing, and the filter coefficient characters which have not been subjected to normalization processing are matlab readable characters; If the normalization processing has not been performed, it is marked that the normalization processing has not been performed.

[0013] In one embodiment, the format matching processing includes: The format of the normalized digital state initial coefficient of the filter is matched with the platform format.

[0014] In one embodiment, the digital filter coefficient at the target sampling rate is converted into characters in the engineering format and output, obtaining a sampling rate conversion result, including: According to the labeled data preprocessing step, the digital filter coefficient at the target sampling rate is converted into characters in the engineering format and output, obtaining a sampling rate conversion result.

[0015] The above-mentioned digital filter sampling rate conversion method only needs to obtain the desired specified sampling rate result by using the existing filter result (determining the current sampling rate of the filter), simplifies the existing digital filter sampling rate conversion process, and enables the user to quickly and accurately complete the sampling rate conversion of the filter. Meanwhile, the present application supports various filter parameter formats (such as multi-dimensional arrays, structures, etc.), is suitable for different types of filter design, and quickly completes the conversion of the filter sampling rate. In addition, according to the sampling rate requirement of the platform (such as 48k or 96k), the present application can convert the digital filter coefficient with parameters (knob parameters) to the specified sampling rate. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 A flowchart of a digital filter sampling rate conversion method in one embodiment; Figure 2 A code example diagram of a filter in one embodiment (only part of the content is shown); Figure 3 A schematic diagram of a coefficient document in one embodiment (only part of the content is shown); Figure 4 A schematic diagram of a syms variable of a filter in one embodiment (only part of the content is shown); Figure 5 A schematic diagram of a syms variable of a filter defined in matlab in one embodiment (only part of the content is shown); Figure 6 A running result of the code in one embodiment, in which the box part can be used for verification (only part of the content is shown); Figure 7 A code example diagram of a verification part in one specific embodiment (only part of the content is shown); Figure 8 A verification result diagram of one specific embodiment; Figure 9 An internal structure diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0017] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0018] In addition, the descriptions such as "first", "second" and the like in the present application are only for the purpose of description and should not be understood as indicating or implying the relative importance of the technical features or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "multiple groups" is at least two groups, such as two groups, three groups, etc., unless otherwise specifically limited.

[0019] In the present application, unless otherwise specifically defined and limited, the terms "connection", "fixing" and the like should be understood in a broad sense, for example, "fixing" can be fixed connection, or detachable connection, or integral; can be mechanical connection, or electrical connection, or physical connection or wireless communication connection; can be directly connected, or indirectly connected through an intermediate medium, or the internal communication of two elements or the interaction relationship between two elements, unless otherwise specifically limited. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0020] In addition, the technical solutions of various embodiments of the present application can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can realize it, and when the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist, nor is it within the scope of protection claimed by the present application.

[0021] The present application provides a digital filter sampling rate conversion method, as shown in the flowchart, in one embodiment, comprising: Figure 1 Step 101, obtaining the target sampling rate, current sampling rate and digital filter coefficient under the current sampling rate of the filter; the digital filter coefficient includes filter parameters.

[0022] Specifically: Obtaining the target sampling rate, current sampling rate, filter parameters and the value of filter parameters under the current sampling rate of the filter; Using filter parameters (for example, Rb, Rt, etc. in the above formula) and the value of filter parameters under the current sampling rate (for example, Rb, Rt, etc. in the above formula); Figure 2 Figure 2 ​​0.9920336796412, 0.22664049310555, etc.), to constitute a coefficient polynomial, and take the coefficient polynomial as the digital filter coefficient under the current sampling rate (such as Figure 2 the shaded part in FIG. 1).

[0023] In this step, how to constitute the coefficient polynomial belongs to the prior art, and will not be described here.

[0024] Step 102, copy the digital filter coefficient under the current sampling rate to a text document to obtain a coefficient document.

[0025] Specifically: copy the digital filter coefficient under the current sampling rate to a text document txt to obtain a coefficient document (such as Figure 3 indicated in FIG. 2).

[0026] In this step, the text document txt belongs to the prior art, and will not be described here.

[0027] Step 103, design a matlab program (including: a preprocessing module, a conversion module and an output module) according to the current sampling rate, the target sampling rate and the filter parameter, to read the coefficient document and convert the format of the coefficient document to obtain matlab executable characters as coefficient characters.

[0028] Specifically: design a matlab program (such as Figure 4 and Figure 5 indicated in FIG. 3) according to the current sampling rate Fs0, the target sampling rate Fs and the filter parameter; read the coefficient document by using the matlab program, perform data preprocessing, and mark the step of data preprocessing (for example: Figure 6 in FIG. 4, p is a structure processing, and den0_1 is a normalization processing), to convert the format of the coefficient document to obtain matlab executable characters as coefficient characters, and the coefficient characters include the filter parameter.

[0029] Among them: the data preprocessing includes sequentially performing: a multidimensional array processing, a structure processing, a normalization processing and a format matching processing; the multidimensional array processing includes: detecting the array dimension in the digital state initial coefficient of the filter, and processing by using an array operation function of MATLAB; The structure processing includes: detecting the digital state initial coefficient of the filter after the multi-dimensional array processing, and judging whether the digital state initial coefficient has a structure; when the digital state initial coefficient has a structure, marking the structure, reserving the structure character, and deleting the structure character in the filter coefficient character; when the digital state initial coefficient does not have a structure, marking no structure; The normalization processing includes: judging whether the filter has a normalization processing according to the filter coefficient character; if the normalization processing is adopted, marking that the normalization processing has been adopted, and transforming the filter coefficient character into a filter coefficient character without normalization processing, which is a matlab readable character; if the normalization processing is not adopted, marking that the normalization processing is not adopted. The format matching processing includes: matching the format of the digital state initial coefficient of the filter after the normalization processing with a platform format.

[0030] In this step, the specific contents of the multi-dimensional array processing, the structure processing, the normalization processing and the format matching processing are all prior art, and will not be described here.

[0031] In step 104, the complex frequency variable of the bilinear transformation method is used as an auxiliary parameter, the coefficient character is converted according to the current sampling rate, the filter parameter and the auxiliary parameter, and the analog filter coefficient is obtained; the analog filter coefficient is converted according to the target sampling rate and the auxiliary parameter, and the digital filter coefficient under the target sampling rate is obtained.

[0032] Specifically: The bilinear transformation method is used, the complex frequency variable of the bilinear transformation method is used as an auxiliary parameter, the coefficient character is converted according to the current sampling rate, the filter parameter (here specifically refers to the filter parameter in the coefficient character) and the auxiliary parameter, and the analog filter coefficient is obtained. The bilinear transformation method is used, the complex frequency variable of the bilinear transformation method is used as an auxiliary parameter, the analog filter coefficient is converted according to the target sampling rate and the auxiliary parameter, and the digital filter coefficient under the target sampling rate is obtained.

[0033] Among them:

[0034] In the formula, is a complex frequency variable of a continuous time system, is a sampling period, is a complex frequency variable of a discrete time system.

[0035] In this step, the bilinear transformation method (a method for converting the frequency domain representation of a continuous-time system (usually represented by Laplace transform) into the frequency domain representation of a discrete-time system (usually represented by Z transform)) and how to use the bilinear transformation method to convert are prior art, which will not be described here.

[0036] Step 105, convert the digital filter coefficients at the target sampling rate into characters in engineering format and output, to obtain the sampling rate conversion result.

[0037] Specifically: According to the labeled data preprocessing step, the digital filter coefficients at the target sampling rate are converted into characters in engineering format and automatically output on the command line, and the sampling rate conversion result, i.e., the target engineering result (such as Figure 6 shown) is obtained by copying.

[0038] In this step, how to convert into characters in engineering format belongs to the prior art, which will not be described here.

[0039] In this embodiment, the coefficient characters, analog filter coefficients, and digital filter coefficients are all stored in matlab.

[0040] The above-mentioned digital filter sampling rate conversion method solves the problem of the prior art that "only the digital filter coefficients without filter parameters at the current sampling rate can be converted, but the digital filter coefficients with filter parameters at the current sampling rate cannot be converted". Only by using the existing filter result (determining the current sampling rate of the filter), the desired result at the specified sampling rate can be obtained, which simplifies the existing digital filter sampling rate conversion process, and enables the user to quickly and accurately complete the sampling rate conversion of the filter. At the same time, the present application supports multiple filter parameter formats (such as multi-dimensional arrays, structures, etc.), which is suitable for different types of filter design and quickly completes the conversion of the sampling rate of the filter. In addition, according to the sampling rate requirement of the platform (such as 48k or 96k), the present application can convert the digital filter coefficients with parameters (knob parameters) to the specified sampling rate.

[0041] It should be understood that, although Figure 1 the steps in the flowchart of Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0042] In a specific embodiment, the digital target coefficients of the output filter are verified to obtain frequency response and phase difference diagrams. If the frequency response and phase response of the filter coefficients at different frequencies are close to each other, the digital filter sampling rate conversion is successful.

[0043] Specifically, Figure 6 Copy the output of the box to the code verification position and give the parameter values, run the program, and compare the digital filter coefficients at the target sampling rate Fs and the digital filter coefficients at the current sampling rate Fs0 using the built-in function fvtool (existing technology) of matlab for frequency response and phase comparison (such as Figure 7 As shown in the figure), we can get the frequency response and phase difference diagram before and after (as shown in the figure). Figure 8 As shown), it can be seen that the method of the present application can accurately realize the digital filter sampling rate conversion.

[0044] The present application also provides a digital filter sampling rate conversion device, which, in one embodiment, includes: a first module, a second module, a third module, a fourth module, and a fifth module, wherein: The first module is used to obtain the target sampling rate, current sampling rate and digital filter coefficients at the current sampling rate of the filter; the digital filter coefficients include filter parameters; The second module is used to copy the digital filter coefficients at the current sampling rate to a text document to obtain a coefficient document; The third module is used to design a MATLAB program according to the current sampling rate, the target sampling rate and the filter parameters to read the coefficient file, convert the format of the coefficient file, and obtain characters that can be run by MATLAB as coefficient characters; The fourth module is used to use the complex frequency variable of the bilinear transformation method as an auxiliary parameter, convert the coefficient characters according to the current sampling rate, filter parameters and auxiliary parameters to obtain analog filter coefficients; and convert the analog filter coefficients according to the target sampling rate and auxiliary parameters to obtain digital filter coefficients at the target sampling rate; The fifth module is used to convert the digital filter coefficients at the target sampling rate into characters in an engineering format and output them to obtain a sampling rate conversion result.

[0045] It should be noted that the third module, the fourth module and the fifth module are respectively a preprocessing module, a conversion module and an output module of the matlab program.

[0046] The specific limitation of the digital filter sampling rate conversion device can refer to the limitation of the digital filter sampling rate conversion method in the above, which will not be repeated here. Each module in the above device can be realized by software, hardware and their combination. The above modules can be embedded in the processor in the computer device in hardware form or independent of the processor in the computer device, or stored in the memory in the computer device in software form, so that the processor calls and executes the operations corresponding to the above modules.

[0047] In one embodiment, a computer device is provided, which can be a terminal, and its internal structure diagram can be as shown in Figure 9 The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a digital filter sampling rate conversion method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0048] Those skilled in the art can understand that Figure 9 The structure shown in the above

[0049] In one embodiment, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps of the method in the above embodiments.

[0050] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to implement the steps of the method in the above embodiments.

[0051] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, databases, or other media in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct Rambus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0052] The contents not described in detail in the specification belong to the prior art known to those skilled in the art.

[0053] The technical features of the above embodiments can be combined in any way. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0054] The above-mentioned embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the present application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended application documents.

Claims

1. A digital filter sampling rate conversion method, characterized in that: include: Get the target sampling rate, current sampling rate and digital filter coefficients of the filter at the current sampling rate; The digital filter coefficients include filter parameters; Copy the digital filter coefficients at the current sampling rate to a text document to obtain a coefficient document; According to the current sampling rate, target sampling rate and filter parameters, design a MATLAB program to read the coefficient file and convert the format of the coefficient file to obtain characters that can be run by MATLAB as coefficient characters; The complex frequency variable of the bilinear transformation method is used as an auxiliary parameter, and the coefficient characters are converted according to the current sampling rate, filter parameters and auxiliary parameters to obtain analog filter coefficients; according to the target sampling rate and auxiliary parameters, the analog filter coefficients are converted to obtain digital filter coefficients at the target sampling rate; The digital filter coefficients at the target sampling rate are converted into characters in an engineering format and output to obtain a sampling rate conversion result.

2. A digital filter sampling rate conversion method according to claim 1, characterized in that: Get the digital filter coefficients at the current sampling rate of the filter, including: Obtain filter parameters and values ​​of the filter parameters at the current sampling rate to form a coefficient polynomial, and use the coefficient polynomial as digital filter coefficients.

3. A digital filter sampling rate conversion method according to claim 1 or 2, characterized in that: The conversion of coefficient characters and the conversion of analog filter coefficients are both achieved by using a bilinear transformation method.

4. A digital filter sampling rate conversion method according to claim 1 or 2, characterized in that: Design a MATLAB program to read the coefficient file and convert the format of the coefficient file to obtain characters that can be run by MATLAB as coefficient characters, including: Design Matlab program; The coefficient file is read by the matlab program, data preprocessing is performed, and the steps of data preprocessing are marked to convert the format of the coefficient file to obtain characters that can be run by matlab as coefficient characters.

5. A digital filter sampling rate conversion method according to claim 4, characterized in that: The data preprocessing includes the following steps: multi-dimensional array processing, structure processing, normalization processing and format matching processing.

6. A digital filter sampling rate conversion method according to claim 5, characterized in that: Multidimensional array processing includes: The array dimension of the digital initial coefficients of the filter is detected and processed using MATLAB's array operation functions.

7. A digital filter sampling rate conversion method according to claim 6, characterized in that: Structural processing includes: Detect the digital state initial coefficients of the filter after multi-dimensional array processing, and determine whether the digital state initial coefficients exist in a structure; When the digital initial coefficients exist in a structure, mark the structure as existing and retain the structure characters, then delete the structure characters in the filter coefficient characters; When the digital initial coefficient structure does not exist, the symbol "no structure" is displayed.

8. A digital filter sampling rate conversion method according to claim 7, characterized in that: Normalization processing includes: According to the filter coefficient characters, determine whether the filter adopts normalization processing; If normalization is used, the mark indicates that normalization has been used, and the filter coefficient characters are converted into filter coefficient characters that have not been normalized. The filter coefficient characters that have not been normalized are characters that can be read by MATLAB. If normalization is not used, the value is marked as not normalized.

9. A digital filter sampling rate conversion method according to claim 8, characterized in that: Format matching processing includes: The format of the digital initial coefficients of the normalized filter is matched to the platform format.

10. A digital filter sampling rate conversion method according to claim 4, characterized in that: Convert the digital filter coefficients at the target sampling rate into engineering format characters and output them to obtain the sampling rate conversion results, including: According to the steps of preprocessing the marked data, the digital filter coefficients at the target sampling rate are converted into characters in an engineering format and output to obtain a sampling rate conversion result.