Signal amplitude adjusting system realized by hardware
Technical Field
The invention relates to the technical field of electronics, in particular to a hardware-implemented signal amplitude adjusting system.
Background
The signal amplitude adjustment plays an important role in signal transmission and processing, and a signal receiving end has certain requirements on the signal amplitude or the receiving end needs the signal amplitude adjustment to excite a subsequent circuit. A method with adjustable signal amplitude, wide adjusting range and high adjusting precision is generated.
The DAC is a module for converting digital signals into analog signals by a digital-to-analog converter.
Independent DAC chips, there are typically two chips, serial and parallel control. Such as DAC0832, belongs to the parallel control port; DAC7612 belongs to the serial input port. The serial port includes serial port, I2C, SPI, etc. The parallel port is typically 8 bits or 16 bits. For example DAC0832 belongs to 8-bit parallel control and DAC7612 belongs to SPI port control. The singlechip controls DAC0832,8 control pins are needed, DAC7612 is controlled, 4 SPI pins are needed, direct DAC7612 can be called if an SPI module is arranged in the singlechip, and IO port software can be used for simulation if SPI is not arranged.
And the DAC module controlled by the parallel port occupies more IO ports of the singlechip, and the more the accuracy is, the more the IO ports are needed. For example DAC0832,8 bit control, 8 pins to 0000 0000 output 0V,8 pins to 1111 1111 output 5V, 256 total from 0000 0000 to 1111 1111, so DAC0832 belongs to 8 bit precision, i.e. 5V/256 is approximately equal to 0.02V,0000 0001 outputs 0.02V,0000 0002 outputs 0.04V, steps 0.02V, 8 bit precision is not sufficient if a voltage step of 0.01V is desired to be output.
The current DAC chip generally adopts serial port control, and the most used SPI port is 4-line control no matter 8-bit precision, 10-bit precision, 12-bit precision and 16-bit precision.
But the amplitude modulation precision of the traditional DAC module is not high and the amplitude modulation range is not large.
Disclosure of Invention
In order to solve the technical problems, the invention provides a hardware-implemented signal amplitude adjusting system, which enables the signal amplitude to be adjustable and an amplitude modulation factor communication interface to be configured.
The technical scheme of the invention is as follows:
A hardware-implemented signal amplitude regulation system comprises an upper computer, a parameter communication module, an amplitude modulation factor analysis module, a factor symbolization module, a signed signal shift module, a signed bit multiplication module, a signed bit addition module and a DAC module.
The parameter communication module is respectively connected with the upper computer and the amplitude modulation factor analysis module;
the signed bit multiplication module is respectively connected with a signed signal shift module, a factor symbolization module and a signed bit addition module;
The factor symbolizing module is connected with the amplitude modulation factor analyzing module; the DAC module is connected with the signed bit addition module;
The amplitude modulation factor is set in a digital mode to change the numerical value of the signed digital signal, so that the analog signal output amplitude of the DAC module is regulated.
Further, the method comprises the steps of,
The upper computer can issue parameters through the parameter communication module, and the serial port, the PCIe interface and the USB interface can be realized only by humanized issuing of parameters used by the system.
Further, the method comprises the steps of,
And the parameter communication module analyzes the data transmitted by the communication interface protocol in the amplitude modulation factor analysis module to obtain an amplitude modulation factor. The amplitude modulation factor consists of an amplification factor and a scaling factor.
The more the number of bits of the amplification factor, the wider the amplitude modulation range; the greater the number of bits of the scaling factor, the greater the amplitude modulation accuracy. The amplitude modulation factor acts on the signed signal and it needs to be converted into a signed bit factor at the factor symbolizing module. The signed signal is amplified and scaled by shifting, so that a divider is avoided, and resources are saved.
The symbolizing factor performs a signed bit multiplication operation with the signed signal. And carrying out signed bit addition operation on the effective multiplication module result to obtain an amplitude-modulated digital signal output. The amplitude-modulated digital signal output passes through the DAC module, the amplitude-modulated analog signal is output, and the amplitude modulation precision is determined by the digital input of the DAC, so that the amplitude modulation limit of the DAC module is made up.
The invention has the beneficial effects that
The amplitude modulation factor is set in a digital mode to change the numerical value of the signed digital signal, so that the function of adjusting the output amplitude of the analog signal of the DAC module is achieved. The signal amplitude is regulated from the source of the digital signal, and the defects of low amplitude modulation precision and small amplitude modulation range of the DAC module are overcome. The invention has the characteristics of adjustable signal amplitude, configurable amplitude modulation factor communication interface, high amplitude modulation precision, wide amplitude modulation range, simple and convenient implementation, humanized control and the like, and has wide application prospect.
Drawings
Fig. 1 is a block diagram of the operation of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
The invention relates to a hardware-implemented signal amplitude regulating system, the block diagram of which is shown in figure 1, and which consists of an upper computer, a parameter communication module, an amplitude modulation factor analysis module, a factor symbolizing module, a signed signal shifting module, a signed bit multiplication module, a signed bit addition module and a DAC module.
The upper computer can issue parameters through the parameter communication module, and the serial port, the PCIe interface and the USB interface can be realized only by humanized issuing of parameters used by the system.
And the parameter communication module analyzes the data transmitted by the communication interface protocol in the amplitude modulation factor analysis module to obtain an amplitude modulation factor. The amplitude modulation factor consists of an amplification factor and a scaling factor. The more the number of bits of the amplification factor, the wider the amplitude modulation range; the greater the number of bits of the scaling factor, the greater the amplitude modulation accuracy.
The amplitude modulation factor acts on the signed signal and it needs to be converted into a signed bit factor at the factor symbolizing module. The signed signal is amplified and scaled by shifting, so that a divider is avoided, and resources are saved. The symbolizing factor performs a signed bit multiplication operation with the signed signal. And carrying out signed bit addition operation on the effective multiplication module result to obtain an amplitude-modulated digital signal output.
The amplitude-modulated digital signal output passes through the DAC module, the amplitude-modulated analog signal is output, and the amplitude modulation precision is determined by the digital input of the DAC, so that the amplitude modulation limit of the DAC module is made up.
Illustrating the amplitude modulation scheme:
① The upper computer issues 32bit amplitude modulation factors (hexadecimal C000A 001), wherein the upper computer is 16 bits high (hexadecimal C000) representing the amplification factors, and the lower computer is 16 bits low (hexadecimal A001) representing the scaling factors, and the scaling factors are issued to the parameter communication module through the communication interface.
② The amplitude modulation factor analysis module analyzes the 32bit amplitude modulation factor, which comprises an amplification factor (hexadecimal C000) and a scaling factor (hexadecimal A001).
③ The factor symbolizing module converts each bit in the factor into a signed bit factor for operation with a signed bit signal. The conversion rule is to convert the original unsigned bit factor bit by bit into a 2bit signed bit factor, i.e. bit 0 into bit 00 and bit 1 into bit 01. The amplification factor (hexadecimal C000) is converted into 16 2-bit signed bit factors, here we denote a 1,A2,…,A16, i.e. a 1=A2=…=A14=2'b00,A15=A16 =2' b01; the scaling factor (hexadecimal a 001) is converted to 16 2-bit signed bit factors, here denoted by B 1,B2,…,B16, i.e. B 1=B3=B16=2'b01,B2=B4=B5=…=B15 = 2' B00.
④ Carrying out signed bit shift operation on a signed bit signal X, wherein the signed bit signal X is respectively shifted to the left by 0 bit, 1 bit, 2 bit, … bit and 15 bit, and the shifted signals are respectively represented by X L0,XL1,XL2,…,XL15; the signed bit signals X are respectively right signed shifted by 1 bit, 2 bits, … bits, 16 bits, and the shifted signals are respectively denoted by X R1,XR2,…,XR16.
⑤ In the signed bit multiplication module, the shifted 32 signals are respectively subjected to signed bit multiplication with 32 signed bit factors, namely TL15=A16*XL15,TL14=A15*XL14,…,TL1=A2*XL1,TL0=A1*XL0;TR1=B1*XR1,TR2=B2*XR2,…,TR15=B15*XR15,TR16=B16*XR16.
⑥ In the signed bit addition operation module, the product results are summed and accumulated, and a multi-stage summation method of pairwise addition is adopted, so that the time sequence risk of hardware for summing 32 numerical values in one clock period is avoided. The signal output by this example
XDO=TL15+TL14+TR1+TR3+TR16=A16*XL15+A15*XL14+B1*XR1+B3*XR3+B16*XR16=215*X+214*X+X/21+X/23+X/216=(215+214+2-1+2-3+2-16)X.
⑦ The amplitude-modulated digital signal output X DO is used as the input of a DAC module, digital-to-analog conversion is carried out, and amplitude-modulated analog signal output X AO is output.
⑧ The amplitude modulation range of the method is 0 to (2 15+214+…+20+2-1+2-2+…+2-16) times of that of the original signal, and the amplitude modulation precision is 2 -16 times of that of the original signal. By adopting the method, the amplitude modulation range is wide, and the amplitude modulation precision is high. The above is illustrated with only 16-bit magnification factors, 16-bit magnification factors.
The foregoing description is only illustrative of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.