Device and method for measuring phase difference of electronic signals
Technical Field
The invention relates to the field of electronic technology and broadcast television, and can be used for designing a radio signal interferometer for measuring the azimuth of a radio emission source such as a broadcast television transmitter and the like by using the technology.
Background
In order to effectively monitor broadcast television and radio environments, to combat their illegal activity, it is necessary to monitor the legitimacy of broadcast television programs and to measure and locate illegal stations. This is accomplished by using a radio signal interferometer that measures the direction of the radio emission source by measuring the phase difference of the radio signals to calculate the direction angle of the source.
The main method for rapidly measuring the phase difference of radio signals at present is to measure the time difference of two signals at the zero crossing point and convert the time difference into the phase difference according to frequency. That is, only zero crossing information of the signal is used for measurement, while information of the signal at other moments is not utilized at all. In a practical circuit, the measurement accuracy of the method is not very high because the signal is superimposed with noise or is disturbed, or the zero crossing point moment is not accurate due to circuit distortion.
And the analog multiplier is adopted to multiply the two signals and then filter the two signals, and the direct current component in the product signal and the two signals are measured to form a cosine function relation. The measurement range of the method is (0, pi) open interval, the whole 2 pi period can not be covered, and only half period can be measured. And linearity is poor near 0, pi and integer pi, and precision is not high. The cost and accuracy are greatly affected by the analog multiplier circuit.
Disclosure of Invention
The invention provides an electronic signal phase difference measuring device and method, which are used for solving the problems that the existing method can only measure half period, the measuring precision is low, the measuring cost is high and the like.
An electronic signal phase difference measuring device comprises a signal A input end, a first amplifier, a first automatic gain controller, a first zero-crossing comparator, a first Schmitt circuit, a superposition device, a signal B input end, a second automatic gain controller, an inversion control end, a first positive and negative symbolizer, a second amplifier, a second zero-crossing comparator, a second Schmitt circuit, a peak detector, a D trigger, a second positive and negative symbolizer and an output end;
the input end of the signal A is electrically connected with a first amplifier, the output end of the first amplifier is electrically connected with the input end of a first automatic gain controller, the output end of the first automatic gain controller is electrically connected with the control end of the first amplifier, the first amplifier is electrically connected with a superposition device, the first amplifier is electrically connected with a first zero-crossing comparator, the first zero-crossing comparator is electrically connected with a first Schmidt circuit, the first Schmidt circuit is electrically connected with the CP end of a D trigger,
the signal B input end is electrically connected with the first positive and negative symbolizer, the phase inversion control end is electrically connected with the first positive and negative symbolizer control end, the first positive and negative symbolizer is electrically connected with the second amplifier, the second amplifier output end is electrically connected with the second automatic gain controller input end, the second automatic gain controller output end is electrically connected with the second amplifier control end, the second amplifier is electrically connected with the adder, the second amplifier is electrically connected with the second zero-crossing comparator, the second zero-crossing comparator is electrically connected with the second Smitt circuit, the second Smitt circuit is electrically connected with the D end of the D trigger, the adder is electrically connected with the peak detector, the peak detector is electrically connected with the second positive and negative symbolizer, the Q end of the D trigger is electrically connected with the control end of the second positive and negative symbolizer, and the second positive and negative symbolizer output end is electrically connected with the Q end.
A method for measuring phase difference of electronic signals is realized by the following steps:
step one, a signal A is input into a circuit from the input end of the signal A, and under the control of a first automatic gain controller, the signal A is amplified by a first amplifier and then a signal with fixed amplitude X is output, and the phase is kept unchanged; meanwhile, a signal B is input into the circuit from the input end of the signal B; under the control of a second automatic gain controller, the signal B is amplified by a second amplifier to a signal with fixed amplitude X;
step two, the phase inversion control end controls the first positive and negative sign device to input the same phase signal or the opposite phase signal of the signal B to the second amplifier,
if the phase inversion control end outputs low level, the output voltage of the first positive and negative symbolizer is the same as the input voltage, otherwise, the output voltage of the first positive and negative symbolizer is the same as the absolute value of the input voltage, and the polarity sign is opposite;
under the control of the first automatic gain controller and the second automatic gain controller, the signal A and the signal B are sent into the adder with the same amplitude X, and the output voltage signal Y of the adder is:
Y=C(A+B)=CX[cos(ωt+Φ A )+cos(ωt+Φ B )]
wherein C is the superimposed gain constant, ω is the angular frequency of signal A and signal B, Φ A Is the initial phase of signal A, phi B Is the initial phase of signal B;
step three, outputting a voltage signal Y from the adder and sending the voltage signal Y to a peak detector, wherein the peak detector obtains a peak value Z of the voltage signal Y;
the first zero-crossing comparator converts the signal output by the first amplifier into square wave at zero point, and sends the square wave to the CP input end of the D trigger after being shaped by the first Schmidt circuit;
the second zero-crossing comparator converts the signal output by the second amplifier into square wave at zero point, and sends the square wave to the D input end of the D trigger after being shaped by the second Smitt circuit;
judging whether the level output by the Q output end of the D trigger is high level or not, if so, delaying the signal A by the signal B, and executing the fifth step; if not, the signal A leads the signal B, and the step six is executed;
fifthly, the second positive and negative symbolizer is used for reversing the signal output by the peak detector to the output end;
step six, the second flip-flop sends the signal output by the peak detector to the output end;
measuring the output voltage V of the output end, and calculating the phase difference phi of the signal A and the signal B:
step eight, if the phase difference phi is in [ pi/2, 3 pi/2 ] closed interval, the phase difference is measured; if the phase difference phi is in the (-pi/2, pi/2) open interval, the phase inversion control terminal is adopted to control the first positive and negative symbolizer, the signal B is sent to the second amplifier after being inverted, the voltage V at the output terminal is measured, and the phase difference between the signal A and the signal B is calculated:
φ=2arccos(V/2CX)+π。
the invention has the beneficial effects that: the measuring device and the measuring method provided by the invention can fully utilize all information on the signal waveform, are very suitable for measuring the micro phase difference, and have high measuring precision and strong anti-interference capability. The measurable range of the method for measuring the direct current component after multiplication is limited to be within half a period, so that the method is not good in linearity near an integer pi and cannot be measured even at the integer pi, and a complex multiplier circuit is needed. Compared with the method, the circuit and the method provided by the invention can not only cover the whole 2 pi period, but also have good linearity in the whole closed range. Because the invention does not need a multiplier, the circuit is simple, and a better measuring effect can be obtained by using an analog circuit, a digital circuit or a singlechip without a hardware multiplier with lower cost.
The invention adopts a method that two signals are directly or after phase inversion are overlapped, output voltage and two signal phase differences form an inverse cosine function relation, the direct overlapping measurement range is a (0, 2 pi) open interval, and the optimal linear area is positioned near integer times of pi; the superimposed measurement range after phase inversion is (-pi, pi) open interval, and the optimal linear region is located near the integral multiple of 2 pi; a method of shifting is utilized. Good linearity can be achieved over the whole 2 pi complete period. Because all information in the whole period of the signal participates in measurement, the measured data is stable and has higher accuracy. The phase difference measuring device can be directly manufactured by an analog circuit, and the digitized signal can be measured by software. Because multiplication is not required, a low-cost single-chip microcomputer or a simple digital logic design circuit without a hardware multiplier can be used. The method has the advantages of low cost, high precision, capability of covering the complete period of the signal in the measuring range, and good linearity in the whole measuring range.
Drawings
FIG. 1 is a schematic block diagram of an electronic signal phase difference measuring device according to the present invention;
FIG. 2 is a schematic diagram of a first flip-flop or a second flip-flop in an electrical signal phase difference measuring apparatus according to the present invention.
Detailed Description
The first embodiment is described with reference to fig. 1 and 2, and an electronic signal phase difference measuring apparatus includes a signal a input terminal 1, a first amplifier 2, a first automatic gain controller 3, a first zero-crossing comparator 4, a first schmitt circuit 5, a adder 6, a signal B input terminal 7, a second automatic gain controller 8, an inversion control terminal 9, a first flip-flop 10, a second amplifier 11, a second zero-crossing comparator 12, a second smitt circuit 13, a peak detector 14, a d trigger 15, a second flip-flop 16, and an output terminal 17;
the signal A input end 1 is electrically connected with the first amplifier 2, the output end of the first amplifier 2 is electrically connected with the input end of the first automatic gain controller 3, the output end of the first automatic gain controller 3 is electrically connected with the control end of the first amplifier 2, the first amplifier 2 is electrically connected with the adder 6, the first amplifier 2 is electrically connected with the first zero-crossing comparator 4, the first zero-crossing comparator 4 is electrically connected with the first Schmidt circuit 5, and the first Schmidt circuit 5 is electrically connected with the CP end of the D trigger 15;
the signal B input end 7 is electrically connected with the first positive and negative symbolizer 10, the phase inversion control end 9 is electrically connected with the control end of the first positive and negative symbolizer 10, the first positive and negative symbolizer 10 is electrically connected with the second amplifier 11, the output end of the second amplifier 11 is electrically connected with the input end of the second automatic gain controller 8, the output end of the second automatic gain controller 8 is electrically connected with the control end of the second amplifier 11, the second amplifier 11 is electrically connected with the adder 6, the second amplifier 11 is electrically connected with the second zero-crossing comparator 12, the second zero-crossing comparator 12 is electrically connected with the second Smitt circuit 13, the second Smitt circuit 13 is electrically connected with the D end of the D trigger 15, the adder 6 is electrically connected with the peak detector 14, the peak detector 14 is electrically connected with the second positive and negative symbolizer 16, the Q end of the D trigger 15 is electrically connected with the control end of the second positive and negative symbolizer 16, and the output end 17 is electrically connected with the second positive and negative symbolizer 16.
Referring to fig. 2, the first flip-flop 10 and the second flip-flop 16 have the same structure and each include a resistor R3, a resistor R4, a resistor R5, an operational amplifier U1, a field effect transistor Q1, a signal input terminal IN, a signal output terminal OUT, and a symbol control terminal CTL;
the signal input end IN is respectively connected with one end of a resistor R3 and one end of a resistor R5, the other end of the resistor R3 is respectively connected with one end of a resistor R4 and an inverting input end of an operational amplifier U1, the other end of the resistor R4 is connected with a signal output end OUT of the operational amplifier U1, a non-inverting input end of the operational amplifier U1 is respectively connected with the other end of the resistor R5 and a drain electrode D of a field effect transistor Q1, a source electrode S of the field effect transistor Q1 is grounded, and a grid electrode G of the field effect transistor Q1 is a symbol control end CTL;
when the CTL control end is at a high level, the Q1 is conducted, so that the 5 th pin of the operational amplifier U1 is grounded, the signal amplitude of the output end OUT is the same as that of the input end IN, the voltage of the output end OUT is the same as that of the input end IN, but the polarity sign is opposite, and the phase difference is pi; when the CTL control terminal is at a low level, Q1 is turned off, the signal amplitude of the output terminal OUT is the same as that of the input terminal IN, the voltage of the output terminal OUT is the same as that of the input terminal IN, and the phase difference is 0.
The second embodiment is a method for measuring by using the electronic signal phase difference measuring device according to the first embodiment, and the specific process of the measuring method is as follows:
in order to measure the phase difference of the two signals A and B, A is input into the circuit from the input end 1 of the signal A, and B is input into the circuit from the input end of the signal B; under the control of the first automatic gain controller 3, the signal a is amplified by the first amplifier 2 into a signal with a fixed amplitude X, and the phase is kept unchanged; under the control of the second automatic gain controller 8, the signal B is amplified by the second amplifier 11 to a signal of fixed amplitude also X; the logic of different high and low levels at the phase inversion control end 9 controls the first positive and negative symbolizer 10 to input the same phase or opposite phase signal of the B signal to the second amplifier 11, if the logic of the level of the phase inversion control end 9 is low, the output voltage of the first positive and negative symbolizer 10 is the same as the input voltage, otherwise, the absolute value of the output voltage is the same as the absolute value of the input voltage, but the polarity sign is opposite; under the control of the first automatic gain controller 3 and the second automatic gain controller 8, the signal a and the signal B are always sent to the adder 6 with the same amplitude X, and the voltage transfer relationship of the adder 6 is:
Y=C(A+B)=CX[cos(ωt+Φ A )+cos(ωt+Φ B )]
wherein Y is an output voltage signal; c is a superposition gain constant, the superposition gain constant is 0.5, and the superposition gain constant can be determined by a circuit or software design; x is the amplitude of signal A and signal B, ω is the angular frequency of signal A and signal B, Φ A Is the initial phase of signal A, phi B Is the initial phase of signal B;
the signal Y output from the adder 6 is sent to the peak detector 14, and the peak value Z of the signal Y is obtained; the first zero-crossing comparator 4 converts the signal output from the first amplifier 2 into square wave at zero point, and sends the square wave to the CP input end of the D trigger 15 after being shaped by the first Schmitt circuit 5; the second zero-crossing comparator 12 converts the signal output from the second amplifier 11 into a square wave at zero, and sends the square wave to the D input terminal of the D flip-flop 15 after being shaped by the second smitt circuit 13; the level of the Q output end of the D trigger 15 marks the positive and negative polarities of the phase difference of the signals A and B, if the level is high, the signal A is delayed from the signal B, and the signal output by the peak detector 14 is inverted and sent to the output end 17; otherwise, signal a leads signal B; the second forward and reverse symbolizer 16 supplies the signal output by the peak detector 14 to the output terminal 17; the voltage V at the output 17 is measured and the phase difference of the two signals is calculated:
φ=2arccos(V/2CX)
when the phase difference of the signals A and B is in [ pi/2, 3 pi/2 ] closed range, the phase difference phi and the output voltage V have better linear relation, and higher precision can be obtained by utilizing the above-mentioned inverse cosine calculation. When the phase difference between the signals A and B is about an integer multiple of 2 pi, the linearity between the phase difference phi and the output voltage V is not ideal, so that the phase difference between the signals A and B is in the (-pi/2, pi/2) open interval, the phase inversion control terminal 9 is used for controlling the first flip-flop 10 to invert the signal B and then send the signal B into the second amplifier 11, and the voltage U of the output terminal 17 is measured at the moment to calculate the phase difference of the two signals:
φ=2arccos(V/2CX)+π
the phase difference phi in this interval after inversion has a better linear relation with the output voltage V, and a higher accuracy can be obtained if the above-mentioned inverse cosine calculation is used.
In this embodiment, the phase difference between the signal a and the signal B may be obtained in another way, that is: the output voltage V of the output end 17 has an approximate linear relation with the phase difference phi of the signal A and the signal B, the maximum error occurs at n pi/2, the maximum relative error is not more than 3%, and the phase difference of the signal A and the signal B can be directly calculated by using an approximate formula: