A digital circuit and a control method thereof

CN115765658BActive Publication Date: 2026-09-25ACTIONS ZHUHAI TECH CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111025810.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-02
Publication Date
2026-09-25
Estimated Expiration
2041-09-02

AI Technical Summary

Benefits of technology

[0012]本发明实施例提供的一种数字电路及其控制方法,在当前待处理信号的幅值超出预设范围时,信号调节模块可以直接根据预设范围对当前待处理信号的幅值进行调节,可以有利于提高处理的速度,减少运算时所消耗的时间,从而可以进一步提高处理的实时性,进一步减少延迟。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115765658B_ABST
    Figure CN115765658B_ABST
Patent Text Reader

Abstract

The application discloses a digital circuit and a control method thereof. When the amplitude of a current to-be-processed signal exceeds a preset range, a signal adjusting module can directly adjust the amplitude of the current to-be-processed signal according to the preset range, which can improve the processing speed and reduce the time consumed during calculation. In addition, when the amplitude of the current to-be-processed signal is adjusted, the adjustment is based on the preset range or a current gain coefficient, which can avoid distortion of the output signal and realize full-amplitude utilization, thereby effectively improving the processing effect of the digital circuit on the digital signal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital audio technology, and more particularly to a digital circuit and its control method. Background Technology

[0002] A traditional DAC (Digital to Analog Converter) module typically includes a DAC digital circuit and a DAC analog circuit. The working principle of a traditional DAC module can be as follows: the DAC digital circuit receives a digital signal, upsamples the digital signal, and then transmits the upsampled digital signal to the DAC analog circuit. The DAC analog circuit converts the upsampled digital signal into a corresponding analog signal and sends it out in the form of sound waves.

[0003] In audio signals, the amplitude of the digital signal processed by the DAC (Digital Converter) is fixed, while the effective amplitude of the received digital signal is not. If the effective amplitude of the received digital signal is large, it may exceed its fixed amplitude during processing by the DAC, leading to distortion. Conversely, if the effective amplitude of the received digital signal is small, the amplitude in the DAC will not be fully utilized, wasting some of its processing power and resulting in insufficient volume at the output of the DAC analog circuit. Summary of the Invention

[0004] This invention provides a digital circuit and its control method to fully utilize the effective amplitude of a DAC digital circuit while avoiding signal distortion after processing, thereby improving the processing performance of the DAC digital circuit.

[0005] In a first aspect, embodiments of the present invention provide a digital circuit, including: a gain determination module and a signal conditioning module;

[0006] The gain determination module is used to: determine the current gain coefficient based on the amplitude of the current signal to be processed and the preset range;

[0007] The signal adjustment module is used to: when the amplitude of the current signal to be processed exceeds the preset range, adjust the amplitude of the current signal to be processed according to the preset range and then output it; when the amplitude of the current signal to be processed does not exceed the preset range, adjust the amplitude of the current signal to be processed according to the determined current gain coefficient and then output it.

[0008] Secondly, embodiments of the present invention provide a control method for the digital circuit as described in the embodiments of the present invention, comprising:

[0009] The gain determination module determines the current gain coefficient based on the amplitude of the current signal to be processed and the preset range.

[0010] When the amplitude of the current signal to be processed exceeds the preset range, the signal adjustment module adjusts the amplitude of the current signal to be processed according to the preset range and then outputs the signal; when the amplitude of the current signal to be processed does not exceed the preset range, the signal adjustment module adjusts the amplitude of the current signal to be processed according to the determined current gain coefficient and then outputs the signal.

[0011] The beneficial effects of this invention are as follows:

[0012] The present invention provides a digital circuit and its control method. When the amplitude of the current signal to be processed exceeds a preset range, the signal adjustment module can directly adjust the amplitude of the current signal to be processed according to the preset range. This can help improve the processing speed, reduce the time consumed during calculation, and thus further improve the real-time performance of the processing and further reduce the delay.

[0013] Furthermore, when adjusting the amplitude of the current signal to be processed, it is based on a preset range or the current gain coefficient. Therefore, it is possible to limit larger amplitudes and amplify smaller amplitudes, thereby avoiding distortion of the output signal and utilizing the full amplitude, thus effectively improving the processing effect of digital circuits on digital signals. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the structure of a digital circuit provided in an embodiment of the present invention;

[0015] Figure 2 This is a schematic diagram of another digital circuit provided in an embodiment of the present invention.

[0016] Figure 3 This is a schematic diagram of the specific structure of another digital circuit provided in an embodiment of the present invention;

[0017] Figure 4 A flowchart of a specific embodiment provided in this invention;

[0018] Figure 5 This is a flowchart of a control method provided in an embodiment of the present invention. Detailed Implementation

[0019] The specific embodiments of a digital circuit and its control method provided by the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0020] This invention provides a digital circuit, such as... Figure 1 As shown, it may include: a gain determination module 10 and a signal conditioning module 20;

[0021] The gain determination module 10 is used to: determine the current gain coefficient based on the amplitude of the current signal to be processed and the preset range;

[0022] The signal conditioning module 20 is used to: adjust the amplitude of the current signal to be processed according to the preset range and output it when the amplitude of the current signal to be processed exceeds the preset range; and adjust the amplitude of the current signal to be processed according to the determined current gain coefficient and output it when the amplitude of the current signal to be processed does not exceed the preset range.

[0023] The preset range can be set according to actual needs, for example, but not limited to, setting the preset range to [-1, 1), which is not limited here.

[0024] Thus, when the amplitude of the current signal to be processed exceeds the preset range, the signal adjustment module can directly adjust the amplitude of the current signal to be processed according to the preset range, which can help improve the processing speed, reduce the time consumed during calculation, and thus further improve the real-time performance of the processing and further reduce the delay.

[0025] Furthermore, when adjusting the amplitude of the current signal to be processed, it is based on a preset range or the current gain coefficient. Therefore, it is possible to limit larger amplitudes and amplify smaller amplitudes, thereby avoiding distortion of the output signal and utilizing the full amplitude, thus effectively improving the processing effect of digital circuits on digital signals.

[0026] It is important to emphasize that if the amplitude of the signal to be processed exceeds the preset range, it means that the amplitude of the acquired digital signal is too large and needs to be limited immediately. At the same time, the current gain coefficient should be determined for reference in subsequent processes.

[0027] If it is determined that the amplitude of the current signal to be processed does not exceed the preset range, it means that the amplitude of the acquired digital signal is not large. Even without amplitude limiting, there will be no distortion problem. Therefore, it is not necessary to process it in real time. Processing can be performed when the current gain coefficient is determined. This case reflects non-real-time characteristics.

[0028] Optionally, in embodiments of the present invention, such as Figure 2 and Figure 3 As shown, it may also include: a signal upsampling module 30;

