A compensation circuit and a digital-to-analog conversion device
By designing a compensation circuit including signal sampling, coefficient input, sampling prediction, comparison and encoding module, the problem of distortion of the R2R resistor network is solved, the circuit structure is simplified, the cost is reduced and analog signal distortion is avoided.
Patent Information
- Application Number
- CN202110679601.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-18
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-06-18
AI Technical Summary
The distortion problem of the existing R2R resistor network leads to high resistance accuracy requirements, resulting in complex compensation circuit structure and large circuit area, which is difficult to achieve.
Design a compensation circuit, including a signal sampling module, a coefficient input module, a sampling prediction module, a comparison module and a coding module, generate compensation values through successive approximation method, store them based on preset conditions and apply them to the original digital signal for re-encoding, forming compensation Digital signal to reduce distortion of analog signals.
It realizes that without changing the digital-to-analog conversion circuit structure, reduces resistance accuracy requirements, simplifies the circuit structure, reduces costs, is easy to implement, and effectively avoids distortion of analog signals.
Smart Images

Figure CN113381758B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a compensation circuit and a digital-to-analog conversion device. Background Art
[0002] DAC (Digital to Analog Converter) is a device that converts digital signals into analog signals. It is widely used in digital circuits. By using digital signals to process data in digital circuits, the circuit can obtain higher anti-interference ability, and the data processing method is more flexible. However, at the input and output ends of the signal, the feedback signal and the control quantity of the controlled object may still be analog signals. The analog input quantity can be converted into a digital signal through ADC (Analog to Digital Converter), and the digital signal is restored to an analog signal using DAC at the signal output end.
[0003] Among them, the R2R resistor network is a traditional digital-to-analog conversion method, which has the advantages of simple principle and easy implementation. However, since the error between resistors will cause nonlinear distortion, this distortion is usually more serious. Therefore, the R2R resistor network has very high requirements on the accuracy of resistors, and the resistors need to be strictly selected and adjusted, resulting in complex production and high costs. In order to solve the above problems, most of the existing technical solutions start from the resistor itself and reduce distortion through series, parallel, bipolar and other methods, but this compensation circuit has a complex structure and a large circuit area, making it difficult to implement. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a compensation circuit and a digital-to-analog conversion device to solve the problem that the prior art reduces the distortion of the R2R resistor network by series connection, parallel connection, bipolar connection, etc., but such compensation circuit has a complex structure and a large circuit area, and is therefore difficult to implement.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A compensation circuit comprises: a signal sampling module, a coefficient input module, a sampling prediction module, a comparison module and a coding module;
[0007] The signal sampling module is used to sample the input original digital signal to obtain an input sampling value, the coefficient input module is used to input a deviation coefficient, and the sampling prediction module is used to generate a predicted sampling value according to the deviation coefficient; the comparison module is used to compare the input sampling value and the predicted sampling value, and output a comparison result;
[0008] The encoding module performs encoding based on successive approximation method to obtain a compensation value, stores the compensation value when the comparison result meets a preset condition, and re-encodes the original digital signal based on the stored compensation value to form a compensated digital signal.
[0009] Optionally, the compensation circuit further comprises a clock module for generating a timing control signal, the clock module comprises a counter, and an output end of the counter is connected to an input end of the sampling prediction module and an input end of the encoding module;
[0010] Each time the counter counts once, the coefficient input module inputs a deviation coefficient once; the sampling prediction module sequentially generates predicted sampling values according to the deviation coefficient input by the coefficient input module;
[0011] Each time the counter counts a specified number of times, it is considered as one clock cycle. Within one clock cycle of the clock module, the signal sampling module samples the input original digital signal once.
[0012] Optionally, the output end of the coefficient input module is connected to the input end of the sampling prediction module, the output end of the sampling prediction module and the output end of the signal sampling module are respectively connected to an input end of the comparison module, and the output end of the comparison module is connected to the input end of the encoding module and the input end of the sampling prediction module.
[0013] Optionally, the sampling prediction module includes a sampling predictor, a sampling selector and a sampling accumulator; the sampling predictor is used to output a predicted sampling value according to the deviation coefficient, and the sampling accumulator is used to store the predicted sampling value currently generated;
[0014] The output end of the coefficient input module and the output end of the sampling accumulator are connected to the input end of the sampling predictor; the output end of the sampling predictor, the output end of the comparison module and the output end of the sampling accumulator are connected to the input end of the sampling selector; the output end of the sampling selector is connected to the input end of the sampling accumulator.
[0015] Optionally, when the comparison result is that the predicted sampling value is greater than the input sampling value, the sampling selector outputs a signal to the sampling accumulator to enable the sampling accumulator to operate; when the comparison result is that the predicted sampling value is less than the input sampling value, the sampling selector outputs a signal to the sampling predictor to enable the sampling predictor to operate.
[0016] Optionally, the output end of the counter is connected to a sampling accumulator, and after each clock cycle, the counter sends a reset signal to the sampling accumulator to clear the stored predicted sampling value in the sampling accumulator.
[0017] Optionally, the encoding module includes a code generator, the output end of the counter is connected to the input end of the code generator, and the code generator is used to output the count value x of the counter as a binary code y according to the following formula:
[0018] y=2 x .
[0019] Optionally, the encoding module further includes a coding predictor, a coding selector and a coding accumulator; the coding predictor is used to output a compensation value according to the binary code, and the coding accumulator is used to store a currently generated compensation value;
[0020] The output end of the code generator and the output end of the code selector are connected to the input end of the code accumulator, the output end of the code generator and the output end of the code accumulator are connected to the input end of the code predictor, and the output end of the code accumulator, the output end of the code predictor and the output end of the comparison module are connected to the input end of the code selector.
[0021] Optionally, when the comparison result is that the predicted sampling value is greater than the input sampling value, the encoding selector sends a signal to the encoding accumulator to enable the encoding accumulator to operate; when the comparison result is that the predicted sampling value is less than the input sampling value, the encoding selector sends a signal to the encoding predictor to enable the encoding predictor to operate.
[0022] The present invention also provides a digital-to-analog conversion device, comprising the compensation circuit as described in any one of the above items, and further comprising a digital-to-analog conversion circuit;
[0023] The digital-to-analog conversion circuit is used to receive the compensated digital signal formed in the compensation circuit and convert it into an analog signal.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] The present invention provides a compensation circuit and a digital-to-analog conversion device, which encodes the input original digital signal based on a successive approximation method according to a preset deviation coefficient, so that the digital signal is encoded before entering the digital-to-analog conversion circuit to eliminate the deviation, thereby avoiding the distortion of the analog signal. The compensation scheme provided by the present invention does not require changing the structure of the digital-to-analog conversion circuit, has a simple circuit structure, can reduce costs and is easy to implement. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0027] Figure 1 It is a structural schematic diagram of an R2R resistor network in the prior art;
[0028] Figure 2 A schematic diagram of the structure of a compensation circuit provided by the present invention;
[0029] Figure 3 A schematic structural diagram of a digital-to-analog conversion device provided by the present invention.
[0030] In the above figure: 100, clock input terminal; 101, coefficient input module; 102, signal sampling module; 103, coding output terminal; 200, counter; 201, coding generator; 202, coding accumulator; 203, coding predictor; 204, coding selector; 210, sampling accumulator; 211, sampling predictor; 212, sampling comparator; 213, sampling selector; A, compensation circuit; B, digital-to-analog conversion circuit. DETAILED DESCRIPTION
[0031] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] To facilitate understanding of the technical solution of the present invention, the technical background of the present invention is briefly introduced here:
[0033] Digital to analog converter (DAC) is an indispensable technical means for the digital storage, transmission and playback of music information. DAC is a device that converts digital signals into analog signals in the form of current, voltage or charge, so that the digital signals can be recognized by the outside world.
[0034] In the prior art, DAC architectures include three types: resistor string, R2R resistor network, and current source array. Figure 1As shown, taking the R2R resistor network as an example, the R2R resistor network is prone to causing the converted analog signal to change due to the difference between the resistors. The specific principle is as follows:
[0035] Write the n-bit R2R output voltage Vo in weighted form: Vo = k0*V0+k1*V1+k2*V2+…+kn*Vn;
[0036] Ideally:
[0037] kx(x=0 to n);
[0038] kn=1 / 2;
[0039] kn-1=1 / 4;
[0040] kn-2=1 / 8;
[0041] kn-3=1 / 16;
[0042] …
[0043] Kx=1 / 2n-x+1=2x-n-1;
[0044] Due to the errors between the resistors in the R2R resistor network, kx will deviate from 2x-n-1, causing the final analog signal to be distorted due to the deviation.
[0045] The present invention aims to provide a circuit compensation scheme, which encodes a digital signal input to a digital-to-analog converter to compensate for deviation, thereby avoiding distortion of an analog signal converted by the digital-to-analog converter.
[0046] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.
[0047] Please refer to Figure 2 The embodiment of the present invention provides a compensation circuit, including: a signal sampling module 102, a coefficient input module 101, a sampling prediction module, a comparison module, an encoding module and a clock module. The output end of the coefficient input module 101 is connected to the input end of the sampling prediction module, the output end of the sampling prediction module and the output end of the signal sampling module 102 are respectively connected to an input end of the comparison module, and the output end of the comparison module is connected to the input end of the encoding module and the input end of the sampling prediction module.
[0048] The clock module is used to generate a timing control signal, including a clock input terminal 100 and a counter 200 for counting, wherein the output terminal of the counter 200 is connected to the input terminal of the sampling prediction module and the input terminal of the encoding module; each designated number of counts performed by the counter 200 is a clock cycle. In this embodiment, when the count value of the counter 200 is 32, a clock cycle is completed.
[0049] Specifically, the signal sampling module 102 is used to sample the input original digital signal to obtain an input sampling value. Within one clock cycle of the clock module, the signal sampling module 102 samples the input original digital signal once; that is, the counter 200 resamples the input original digital signal every 32 times.
[0050] The coefficient input module 101 is used to input the deviation coefficient. In this embodiment, the deviation coefficient has 32 bits. Each time the counter 200 counts, the coefficient input module 101 inputs the deviation coefficient, and the sampling prediction module generates the predicted sampling value according to the deviation coefficient and outputs it to the comparison module.
[0051] The comparison module includes a sampling comparator 212, which is used to compare the input sampling value and the predicted sampling value, and output the comparison result, and output the comparison result to the sampling prediction module and the encoding module. When the comparison result is that the predicted sampling value is greater than the input sampling value, the comparison result is false; when the comparison result is that the predicted sampling value is less than the input sampling value, the comparison result is true.
[0052] The encoding module is used to generate a code for the count value of the counter 200 based on the successive approximation method to obtain a compensation value, store the compensation value when the comparison result meets the preset conditions, and after completing a clock cycle, that is, every 32 times the counter 200 counts, the encoding module outputs the stored compensation value once, and then re-encodes the original digital signal based on the compensation value to form a compensated digital signal.
[0053] Furthermore, in this embodiment, the sampling prediction module includes a sampling predictor 211, a sampling selector 213 and a sampling accumulator 210; the sampling predictor 211 is used to output a predicted sampling value according to the deviation coefficient, and the sampling accumulator 210 is used to store the currently generated predicted sampling value.
[0054] The output end of the coefficient input module 101 and the output end of the sampling accumulator 210 are connected to the input end of the sampling predictor 211; the output end of the sampling predictor 211, the output end of the comparison module and the output end of the sampling accumulator 210 are connected to the input end of the sampling selector 213; the output end of the sampling selector 213 is connected to the input end of the sampling accumulator 210.
[0055] It can be understood that when the comparison result is false, the sampling selector 213 selects the sampling accumulator 210, outputs a signal to the sampling accumulator 210 to make the sampling accumulator 210 act, and the sampling accumulator 210 stores the currently generated predicted sampling value. When the comparison result is true, the sampling selector 213 selects the sampling predictor 211, outputs a signal to the sampling predictor 211 to make the sampling predictor 211 act, and re-outputs the predicted sampling value to the sampling accumulator 210 according to the deviation coefficient.
[0056] In this embodiment, the output end of the counter 200 is connected to the sampling accumulator 210. After each clock cycle, that is, when the count value of the counter 200 reaches 32, the counter 200 sends a reset signal to the sampling accumulator 210 to clear the stored predicted sampling value.
[0057] Furthermore, the encoding module includes a code generator 201, the output end of the counter 200 is connected to the input end of the code generator 201, and the code generator 201 is used to output the count value x of the counter 200 as a binary code y according to the following formula:
[0058] y=2 x .
[0059] In addition, the encoding module also includes an encoding predictor 203, an encoding selector 204 and an encoding accumulator 202; the encoding predictor 203 is used to make predictions based on the binary code y and output a compensation value based on the prediction result; the encoding accumulator 202 is used to store the currently generated compensation value.
[0060] Among them, the output end of the code generator 201 and the output end of the code selector 204 are connected to the input end of the code accumulator 202, the output end of the code generator 201 and the output end of the code accumulator 202 are connected to the input end of the code predictor 203, and the output end of the code accumulator 202, the output end of the code predictor 203 and the output end of the comparison module are connected to the input end of the code selector 204.
[0061] It can be understood that, in this embodiment, both the coding predictor 203 and the sampling predictor 211 use adders.
[0062] In this embodiment, when the comparison result is false, the coding selector 204 selects the coding accumulator 202 and sends a signal to the coding accumulator 202 to activate the coding accumulator 202 and store the compensation value; when the comparison result is true, the coding selector 204 sends a signal to the coding predictor 203 to activate the coding predictor 203, re-predict according to the binary code y, and output the compensation value from the coding output terminal 103 based on the prediction result.
[0063] In this embodiment, the output end of the counter 200 is connected to the code accumulator 202. After each clock cycle, that is, when the count value of the counter 200 reaches 32, the counter 200 sends a reset signal to the code accumulator 202 to clear the stored compensation value.
[0064] Please refer to Figure 3 Based on the aforementioned embodiments, the present invention also provides a digital-to-analog conversion device, comprising a compensation circuit A as described in any one of the above items, and also comprising a digital-to-analog conversion circuit B; the digital-to-analog conversion circuit B is used to receive the compensated digital signal formed in the compensation circuit A and convert it into an analog signal.
[0065] Specifically, in this embodiment, the digital-to-analog conversion circuit B may be an R2R resistor network, or may be other types of digital-to-analog conversion circuits.
[0066] The present invention uses a compensation circuit A and an FPGA method to compensate the original digital signal of the input digital-to-analog conversion circuit B in the digital domain, thereby reducing the requirement for resistance accuracy. At the same time, the compensation circuit has a simple structure, low cost and is easy to implement.
[0067] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A compensation circuit, It is characterized in that include: Signal sampling module, coefficient input module, sampling prediction module, comparison module and encoding module; The signal sampling module is used to sample the input original digital signal to obtain an input sampling value, the coefficient input module is used to input the deviation coefficient one by one, and the sampling prediction module is used to generate the predicted sampling value one by one according to the deviation coefficient; the comparison module is used to compare the input sampling value and the predicted sampling value one by one, and output the comparison result; The encoding module is used to successively encode to obtain a compensation value, store the compensation value when the comparison result meets a preset condition, and encode the original digital signal based on the stored compensation value to form a compensated digital signal; The deviation coefficient initially input by the coefficient input module is a preset value; The sampling prediction module includes a sampling predictor, a sampling selector and a sampling accumulator; the sampling predictor is used to output a predicted sampling value according to the deviation coefficient, and the sampling accumulator is used to store the predicted sampling value currently generated; when the comparison result is that the predicted sampling value is greater than the input sampling value, the sampling selector outputs a signal to the sampling accumulator to enable the sampling accumulator to act; when the comparison result is that the predicted sampling value is less than the input sampling value, the sampling selector outputs a signal to the sampling predictor to enable the sampling predictor to act.
2. The compensation circuit according to claim 1, It is characterized in that It also includes a clock module for generating a timing control signal, the clock module includes a counter, and the output end of the counter is connected to the input end of the sampling prediction module and the input end of the encoding module; Each time the counter counts once, the coefficient input module inputs a deviation coefficient once; the sampling prediction module sequentially generates predicted sampling values according to the deviation coefficient input by the coefficient input module; Each time the counter counts a specified number of times, it is considered as one clock cycle. Within one clock cycle of the clock module, the signal sampling module samples the input original digital signal once. The encoding module outputs the compensation value once every clock cycle.
3. The compensation circuit according to claim 2, It is characterized in that The output end of the coefficient input module is connected to the input end of the sampling prediction module, the output end of the sampling prediction module and the output end of the signal sampling module are respectively connected to an input end of the comparison module, and the output end of the comparison module is connected to the input end of the encoding module and the input end of the sampling prediction module.
4. The compensation circuit according to claim 3, It is characterized in that The output end of the coefficient input module and the output end of the sampling accumulator are connected to the input end of the sampling predictor; the output end of the sampling predictor, the output end of the comparison module and the output end of the sampling accumulator are connected to the input end of the sampling selector; the output end of the sampling selector is connected to the input end of the sampling accumulator.
5. The compensation circuit according to claim 4, It is characterized in that The output end of the counter is connected to the sampling accumulator. After each clock cycle, the counter sends a reset signal to the sampling accumulator to clear the stored predicted sampling value in the sampling accumulator.
6. The compensation circuit according to claim 2, It is characterized in that The encoding module includes a code generator, the output end of the counter is connected to the input end of the code generator, and the code generator is used to output the count value x of the counter as a binary code y according to the following formula: y=2 x 。 7. The compensation circuit according to claim 6, It is characterized in that The encoding module further includes an encoding predictor, an encoding selector and an encoding accumulator; the encoding predictor is used to output a compensation value according to the binary code, and the encoding accumulator is used to store the currently generated compensation value; The output end of the code generator and the output end of the code selector are connected to the input end of the code accumulator, the output end of the code generator and the output end of the code accumulator are connected to the input end of the code predictor, and the output end of the code accumulator, the output end of the code predictor and the output end of the comparison module are connected to the input end of the code selector.
8. The compensation circuit according to claim 7, It is characterized in that When the comparison result is that the predicted sampling value is greater than the input sampling value, the encoding selector sends a signal to the encoding accumulator to enable the encoding accumulator to operate; when the comparison result is that the predicted sampling value is less than the input sampling value, the encoding selector sends a signal to the encoding predictor to enable the encoding predictor to operate.
9. A digital-to-analog conversion device, It is characterized in that A compensation circuit as claimed in any one of claims 1 to 8, further comprising a digital-to-analog conversion circuit; The digital-to-analog conversion circuit is used to receive the compensated digital signal formed in the compensation circuit and convert it into an analog signal.
