A method, apparatus, device and medium for measuring phase difference of a sinusoidal signal
By performing quadrature demodulation on the sinusoidal signal, removing abnormal jump data points, and averaging the data, the problem of balancing speed and accuracy in phase difference measurement was solved, achieving high-precision and high-speed measurement under high signal-to-noise ratio conditions.
Patent Information
- Application Number
- CN202511467789.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-10-14
AI Technical Summary
Existing phase difference measurement algorithms struggle to balance high precision and high speed, especially in the initialization of astronomical radio frequency telescopes with phased array antennas. Existing high-speed algorithm improvement methods require significant computational resources and contain measurement errors.
By performing quadrature demodulation on the two input sinusoidal signals, the phase value time series is obtained, abnormal jump data points are identified and removed, and finally averaging is performed to ensure the stability and reliability of the measurement results.
It achieves a phase difference measurement accuracy of better than 10 degrees under a signal-to-noise ratio greater than 6dB, while also taking into account a high measurement speed, effectively balancing measurement speed and accuracy.
Smart Images

Figure CN120928036B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of signal processing, in particular to a phase difference measurement method and device of a sinusoidal signal, equipment and medium. BACKGROUND
[0002] In the field of signal processing, measuring the phase difference of a same-frequency sinusoidal signal is widely used in many industries such as communication, power, and medical treatment. According to the Nyquist sampling theorem, the sampling time is positively correlated with the phase difference resolution, and is negatively correlated with the noise amplitude, resulting in a contradiction between the measurement speed and the accuracy.
[0003] Current phase difference measurement algorithms can be divided into two categories: high speed and high accuracy. The former is suitable for high-speed applications but has low computational complexity, and the latter is suitable for high-precision requirements but consumes a lot of computing resources. In some practical applications, such as the initialization of a phased array antenna astronomical radio telescope, both high accuracy and high speed are required. Although the existing high-speed algorithm improvement methods, such as Kalman filtering and wavelet transform, have improved the speed, they still face the problems of high computational resource demand and measurement error.
[0004] Therefore, how to balance the measurement speed and accuracy in phase difference measurement is a technical problem that needs to be solved at present. SUMMARY
[0005] The present application provides a phase difference measurement method, device, equipment and medium of a sinusoidal signal, which achieves a phase difference measurement accuracy better than 10 degrees under a noise condition with a signal-to-noise ratio greater than 6dB, while taking into account the high measurement speed.
[0006] In order to achieve the above purpose, the main technical scheme adopted by the present application includes:
[0007] In a first aspect, the present application provides a phase difference measurement method of a sinusoidal signal, the method comprising:
[0008] Orthogonal demodulation processing is performed on the input two-channel sinusoidal signals to obtain the phase value time series of the two-channel sinusoidal signals;
[0009] The phase value time series of the two-channel sinusoidal signals are subtracted to obtain a preliminary phase difference value time series;
[0010] Abnormal jump data points in the preliminary phase difference value time series are identified and removed to obtain a target phase difference value time series;
[0011] The target phase difference value time series is averaged to obtain a target phase difference corresponding to the two-channel sinusoidal signals.
[0012] The embodiment provides a phase difference measurement method of a sinusoidal signal, phase value time sequences of two sinusoidal signals are obtained through orthogonal demodulation processing, then phase difference value time sequences of the two sinusoidal signals are calculated, and on this basis, abnormal jump data points are removed, so that the accuracy of data is improved. Finally, the target phase difference value time sequence is subjected to average processing, data is further smoothed, and the stability and reliability of the measurement result are ensured. Through the process, the measurement speed and the accuracy are successfully balanced, the phase difference can be quickly obtained, the high measurement accuracy is ensured, and the effective balance between the two is realized.
[0013] In one embodiment, the input sinusoidal signal is subjected to orthogonal demodulation processing, and phase value time sequences of two sinusoidal signals are obtained, including:
[0014] The power division processing is performed on any one of the two sinusoidal signals, and first branch sinusoidal signals and second branch sinusoidal signals corresponding to the any one of the two sinusoidal signals are obtained;
[0015] The phase angle of the first branch sinusoidal signal is adjusted, and the first branch digital signal is obtained through analog-to-digital conversion of the first branch sinusoidal signal after the phase angle adjustment;
[0016] The second branch digital signal is obtained through analog-to-digital conversion of the second branch sinusoidal signal;
[0017] The phase calculation is performed according to the first branch digital signal and the second branch digital signal, and the phase value time sequence matched with the any one of the two sinusoidal signals is obtained.
[0018] The embodiment decomposes the original signal into two independent branch signals through power division processing, and provides a clear signal source for subsequent phase calculation. Then, the phase angle of the first branch signal is adjusted, and the first branch digital signal is obtained through analog-to-digital conversion, so that the accuracy is improved and the accumulation of signal errors is avoided. The second branch signal is also converted into a digital signal through analog-to-digital conversion, and the processing flow is simplified. Finally, through the efficient phase calculation method, the calculation speed can be improved on the basis of ensuring high accuracy. The whole process ensures the measurement accuracy and improves the calculation efficiency.
[0019] In one embodiment, the phase calculation is performed according to the first branch digital signal and the second branch digital signal, and the phase value time sequence matched with the any one of the two sinusoidal signals is obtained, including:
[0020] The initial phase value is obtained according to the ratio between the first branch digital signal and the second branch digital signal;
[0021] The modulo operation is performed on the initial phase value, and the phase value after the modulo operation is obtained;
[0022] According to a preset angle range, the phase value after the modulo operation is adjusted to obtain a phase value time sequence matched with the any one route sinusoidal signal.
[0023] The embodiment calculates the initial phase value quickly according to the ratio of the first branch digital signal and the second branch digital signal, ensures the calculation speed, and provides the accurate phase value. Then, the initial phase value is limited in a standardized range through the modulo operation, thereby eliminating the discontinuity caused by the phase value out of the range, and ensuring the stability of the calculation. Finally, the phase value after the modulo operation is adjusted according to the preset angle range, so that the phase value is smoothly transitioned, and the error caused by the extreme value jump is avoided. Through the series of processing, the efficiency of the measurement speed is ensured, and the high accuracy of the measurement result is ensured, so that the balance between the speed and the accuracy is realized in the phase difference measurement.
[0024] In one embodiment, the phase value time sequence of the two routes of sinusoidal signals is subtracted to obtain a preliminary phase difference value time sequence, including:
[0025] When the measurement result of the phase value of one route of sinusoidal signals minus the phase value of another route of sinusoidal signals and plus the measurement noise is greater than or equal to zero, the measurement result or the measurement result minus the preset angle threshold is determined as the value of the phase difference value time sequence;
[0026] When the measurement result of the phase value of one route of sinusoidal signals minus the phase value of another route of sinusoidal signals and plus the measurement noise is less than zero, the measurement result or the measurement result plus the preset angle threshold is determined as the value of the phase difference value time sequence.
[0027] The embodiment ensures the accuracy of the phase difference value by determining the value or the value minus the preset angle threshold as the phase difference when the result of the calculated phase difference plus the noise is greater than or equal to zero, and determining the value or the value plus the preset angle threshold as the phase difference if it is less than zero. In this way, the phase difference can be quickly identified and adjusted while ensuring high accuracy, avoiding complex operation process, and significantly improving the measurement speed and accuracy.
[0028] In one embodiment, the preliminary phase difference value time sequence is identified and the abnormal jump data points are removed to obtain a target phase difference value time sequence, including:
[0029] The preliminary phase difference value time sequence is classified to obtain a preliminary classification result; the preliminary classification result includes a first abnormal jump for representing positive 360 degrees, no abnormal jump, and a second abnormal jump for representing negative 360 degrees;
[0030] determine a standard deviation corresponding to any preliminary classification result, and determine an absolute value of a difference between each data point and a median in the preliminary classification result to which the data point belongs;
[0031] determine a data point as an abnormal jump data point if the absolute value is greater than a specified multiple of the standard deviation;
[0032] remove the abnormal jump data point from the preliminary classification result to which the abnormal jump data point belongs, to obtain the target phase difference time sequence.
[0033] The embodiment classifies the preliminary phase difference time sequence into three categories: a first abnormal jump for representing 360 degrees, no abnormal jump, and a second abnormal jump for representing -360 degrees, to provide a basis for subsequent abnormal jump data point identification. Then, the standard deviation of each category of data and the absolute value of the difference between each data point and the median are calculated to identify abnormal jump data points deviating from the conventional fluctuation range. The abnormal jump data points are removed from the data points by a specified multiple of the standard deviation, to ensure the accuracy of the data. Finally, the data is further optimized by iteratively removing abnormal jump data points, to ensure that the phase difference time sequence is more stable and accurate. This method can improve the measurement speed while ensuring high measurement accuracy, effectively balancing the speed and accuracy of phase difference measurement.
[0034] In one embodiment, the method further comprises:
[0035] determining an absolute difference between a mean value of each two preliminary classification results;
[0036] merging the corresponding preliminary classification results to obtain a new classification result if the absolute difference is less than a preset distance threshold.
[0037] In one embodiment, the target phase difference time sequence is processed by averaging to obtain a target phase difference corresponding to the two sinusoidal signals, comprising:
[0038] In the target phase difference time sequence, a target classification result with the largest number of data points is obtained;
[0039] processing the data points in the target classification result by averaging to obtain a target mean value corresponding to the target classification result;
[0040] determining the target mean value as the target phase difference corresponding to the two sinusoidal signals.
[0041] The embodiment obtains the target classification result with the largest number of data points, selects the most representative signal data, ensures the accuracy of measurement and improves the processing speed. Then, by averaging the data points in the classification, the noise and short-term fluctuations are removed, further improving the measurement accuracy, while avoiding complex calculation steps, thereby ensuring a high processing speed. Finally, the target mean is determined as the final target phase difference, thereby ensuring the stability and reliability of the result. The overall method ensures high measurement accuracy while effectively improving the measurement speed, achieving a good balance between the two.
[0042] In a second aspect, the embodiment of the present application provides a phase difference measurement device of a sinusoidal signal, the device comprising:
[0043] a quadrature demodulation processing unit, configured to perform quadrature demodulation processing on the input two-way sinusoidal signals to obtain phase value time sequences of the two-way sinusoidal signals respectively;
[0044] a subtraction processing unit, configured to subtract the phase value time sequences of the two-way sinusoidal signals to obtain a preliminary phase difference value time sequence;
[0045] an abnormal jump processing unit, configured to identify and remove abnormal jump data points in the preliminary phase difference value time sequence to obtain a target phase difference value time sequence;
[0046] an averaging processing unit, configured to perform averaging processing on the target phase difference value time sequence to obtain a target phase difference corresponding to the two-way sinusoidal signals.
[0047] In a third aspect, the embodiment of the present application provides a computer device, comprising:
[0048] a memory and a processor, which are communicatively connected, and the memory stores computer instructions, and the processor executes the computer instructions to perform the phase difference measurement method of the sinusoidal signal.
[0049] In a fourth aspect, the embodiment of the present application provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the phase difference measurement method of the sinusoidal signal. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0051] Figure 1 A flow chart of a phase difference measurement method of a sinusoidal signal provided for an embodiment of the present application;
[0052] Figure 2 A flow chart of step S1 provided for an embodiment of the present application;
[0053] Figure 3 A flow chart of step S17 provided for an embodiment of the present application;
[0054] Figure 4 A flow chart of step S3 provided for an embodiment of the present application;
[0055] Figure 5 A flow chart of step S5 provided for an embodiment of the present application;
[0056] Figure 6 A flow chart of step S7 provided for an embodiment of the present application;
[0057] Figure 7 A schematic diagram of an implementation device provided for an embodiment of the present application;
[0058] Figure 8 A time series of phase values of two sinusoidal signals and A time series of preliminary phase difference values ;
[0059] Figure 9 A schematic diagram of a result of a tripartition clustering step in a cluster averager;
[0060] Figure 10 A schematic diagram of a result of an abnormal jump data point removing step in a cluster averager;
[0061] Figure 11 A schematic diagram of a result of a near cluster merging step in a cluster averager;
[0062] Figure 12 A relationship between maximum phase measurement error and average point number of four algorithms when signal-to-noise ratios are 0 dB in turn;
[0063] Figure 13 A relationship between maximum phase measurement error and average point number of four algorithms when signal-to-noise ratios are 6 dB in turn;
[0064] Figure 14 A relationship between maximum phase measurement error and average point number of four algorithms when signal-to-noise ratios are 10 dB in turn;
[0065] Figure 15 A relationship between maximum phase measurement error and average point number of four algorithms when signal-to-noise ratios are 20 dB in turn;
[0066] Figure 16 Fig. 6 is a diagram showing the relationship between the maximum phase measurement error and the average number of points for the four algorithms when the signal-to-noise ratio is 30 dB;
[0067] Figure 17 Fig. 7 is a diagram showing the relationship between the maximum phase measurement error and the average number of points for the four algorithms when the signal-to-noise ratio is 40 dB;
[0068] Figure 18 Fig. 8 is a diagram showing the relationship between the phase measurement error and the phase difference for the four algorithms;
[0069] Figure 19 Fig. 9 is a block diagram of a phase difference measurement device for a sinusoidal signal according to an embodiment of the present application;
[0070] Figure 20 Fig. 10 is a structural schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0072] In the field of signal processing, measuring the phase difference of two sinusoidal signals of the same frequency is a fundamental and widely applicable problem, involving multiple industries and fields such as communication, power, industrial control, medical and scientific instruments, image and audio processing, etc. Specific application scenarios include radar, sonar, power networks, motor control, optical sensors, and electroencephalogram, etc. Measuring the phase difference of signals plays a crucial role in achieving precise control and diagnosis.
[0073] According to the Nyquist sampling theorem, there is a positive correlation between the sampling time of a signal and the phase difference resolution, while there is a negative correlation between the sampling time and the noise amplitude. Therefore, there is an inherent contradiction between the measurement speed and accuracy of the phase difference. Under certain noise level and accuracy requirements, how to balance the sampling time, computational complexity, and measurement accuracy becomes a key problem.
[0074] Phase difference measurement algorithms can be mainly divided into two categories: high measurement speed algorithm and high measurement accuracy algorithm. High speed algorithm (such as zero crossing detection method, high frequency clock filling counting method and quadrature demodulation method) has low calculation complexity, is suitable for application occasions with high speed requirement, and usually uses simple hardware resources. In contrast, high measurement accuracy algorithm (such as cross-correlation function peak refinement, multiple signal classification (MUSIC) algorithm and FFT phase method) is suitable for application occasions with high accuracy requirement, but has high calculation complexity and needs a large amount of hardware resources.
[0075] In some practical applications, such as the initialization process of an astronomical radio telescope based on a phased array antenna, both high accuracy and high speed are required. Since high accuracy algorithms (such as MUSIC algorithm, FFT phase method, etc.) consume more computing resources, improvements need to be made in high speed algorithms to meet these requirements. Existing high speed algorithm improvement methods include multi-cycle signal averaging, narrowband filtering, Kalman filtering and wavelet transform, etc., but these methods often require more computing resources, especially hardware multipliers. At the same time, the method of taking the average of multiple measured phase differences may have a ±360-degree abnormal jump problem, resulting in measurement error.
[0076] Therefore, how to balance the measurement speed and the measurement accuracy in the phase difference measurement is a technical problem to be solved at present.
[0077] In order to solve the above technical problems, according to the embodiments of the present application, a phase difference measurement method for sinusoidal signals is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0078] In the present embodiment, a phase difference measurement method for sinusoidal signals is provided, Figure 1 The flowchart of the phase difference measurement method for sinusoidal signals provided in the present embodiment is shown in Figure 1 The flowchart includes the following steps:
[0079] Step S1, performing quadrature demodulation processing on the input two-way sinusoidal signals to obtain the phase value time sequence of the two-way sinusoidal signals.
[0080] Specifically, after power division of the input two-way sinusoidal signals, each way is first divided into two in-phase signals, one of which is phase-shifted by 90° to generate a cosine branch, and the other remains a sine branch; the two branches are then synchronously sampled by an analog-to-digital converter to form a pair of digital quadrature signals. The instantaneous phase is calculated point by point using the arctangent function of the ratio of the pair of quadrature signals, and then the folded phase is unfolded into a continuous curve of 0°-180° through "modulus + mapping", so that the time sequence of the phase value without jump is obtained; the whole process can be realized only by addition, subtraction, comparison and table lookup operations, which not only eliminates the ±180° discontinuity caused by traditional atan2 folding, but also significantly reduces the dependence on multipliers or FFT, laying a fast and robust digital foundation for subsequent high-precision and low-power phase difference measurement.
[0081] Step S3, subtracting the phase value time sequences of the two-way sinusoidal signals to obtain a preliminary phase difference value time sequence.
[0082] Specifically, the phase value time sequences of the two-way sinusoidal signals corrected to the continuous interval of 0°-180° are subtracted sample by sample to obtain a preliminary phase difference value time sequence; the difference directly reflects the true phase difference of the two-way signals in an ideal case, but due to measurement noise and ±180° folding residues, abnormal jump data points of ±360° may appear in the sequence, which are mixed with noise, causing a systematic deviation of up to ±180° by simple averaging, so subsequent steps are needed to identify and remove them to obtain an unbiased and low-noise final phase difference.
[0083] Step S5, identifying and removing abnormal jump data points in the preliminary phase difference value time sequence to obtain a target phase difference value time sequence.
[0084] Specifically, for the ±360° jump and measurement noise mixed in the preliminary phase difference value time sequence, it is first explicitly divided into three categories of "positive jump, no jump, and negative jump" by three-way clustering, and then the abnormal jump data points are removed in each category by the median criterion, and finally the sample set with the most points is retained; after the four-step processing of "classification-cleaning-merging-optimization", the abnormal jump is accurately stripped, and the remaining data has neither systematic deviation nor significantly reduced random noise, thereby obtaining a continuous and reliable target phase difference value time sequence, which lays a clean sample foundation for subsequent high-precision averaging.
[0085] Step S7, averaging the target phase difference value time sequence to obtain the target phase difference corresponding to the two-way sinusoidal signals.
[0086] Specifically, after deleting anomalous jump data points, the target phase difference time series retains only the core data points with high signal-to-noise ratios that correspond to the true phase difference. Averaging these data points directly approximates the true phase difference statistically. Therefore, the resulting target phase difference possesses the characteristics of being unbiased, having low variance, high precision, and high measurement speed.
[0087] This embodiment provides a method for measuring the phase difference of sinusoidal signals. It obtains the phase value time series of two sinusoidal signals through quadrature demodulation processing, then calculates the phase difference time series of the two sinusoidal signals, and removes abnormal jump data points to improve data accuracy. Finally, it performs averaging on the target phase difference time series to further smooth the data and ensure the stability and reliability of the measurement results. This process successfully balances measurement speed and accuracy, achieving both rapid phase difference acquisition and high measurement precision, thus realizing an effective balance between the two.
[0088] Figure 2 The flowchart for step S1 provided in the embodiments of this application may include the following steps:
[0089] Step S11: Perform power division processing on either of the two sinusoidal signals to obtain the first branch sinusoidal signal and the second branch sinusoidal signal corresponding to the sinusoidal signal.
[0090] Specifically, for either of the two sinusoidal signals... The power is divided into two identical signals, namely the first branch sinusoidal signal U. a,1 (t) and the second branch sinusoidal signal U a,2 (t), where U a,t U represents the signal voltage value of a sinusoidal signal a at time t. a,0 ω is the amplitude of a sinusoidal signal a, i.e., the maximum voltage value; ω is the angular frequency of the sinusoidal signal a, which is related to the frequency f0 of the signal, f0=ω / 2π; Let U be the initial phase of a sinusoidal signal 'a'. Therefore, the first branch sinusoidal signal U... a,1 (t) and the second branch sinusoidal signal U a,2 (t) is:
[0091]
[0092] in, This is the fixed phase shift of the power divider.
[0093] Step S13: Adjust the phase angle of the first branch sinusoidal signal, and perform analog-to-digital conversion on the first branch sinusoidal signal after phase angle adjustment to obtain the first branch digital signal.
[0094] Specifically, the first branch sinusoidal signal U a,1 (t) By using a 90-degree phase shifter, change U a,1 The phase of (t) is used to obtain the first branch digital signal U after phase angle adjustment. a,3 (t):
[0095]
[0096] This adjustment makes the original first-branch sine signal U... a,1 (t) becomes a cosine signal that is related to time t.
[0097] The first branch sinusoidal signal U after phase angle adjustment a,3 (t) Perform analog-to-digital conversion. The process of analog-to-digital conversion is the discretization of a continuous signal, using a sampling period T. s Discrete sampling is performed to obtain the first branch digital signal U. a,3 [n]:
[0098]
[0099] Wherein, the sampling frequency f s =1 / T s , satisfying f s ≥10f0, to ensure that the digital signal can record the details of the analog signal, where n is the sample number.
[0100] Step S15: Perform analog-to-digital conversion on the second branch sine signal to obtain the second branch digital signal.
[0101] Specifically, the second branch sinusoidal signal U a,2 (t) is converted from analog to digital to the second branch digital signal U. a,4 [n], that is:
[0102]
[0103] Step S17: Perform phase calculation based on the first branch digital signal and the second branch digital signal to obtain the phase value time series that matches any sinusoidal signal.
[0104] Specifically, the phase difference between the first and second branch digital signals can be obtained by calculating the ratio of their values. After calculating the phase difference using an efficient algorithm (such as atan2), a time series of phase values matching any sinusoidal signal is obtained. This series changes over time, reflecting the phase characteristics of the signal. Appropriate processing, such as modulo operations and angle adjustments, ensures that the calculated phase values are within a preset range, thereby avoiding discontinuities or errors.
[0105] The embodiment decomposes the original signal into two independent branch signals through power division processing, providing clear signal sources for subsequent phase calculation. Then, the phase angle of the first branch signal is adjusted and converted into a digital signal to improve accuracy and avoid accumulation of signal errors. The second branch signal is also converted into a digital signal through analog-to-digital conversion, simplifying the processing flow. Finally, through an efficient phase calculation method, the calculation speed can be improved on the basis of ensuring high accuracy. The entire process ensures measurement accuracy while improving calculation efficiency.
[0106] Figure 3 A flowchart of step S17 provided by the embodiment of the present application can include the following steps:
[0107] Step S171, obtaining an initial phase value according to the ratio between the first branch digital signal and the second branch digital signal.
[0108] Specifically, the initial phase value is calculated using the atan2 function:
[0109]
[0110] Since the signal U a,3 [n] is obtained through cosine transformation, U a,4 [n] is a sine transformation signal. By calculating the ratio and using the atan2 function, the phase difference between the signals can be obtained. The initial phase value output by atan2 falls between -180° and +180°. This phase value is initial, but may jump due to continuous sampling, especially when the signal undergoes periodic changes.
[0111] Step S173, performing a modulo operation on the initial phase value to obtain a modulo phase value.
[0112] Specifically, since the true phase is always increasing with time, a 360° jump (e.g., from +180° to -180°) will occur every time atan2 jumps from +180° to -180°, causing discontinuity. Therefore, a modulo operation is needed to map the phase value to the range of 0° to 360°. The purpose of this is to standardize all initial phase values to a relatively smooth range, eliminating discontinuity caused by phase jumps. Therefore, the initial phase value is moduloed by 360°:
[0113]
[0114] where h( ) represents the jump effect of the atan -1 ( ) function on continuous phase, and the initial phase value is moduloed by 360°.
[0115] Step S175, according to the preset angle range, the phase value after the modulo operation is adjusted to obtain the phase value time sequence matched with any one road sine signal.
[0116] Specifically, since the modulo operation only guarantees the interval to fall in 0°-360°, but 180° may still be discontinuous (because 180° and 360° are actually only 180° apart). Therefore, the phase value after the modulo operation needs to be adjusted to fold back 180°-360° to 0°-180°, and no longer appear ±180° jump. Specifically, the g function is used to adjust the phase value after the modulo operation:
[0117]
[0118] If the phase value after the modulo operation is between 0° and 180°, it remains unchanged; if the phase value after the modulo operation is between 180° and 360°, subtract 180° to map it to the range of 0° to 180°. In this way, the adjusted phase value can eliminate the phase jump caused by the atan2 function, so that the phase of the signal is continuous.
[0119] Similarly, for the processing of the other road sine signal, the obtained phase value time sequence is .
[0120] The embodiment according to the ratio of the first branch digital signal and the second branch digital signal, the initial phase value is quickly calculated, which ensures the calculation speed and provides accurate phase value. Then, the initial phase value is limited in a standardized range through the modulo operation, so as to eliminate the discontinuity caused by the phase value out of range, and ensure the stability of the calculation. Finally, the phase value after the modulo operation is adjusted according to the preset angle range, so that the phase value is smoothly transitioned, and the error caused by the extreme value jump is avoided. Through this series of processing, both the efficiency of the measurement speed and the high precision of the measurement result can be ensured, so as to realize the balance between speed and precision in the phase difference measurement.
[0121] Figure 4 The flowchart of step S3 provided by the embodiment of the present application can include the following steps:
[0122] Step S31, when the measurement result obtained by subtracting the phase value of one road sine signal from the phase value of the other road sine signal and adding the measurement noise is greater than or equal to zero, the measurement result or the measurement result minus the preset angle threshold is determined as the value of the phase difference value time sequence.
[0123] Specifically, the preliminary phase difference value time sequence At any sampling point n, considering the measurement noise ξ[n], the measurement result one of the following three:
[0124] (1) No jump:
[0125] (2) Negative jump:
[0126] (3) Positive jump:
[0127] Since ξ[n] is random, the true jump point is submerged by noise, and it is difficult to distinguish between jump and noise.
[0128]
[0129] The preset angle threshold is 360°, and if , it is considered that "may fall in +360° jump or no jump", and the value of the candidate phase difference value time sequence is or -360°.
[0130] In step S33, when the phase value of one sinusoidal signal is subtracted from the phase value of another sinusoidal signal, and the measurement result after adding the measurement noise is less than zero, the measurement result or the measurement result plus the preset angle threshold is determined as the value of the phase difference value time sequence.
[0131] Specifically,
[0132]
[0133] If , it is considered that "may fall in -360° jump or no jump", and the value of the candidate phase difference value time sequence is or +360°.
[0134] It should be noted that the purpose of steps S31 to S33 is to list all possible candidate values, and the subsequent steps are required to identify which one is the "true value".
[0135] In this embodiment, when the calculated phase difference plus the noise result is greater than or equal to zero, the value or the value minus the preset angle threshold is directly determined as the phase difference; if it is less than zero, the value or the value plus the preset angle threshold is determined as the phase difference, so as to ensure the accuracy of the phase difference value. In this way, the phase difference can be quickly identified and adjusted while ensuring high precision, avoiding complex operation process, and significantly improving the measurement speed and accuracy.
[0136] Figure 5 The flowchart of step S5 provided in the embodiment of the application can include the following steps:
[0137] Step S51, classifying the preliminary phase difference value time series to obtain a preliminary classification result; the preliminary classification result includes a first abnormal jump for representing +360°, no abnormal jump, and a second abnormal jump for representing -360°.
[0138] Specifically, the preliminary phase difference value time series is classified into a preliminary classification result including three types of data points by using a clustering algorithm, including a first abnormal jump of +360°, no abnormal jump, and a second abnormal jump of -360°. The clustering algorithm includes but is not limited to K-means, AGNES, GMM, etc.
[0139] Step S53, determining the standard deviation corresponding to any preliminary classification result, and determining the absolute value of the difference between each data point and the median in the preliminary classification result to which the data point belongs.
[0140] Specifically, the standard deviation of the three types of data points is calculated respectively, and the absolute value of the difference between each data point and the median in the preliminary classification result to which the data point belongs is determined.
[0141] Step S55, determining the data points with an absolute value greater than a specified multiple of the standard deviation as abnormal jump data points.
[0142] Specifically, the data points with an absolute value greater than a specified multiple of the standard deviation are determined as abnormal jump data points. Preferably, the specified multiple is 3.
[0143] In a preferred embodiment, the method further comprises: determining the absolute difference between the means of any two preliminary classification results; in the case that the absolute difference is less than a preset distance threshold, merging the corresponding preliminary classification results to obtain a new classification result.
[0144] Specifically, the means of the three types of data points are calculated respectively, and the absolute difference between any two current means is calculated; if the absolute difference is less than 60 degrees, it indicates that they are likely to be the same true phase difference affected by noise and misclassified into two clusters, so the two types are merged into one type; if all pairwise absolute differences are greater than or equal to 60 degrees, the original three-part structure is maintained. In this way, the redundancy caused by over-classification can be eliminated, and the sample can be further simplified and the robustness of the final mean can be improved.
[0145] Step S57, deleting the abnormal jump data points from the preliminary classification result to which the data points belong to obtain a target phase difference value time series.
[0146] The abnormal jump data points are deleted from the preliminary classification result to which the data points belong, the standard deviation of the three types of data points is recalculated, and steps S53 to S55 are iterated until all abnormal jump data points are deleted to obtain a target phase difference value time series.
[0147] The embodiment classifies the preliminary phase difference value time sequence into three categories: a first abnormal jump for representing 360 degrees, no abnormal jump, and a second abnormal jump for representing -360 degrees, to provide a basis for subsequent abnormal jump data point identification. Then, the standard deviation of each category of data and the absolute value of the difference between each data point and the median are calculated to identify abnormal jump data points deviating from the conventional fluctuation range. The abnormal jump data points are removed from the data points by a specified multiple of the standard deviation, ensuring the accuracy of the data. Finally, the data is further optimized by iteratively removing abnormal jump data points, ensuring that the phase difference value time sequence is more stable and accurate. This method can improve the measurement speed while ensuring high measurement accuracy, effectively balancing the speed and accuracy of phase difference measurement.
[0148] Figure 6 A flowchart of step S7 provided by the embodiment of the present application can include the following steps:
[0149] Step S71, in the target phase difference value time sequence, the target classification result with the most data points is obtained.
[0150] Specifically, the target classification result with the most data points is determined from the target phase difference value time sequence. The target classification result with the most data points is more likely to represent the mainstream trend in the data rather than a few abnormal data points. Therefore, selecting this classification result as the target classification result can ensure that the target phase difference calculated has strong representativeness.
[0151] Step S73, the data points in the target classification result are averaged to obtain the corresponding target mean value.
[0152] Specifically, once the target classification result is determined, all data points in the target classification result are averaged. The purpose of this step is to reduce noise and fluctuations by averaging the data points, especially after removing the abnormal jump data points, the residual data points may still have some small fluctuations. By calculating the average of these data points, errors caused by small fluctuations can be effectively suppressed, making the result more stable.
[0153] Step S75, the target mean value is determined as the target phase difference corresponding to the two sinusoidal signals.
[0154] Specifically, the target mean value obtained is determined as the target phase difference corresponding to the two sinusoidal signals. This target mean value represents the most reliable phase difference value after removing abnormal jump data and noise interference. In this way, the finally determined target phase difference is more accurate, reflecting the true phase difference relationship of the two sinusoidal signals.
[0155] The embodiment selects the most representative signal data by obtaining the target classification result with the largest number of data points, ensures the accuracy of measurement and improves the processing speed. Then, by averaging the data points in the classification, the noise and short-term fluctuations are removed, further improving the measurement accuracy, while avoiding complex calculation steps, thereby ensuring a high processing speed. Finally, the target mean is determined as the final target phase difference, thereby ensuring the stability and reliability of the results. The overall method ensures high measurement accuracy while effectively improving the measurement speed, achieving a good balance between the two.
[0156] The specific implementation of the present application will be described below in combination with a specific implementation device. Referring to Figure 7 , it is assumed that the frequency f0=10 MHz of a sinusoidal signal a and another sinusoidal signal b, the sampling frequency f s =2 GHz of the first analog-to-digital converter, the second analog-to-digital converter, the third analog-to-digital converter and the fourth analog-to-digital converter, the phase difference of the sinusoidal signal a and the sinusoidal signal b is randomly distributed between-180 degrees and +180, the amplitudes of the two sinusoidal signals are normalized to 1, and the Gaussian white noise with the same variance and zero mean is contained, and the signal-to-noise ratio is defined as:
[0157]
[0158] where s(t) is the true signal analog voltage value, n(t) is the noise analog voltage value, and var[] is the variance.
[0159] The sinusoidal signal passes through the first power divider for power division processing to obtain the first branch sinusoidal signal U a,1 (t) and the second branch sinusoidal signal U a,2 (t). The first branch sinusoidal signal U a,1 (t) passes through the first 90-degree phase shifter and the first analog-to-digital converter in turn to obtain the first branch digital signal U a,3 [n]. The second branch sinusoidal signal U a,2 (t) passes through the second analog-to-digital converter to obtain the second branch digital signal U a,4 [n]. The first branch digital signal and the second branch digital signal pass through the first atan2 phase to obtain the phase value time sequence .
[0160] The other sinusoidal signal passes through the second power divider for power division processing to obtain the third branch sinusoidal signal U b,1 (t) and the fourth branch sinusoidal signal U b,2 (t). The third branch sinusoidal signal U b,1 (t) passes through the second 90-degree phase shifter and the third analog-to-digital converter in turn to obtain the third branch digital signal Ub,3 [n]. The fourth branch sinusoidal signal U b,2 (t) is passed through a fourth analog-to-digital converter to obtain a second branch digital signal U b,4 [n]. The first branch digital signal and the second branch digital signal are passed through a second atan2 phase detector to obtain another sinusoidal signal matching phase value time sequence .
[0161] Then, the sinusoidal signal matching phase value time sequence and the other sinusoidal signal matching phase value time sequence are passed through a subtractor to obtain a preliminary phase difference value time sequence . Please refer to Figure 8 for the sinusoidal signal phase value time sequence and and the preliminary phase difference value time sequence . The sinusoidal signal a phase value time sequence Because ωT s n increases with time, when the output phase of the first atan2 phase detector increases to just over 180 degrees, it will fold back to -180 degrees and then re-increase. The sinusoidal signal b phase value time sequence is the same. , The actual phase difference between the two sinusoidal signals is 28.4 degrees, which can be known from Figure 8 As the sinusoidal signals a and b increase to 180 degrees and then fold back to -180 degrees, the measured phase difference between the two sinusoidal signals jumps between 28.4 degrees, 28.4 degrees-360 degrees (-331.6 degrees) and 28.4 degrees+360 degrees (388.4 degrees), and due to the existence of noise, it also fluctuates around the above three values. Therefore, considering the measurement noise, the preliminary phase difference value time sequence between the two sinusoidal signals will have three values, i.e.
[0162]
[0163] wherein ξ[n] is a measurement noise value time sequence, . Therefore, the phase difference measured multiple times has an abnormal jump of ±360 degrees, which is mixed with noise fluctuations, making it difficult to identify or eliminate the abnormal jump, thereby causing a large and unstable average value error. In order to solve the above problem, the preliminary phase difference value time sequence is passed through a clustering averager to perform three-part clustering, remove abnormal jump data points, merge similar classes, take averages, etc. to obtain the final target phase difference.
[0164] Please refer to Figure 9For the results of the three-part clustering step in the cluster averager, it can be seen from the schematic diagram that it divides most of the data with a mean of 28.4 degrees into the first class, a small part of the data with a mean of 28.4 degrees into the second class, and data with a mean of 28.4 degrees-360 degrees (-331.6 degrees) and 28.4 degrees+360 degrees (388.4 degrees) into the third class. The classification result is not completely accurate, so subsequent steps are needed to improve the accuracy of the classification.
[0165] Referring to Figure 10 For the results of the cluster averager removing abnormal jump data points step, it can be seen from the schematic diagram that it removes the data with a mean of 28.4 degrees+360 degrees (388.4 degrees) from the third class as outliers.
[0166] Referring to Figure 11 For the results of the cluster averager merging near classes step, it can be seen from the schematic diagram that it merges the first class and the second class with a close mean into one class, i.e., all data with a mean of 28.4 degrees are divided into one class. After the three steps of three-part clustering, removing abnormal jump data points, and merging near classes, the phase difference value data containing ±360-degree abnormal jumps are correctly classified with a high probability, but are still subject to noise interference, and there is still a possibility of being misclassified. From the maximum class, among the two or three data points after the above steps, the mean of the class with the most points (i.e., the first class with a mean of 28.4 degrees) is selected as the phase difference value after removing abnormal jumps and suppressing noise through averaging, at the cost of about one time the most measured data points, to further reduce the influence of misclassification on the mean value, and to ensure the unbiasedness of the measurement.
[0167] For the relationship between the maximum measurement error and the average number of points of the four algorithms when the signal-to-noise ratio is 0 dB, 6 dB, 10 dB, 20 dB, 30 dB, and 40 dB, respectively. Four methods of direct averaging, ±180-degree averaging, cluster averaging, and FFT phase are selected to measure the phase difference of sinusoidal signals a and b. Direct averaging, ±180-degree averaging, and cluster averaging all use quadrature demodulation to measure the phases of sinusoidal signals a and b, respectively, and then directly subtract to generate a phase difference time series, i.e., the functions implemented by the first power divider, the first 90-degree phase shifter, the first analog-to-digital converter, the second analog-to-digital converter, the first atan2 phase, the second power divider, the second 90-degree phase shifter, the third analog-to-digital converter, the fourth analog-to-digital converter, the second atan2 phase, and the subtracter in this embodiment.
[0168] The difference among the three methods of direct average, average within ±180 degrees and cluster average is that the direct average method takes the average of all data points of the phase difference time series, the average within ±180 degrees selects the data points within the range of ±180 degrees in the time series, and the cluster average takes the average of the data points after the above three cluster steps, removing abnormal jump data points, merging near classes and taking the average of the maximum class. The FFT phase method first takes the FFT transform of the sampling time series U a,4 [n] of the sinusoidal signal a to get the frequency spectrum X a,4 [m], then estimates the frequency f0 of the sinusoidal signal according to the amplitude maximum value method, and then calculates the frequency offset δ according to the three-point method:
[0169]
[0170] wherein the frequency spectrum X a,4 [m] is a complex number, || represents the amplitude, and the more accurate frequency estimation of the sinusoidal signal is:
[0171]
[0172] wherein is the frequency resolution of the FFT transform, and if the total number of data points of the sampling time series U a,4 [n] of the sinusoidal signal a is N, then The phase measurement value of the corrected sinusoidal signal a is:
[0173]
[0174] wherein angle( ) represents the phase angle, and the above correction steps can reduce the influence of the FFT fence effect and the spectrum leakage problem on the phase measurement. The phase measurement value of the sinusoidal signal b is the same, and then the phase difference value is calculated by difference.
[0175] Please refer to Figure 12-17The maximum phase measurement error and the average number of points of the four algorithms when the signal-to-noise ratio is 0 dB, 6 dB, 10 dB, 20 dB, 30 dB and 40 dB, respectively. The direct average, ±180-degree average, clustering average and FFT phase four methods are represented by red, green, blue and pink solid lines, respectively. The horizontal axis is the average number of points, that is, the total number of data points of the phase difference time series. The total number of data points is 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 12 cases. In the simulation, the phase difference is uniformly spaced between -180 degrees and +180 degrees, taking 40 points. For each point, 15 different random numbers are used to simulate noise to generate two sinusoidal signal time series, then the above four methods are used to measure the phase difference and the measurement error is counted. The average value of the 15 groups of data is taken, and the maximum phase measurement error on the vertical axis represents the maximum error obtained by the above method for 40 phase difference values, with the unit of degree. Figure 18 The relationship between the phase measurement error of the four algorithms and the phase difference.
[0176] According to Figure 12-17 It can be seen that under different signal-to-noise ratios, with the increase of the average number of points, the maximum phase measurement error of the direct average method is always close to 180 degrees. From Figure 18 It can be seen that the maximum error of the direct average method occurs when the phase difference is close to ±180 degrees, because the phase difference measured by the quadrature demodulation method will randomly jump around ±180 degrees, so that the total average value is close to 0 degrees.
[0177] When the signal-to-noise ratio is not more than 20 dB, with the increase of the average number of points, the maximum phase measurement error of the positive and negative 180-degree average method increases. This is because with the increase of the number of sampling points, the total length of the sampling time series exceeds the period of the sinusoidal signal, resulting in the introduction of more abnormal jumps. When the signal-to-noise ratio is more than 20 dB, with the increase of the average number of points, the maximum phase measurement error of the positive and negative 180-degree average method gradually decreases, because the higher signal-to-noise ratio can effectively filter out the influence of abnormal jumps. Figure 18 Further shows that the maximum phase measurement error of the positive and negative 180-degree average method also occurs when the phase difference is close to ±180 degrees, and the reason is the same as that of the direct average method. Overall, the abnormal jump filtering capability of the positive and negative 180-degree average method is limited, and it is suitable for application occasions with signal-to-noise ratio higher than 20 dB.
[0178] When the signal-to-noise ratio is not more than 6 dB, the maximum phase measurement error of the cluster average method gradually decreases with the increase of the average point number, and the error value is always not more than 10 degrees, which shows the significant advantage of the cluster average method in screening and removing abnormal jump influence. Especially when the average point number is not more than 256 points, the maximum phase measurement error of the cluster average method is almost always less than that of the FFT phase method, and the measurement accuracy advantage is more obvious with the decrease of the average point number or the increase of the signal-to-noise ratio.
[0179] Correspondingly, please refer to Figure 19 A block diagram of a phase difference measurement device of a sinusoidal signal provided by an embodiment of the present application, the device comprising:
[0180] The quadrature demodulation processing unit 101 is configured to perform quadrature demodulation processing on the input two-way sinusoidal signals, and obtain phase value time sequences of the two-way sinusoidal signals respectively.
[0181] The subtraction processing unit 103 is configured to subtract the phase value time sequences of the two-way sinusoidal signals to obtain a preliminary phase difference value time sequence.
[0182] The abnormal jump processing unit 105 is configured to identify and remove abnormal jump data points in the preliminary phase difference value time sequence to obtain a target phase difference value time sequence.
[0183] The average processing unit 107 is configured to perform average processing on the target phase difference value time sequence to obtain a target phase difference corresponding to the two-way sinusoidal signals.
[0184] In some optional embodiments, the quadrature demodulation processing unit 101 comprises:
[0185] The power division processing is performed on any one of the two-way sinusoidal signals to obtain a first branch sinusoidal signal and a second branch sinusoidal signal corresponding to the any one of the two-way sinusoidal signals.
[0186] The phase angle of the first branch sinusoidal signal is adjusted, and the first branch digital signal is obtained by performing analog-to-digital conversion on the first branch sinusoidal signal after the phase angle adjustment.
[0187] The second branch digital signal is obtained by performing analog-to-digital conversion on the second branch sinusoidal signal.
[0188] The phase calculation is performed according to the first branch digital signal and the second branch digital signal to obtain a phase value time sequence matched with the any one of the two-way sinusoidal signals.
[0189] In some optional embodiments, the phase calculation is performed according to the first branch digital signal and the second branch digital signal to obtain a phase value time sequence matched with the any one of the two-way sinusoidal signals, comprising:
[0190] According to a ratio between the first branch digital signal and the second branch digital signal, an initial phase value is obtained;
[0191] A modulo operation is performed on the initial phase value to obtain a phase value after the modulo operation;
[0192] According to a preset angle range, the phase value after the modulo operation is adjusted to obtain a phase value time sequence matched with any one sinusoidal signal.
[0193] In some optional embodiments, the subtraction processing unit 103 comprises:
[0194] When a measurement result obtained by subtracting a phase value of another sinusoidal signal from a phase value of one sinusoidal signal and adding a measurement noise is greater than or equal to zero, the measurement result or the measurement result minus a preset angle threshold is determined as a value of the phase difference value time sequence;
[0195] When the measurement result obtained by subtracting the phase value of another sinusoidal signal from the phase value of one sinusoidal signal and adding the measurement noise is less than zero, the measurement result or the measurement result plus the preset angle threshold is determined as the value of the phase difference value time sequence.
[0196] In some optional embodiments, the abnormal jump processing unit 105 comprises:
[0197] The preliminary phase difference value time sequence is classified to obtain a preliminary classification result; the preliminary classification result comprises a first abnormal jump for representing 360 degrees, no abnormal jump, and a second abnormal jump for representing -360 degrees;
[0198] A standard deviation corresponding to any one preliminary classification result is determined, and an absolute value of a difference between each data point and a median in the preliminary classification result to which the data point belongs is determined;
[0199] A data point with an absolute value greater than a specified multiple of the standard deviation is determined as an abnormal jump data point;
[0200] The abnormal jump data point is deleted from the preliminary classification result to which the abnormal jump data point belongs, to obtain a target phase difference value time sequence.
[0201] In some optional embodiments, the apparatus further comprises:
[0202] An absolute difference between a mean of each two preliminary classification results is determined;
[0203] In a case where the absolute difference is less than a preset distance threshold, the corresponding preliminary classification results are merged to obtain a new classification result.
[0204] In some optional embodiments, the average processing unit 107 comprises:
[0205] In the target phase difference time series, obtain the target classification result with the largest number of data points;
[0206] The data points in the target classification results are averaged to obtain the corresponding target mean.
[0207] The target mean is determined as the target phase difference between the two sinusoidal signals.
[0208] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0209] In this embodiment, a phase difference measurement device for a sinusoidal signal is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0210] Please see Figure 20 , Figure 20 This application provides a schematic diagram of the structure of a computer device, as shown in the embodiment of the present application. Figure 20 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 20 Take a processor 10 as an example.
[0211] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0212] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.
[0213] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, etc. The data storage area can store data created according to the use of the computer device, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory such as at least one disk storage device, a flash memory device, or other non-transitory solid state memory device. In some alternative embodiments, the memory 20 can optionally include memory that is remotely located with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0214] The memory 20 can include a volatile memory such as a random access memory, and can also include a non-volatile memory such as a flash memory, a hard disk, or a solid state disk. The memory 20 can also include a combination of the above-mentioned types of memory.
[0215] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0216] The embodiments of the present application also provide a computer readable storage medium. The above-mentioned method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium through network downloading of original computer code and stored in a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that the computer, processor, microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the method shown in the above embodiments.
[0217] The apparatuses and units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0218] For the convenience of description, the above apparatus is described in various units by function for separate description. Of course, the functions of the units can be implemented in one or more software and / or hardware in implementing the present application.
[0219] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, and apparatus. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0220] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and apparatuses according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate an apparatus for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flowcharts and / or block diagrams.
[0221] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flowcharts and / or block diagrams.
[0222] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one flow or multiple flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flowcharts and / or block diagrams.
[0223] It should also be noted that the terms "comprising", "comprises" or other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0224] Various embodiments are described herein with reference to the drawings. The same or like elements in the drawings are denoted by the same reference numerals, and a repeated description is omitted. Each of the various embodiments described in the specification is described in a progressive manner, and the same or similar parts between the various embodiments can be mutually referred to. Each of the various embodiments focuses on the difference from other embodiments. In particular, the device embodiments are described simply because they are substantially similar to the method embodiments, and the relevant parts can be referred to the description of the method embodiments.
[0225] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
[0226] Although the embodiments of the present application are described in conjunction with the drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A method of measuring the phase difference of a sinusoidal signal, characterized by, The method comprises: performing quadrature demodulation processing on the input two-way sinusoidal signals to obtain phase value time sequences of the two-way sinusoidal signals respectively; subtracting the phase value time sequences of the two-way sinusoidal signals to obtain a preliminary phase difference value time sequence; classifying the preliminary phase difference value time sequence to obtain a preliminary classification result; the preliminary classification result comprises a first abnormal jump for representing 360 degrees, no abnormal jump, and a second abnormal jump for representing -360 degrees; determining a standard deviation corresponding to any preliminary classification result, and determining an absolute value of a difference between each data point and a median in the preliminary classification result to which the data point belongs; determining a data point as an abnormal jump data point when the absolute value is greater than a specified multiple of the standard deviation; deleting the abnormal jump data point from the preliminary classification result to which the abnormal jump data point belongs to obtain a target phase difference value time sequence; determining a target classification result as a type with the largest number of data points in the target phase difference value time sequence; performing average processing on the data points in the target classification result to obtain a target mean value corresponding to the target classification result; and determining the target mean value as a target phase difference corresponding to the two-way sinusoidal signals.
2. The method of claim 1, wherein, The quadrature demodulation processing on the input sinusoidal signals to obtain phase value time sequences of two-way sinusoidal signals comprises: performing power division processing on any one of the two-way sinusoidal signals to obtain a first branch sinusoidal signal and a second branch sinusoidal signal corresponding to the any one of the two-way sinusoidal signals; performing phase angle adjustment on the first branch sinusoidal signal, and performing analog-to-digital conversion on the first branch sinusoidal signal after the phase angle adjustment to obtain a first branch digital signal; performing analog-to-digital conversion on the second branch sinusoidal signal to obtain a second branch digital signal; performing phase calculation according to the first branch digital signal and the second branch digital signal to obtain a phase value time sequence matched with the any one of the two-way sinusoidal signals.
3. The method of claim 2, wherein, The phase calculation according to the first branch digital signal and the second branch digital signal to obtain a phase value time sequence matched with the any one of the two-way sinusoidal signals comprises: obtaining an initial phase value according to a ratio between the first branch digital signal and the second branch digital signal; performing a modulo operation on the initial phase value to obtain a phase value after the modulo operation; adjusting the phase value after the modulo operation according to a preset angle range to obtain the phase value time sequence matched with the any one of the two-way sinusoidal signals.
4. The method of claim 1, wherein, The subtraction of the phase value time sequences of the two-way sinusoidal signals to obtain a preliminary phase difference value time sequence comprises: when a measurement result obtained by subtracting a phase value of one of the two-way sinusoidal signals from a phase value of the other one of the two-way sinusoidal signals and adding a measurement noise is greater than or equal to zero, determining the measurement result or the measurement result minus a preset angle threshold as a value of the phase difference value time sequence; when the measurement result obtained by subtracting the phase value of one of the two-way sinusoidal signals from the phase value of the other one of the two-way sinusoidal signals and adding the measurement noise is less than zero, determining the measurement result or the measurement result plus the preset angle threshold as the value of the phase difference value time sequence.
5. The method of claim 1, wherein, After the abnormal jump data points are deleted from the preliminary classification results, the method further comprises: determining the absolute difference between the mean values of each two preliminary classification results; in the case where the absolute difference is less than a preset distance threshold, merging the corresponding preliminary classification results to obtain a new classification result; obtaining the target phase difference time sequence according to the new classification result.
6. An apparatus for implementing the method of measuring the phase difference of a sinusoidal signal according to any one of claims 1 to 5, characterized in that, The device comprises: a quadrature demodulation processing unit configured to perform quadrature demodulation processing on the input two-channel sinusoidal signals to obtain phase value time sequences of the two-channel sinusoidal signals respectively; a subtraction processing unit configured to subtract the phase value time sequences of the two-channel sinusoidal signals to obtain a preliminary phase difference time sequence; an abnormal jump processing unit configured to identify and remove abnormal jump data points in the preliminary phase difference time sequence to obtain a target phase difference time sequence; an average processing unit configured to perform average processing on the target phase difference time sequence to obtain a target phase difference corresponding to the two-channel sinusoidal signals.
7. A computer device, comprising: comprise: a memory and a processor, which are communicatively connected, and the memory stores computer instructions, and the processor executes the computer instructions to perform the phase difference measurement method of the sinusoidal signal according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the phase difference measurement method of the sinusoidal signal according to any one of claims 1 to 5.
Citation Information
Patent Citations
UQPSK coherent demodulation method and system
CN115695124A
Phase difference detection circuit and its method, phase comparator having the phase difference detection circuit, phase locked loop circuit having the phase difference comparation circuit and optical disk drive servo device using the phase locked loop circuit
JP2000076667A