[0029] The signal upsampling module 30 is used to: upsample the acquired current digital signal to obtain the current signal to be processed and transmit it to the gain determination module 10.

[0030] Thus, after the signal upsampling module upsamples the current digital signal, the corresponding current signal to be processed can be obtained. Then, the current gain coefficient is determined based on the gain determination module, and the current signal to be processed is adjusted by the signal adjustment module. In other words, in this embodiment of the invention, the upsampled signal is adjusted under high-frequency conditions, which makes the processing speed of the current signal to be processed faster, thereby reducing the delay and avoiding a large time-domain delay on the data stream composed of digital signals, thus improving the real-time performance of the processing.

[0031] Optionally, the digital signal mentioned in the embodiments of the present invention can be a digital audio signal, or other signals, such as, but not limited to, digital video signals or digital display signals. As long as it is a digital signal whose amplitude needs to be adjusted, it falls within the technical scope to be protected by the embodiments of the present invention.

[0032] Specifically, when the digital signal is a digital audio signal, adjusting the amplitude of the signal through digital circuitry reflects the adjustment of the volume, ensuring that the adjusted result avoids problems such as popping sounds and unclear sounds, thereby improving the user's listening experience.

[0033] Optionally, in this embodiment of the invention, the digital signals acquired by the signal upsampling module can be acquired one by one, and the time interval between each acquired digital signal can be short. Therefore, for the digital circuit, when an acquired digital signal is processed, the amplitude of the digital signal is adjusted, and the same process is used to adjust the amplitude when the next acquired digital signal is acquired.

[0034] Furthermore, it should be noted that, optionally, the amplitude adjustment processes for different digital signals can be independent of each other, and the output can be completed immediately after each digital signal is processed.

[0035] Optionally, in order to determine the current gain coefficient based on the amplitude of the current signal to be processed and a preset range, in this embodiment of the invention, as follows: Figure 2 As shown, the gain determination module 10 includes: a comparison unit 11 and a gain determination unit 12;

[0036] The comparison unit 11 is used to: determine whether the amplitude of the current signal to be processed exceeds a preset range;

[0037] Gain determination unit 12 is used for:

[0038] The current gain coefficient is determined based on the amplitude and preset range of the signal to be processed.

[0039] Thus, the comparison unit can be used to determine whether the amplitude of the current signal to be processed exceeds the preset range, and the gain determination unit can be used to determine the current gain coefficient, thereby realizing the function of the gain determination module, so that the signal conditioning module can perform subsequent processing.

[0040] Specifically, in this embodiment of the invention, the gain determination unit is specifically used for:

[0041] When the amplitude of the current signal to be processed does not exceed the preset range, determine whether the gain coefficient needs to be updated based on the previous signal to be processed and the preset update confirmation conditions.

[0042] If necessary, the current gain coefficient is determined based on the first value stored in the current register and the preset range; wherein, the first value is determined based on the current signal to be processed and each signal to be processed obtained before the current signal to be processed is obtained.

[0043] If not required, the gain coefficient determined last time will be used as the current gain coefficient.

[0044] In this way, based on the amplitude of the previous signal to be processed and the update confirmation conditions, it can be determined whether the gain coefficient needs to be updated. If an update is needed, the gain coefficient is recalculated and used as the current gain coefficient to complete the update. If no update is needed, the gain coefficient determined last time can be used as the current gain coefficient. This can help reduce the computational load of the gain determination unit, thereby reducing the computational load and power consumption of the digital circuit, improving the processing speed of the digital circuit, and more effectively reducing latency and improving the real-time performance of the processing.

[0045] Specifically, in order to determine whether the gain coefficient needs to be updated based on the previous signal to be processed and the preset update confirmation conditions, in this embodiment of the invention, the gain determination unit is specifically used for:

[0046] If the amplitude of the previous signal to be processed exceeds the preset range, it is determined that the gain coefficient does not need to be updated at present;

[0047] If the amplitude of the previous signal to be processed does not exceed the preset range and the update confirmation condition is met, it is determined that the gain coefficient needs to be updated.

[0048] In this way, it can be determined when the gain coefficient needs to be updated and when it does not. When the gain coefficient does not need to be updated, there is no need to recalculate it; the previously determined gain coefficient can be used. This can help reduce the computational load of the gain determination unit, thereby reducing the computational load of the digital circuit, increasing the processing speed of the digital circuit, and more effectively reducing latency and improving the real-time performance of the processing.

[0049] It should be noted that, optionally, if the amplitude of the signal to be processed corresponding to the first acquired digital signal does not exceed the preset range, and it is determined that there is no need to update the gain coefficient at present, the preset gain coefficient can be used as the gain coefficient determined last time, that is: the preset gain coefficient is determined as the current gain coefficient.

[0050] Optionally, in this embodiment of the invention, the update confirmation conditions include:

[0051] The sign bit value of the current signal to be processed is different from that of the previous signal to be processed;

[0052] Alternatively, the sign bit values ​​of the current signal to be processed are the same as those of a preset number of signals to be processed obtained before the current signal to be processed was obtained;

[0053] Alternatively, the sign bit values ​​of the current signal to be processed are the same as those of the signal to be processed obtained within a preset time period before the current signal to be processed was obtained.

[0054] Specifically, the signal to be processed can be 16-bit or 32-bit, and there is no limitation here. Regardless of the number of bits, the highest bit can be the sign bit, and the value of the sign bit can be used to indicate the positive or negative amplitude of the signal to be processed.

[0055] Therefore, the sign bit value of the current signal to be processed is different from that of the previous signal to be processed, which can be interpreted as the amplitude of the current signal to be processed crossing zero, thus satisfying the update confirmation condition, i.e.:

[0056] The amplitude of the current signal to be processed can be positive, and the amplitude of the previous signal to be processed can be negative; or, the amplitude of the current signal to be processed can be negative, and the amplitude of the previous signal to be processed can be positive.

[0057] Alternatively, the second scenario is: the sign bit values ​​of the current signal to be processed are the same as those of the preset number of signals to be processed obtained before the current signal to be processed were obtained. This can be understood as:

[0058] The amplitude of the current signal to be processed is either positive or negative compared to the amplitude of the previous preset number of signals to be processed (the preset number can be set according to actual needs and is not limited here). That is, the amplitude of the current signal to be processed changes little compared to the amplitude of the previous preset number of signals to be processed, and it can be confirmed that the update confirmation condition is met.

[0059] Alternatively, a third scenario is that the sign bit values ​​of the current signal to be processed are the same as those of the signal to be processed obtained within a preset time period before the current signal to be processed was obtained. This can be understood as:

