Fractional time parameter generation method and device in Farrow structure filter
The accumulated error in the Farrow filter is eliminated through two-stage quantization processing, and the error is periodically eliminated and converted into random errors, which solves the cumulative error problem of fractional time parameters and achieves stable performance improvement under low complexity.
Patent Information
- Application Number
- CN202510499589.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-08
AI Technical Summary
The cumulative error of fraction time parameters in the existing Farrow structural filter seriously affects the performance of variable sampling and fraction delays, and the existing error elimination method may be complex or have large cumulative errors.
The two-stage quantization process is adopted to quantize the accumulated step length and fraction delay into fixed-point numbers, and through the balance and rounding operations, combined with the Farrow filter type processing, the accumulated error periodically eliminates and converts the directional error into random error.
It realizes long-term stable fraction time parameter generation under low complexity, improves the performance of the Farrow filter, and is suitable for various derivative structures.
Smart Images

Figure CN120454680A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital signal processing, and in particular to a method and device for generating fractional time parameters in a Farrow structure filter. Background Art
[0002] Sampling rate conversion and fractional delay for digital signals are typically achieved through methods such as polyphase filters and CIC comb filters. However, these methods only support integer and simple fractional sampling rate conversion and delay. Furthermore, once the structure is determined, their flexibility is often limited. Farrow filters and their derivatives (hereinafter collectively referred to as Farrow filters) are widely used in digital and audio / video signal sampling rate conversion, synchronization, sampling offset compensation, frequency synthesis, clock recovery, clock jitter suppression, arbitrary waveform generation, radar, and channel simulators due to their flexible sampling and fractional delay capabilities.
[0003] Sampling rate conversion can essentially be regarded as a process of resampling the signal, such as Figure 1 As shown in the figure, the digital signal x(nT_in) with a sampling period of T_in is processed by the digital-to-analog conversion module DAC and an analog filter with an impulse response of h_a(t), and then resampled with T_out as the sampling period to obtain y(mT_out), thus completing the sampling rate conversion process. The Farrow filter is to expand the impulse response h_a(t) by Q-order Lagrangian, Taylor and other methods according to different positions to Figure 1 The sampling rate conversion model is approximately implemented in the digital domain.
[0004] Based on the above idea, there are many derivative structures of the Farrow filter, which can be classified as follows: if the impulse response h_a(t) is expanded at the (n+μ)T_in position, it is a traditional Farrow filter; if the impulse response h_a(t) is expanded at the (n+(aμ+b))T_in position, it is an improved Farrow filter; if the impulse response h_a(t) is expanded at the (m+μ)T_out position, it is a transposed Farrow filter; if the impulse response h_a(t) is expanded at the (m+(aμ+b))T_out position, it is a transposed improved Farrow filter. In the above description, μ is a fractional time parameter, a and b are integers, and when a=-2b, the expanded result will be symmetrical. This symmetry can save multiplier resources in implementation.
[0005] The fractional time parameter μ is obtained by cyclic accumulation and modulus. For the non-transposed Farrow filter, the accumulation step is μ_step = T_out / T_in; for the transposed Farrow filter, the accumulation step is μ_step = T_in / T_out. In the chip and digital signal processor, the accumulation step needs to be quantized into a digital signal with a W-bit fractional part: M_step = round(μ_step·2 W ), round(·) is the rounding operation, and the quantization error ξ=M_step / 2 W -μ_step,ξ∈[-2 -w-1 ,2 -w-1 ], every time it is accumulated N times, the cumulative error of the fractional time parameter μ is Nξ, which will seriously affect the performance of variable sampling and fractional delay.
[0006] There are two ways to eliminate the error. Figure 2 As shown in the figure, a timing error detector (TED) detects the value containing the time error, and controls the score generator after loop filtering (LP) to correct the error in the form of negative feedback. However, this method is too complicated to implement and requires a feedback path. The second method is as follows Figure 3 As shown, in most practical needs, there is often a greatest common divisor gcd(fs_in, fs_out) greater than 1 between the input sampling rate fs_in = 1 / T_in and the output sampling rate fs_out = 1 / T_out. Therefore, the fractional time parameter μ is a periodic variable. For a non-transposed Farrow filter, the period T of the fractional time parameter can be calculated as T = fs_out / gcd(fs_in, fs_out). For a transposed Farrow filter, the period T = fs_in / gcd(fs_in, fs_out). Therefore, whenever the counter cnt = T, μ = 0 is set to eliminate the cumulative error periodically. However, this method still leaves a large cumulative error, and this error is directional at different sample points (the error of each output sample point deviates from the theoretical value in the same direction, as shown in the comparison in the embodiment). This will cause distortion to the signal spectrum itself. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a method and device for generating fractional time parameters in a Farrow structure filter, which can eliminate the cumulative error of the fractional time parameters with lower complexity, so that the Farrow filter can operate stably for a long time.
[0008] The technical solution adopted by the present invention to solve the technical problem is: to provide a method for generating fractional time parameters in a Farrow structure filter, comprising:
[0009] quantizing the accumulated step size into a first fixed-point number having a first bit width;
[0010] Determine the frequency of the clock signal using the output sampling rate, use the first fixed-point number as the accumulation step, accumulate once per beat and take the remainder, and determine a first output result based on the period of the fractional time parameter;
[0011] quantizing the fractional delay into a second fixed-point number having the first bit width, adding the second fixed-point number to the first output result, and then taking the remainder thereof to obtain a second output result;
[0012] Performing a right shift of the second output result by the second bit width and rounding to obtain an output result of the target bit width; wherein the target bit width is equal to the first bit width minus the second bit width;
[0013] The output result of the target bit width is processed according to the type of the Farrow filter to obtain a fractional time parameter.
[0014] The first output result is determined based on the period of the fractional time parameter, specifically:
[0015] Determine whether the number of beats in the current beat is equal to an integer multiple of the period of the fractional time parameter;
[0016] If the number of beats of the current beat is equal to an integer multiple of the period of the fractional time parameter, the result of the accumulation and remainder of the current beat is set to zero and used as the first output result of the current beat;
[0017] If the number of beats of the current beat is not equal to an integer multiple of the period of the fractional time parameter, the result of the accumulation and modulus of the current beat is used as the first output result of the current beat.
[0018] The processing of the output result of the target bit width according to the type of the Farrow filter to obtain the fractional time parameter specifically includes:
[0019] When the type of the Farrow filter is an improved Farrow filter or a transposed improved Farrow filter, the fractional time parameter is calculated by μ=a*x+b; where μ is the fractional time parameter, x is the output result of the target bit width, and a and b are both preset integers;
[0020] When the type of the Farrow filter is neither an improved Farrow filter nor a transposed improved Farrow filter, the output result of the target bit width is directly used as the fractional time parameter.
[0021] The technical solution adopted by the present invention to solve the technical problem is: to provide a device for generating fractional time parameters in a Farrow structure filter, comprising:
[0022] A quantization module, configured to quantize the accumulated step length into a first fixed-point number having a first bit width;
[0023] A first calculation module is configured to determine the frequency of the clock signal at the output sampling rate, use the first fixed-point number as an accumulation step, accumulate once per beat and obtain the remainder, and determine a first output result based on a period of the fractional time parameter;
[0024] A second calculation module is configured to quantize the fractional delay into a second fixed-point number having the first bit width, add the second fixed-point number to the first output result, and then obtain the remainder thereof to obtain a second output result;
[0025] a right shift module, configured to perform a right shift of the second output result by a second bit width, rounding the second output result to obtain an output result of a target bit width; wherein the target bit width is equal to the first bit width minus the second bit width;
[0026] The processing module is used to process the output result of the target bit width according to the type of the Farrow filter to obtain a fractional time parameter.
[0027] The first calculation module includes:
[0028] a judging unit, configured to judge whether the number of beats of a current beat is equal to an integer multiple of a period of a fractional time parameter;
[0029] a zeroing unit, configured to set the result of the accumulation and remainder of the current beat to zero when the number of beats of the current beat is equal to an integral multiple of the period of the fractional time parameter, and use the result as the first output result of the current beat;
[0030] The determining unit is configured to use the result of accumulating and taking the remainder of the current beat as the first output result of the current beat when the number of the current beat is not equal to an integral multiple of the period of the fractional time parameter.
[0031] The processing module includes:
[0032] A first processing unit is configured to calculate a fractional time parameter by μ=a*x+b when the Farrow filter is an improved Farrow filter or a transposed improved Farrow filter; wherein μ is the fractional time parameter, x is an output result of a target bit width, and a and b are both preset integers;
[0033] The second processing unit is configured to use the output result of the target bit width directly as the fractional time parameter when the type of the Farrow filter is neither an improved Farrow filter nor a transposed improved Farrow filter.
[0034] The technical solution adopted by the present invention to solve its technical problem is: providing an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the steps of the above-mentioned fractional time parameter generation method when executing the computer program.
[0035] The technical solution adopted by the present invention to solve its technical problem is: providing a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned fractional time parameter generation method are implemented.
[0036] Beneficial effects
[0037] Due to the adoption of the above-mentioned technical solution, the present invention has the following advantages and positive effects compared to the prior art: on the one hand, the present invention periodically eliminates cumulative errors, and on the other hand, converts directional errors into random errors. This improves the performance of the Farrow filter through a two-stage quantization process, enabling the Farrow filter to operate stably for a long time. Furthermore, the processing method proposed in the present invention is relatively low in complexity, requiring only simple processes such as accumulation, shift register, remainder, shifting, and rounding. It can also be applied to various derivative structures of the Farrow structure filter, showing strong adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of a theoretical model of sampling rate conversion in the prior art;
[0039] Figure 2 This is a schematic diagram of fractional time parameter generation for eliminating errors using feedback correction in the prior art;
[0040] Figure 3 This is a schematic diagram of fractional time parameter generation using period zeroing in the prior art;
[0041] Figure 4 is a schematic diagram of a fractional time parameter generation method according to a first embodiment of the present invention;
[0042] Figure 5 1 is a schematic structural diagram of an improved Farrow filter according to an embodiment of the present invention;
[0043] Figure 6 3 is a comparison diagram of errors generated by generating fractional time parameters using the first implementation and the period zeroing method. DETAILED DESCRIPTION
[0044] Below in conjunction with specific embodiment, further set forth the present invention.Should be understood that these embodiments are only used to illustrate the present invention and are not used in limiting the scope of the present invention.In addition, should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall equally within the scope limited by the appended claims of the application.
[0045] The first embodiment of the present invention relates to a method for generating fractional time parameters in a Farrow structure filter. This method introduces the concept of two-stage quantization based on the periodic zeroing method. On the one hand, it can periodically eliminate the cumulative error, and on the other hand, it can convert the directional error of the periodic zeroing method into a random error (the direction in which each output sample error deviates from the theoretical value is random). Figure 4 As shown, specifically including:
[0046] Step 1: quantize the cumulative step length μ_step to a first fixed-point number M_step including the first bit width W1, that is, M_step=round(μ_step·2 W1 );
[0047] Step 2: Determine the frequency of the clock signal using the output sampling rate fs_out, use the first fixed-point number M_step as the accumulation step, accumulate once per beat and take the remainder, and determine the first output result based on the period of the fractional time parameter. In this step, determining the first output result based on the period of the fractional time parameter specifically includes the following steps:
[0048] Determine whether the number of beats m of the current beat is equal to an integer multiple of the period T of the fractional time parameter;
[0049] If the number m of the current beat is equal to an integer multiple of the period T of the fractional time parameter, then the result of the accumulation and remainder of the current beat, mod(μ[(m-1)T_out]+M_step), is set to zero and used as the first output result of the current beat, that is, μ1[mT_out]=0;
[0050] If the beat number m of the current beat is not equal to an integer multiple of the period T of the fractional time parameter, the result of the accumulation and remainder of the current beat, mod(μ[(m-1)T_out]+M_step), is used as the first output result of the current beat, that is, μ1[mT_out]=mod(μ[(m-1)T_out]+M_step).
[0051] Step 3: quantize the fractional delay τ into a second fixed-point number M_dly containing the first bit width W1, that is, M_dly=round(τ·2 W1), and add it to the first output result μ1[mT_out] and take the remainder again to obtain the second output result, that is, μ2[mT_out]=mod(μ1[mT_out]+M_dly,2 W1 ).
[0052] Step 4: perform a right shift of the second output result μ2[mT_out] by the second bit width W2 to obtain the output result of the target bit width W, that is, μ[mT_out]=round(μ2[mT_out] / 2 W2 ,2 W ). The target bit width W is equal to the first bit width W1 minus the second bit width W2.
[0053] Step 5: Process the output result of the target bit width according to the type of the Farrow filter to obtain a fractional time parameter.
[0054] In this step, when the type of the Farrow filter is an improved Farrow filter or a transposed improved Farrow filter, the fractional time parameter is calculated by μ'[mT_out]=a·μ[mT_out]+b; wherein μ'[mT_out] is the fractional time parameter obtained after processing, and a and b are both preset integers; when the type of the Farrow filter is neither an improved Farrow filter nor a transposed improved Farrow filter, the output result μ[mT_out] of the target bit width is directly used as the fractional time parameter.
[0055] It is not difficult to find that this embodiment only needs to perform simple operations such as accumulation, shift storage, remainder, shift, rounding, etc., and does not require feedback path design. Its implementation complexity is low, and this embodiment converts the directional error into a random error, greatly reducing the error.
[0056] The present invention is further described below through a specific embodiment.
[0057] This embodiment introduces an improved Farrow structure filter that can support arbitrary sampling rate conversion and fractional delay τ. Its overall processing architecture is as follows: Figure 5 As shown in the figure, a Q=5th order Taylor expansion is used to obtain six sets of coefficients C_q(k), where q=[0,1,…,5]. The input signal x(nT_in) is processed by a finite impulse response (FIR) digital filter with coefficients C_q(k) to obtain the interpolation coefficients P0~P5 for each output sample point, which are stored in a cross-clock domain FIFO. The fractional time parameters are calculated according to Figure 4The calculation is performed as shown to obtain a 2μ-1 sequence (in this embodiment, W1 = 20 bits, W = 16 bits, and W2 = 4 bits), and then a polynomial interpolation operation is performed to obtain an output signal y(mT_out) = ΣPq(2μ-1)^q with a sampling rate of fs_out = 1 / T_out.
[0058] Figure 6 Figure 2 shows a comparison between the periodic zeroing method (black dashed-dotted line) and the first implementation (red solid line) for an input sampling rate of fs_in = 491.52 MHz, an output sampling rate of fs_out = 250 MHz, and a fractional delay of τ = 0. The period T of the fractional time parameter is: T = fs_out / gcd(fs_in, fs_out) = 3125. While the periodic zeroing method can clear the accumulated error after every 3125 output samples, the maximum error is significant and always in the same direction. The error in the first implementation, as shown by the red curve, is minimal, while also being a random variable with a mean of 0 and uniformly distributed between [-2^-17, 2^-17].
[0059] A second embodiment of the present invention relates to a device for generating fractional time parameters in a Farrow structure filter, comprising:
[0060] A quantization module, configured to quantize the accumulated step length into a first fixed-point number having a first bit width;
[0061] A first calculation module is configured to determine the frequency of the clock signal at the output sampling rate, use the first fixed-point number as an accumulation step, accumulate once per beat and obtain the remainder, and determine a first output result based on a period of the fractional time parameter;
[0062] A second calculation module is configured to quantize the fractional delay into a second fixed-point number having the first bit width, add the second fixed-point number to the first output result, and then obtain the remainder thereof to obtain a second output result;
[0063] a right shift module, configured to perform a right shift of the second output result by a second bit width, rounding the second output result to obtain an output result of a target bit width; wherein the target bit width is equal to the first bit width minus the second bit width;
[0064] The processing module is used to process the output result of the target bit width according to the type of the Farrow filter to obtain a fractional time parameter.
[0065] The first calculation module includes:
[0066] a judging unit, configured to judge whether the number of beats of a current beat is equal to an integer multiple of a period of a fractional time parameter;
[0067] a zeroing unit, configured to set the result of the accumulation and remainder of the current beat to zero when the number of beats of the current beat is equal to an integral multiple of the period of the fractional time parameter, and use the result as the first output result of the current beat;
[0068] The determining unit is configured to use the result of accumulating and taking the remainder of the current beat as the first output result of the current beat when the number of the current beat is not equal to an integral multiple of the period of the fractional time parameter.
[0069] The processing module includes:
[0070] A first processing unit is configured to calculate a fractional time parameter by μ=a*x+b when the Farrow filter is an improved Farrow filter or a transposed improved Farrow filter; wherein μ is the fractional time parameter, x is an output result of a target bit width, and a and b are both preset integers;
[0071] The second processing unit is configured to use the output result of the target bit width directly as the fractional time parameter when the type of the Farrow filter is neither an improved Farrow filter nor a transposed improved Farrow filter.
[0072] A third embodiment of the present invention relates to an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the fractional time parameter generation method of the first embodiment are implemented.
[0073] A fourth embodiment of the present invention relates to a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the fractional time parameter generation method of the first embodiment are implemented.
[0074] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) that contain computer-usable program code.
[0075] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0076] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction method, which is implemented in the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0077] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0078] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for generating fractional time parameters in a Farrow structure filter, characterized in that: include: quantizing the accumulated step size into a first fixed-point number having a first bit width; Determine the frequency of the clock signal using the output sampling rate, use the first fixed-point number as the accumulation step, accumulate once per beat and take the remainder, and determine a first output result based on the period of the fractional time parameter; quantizing the fractional delay into a second fixed-point number having the first bit width, adding the second fixed-point number to the first output result, and then taking the remainder thereof to obtain a second output result; Performing a right shift of the second output result by the second bit width and rounding to obtain an output result of the target bit width; wherein the target bit width is equal to the first bit width minus the second bit width; The output result of the target bit width is processed according to the type of the Farrow filter to obtain a fractional time parameter.
2. The method for generating fractional time parameters in a Farrow structure filter according to claim 1, wherein: The first output result is determined based on the period of the fractional time parameter, specifically: Determine whether the number of beats in the current beat is equal to an integer multiple of the period of the fractional time parameter; If the number of beats of the current beat is equal to an integer multiple of the period of the fractional time parameter, the result of the accumulation and remainder of the current beat is set to zero and used as the first output result of the current beat; If the number of beats of the current beat is not equal to an integer multiple of the period of the fractional time parameter, the result of the accumulation and modulus of the current beat is used as the first output result of the current beat.
3. The method for generating fractional time parameters in a Farrow structure filter according to claim 1, wherein: The processing of the output result of the target bit width according to the type of the Farrow filter to obtain the fractional time parameter specifically includes: When the type of the Farrow filter is an improved Farrow filter or a transposed improved Farrow filter, the fractional time parameter is calculated by μ=a*x+b; where μ is the fractional time parameter, x is the output result of the target bit width, and a and b are both preset integers; When the type of the Farrow filter is neither an improved Farrow filter nor a transposed improved Farrow filter, the output result of the target bit width is directly used as the fractional time parameter.
4. A device for generating fractional time parameters in a Farrow structure filter, characterized in that: include: A quantization module, configured to quantize the accumulated step length into a first fixed-point number having a first bit width; A first calculation module is configured to determine the frequency of the clock signal at the output sampling rate, use the first fixed-point number as an accumulation step, accumulate once per beat and obtain the remainder, and determine a first output result based on a period of the fractional time parameter; A second calculation module is configured to quantize the fractional delay into a second fixed-point number having the first bit width, add the second fixed-point number to the first output result, and then obtain the remainder thereof to obtain a second output result; a right shift module, configured to perform a right shift of the second output result by a second bit width, rounding the second output result to obtain an output result of a target bit width; wherein the target bit width is equal to the first bit width minus the second bit width; The processing module is used to process the output result of the target bit width according to the type of the Farrow filter to obtain a fractional time parameter.
5. The device for generating fractional time parameters in a Farrow structure filter according to claim 4, characterized in that: The first calculation module includes: a judging unit, configured to judge whether the number of beats of a current beat is equal to an integer multiple of a period of a fractional time parameter; a zeroing unit, configured to set the result of the accumulation and remainder of the current beat to zero when the number of beats of the current beat is equal to an integral multiple of the period of the fractional time parameter, and use the result as the first output result of the current beat; The determining unit is configured to use the result of the accumulation and modulo of the current beat as the first output result of the current beat when the number of beats of the current beat is not equal to an integral multiple of the period of the fractional time parameter.
6. The device for generating fractional time parameters in a Farrow structure filter according to claim 4, characterized in that: The processing module includes: A first processing unit is configured to calculate a fractional time parameter by μ=a*x+b when the Farrow filter is an improved Farrow filter or a transposed improved Farrow filter; wherein μ is the fractional time parameter, x is an output result of a target bit width, and a and b are both preset integers; The second processing unit is configured to use the output result of the target bit width directly as the fractional time parameter when the type of the Farrow filter is neither an improved Farrow filter nor a transposed improved Farrow filter.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for generating fractional time parameters in a Farrow structure filter according to any one of claims 1 to 3 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating fractional time parameters in a Farrow structure filter according to any one of claims 1 to 3 are implemented.