[0060] The amplitude of the current signal to be processed is either positive or negative compared to the amplitude of the signal to be processed obtained within the previous preset time (the preset time can be set according to actual needs and is not limited here). That is, the amplitude of the current signal to be processed changes little compared to the amplitude of the signal to be processed obtained within the previous preset time, and it can be confirmed that the update confirmation condition is met.

[0061] In other words, the update confirmation condition is met if the amplitude of the current signal to be processed is greater than 0, or if the amplitude of the current signal to be processed and the amplitude of the previous preset number of signals to be processed are both less than 0, or if the amplitude of the current signal to be processed and the amplitude of the signals to be processed obtained within the previous preset time period are both less than 0.

[0062] Specifically, the number of signals to be processed obtained within the preset time can be a preset number, a number greater than the preset number, or a number less than the preset number. The preset time and preset number can be set according to actual needs, and are not limited here.

[0063] In this way, when determining whether the gain coefficient needs to be updated, the gain coefficient is only updated when the update confirmation condition is met. This can avoid causing significant interference to the amplitude adjustment result, improve the accuracy of the amplitude adjustment result, and also improve the amplitude adjustment effect.

[0064] Specifically, in this embodiment of the invention, if the first condition in the update confirmation condition is that the sign bit value of the current signal to be processed is different from that of the previous signal to be processed, the second condition in the update confirmation condition is that the sign bit value of the current signal to be processed is the same as that of a preset number of signals to be processed obtained before the current signal to be processed, and the third condition in the update confirmation condition is that the sign bit value of the current signal to be processed is the same as that of signals to be processed obtained within a preset time before the current signal to be processed, then:

[0065] The first condition can have a higher priority than the second condition, and the second condition can have a higher priority than the third condition.

[0066] In other words, when determining whether the update confirmation condition is met, first determine whether the first condition is met;

[0067] If the first condition is met, it is determined that the update confirmation condition is met. At the same time, there is no need to judge the second and third conditions. The counter is reset (or returned to zero), and the timer is reset (or returned to zero).

[0068] If the first condition is not met, then it can be determined whether the second condition is met, that is, whether the current value of the counter is the preset number + 1;

[0069] If so, it is determined that the update confirmation condition is met (that is, the current value of the counter is the preset number + 1). At this time, the counter can be reset (or returned to zero), and the timer can be reset (or returned to zero).

[0070] If not, then we can continue to determine whether the third condition is met, that is, whether the timer has reached the current timing period;

[0071] If the condition is met, it is determined that the update confirmation condition is met. At this time, the counter can be reset (or returned to zero), and the timer can be reset (or returned to zero).

[0072] If the condition is not met, it is determined that the update confirmation condition is not currently met. Therefore, the counter can be incremented by 1, and the timer can be controlled to continue counting.

[0073] Of course, the priority settings for the first, second, and third conditions are not limited to the above. They can be set according to actual needs and are not limited here.

[0074] Optionally, in this embodiment of the invention, the gain determination unit is further configured to:

[0075] If it is determined that the update confirmation conditions are not met, then it is determined that the gain coefficient does not need to be updated at this time.

[0076] In other words, it is necessary to determine whether the gain coefficient needs to be updated based on the amplitude of the previous signal to be processed and the update confirmation condition. Even if the amplitude of the previous signal to be processed does not exceed the preset range, the gain coefficient will not be updated if the update confirmation condition is not met. The gain coefficient determined last time will still be used as the current gain coefficient. This is to evaluate whether the gain coefficient needs to be updated from multiple angles and aspects, so that the determined current gain coefficient is more effective, thereby making the amplitude of the adjusted signal more in line with the amplitude requirements of the digital circuit.

[0077] Optionally, in this embodiment of the invention, the gain determination unit is further configured to:

[0078] Before the comparison unit determines whether the amplitude of the current signal to be processed exceeds the preset range, it determines whether the first value stored in the current register is greater than or equal to the absolute value of the amplitude of the current signal to be processed.

[0079] If so, then keep the first value currently stored in the register unchanged;

[0080] If not, update the first value stored in the current register to the absolute value of the amplitude of the current signal to be processed.

[0081] In this way, it can be determined when to update the first value stored in the register, so that when the gain coefficient needs to be updated, the current gain coefficient can be recalculated based on the first value stored in the current register and the preset range, thereby facilitating the signal conditioning module to adjust the amplitude of the current signal to be processed based on the current gain coefficient.

[0082] Optionally, in this embodiment of the invention, the gain determination unit is further configured to:

[0083] When it is determined that the gain coefficient needs to be updated, the first value stored in the current register is changed to the second value;

[0084] The first value stored in the current register is the absolute value of the amplitude of the nth signal to be processed. When the current signal to be processed is the mth signal to be processed, the second value is the maximum value among the absolute values ​​of the amplitudes of the (n+1)th to the mth signal to be processed. n is a positive integer and m is an integer greater than n+1.

[0085] In this way, when the gain coefficient needs to be updated, the value stored in the current register is updated at the same time. This avoids the gain coefficient calculated based on the current value being unsuitable for the current situation if the value stored in the current register is not updated. This also avoids inaccurate adjustment results after using an inappropriate gain coefficient, thereby improving the accuracy of adjustment and reducing adjustment errors.

[0086] The following example illustrates this.

[0087] For example, let Ax represent the x-th signal to be processed, where x is a positive integer, and assume the preset number is 2; if:

[0088] The amplitude of the first signal A1 to be processed exceeds the preset range, and the gain coefficient is updated (referred to as the first updated gain coefficient). The value stored in the register is the absolute value of the amplitude of A1.

[0089] The amplitude of the second signal A2 to be processed does not exceed the preset range, and the gain coefficient is not updated. The value stored in the register is the absolute value of the amplitude of A1.

[0090] The amplitude of the third signal to be processed, A3, does not exceed the preset range, and the gain coefficient is not updated. The value stored in the register is the absolute value of the amplitude of A1.

[0091] The amplitude of the fourth signal to be processed, A4, does not exceed the preset range, and the gain coefficient is updated (referred to as the second updated gain coefficient). The value stored in the register is changed to the maximum value among the absolute values ​​of the amplitudes of A2, A3, and A4 (assuming it is the absolute value of the amplitude of A3).

[0092] The amplitude of the fifth signal to be processed, A5, does not exceed the preset range and the absolute value of the amplitude of A5 is less than the absolute value of the amplitude of A3. Therefore, the gain coefficient is not updated and the value stored in the register is the absolute value of the amplitude of A3.

[0093] The amplitude of the sixth signal to be processed, A6, does not exceed the preset range and the absolute value of the amplitude of A6 is less than the absolute value of the amplitude of A3. Therefore, the gain coefficient is not updated and the value stored in the register is the absolute value of the amplitude of A3.

[0094] If the amplitude of the seventh signal to be processed, A7, does not exceed the preset range and the absolute value of the amplitude of A7 is less than the absolute value of the amplitude of A3, the value stored in the update gain coefficient (referred to as the third update gain coefficient) register is changed to the maximum value among the absolute values ​​of the amplitudes of A4, A5, A6 and A7 (assuming it is the absolute value of the amplitude of A7).

[0095] in:

[0096] When updating the gain coefficient for the first time, the current gain coefficient is calculated based on the amplitude of the first signal to be processed, A1, and the maximum value of the preset range.

[0097] When updating the gain coefficient for the second time, the current gain coefficient is calculated based on the amplitude of the first signal to be processed, A1, and the maximum value of the preset range.

[0098] When updating the gain coefficient for the third time, the current gain coefficient is calculated based on the amplitude of the third signal to be processed, A3, and the maximum value of the preset range.

[0099] Optionally, in this embodiment of the invention, the gain determination unit is specifically used for:

[0100] When the amplitude of the current signal to be processed exceeds the preset range, the ratio of the maximum value of the preset range to the absolute value of the amplitude of the current signal to be processed is used as the current gain coefficient.

[0101] When it is determined that the gain coefficient needs to be updated, the ratio of the maximum value of the preset range to the first value is used as the current gain coefficient.

[0102] In this way, the current gain coefficient corresponding to different conditions can be determined, so that the subsequent signal conditioning module can adjust the amplitude of the current signal to be processed according to the determined current gain coefficient when the amplitude of the current signal to be processed does not exceed the preset range, so as to achieve full amplitude utilization and avoid distortion.

[0103] Optionally, in embodiments of the present invention, the comparison unit is further configured to:

[0104] When the amplitude of the current signal to be processed exceeds the preset range, determine whether the sign bit of the current signal to be processed is a preset value;

[0105] If so, output the maximum value of the preset range to the signal conditioning module;

[0106] If not, output the minimum value of the preset range to the signal conditioning module;

[0107] like Figure 2 As shown, the signal conditioning module 20 includes a selection unit 21 and a conditioning unit 22;

[0108] Selection unit 21 is used for:

[0109] When the amplitude of the current signal to be processed exceeds the preset range, the maximum value or minimum value of the preset range received is used as the adjustment result of the amplitude of the current signal to be processed and output.

[0110] When the amplitude of the current signal to be processed does not exceed the preset range, the output result of the received adjustment unit 22 will be output.

[0111] Adjustment unit 22 is used for:

[0112] When the amplitude of the current signal to be processed does not exceed the preset range, the amplitude of the current signal to be processed is adjusted according to the determined current gain coefficient and then output to the selection unit 21.

[0113] The preset value can be set to 0, 1 or other values, and can be set according to actual needs. There are no restrictions here.

[0114] Thus, when the amplitude of the current signal to be processed exceeds the preset range, there is no need to adjust the amplitude of the current signal to be processed according to the current gain coefficient. Instead, the result output by the comparison unit can be directly output as the adjusted result. While achieving amplitude limiting, the processing time and complexity of the operation are reduced, thereby greatly improving the processing efficiency.

[0115] Furthermore, when the amplitude of the current signal to be processed does not exceed the preset range, the amplitude of the current signal to be processed can be adjusted according to the determined current gain coefficient in order to achieve full amplitude utilization.

[0116] Optionally, in this embodiment of the invention, the adjustment unit is specifically used for:

[0117] Perform a multiplication operation on the amplitude of the current signal to be processed and the current gain coefficient.

[0118] In other words, when adjusting the amplitude, the product of the current amplitude of the signal to be processed and the current gain coefficient can be used as the amplitude of the signal to be processed after adjustment, so as to achieve full amplitude utilization without distortion.

[0119] Optionally, in this embodiment of the invention, the adjustment unit is further configured to:

[0120] After adjusting the amplitude of the current signal to be processed based on the determined current gain coefficient, and before outputting the adjusted current signal to be processed to the selection unit, the adjusted current signal to be processed is transmitted to the comparison unit so that the comparison unit can determine whether the amplitude of the adjusted current signal to be processed exceeds the preset range.

[0121] When the amplitude of the adjusted current signal to be processed does not exceed the preset range, the adjusted current signal to be processed is output to the selection unit;

[0122] When the amplitude of the adjusted current signal to be processed exceeds the preset range, the output of the adjusted current signal to be processed to the selection unit is prohibited, and the comparison unit transmits the maximum value or the minimum value of the preset range to the selection unit according to the sign bit of the adjusted current signal to be processed.

[0123] In other words, after the adjustment unit adjusts the amplitude of the current signal to be processed according to the determined current gain coefficient, the amplitude of the current signal to be processed after adjustment (hereinafter referred to as the adjusted amplitude) may exceed the preset range or may not exceed the preset range. Therefore, the comparison unit needs to make a judgment on the adjusted amplitude again.

[0124] If the comparison unit determines again that the adjusted amplitude does not exceed the preset range, the adjustment unit can directly transmit the adjusted amplitude to the selection unit so that the selection unit can output the adjusted amplitude.

[0125] If the comparison unit determines that the adjusted amplitude exceeds the preset range during the next judgment, the comparison unit needs to select the maximum or minimum value of the preset range to output to the selection unit based on the value of the sign bit of the current signal to be processed after adjustment, so that the selection unit outputs the maximum or minimum value of the preset range.

[0126] In this way, the adjusted amplitude can be judged again, avoiding the phenomenon that distortion will still occur when the adjusted amplitude exceeds the preset range and directly outputting it. This can further ensure that the amplitude of the final output signal meets the requirements, effectively avoiding distortion while achieving full amplitude utilization.

[0127] Optionally, in embodiments of the present invention, such as Figure 3 As shown, the comparison unit 11 includes a comparator 11a, and the gain determination unit 12 includes a multiplier 12a or a flip-flop; wherein, Figure 3 The image only shows the gain determination unit 12, which includes a multiplier 12a, and a0 represents the maximum value of a preset range;

[0128] The selection unit 21 includes a selector 21a; the adjustment unit 22 includes a digital multiplier 22a; and the signal upsampling module 30 includes a digital filter 31 and an upsampling processor 32.

[0129] To clarify, optionally, in this embodiment of the invention, when the gain determination unit determines the current gain coefficient, if the amplitude of the current signal to be processed exceeds the preset range, the ratio of the maximum value of the preset range (let's say a0) to the absolute value of the amplitude of the current signal to be processed (let's say Fm) (let's say K1) is used as the current gain coefficient. If it is determined that the gain coefficient needs to be updated, the ratio of the maximum value of the preset range (let's say a0) to the maximum value of the absolute values ​​of the amplitudes of each signal to be processed obtained within the gain update period (let's say Fn) (let's say K2) is used as the current gain coefficient.

[0130] Then K1 = a0 / Fm, K2 = a0 / Fn. If we take the reciprocals of K1 and K2 respectively, we can get 1 / K1 = Fm / a0, 1 / K2 = Fn / a0. That is, the reciprocal of the current gain coefficient is the product of 1 / a0 and the absolute value of the amplitude. Therefore, based on this, the multiplication coefficient can be fixed, that is, a multiplier can be used to realize the function of the gain determination unit.

[0131] In this way, the algorithm for the gain determination unit can be optimized, the processing speed can be improved, the processing time can be reduced, and the processing delay can be effectively eliminated.

[0132] Optionally, in embodiments of the present invention, such as Figure 2 As shown, the digital circuit may also include a modulation module 40, which modulates the format of the signal output by the signal conditioning module so that the format of the modulated signal meets the requirements of the subsequent analog circuit, thereby enabling the analog circuit to convert the digital signal into the corresponding analog signal.

[0133] Specifically, in embodiments of the present invention, such as Figure 2 and Figure 3 As shown, the modulation module 40 may include a modulator 41.

[0134] It should be noted that, in this embodiment of the invention, the amplitude adjustment is performed under high-frequency conditions, targeting the signal to be processed after digital signal upsampling; and, the digital circuit can determine the gain coefficient corresponding to each signal to be processed, so the gain coefficient can be updated in real time, resulting in higher accuracy after adjustment.

[0135] Furthermore, the digital circuit provided in this embodiment of the invention is an amplitude adjustment implemented in hardware, which makes the signal entering the modulation module as full amplitude as possible. This achieves zero software loss, minimal circuit addition (i.e., the manufacturing cost of the gain determination module and the signal conditioning module is far less than the storage unit consumption required by software adjustment), and near-zero operation delay (i.e., the added signal conditioning module only adds one level of high-frequency delay after upsampling; taking an input sampling rate of 48KHz as an example, hardware adjustment can generally be done at 16 times the oversampling rate, and its first-level delay is 1.3us).

[0136] It should also be noted that, in the embodiments of the present invention, the amplitude limiting or amplitude limiting processing mentioned above can be understood as limiting the maximum effective amplitude of the digital circuit output. If the amplitude of the signal to be processed after frequency upsampling exceeds the preset range, the amplitude of the signal to be processed needs to be adjusted, and the adjusted amplitude can be the maximum or minimum value of the preset range.

[0137] For digital circuits, the specific processing or calculation process can include the following:

[0138] If the effective number of bits of the signal output by the digital circuit is N bits, then during the processing, M bits can be extended in the high-order bits (i.e., sign bit extension), so that the actual processing precision is (N+M) bits. In the intermediate processing, the M bits extended in the high-order bits can ensure that even if the range of N bits is exceeded during fixed-point arithmetic, there will be no error in the calculation due to the wide range of the operation bits. At the end of the calculation, it must be ensured that all M bits extended in the high-order bits have the same value and are the same as the (N-1)th bit, so that the calculation result does not exceed the maximum range of the expected calculation precision.

[0139] Conversely, if the M bits of the high-order extension of the final result are not the same value or are different from the (N-1)th bit, it indicates that the actual magnitude of the operation result has exceeded the expected operation precision (i.e., N bits). In this case, it is necessary to perform amplitude limiting on this result that exceeds the magnitude, and the amplitude limiting is to the expected maximum value corresponding to the sign bit.

[0140] For example: Suppose the result of the signal upsampling module is 26 bits (the lower 24 bits can represent the preset range [-1, 1), where the lower 24 bits can be represented by 0x7fffff to represent the maximum value of a positive value close to 1, and 0x800000 to represent -1; the higher 2 bits are the sign bit extension, which is equivalent to a total representation range of [-4, 4), but in practice only [-1, 1) is considered to be the distortion-free range, exceeding which will cause simulation errors), and the intermediate result is 20 bits (where the highest bit is the sign bit, and 20 bits can also represent [-1, 1), and this intermediate result can be understood as: related to the current gain coefficient and used to represent the current gain coefficient and facilitate subsequent amplitude adjustment), then it can be considered that during the operation, the bit width of the signal to be processed is 46 bits (i.e., 26 bits + 20 bits) is sufficient;

[0141] Then, determine whether bits [45:42] (bit [45:42] represents the values ​​from bit 45 to bit 42) are the same;

[0142] If they are the same, it means that the preset range has not been exceeded, and bit[42:19] (bit[42:19] represents the value of the 42nd bit to the 19th bit) can be directly output as the processing result;

[0143] If they are different, it means that the actual calculation result has exceeded the preset range and needs to be limited. Therefore, depending on whether the value of bit

[45] (bit

[45] represents the 45th bit) is 0, the limit can be set to 0x7fffff or 0x800000 in the case of 24 bits (or 0x7fffff or 0x3800000 in the case of 26 bits).

[0144] The value of bit

[45] can be 0 or 1. When it is 0, it represents a positive value and outputs the maximum value of the preset amplitude, so the amplitude can be limited to 0x7fffff (or 0x7fffff in the case of 24 bits). When it is 1, it represents a negative value and outputs the minimum value of the preset amplitude, so the amplitude can be limited to 0x800000 (or 0x3800000 in the case of 26 bits).

[0145] The working process of the digital circuit of the present invention will be described below with reference to specific embodiments.

[0146] Combination Figure 4 As shown.

[0147] S401, The signal upsampling module upsampling the acquired current digital signal to obtain the current signal to be processed;

[0148] S402. The gain determination unit determines whether the first value stored in the current register is greater than or equal to the absolute value of the amplitude of the current signal to be processed; if yes, then execute S403; if no, then execute S404.

[0149] If the current signal to be processed is the first signal, the first value stored in the current register can be a default value, such as, but not limited to, the maximum value of the preset range.

[0150] S403: The gain determination unit keeps the first value in the current register unchanged; execute S405;

[0151] S404. The gain determination unit changes the first value stored in the current register to the absolute value of the amplitude of the current signal to be processed; execute S405.

[0152] S405. The comparison unit determines whether the amplitude of the current signal to be processed exceeds the preset range; if yes, then execute S406 and S407; if no, control the counter to increment by 1, and then execute S411.

[0153] Steps S406 and S407 can be performed simultaneously or at different times, depending on actual needs, and are not limited here.

[0154] S406. The gain determination unit determines the current gain coefficient based on the amplitude and preset range of the current signal to be processed, controls the counter to return to zero, and ends the process.

[0155] One point to note is that, for the current signal to be processed, if it is determined that the amplitude of the current signal to be processed exceeds the preset range, when the current gain coefficient (which can be denoted as X1) is determined, it is not necessary to transmit the determined current gain coefficient to the adjustment unit, but to store it in the gain determination unit.

[0156] When the next signal to be processed is obtained, if the amplitude of the next signal to be processed does not exceed the preset range, and it is determined that the gain coefficient does not need to be updated at present, the gain coefficient determined last time (i.e., X1) can be used as the current gain coefficient and transmitted to the adjustment unit.

[0157] S407. The comparison unit determines whether the sign bit of the current signal to be processed is 0; if yes, then execute S408; if no, then execute S409.

[0158] S408, the comparison unit transmits the maximum value of the preset range to the selection unit; controls the counter to return to zero, and executes S410;

[0159] S409. The comparison unit transmits the minimum value of the preset range to the selection unit; controls the counter to return to zero, and executes S410.

[0160] S410. The selection unit outputs the received result; the process ends.

[0161] S411. The gain determination unit determines whether the gain coefficient needs to be updated. If yes, then execute S412; otherwise, execute S413.

[0162] S412, The gain determination unit determines the current gain coefficient based on the first value stored in the processed current register and the maximum value of the preset range; and changes the first value stored in the processed current register to the second value; controls the counter to return to zero, and executes S414;

[0163] The first value stored in the current register after processing is the nth (n is a positive integer) signal to be processed, and the current signal to be processed is the mth (m is an integer greater than n+1) signal to be processed. The second value is the maximum absolute value of the amplitude between the (n+1)th signal to be processed and the mth signal to be processed.

[0164] S413. The gain determination unit uses the previously determined gain coefficient as the current gain coefficient.

[0165] S414. The adjustment unit adjusts the amplitude of the current signal to be processed according to the determined current gain coefficient.

[0166] S415. The comparison unit continues to determine whether the amplitude of the adjusted signal exceeds the preset range; if not, execute S416; if yes, execute S406 and S407.

[0167] S416, The adjustment unit transmits the adjusted signal to the selection unit; return to S410.

[0168] The following example illustrates this.

[0169] Let Ax represent the x-th signal to be processed, where x is a positive integer. Assuming the preset number is 2, the digital signal is a digital audio signal, adjusting the signal amplitude is equivalent to adjusting the volume, and the number of signals to be processed within the preset time in the update confirmation condition is the preset number (i.e., the second condition in the update confirmation condition is equivalent to the third condition, so this embodiment only uses the first and second conditions in the update confirmation condition for judgment, without needing to make a judgment based on the third condition), then:

[0170] Regarding A1:

[0171] When A1 is obtained, the gain determination unit determines that the value stored in the current register (the current stored value is the default value, assumed to be 0) is less than the absolute value of the amplitude of A1, and then changes the value in the current register to the absolute value of the amplitude of A1.

[0172] If the comparison unit determines that the amplitude of A1 exceeds the preset range and the sign bit of A1 is 0, then the maximum value of the preset range is transmitted to the selection unit. At the same time, the gain determination unit determines the first gain coefficient (denoted as Z1) based on the absolute value of the amplitude of A1 and the maximum value of the preset range, and controls the counter to return to zero.

[0173] The selection unit outputs the maximum value of the received preset range as the volume adjustment result.

[0174] Regarding A2:

[0175] When A2 is obtained, the gain determination unit determines that the value stored in the current register (the current stored value is the absolute value of the amplitude of A1) is greater than the absolute value of the amplitude of A2. If so, the value in the current register remains unchanged and is still the absolute value of the amplitude of A1.

[0176] The comparison unit determines that the amplitude of A2 does not exceed the preset range. At this time, the control counter is incremented by 1 (because the value of the counter before incrementing by 1 is 0, the value after incrementing by 1 is 1). The gain determination unit determines that the gain coefficient does not need to be updated at present, so Z1 is transmitted to the adjustment unit as the current gain coefficient.

[0177] The adjustment unit calculates the product of the amplitudes of Z1 and A2 to obtain the processing result (denoted as G2);

[0178] If the comparison unit determines that the amplitude of G2 does not exceed the preset range, the adjustment unit will transmit G2 to the selection unit, so that the selection unit outputs G2 as the volume adjustment result.

[0179] Regarding A3:

[0180] When A3 is obtained, the gain determination unit determines that the value stored in the current register (the current stored value is the absolute value of the amplitude of A1) is greater than the absolute value of the amplitude of A3. If so, the value in the current register remains unchanged and is still the absolute value of the amplitude of A1.

[0181] The comparison unit determines that the amplitude of A3 does not exceed the preset range. At this time, the control counter is incremented by 1 (because the value of the counter before incrementing by 1 is 1, the value after incrementing by 1 is 2). The gain determination unit determines that there is no need to update the gain coefficient at present, so it continues to transmit Z1 as the current gain coefficient to the adjustment unit.

[0182] The adjustment unit calculates the product of the amplitudes of Z1 and A3 to obtain the processing result (denoted as G3);

[0183] If the comparison unit determines that the amplitude of G3 does not exceed the preset range, the adjustment unit will transmit G3 to the selection unit, so that the selection unit outputs G3 as the volume adjustment result.

[0184] For A4:

[0185] When A4 is obtained, the gain determination unit determines that the value stored in the current register (the current stored value is the absolute value of the amplitude of A1) is greater than the absolute value of the amplitude of A4. If so, the value in the current register remains unchanged and is still the absolute value of the amplitude of A1.

[0186] The comparison unit determines that the amplitude of A4 does not exceed the preset range. At this time, the control counter is incremented by 1 (since the value of the counter before incrementing by 1 is 2, the value after incrementing by 1 is 3). The gain determination unit determines that the gain coefficient needs to be updated. Based on the amplitude of A1 and the preset range, it determines the current gain coefficient (denoted as Z4) and transmits it to the adjustment unit. At the same time, the absolute value of A1 in the current register is changed to the absolute value of the amplitude of A3 (assuming that the absolute value of the amplitude of A3 among A2, A3 and A4 is the largest). And, the control counter is reset to zero.

[0187] The adjustment unit calculates the product of the amplitudes of Z4 and A4 to obtain the processing result (denoted as G4);

[0188] If the comparison unit determines that the amplitude of G4 exceeds the preset range and that the sign bit of A4 is 1, then the minimum value of the preset range is transmitted to the selection unit. At the same time, the gain determination unit updates the current gain coefficient (denoted as Z4') according to the amplitude of A4 and the preset range, and controls the counter to return to zero.

[0189] The selection unit outputs the minimum value of the received preset range as the volume adjustment result.

[0190] For A5:

[0191] When A5 is obtained, the gain determination unit determines that the value stored in the current register (the current stored value is the absolute value of the amplitude of A3) is less than the absolute value of the amplitude of A5, and then changes the absolute value of the amplitude of A3 in the current register to the absolute value of the amplitude of A5.

[0192] The comparison unit determines that the amplitude of A5 does not exceed the preset range. At this time, the counter is incremented by 1 (because the value of the counter before incrementing by 1 is 0, the value after incrementing by 1 is 1). The gain determination unit determines that there is no need to update the gain coefficient at present, so Z4' is continued to be transmitted to the adjustment unit as the current gain coefficient.

[0193] The adjustment unit calculates the product of the amplitudes of Z4' and A5 to obtain the processing result (denoted as G5);

[0194] The comparison unit determines that the amplitude of G5 does not exceed the preset range, and the adjustment unit transmits G5 to the selection unit, so that the selection unit outputs G5 as the volume adjustment result.

[0195] Based on the same inventive concept, this invention provides a control method for the digital circuit described above. The implementation principle of this control method is similar to that of the aforementioned digital circuit. For specific implementation methods of this control method, please refer to the specific embodiments of the aforementioned digital circuit. Repeated descriptions will not be repeated.

[0196] Specifically, the embodiments of the present invention provide a control method for the digital circuit as described above in the embodiments of the present invention, such as... Figure 5 As shown, it may include:

[0197] S501, The gain determination module determines the current gain coefficient based on the amplitude of the current signal to be processed and the preset range.

[0198] S502. When the amplitude of the current signal to be processed exceeds the preset range, the signal conditioning module adjusts the amplitude of the current signal to be processed according to the preset range and then outputs it; when the amplitude of the current signal to be processed does not exceed the preset range, the signal conditioning module adjusts the amplitude of the current signal to be processed according to the determined current gain coefficient and then outputs it.

[0199] Optionally, in this embodiment of the invention, before determining the current gain coefficient based on the obtained amplitude of the current signal to be processed and a preset range, the method further includes:

[0200] The signal upsampling module upsampling the acquired current digital signal to obtain the current signal to be processed and transmits it to the gain determination module.

[0201] Optionally, in this embodiment of the invention, when the gain determination module includes a comparison unit and a gain determination unit, when the amplitude of the current signal to be processed does not exceed a preset range, the current gain coefficient is determined based on the amplitude of the current signal to be processed and the preset range, specifically including:

[0202] Based on the previous signal to be processed and the preset update confirmation conditions, determine whether the gain coefficient needs to be updated.

[0203] If necessary, the current gain coefficient is determined based on the first value stored in the current register and the preset range; wherein, the first value is determined based on the current signal to be processed and each signal to be processed obtained before the current signal to be processed is obtained.

[0204] If not required, the gain coefficient determined last time will be used as the current gain coefficient.

[0205] Optionally, in this embodiment of the invention, determining whether the gain coefficient needs to be updated based on the previous signal to be processed and a preset update confirmation condition specifically includes:

[0206] If the amplitude of the previous signal to be processed exceeds the preset range, it is determined that the gain coefficient does not need to be updated at present;

[0207] If the amplitude of the previous signal to be processed does not exceed the preset range and the update confirmation condition is met, it is determined that the gain coefficient needs to be updated.

[0208] Optionally, in this embodiment of the invention, the method for determining the first value stored in the current register before the comparison unit determines whether the amplitude of the current signal to be processed exceeds a preset range includes:

[0209] Determine whether the first value stored in the current register is greater than or equal to the absolute value of the amplitude of the current signal to be processed;

[0210] If so, then keep the first value currently stored in the register unchanged;

[0211] If not, update the first value stored in the current register to the absolute value of the amplitude of the current signal to be processed.

[0212] Optionally, in embodiments of the present invention, it further includes:

[0213] When it is determined that the gain coefficient needs to be updated, the first value stored in the current register is changed to the second value;

[0214] The first value stored in the current register is the absolute value of the amplitude of the nth signal to be processed. When the current signal to be processed is the mth signal to be processed, the second value is the maximum value among the absolute values ​​of the amplitudes of the (n+1)th to the mth signal to be processed. n is a positive integer and m is an integer greater than n+1.

[0215] Optionally, in embodiments of the present invention, it further includes:

[0216] If it is determined that the update confirmation conditions are not met, then it is determined that the gain coefficient does not need to be updated at this time.

[0217] Optionally, in this embodiment of the invention, determining the current gain coefficient based on the amplitude and preset range of the current signal to be processed specifically includes:

[0218] When the amplitude of the current signal to be processed exceeds the preset range, the ratio of the maximum value of the preset range to the absolute value of the amplitude of the current signal to be processed is used as the current gain coefficient.

[0219] When it is determined that the gain coefficient needs to be updated, the ratio of the maximum value of the preset range to the first value is used as the current gain coefficient.

[0220] Optionally, in this embodiment of the invention, when the signal conditioning module includes a selection unit and an adjustment unit, when the amplitude of the current signal to be processed exceeds a preset range, the amplitude of the current signal to be processed is adjusted according to the preset range before being output, specifically including:

[0221] When the amplitude of the current signal to be processed exceeds the preset range, the selection unit will take the maximum value or the minimum value of the preset range as the adjustment result of the amplitude of the current signal to be processed and output it.

[0222] The maximum or minimum value of the preset range received by the selection unit is: when the amplitude of the current signal to be processed exceeds the preset range, the comparison unit outputs the maximum value of the preset range to the selection unit when it determines that the sign bit of the current signal to be processed is a preset value, and outputs the minimum value of the preset range to the selection unit when it determines that the sign bit of the current signal to be processed is not a preset value.

[0223] When the amplitude of the current signal to be processed does not exceed the preset range, the amplitude of the current signal to be processed is adjusted according to the determined current gain coefficient before being output, specifically including:

[0224] When the amplitude of the current signal to be processed does not exceed the preset range, the selection unit will output the output result received from the adjustment unit;

[0225] The output of the adjustment unit is as follows: the adjustment unit adjusts the amplitude of the current signal to be processed according to the determined current gain coefficient.

[0226] Optionally, in this embodiment of the invention, adjusting the amplitude of the current signal to be processed based on the determined current gain coefficient specifically includes:

[0227] Perform a multiplication operation on the amplitude of the current signal to be processed and the current gain coefficient.

[0228] Optionally, in this embodiment of the invention, after adjusting the amplitude of the current signal to be processed according to the determined current gain coefficient, and before outputting the adjusted current signal to be processed to the selection unit, the method further includes:

[0229] The adjusted current signal to be processed is transmitted to the comparison unit so that the comparison unit can determine whether the amplitude of the adjusted current signal to be processed exceeds the preset range.

[0230] When the amplitude of the adjusted current signal to be processed does not exceed the preset range, the adjusted current signal to be processed is output to the selection unit;

[0231] When the amplitude of the adjusted current signal to be processed exceeds the preset range, the output of the adjusted current signal to be processed to the selection unit is prohibited, and the comparison unit transmits the maximum value or the minimum value of the preset range to the selection unit according to the sign bit of the adjusted current signal to be processed.

[0232] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A digital circuit, characterized in that, include: Gain determination module and signal conditioning module; The gain determination module is used to: determine the current gain coefficient based on the amplitude of the current signal to be processed and the preset range; The signal adjustment module is used to: when the amplitude of the current signal to be processed exceeds the preset range, adjust the amplitude of the current signal to be processed according to the preset range and then output it; When the amplitude of the current signal to be processed does not exceed the preset range, the amplitude of the current signal to be processed is adjusted according to the determined current gain coefficient and then output. The gain determination module includes a comparison unit and a gain determination unit; wherein, the comparison unit is used to: determine whether the amplitude of the current signal to be processed exceeds the preset range; the gain determination unit is used to: determine the current gain coefficient based on the amplitude of the current signal to be processed and the preset range; The gain determination unit is specifically used to: when the amplitude of the current signal to be processed does not exceed the preset range, determine whether the gain coefficient needs to be updated based on the previous signal to be processed and the preset update confirmation condition; if so, determine the current gain coefficient based on the first value stored in the current register and the preset range; wherein, the first value is determined based on the current signal to be processed and each signal to be processed obtained before the current signal to be processed is obtained; if not, use the gain coefficient determined last time as the current gain coefficient.

2. The digital circuit as described in claim 1, characterized in that, The gain determination unit is specifically used for: When the amplitude of the previous signal to be processed exceeds the preset range, it is determined that the gain coefficient does not need to be updated at present; When the amplitude of the previous signal to be processed does not exceed the preset range and the update confirmation condition is met, it is determined that the gain coefficient needs to be updated.

3. The digital circuit as described in claim 1, characterized in that, The update confirmation conditions include: The sign bit value of the current signal to be processed is different from that of the previous signal to be processed; Alternatively, the sign bit values ​​of the current signal to be processed are the same as those of a preset number of signals to be processed obtained before the current signal to be processed is obtained; Alternatively, the sign bit value of the current signal to be processed is the same as that of the signal to be processed obtained within a preset time before the current signal to be processed is obtained.

4. The digital circuit as described in claim 1, characterized in that, The gain determination unit is also used for: Before the comparison unit determines whether the amplitude of the current signal to be processed exceeds the preset range, it determines whether the first value stored in the current register is greater than or equal to the absolute value of the amplitude of the current signal to be processed. If so, then keep the first value stored in the current register unchanged; If not, the first value stored in the current register is updated to the absolute value of the amplitude of the current signal to be processed.

5. The digital circuit as described in claim 1, characterized in that, The gain determination unit is also used for: When it is determined that the gain coefficient needs to be updated, the first value stored in the current register is changed to the second value; Wherein, the first value stored in the current register is the absolute value of the amplitude of the nth signal to be processed, and when the current signal to be processed is the mth signal to be processed, the second value is the maximum value among the absolute values ​​of the amplitudes of the (n+1)th signal to be processed to the mth signal to be processed, where n is a positive integer and m is an integer greater than n+1.

6. The digital circuit as described in claim 1, characterized in that, The gain determination unit is specifically used for: When the amplitude of the current signal to be processed exceeds the preset range, the ratio of the maximum value of the preset range to the absolute value of the amplitude of the current signal to be processed is used as the current gain coefficient. When it is determined that the gain coefficient needs to be updated, the ratio of the maximum value of the preset range to the first value is taken as the current gain coefficient.

7. The digital circuit as described in claim 1, characterized in that, The comparison unit is also used for: When the amplitude of the current signal to be processed exceeds the preset range, it is determined whether the sign bit of the current signal to be processed is a preset value; If so, output the maximum value of the preset range to the signal conditioning module; If not, output the minimum value of the preset range to the signal conditioning module; The signal conditioning module includes a selection unit and a conditioning unit; The selection unit is used for: When the amplitude of the current signal to be processed exceeds the preset range, the maximum value or the minimum value of the preset range is received and used as the adjustment result of the amplitude of the current signal to be processed and output. When the amplitude of the current signal to be processed does not exceed the preset range, the output result of the received adjustment unit is output. The adjustment unit is used for: When the amplitude of the current signal to be processed does not exceed the preset range, the amplitude of the current signal to be processed is adjusted according to the determined current gain coefficient and then output to the selection unit.

8. The digital circuit as described in claim 7, characterized in that, The adjustment unit is specifically used for: The amplitude of the current signal to be processed and the current gain coefficient are multiplied together.

9. The digital circuit as described in claim 7, characterized in that, The adjustment unit is also used for: After adjusting the amplitude of the current signal to be processed according to the determined current gain coefficient, and before outputting the adjusted current signal to be processed to the selection unit, the adjusted current signal to be processed is transmitted to the comparison unit so that the comparison unit can determine whether the amplitude of the adjusted current signal to be processed exceeds the preset range. When the amplitude of the adjusted current signal to be processed does not exceed the preset range, the adjusted current signal to be processed is output to the selection unit; When the amplitude of the adjusted current signal to be processed exceeds the preset range, the output of the adjusted current signal to be processed to the selection unit is prohibited, and the comparison unit transmits the maximum value or the minimum value of the preset range to the selection unit according to the sign bit of the adjusted current signal to be processed.

10. The digital circuit according to any one of claims 7-9, characterized in that, The comparison unit includes a comparator, and the gain determination unit includes a multiplier or a flip-flop. The selection unit includes a selector, and the adjustment unit includes a digital multiplier.

11. The digital circuit as described in claim 1, characterized in that, Also includes: Signal upsampling module; The signal upsampling module is used to: upsample the acquired current digital signal to obtain the current signal to be processed and transmit it to the gain determination module.

12. The digital circuit as described in claim 11, characterized in that, The signal upsampling module includes a digital filter and an upsampling processor.

13. A control method for a digital circuit as described in any one of claims 1-12, characterized in that, include: The gain determination module determines the current gain coefficient based on the amplitude of the current signal to be processed and the preset range. When the amplitude of the current signal to be processed exceeds the preset range, the signal adjustment module adjusts the amplitude of the current signal to be processed according to the preset range and then outputs it. When the amplitude of the current signal to be processed does not exceed the preset range, the signal adjustment module adjusts the amplitude of the current signal to be processed according to the determined current gain coefficient and then outputs the signal.

Citation Information

Patent Citations

  • Digital audio automatic gain control method and its system

    CN101370056A

  • Automatic gain control method of digital communication receiver

    CN110324054A