A method for measuring the signal-to-noise ratio of sinusoidal signals
By a sampling signal, the zero-crossing time series is obtained and integrated processing is performed. Combined with standard deviation calculation, the problem of low signal-to-noise measurement accuracy and large calculation amount in the prior art is solved, and efficient and accurate signal-to-noise measurement is achieved. , suitable for embedded systems.
Patent Information
- Application Number
- CN202210505123.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-10
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-05-10
AI Technical Summary
In the prior art, the measurement accuracy of the sinusoidal signal signal-to-noise ratio is inaccurate and the calculation amount is too large, and efficient measurement methods are lacking.
A sine signal signal-to-noise ratio measurement method is designed, and the zero-crossing time series is obtained by sampling signals, the digital starting integral point time is calculated, rectangular or trapezoidal interpolation and integration are performed, and the signal-to-noise ratio of the signal is calculated based on the standard deviation, and the signal-to-noise ratio of the signal is optimized. The determination and integration process of zero point.
It improves the accuracy and efficiency of signal-to-noise ratio measurement, reduces the computational complexity, and is suitable for applications in embedded systems.
Smart Images

Figure CN114966198B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for measuring a sinusoidal signal signal-to-noise ratio, and belongs to the technical field of signal signal-to-noise ratio measurement. Background Art
[0002] In actual applications, the device will receive useful signals that need to be processed by the device, as well as irregular noise that does not exist in the useful signal. The ratio of the power of the useful signal to the power of the interference noise in the received signal is called the signal-to-noise ratio (SNR). The useful signal power and noise power are measured by the effective values of all samples of the received signal sequence and noise sequence, respectively. The signal-to-noise ratio is an important parameter that can be measured in real time and can reflect the characteristics of the system in real time. It is an important indicator for measuring the performance of the receiver. However, the existing technology for measuring the signal-to-noise ratio of sinusoidal signals does not have a systematic, complete, and accurate process. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method for measuring the signal-to-noise ratio of a sinusoidal signal, which adopts a new design strategy and can solve the shortcomings of inaccurate signal-to-noise ratio measurement accuracy or excessive amount of calculation during the measurement process in the prior art, thereby improving the signal-to-noise ratio measurement efficiency.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solution: the present invention designs a sinusoidal signal signal-to-noise ratio measurement method for obtaining the signal-to-noise ratio of a target sinusoidal signal, wherein the target sinusoidal signal is a target sinusoidal digital signal, comprising the following steps:
[0005] Step A: Sampling the target periodic signal to obtain a sampling signal, and then proceeding to step B;
[0006] Step B: Obtain a continuous zero-crossing time series T after at least two cycles of the sampling signal have both passed the negative peak or the positive peak by analog or digital methods. z1 , …, T zk , …, T zK , K represents the number of zero-crossing times in the continuous zero-crossing time series, T zk represents the kth zero-crossing time in the continuous zero-crossing time sequence, then initializes j=K+1, and enters step C;
[0007] Step C. According to T z(j-1) , …, T z(j-m) , calculate the average period T, and further according to the preset parameter c in the range of (0.5, 1), press T sj =T z(j-1) +T×c, calculate the jth zero-crossing time T zj The corresponding digital starting integration point time T sj, then enter step D, where 1<m<j, T zj represents the jth zero-crossing time;
[0008] Step D: Based on each sampling point on the sampled signal, select the time T corresponding to the digital starting integration point sj The two adjacent sampling points constitute the first sampling point to be analyzed and the second sampling point to be analyzed in sequence, and the time corresponding to the sampling point to be analyzed and the sampling value corresponding to the sampling point to be analyzed are combined to form the coordinates of the sampling point to be analyzed, and then enter step E;
[0009] Step E. According to the digital starting integration point time T sj , through rectangular interpolation or trapezoidal interpolation, obtain the value T between the first sampling point and the second sampling point sj The corresponding sample value x sj , which constitutes the coordinates of the starting point of the numerical integration (T sj , x sj ), then initialize v=2, and sequentially define the first sampling point to be analyzed and each sampling point after the second sampling point to be analyzed on the sampling signal as each sampling point to be analyzed, and enter step F;
[0010] Step F: Perform a digital integration operation on the sampling signal from the coordinate position of the digital integration starting point to the coordinate position of the vth sampling point to be analyzed, forming a digital integration result S v ; and perform a digital integration operation on the sampling signal from the coordinate position of the digital integration starting point to the coordinate position of the v+1th sampling point to be analyzed, forming a digital integration result S v+1 , then go to step G;
[0011] Step G. Determine the digital integration result S v And the numerical integration result S v+1 Is the product of greater than 0? If yes, then add 1 to the value of v and return to step F; otherwise, go to step H;
[0012] Step H. Based on the condition that the sum of the digital integration from the digital integration start point to the digital integration end point is zero, the coordinates of the digital integration end point located between the vth sampling point to be analyzed and the v+1th sampling point to be analyzed are obtained by rectangular interpolation or trapezoidal interpolation (T ej , x ej ), then proceed to step I;
[0013] Step I. Press Get the jth zero-crossing time T zj ; Press T further tj =T ej -T sj , get the jth zero-crossing time Tzj The corresponding integration time T tj , which constitutes the jth target zero-crossing time T zj The corresponding integration time T tj ; Then proceed to step J;
[0014] Step J: According to the target zero-crossing time T zj , press T p(j-1) =T zj -T z(j-1) To obtain the measured signal period, press Obtain the frequency of the signal under test, and then proceed to step K;
[0015] Step K. Determine the signal zero-crossing time series {T z(K+1) , ..., T zj} is less than the preset threshold w+1, if yes, go to step N; otherwise, perform the following operation: t(K+1) , ..., T ti} Select the latest w integral durations and calculate the average integral duration T ta , converted into the count value n corresponding to the sampling period multiple; from the signal period sequence {T p(K+1) , ..., T p(j-1)} Select the latest w signal cycles generated in the calculation to obtain the cycle average value T pa , converted into the count value N corresponding to the sampling period multiple, and then enter step L;
[0016] Step L. Based on the signal period sequence {T p(K+1) , ..., T p(j-1)}, and calculate the standard deviation σ of the w signal cycles generated most recently. T ,pass Get the parameter σ R ; or by the signal frequency sequence {F (K+1) , ..., F (j-1)}, select the latest w signal frequencies generated, and calculate the standard deviation σ of the obtained frequencies F ,pass Get the parameter σ R , then proceed to step M;
[0017] Step M: According to the count values n, N, and parameter σ R , combined with Calculate and obtain the signal-to-noise ratio (SNR) of the target sinusoidal signal, where A is the peak value of the sinusoidal signal and σ is the effective value of the noise signal, and then proceed to step N;
[0018] Step N: Update the value of j by adding 1 and return to step C.
[0019] As a preferred technical solution of the present invention: in step C, according to T z(j-1) , …, T z(j-m) ,according to The average period T is calculated.
[0020] As a preferred technical solution of the present invention: in the step A, an equal time interval sampling method or an unequal time interval sampling method is adopted to sample the target periodic signal to obtain a sampling signal; a whole cycle sampling is performed on the target periodic signal to obtain a sampling signal.
[0021] As a preferred technical solution of the present invention: the digital integration operation in step F is trapezoidal integration or rectangular integration.
[0022] As a preferred technical solution of the present invention: in the step M, according to the count values n, N, and the parameter σ R , combined with Use any of the following four formulas:
[0023]
[0024]
[0025]
[0026]
[0027] Calculate the signal-to-noise ratio (SNR) of the target sinusoidal signal.
[0028] The method for measuring the signal-to-noise ratio of a sinusoidal signal described in the present invention, using the above technical solution, has the following technical effects compared with the prior art:
[0029] The traditional zero-crossing method uses two consecutive points with opposite signs to determine the zero-crossing point. Although the algorithm has a clear physical concept, it is easily interfered by harmonics, noise, etc., and the measurement accuracy is low. The sinusoidal signal signal-to-noise ratio measurement method designed by the present invention is based on the characteristic that most target sinusoidal digital signals are symmetrical. According to the calculated integration start time, a linear interpolation operation is performed to select a sampling point P. SAs the starting point of integration, digital integration is then performed, and an integration end point is obtained by interpolation, so that the digital integral from the integration starting point to the integration end point is zero, and the zero point of the electrical signal is calculated by the sampling occurrence time of the integration starting point and the virtual occurrence time of the integration end point. After determining the zero-crossing point of the signal, the frequency and period of the electrical signal can be calculated, and the signal-to-noise ratio of the sinusoidal signal can be further calculated. The accuracy of the corresponding signal-to-noise ratio measurement is also greatly improved, and the design method is very convenient and simple when performing calculations, and is suitable for use in embedded systems.
[0030] Similarly, in order to solve the above technical problems, the present invention adopts the following technical solution: the present invention designs a sinusoidal signal signal-to-noise ratio measurement method for obtaining the signal-to-noise ratio of a target sinusoidal signal, wherein the target sinusoidal signal is a target sinusoidal analog signal, comprising the following steps:
[0031] Step i. Obtaining a continuous zero-crossing time series T after at least two cycles of the sampling signal have both passed the negative peak or the positive peak by analog or digital methods z1 , …, T zk , …, T zK , K represents the number of zero-crossing times in the continuous zero-crossing time series, T zk represents the kth zero-crossing time in the continuous zero-crossing time series, then initialize j=K+1, and enter step ii;
[0032] Step ii. According to T z(j-1) , …, T z(j-m) , calculate the average period T, and further according to the preset parameter c in the range of (0.5, 1), press T sj =T z(j-1) +T×c, calculate the jth zero-crossing time T zj The corresponding digital starting integration point time T sj , then proceed to step iii, where 1<m<j, T zj represents the jth zero-crossing time;
[0033] Step iii. At time T sj Initialize the integrator before returning the integrator output voltage to zero and start the integration at the digital start point time T sj Start the simulation integration, and end the integration when the integrator output voltage returns to zero again. Record the integration end point time T ej , then proceed to step iv;
[0034] Step iv. Press Get the jth zero-crossing time T zj ; Press T further tj =T ej -T sj, get the jth zero-crossing time T zj The corresponding integration time T tj , which constitutes the jth target zero-crossing time T zj The corresponding integration time T tj ; Then proceed to step v;
[0035] Step v. According to the target zero crossing time T zj , press T p(j-1) =T zj -T z(j-1) To obtain the measured signal period, press Obtain the frequency of the signal under test, and then proceed to step vi;
[0036] Step vi. Determine the signal zero-crossing time series {T z(K+1) , ..., T zj} is less than the preset threshold w+1, if yes, proceed to step ix; otherwise, perform the following operation: t(K+1) , ..., T tj} Select the latest w integral durations and calculate the average integral duration T ta , converted into the count value n corresponding to the counter period multiple; by the signal period sequence {T p(K+1) , ..., T p(j-1)} Select the latest w signal cycles generated in the calculation to obtain the cycle average value T pa , converted into a count value N corresponding to a multiple of the counter period, and then proceeding to step vii;
[0037] Step vii. Based on the signal period sequence {T p(K+1) , ..., T p(j-1)}, and calculate the standard deviation σ of the w signal cycles generated most recently. T ,pass Get the parameter σ R ; or by the signal frequency sequence {F (K+1) , ..., F (j-1)}, select the latest w signal frequencies generated, and calculate the standard deviation σ of the obtained frequencies F ,pass Get the parameter σ R , then proceed to step viii;
[0038] Step viii. According to the count values n, N, and parameter σ R , combined with Calculate and obtain the signal-to-noise ratio (SNR) of the target sinusoidal signal, where A is the peak value of the sinusoidal signal and σ is the effective value of the noise signal, and then proceed to step ix;
[0039] Step ix. Update the value of j by adding 1 and return to step iii.
[0040] As a preferred technical solution of the present invention: z(j-1) , …, T z(j-m) ,according to The average period T is calculated.
[0041] As a preferred technical solution of the present invention: respectively obtain the starting integration point time T sj and end point time T ej Then, according to the circuit delay parameters, the sj 、T ej Perform a correction update.
[0042] As a preferred technical solution of the present invention: in the step viii, according to the count values n, N, and the parameter σ R , combined with Use any of the following four formulas:
[0043]
[0044]
[0045]
[0046]
[0047] Calculate the signal-to-noise ratio (SNR) of the target sinusoidal signal.
[0048] As a preferred technical solution of the present invention: the analog integration in step iii is implemented by an operational amplifier or other devices with integration function.
[0049] The method for measuring the signal-to-noise ratio of a sinusoidal signal described in the present invention, using the above technical solution, has the following technical effects compared with the prior art:
[0050] The traditional zero-crossing method uses two consecutive points with opposite signs to determine the zero-crossing point. Although the algorithm has a clear physical concept, it is easily interfered by harmonics, noise, etc., and the measurement accuracy is low. The present invention designs a sinusoidal signal signal-to-noise ratio measurement method. According to the upper and lower symmetric characteristics of the target sinusoidal analog signal, analog integration is performed according to the calculated integration start time, and the integration is stopped when the analog integration outputs zero. The zero point of the electrical signal is calculated from the integration start time and the integration end time. After the zero-crossing point of the signal is determined, the frequency and period of the electrical signal can be calculated, and the signal-to-noise ratio of the sinusoidal signal can be further calculated. The accuracy of the corresponding signal-to-noise ratio measurement is also greatly improved, and the design method is very convenient and simple when performing calculations, and is suitable for use in embedded systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 After calculating the starting point of the integral, the virtual occurrence time of the integral end point is calculated by rectangular integration and rectangular interpolation, and a schematic diagram of the zero-crossing point is obtained;
[0052] Figure 2 After calculating the starting point of the integral, the virtual occurrence time of the integral end point is calculated by using trapezoidal integration and trapezoidal interpolation, and a schematic diagram of the zero-crossing point is obtained;
[0053] Figure 3 After calculating the starting point of the integral, the virtual occurrence time of the integral end point is calculated by using trapezoidal integration and rectangular interpolation, and a schematic diagram of the zero-crossing point is obtained;
[0054] Figure 4 The traditional zero-crossing point comparison method is used to obtain the zero-crossing point after two negative peaks, and after calculating the integral start point, the virtual occurrence time of the integral end point is calculated by using the trapezoidal integration and trapezoidal interpolation method, so as to obtain the schematic diagram of the third zero-crossing point;
[0055] Figure 5 The traditional zero-crossing point comparison method is used to obtain the zero-crossing point after two negative peaks. After calculating the integral start point, the virtual occurrence time of the integral end point is calculated by trapezoidal integration and trapezoidal interpolation to obtain the schematic diagram of the 10th, 11th, and 12th zero-crossing points.
[0056] Figure 6 It is a schematic diagram of integrating at a certain zero point of the electrical signal and calculating the zero-crossing point;
[0057] Figure 7 It is a schematic diagram of obtaining two zero-crossing points by using the traditional zero-crossing point comparison method and then obtaining the third zero-crossing point by using the method described in this article;
[0058] Figure 8It is a schematic diagram of analog integration after the measured electrical signal passes the negative peak, that is, integrating once per cycle and calculating the signal period;
[0059] Fig. 9 It is a schematic diagram of analog integration after the measured electrical signal passes the positive peak, that is, integrating once per cycle and calculating the signal period. DETAILED DESCRIPTION
[0060] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0061] The present invention designs a sinusoidal signal signal-to-noise ratio measurement method, and designs corresponding signal-to-noise ratio measurement methods for target sinusoidal digital signals and target sinusoidal analog signals respectively. Firstly, for the target sinusoidal digital signal, the following steps A to N are designed to be executed.
[0062] Step A: Perform full-cycle sampling on the target periodic signal in an equal-time interval sampling mode or an unequal-time interval sampling mode to obtain a sampling signal, and then proceed to step B.
[0063] Step B: Obtain a continuous zero-crossing time series T after at least two cycles of the sampling signal have both passed the negative peak or the positive peak by analog or digital methods. z1 , …, T zk , …, T zK , K represents the number of zero-crossing times in the continuous zero-crossing time series, T zk Represents the kth zero-crossing time in the continuous zero-crossing time sequence, then initializes j=K+1, and enters step C.
[0064] Step C. According to T z(j-1) , …, T z(j-m) , calculate the average period T, and further according to the preset parameter c in the range of (0.5, 1), press T sj =T z(j-1) +T×c, calculate the jth zero-crossing time T zj The corresponding digital starting integration point time T sj , then enter step D, where 1<m<j, T zj represents the jth zero-crossing time.
[0065] In the practical application of the above step C, according to T z(j-1) , …, T z(j-m) ,according to The average period T is obtained by calculation; regarding the value of the preset parameter c, c should not be too close to 1. If c is close to 1, the operation time will be shortened, which will affect the measurement accuracy.
[0066] Step D: Based on each sampling point on the sampled signal, select the time T corresponding to the digital starting integration point sj The two adjacent sampling points constitute the first sampling point to be analyzed and the second sampling point to be analyzed respectively, and the time corresponding to the sampling point to be analyzed and the sampling value corresponding to the sampling point to be analyzed are combined to form the coordinates of the sampling point to be analyzed, and then enter step E.
[0067] Step E. According to the digital starting integration point time T sj , through rectangular interpolation or trapezoidal interpolation, obtain the value T between the first sampling point and the second sampling point sj The corresponding sample value x sj , which constitutes the coordinates of the starting point of the numerical integration (T sj , x sj ), then initialize v=2, and sequentially define the first sampling point to be analyzed and each sampling point after the second sampling point to be analyzed on the sampling signal as each sampling point to be analyzed, and enter step F.
[0068] Step F: Perform a digital integration operation on the sampling signal from the coordinate position of the digital integration starting point to the coordinate position of the vth sampling point to be analyzed, forming a digital integration result S v ; and perform a digital integration operation on the sampling signal from the coordinate position of the digital integration starting point to the coordinate position of the v+1th sampling point to be analyzed, forming a digital integration result S v+1 , and then enter step G; here the digital integration operation is trapezoidal integration or rectangular integration.
[0069] Step G. Determine the digital integration result S v And the numerical integration result S v+1 Is the product of greater than 0? If so, add 1 to the value of v and return to step F; otherwise, go to step H.
[0070] Step H. Based on the condition that the sum of the digital integration from the digital integration start point to the digital integration end point is zero, the coordinates of the digital integration end point located between the vth sampling point to be analyzed and the v+1th sampling point to be analyzed are obtained by rectangular interpolation or trapezoidal interpolation (T ej , x ej ), then go to step I.
[0071] Step I. Press Get the jth zero-crossing time T zj ; Press T further tj =T ej -T sj , get the jth zero-crossing time T zj The corresponding integration time T tj , which constitutes the jth target zero-crossing time Tzj The corresponding integration time T tj ; Then go to step J.
[0072] Step J: According to the target zero-crossing time T zj , press T p(j-1) =T zj -T z(j-1) To obtain the measured signal period, press Get the frequency of the signal to be measured, and then go to step K.
[0073] Step K. Determine the signal zero-crossing time series {T z(K+1) , ..., T zj} is less than the preset threshold w+1, if yes, go to step N; otherwise, perform the following operation: t(K+1) , ..., T ti} Select the latest w integral durations and calculate the average integral duration T ta , converted into the count value n corresponding to the sampling period multiple; from the signal period sequence {T p(K+1) , ..., T p(j-1)} Select the latest w signal cycles generated in the calculation to obtain the cycle average value T pa , converted into the count value N corresponding to the sampling period multiple, and then enter step L.
[0074] Step L. Based on the signal period sequence {T p(K+1) , ..., T p(j-1)}, and calculate the standard deviation σ of the w signal cycles generated most recently. T ,pass Get the parameter σ R ; or by the signal frequency sequence {F (K+1) , ..., F (j-1)}, select the latest w signal frequencies generated, and calculate the standard deviation σ of the obtained frequencies F ,pass Get the parameter σ R , then go to step M.
[0075] Step M. Since N corresponds to the signal period (N will be affected by noise and will change), the size of n is controlled by c (n will be affected by noise and will be affected by factors such as rounding during calculation), so the formula n / N is approximately equal to 2*(1-c), so there will be variations of the formula, so here according to the count values n, N, and parameter σ R , combined with Use any of the following four formulas:
[0076]
[0077]
[0078]
[0079]
[0080] The signal-to-noise ratio (SNR) of the target sinusoidal signal is calculated, where A is the peak value of the sinusoidal signal and σ is the effective value of the noise signal, and then the process goes to step N. In practical applications, the process is not limited to the above four formulas, and other formulas are also possible.
[0081] Step N: Update the value of j by adding 1 and return to step C.
[0082] In practical applications, the specific operation of calculating the zero-crossing time for the above-mentioned target sinusoidal digital signal design method can be found in Figure 1 , Figure 2 , Figure 3 The hollow triangles in the figure indicate the starting and ending points of the integration. Figure 1 The method of rectangular integration and rectangular interpolation is used to calculate the virtual occurrence time of the integral end point and obtain the schematic diagram of the zero-crossing point. Figure 1 From t S Start numerical integration, t E is the virtual occurrence time of the integral end point obtained by interpolation. S to E The digital integral of is 0. z is the calculated zero-crossing point. Figure 2 The virtual occurrence time of the integral end point is calculated by using trapezoidal integration and trapezoidal interpolation, and a schematic diagram of the zero-crossing point is obtained. Figure 2 From t s Start numerical integration, t E is the virtual occurrence time of the integral end point obtained by interpolation. S to E The digital integral of is 0. z is the calculated zero-crossing point. Figure 3 The virtual occurrence time of the integral end point is calculated by using trapezoidal integration and rectangular interpolation, and a schematic diagram of the zero-crossing point is obtained. Figure 3 From t S Start numerical integration, t E is the virtual occurrence time of the integral end point obtained by interpolation. S to E The digital integral of is 0. zis the zero-crossing point obtained by calculation. If the trapezoidal interpolation method is used purely, the amount of calculation will be too large when performing interpolation calculation. Figure 3 The trapezoidal integration method is used at the beginning of the integration, but the rectangular interpolation method is used when performing the interpolation operation. The purpose of this is to reduce the complexity of the operation. In order to obtain more accurate measurement results, the height of the rectangle is assumed to be the average value of the two adjacent sampling points in the calculation of the attached figure. sj (i.e., t S ) is the calculated integration start time, and its calculation formula is T Sj =T z(j-1) +(T z(j-1) -T z(j-2) )×0.89, that is, c=0.89, T=(T z(j-1) -T z(j-2) ), it is recommended to use T=(T z(j-1) -T z(j-3) ) / 2. The following method can also be used: when calculating the integration start time, the number of zero-crossing points previously obtained is judged. If there are only two zero-crossing points previously obtained, T=(T z(j-1) -T z(j-2) ); If the number of zero-crossing points obtained before is greater than two, T=(T z(j-1) -T z(j-3) ) / 2. The schematic diagram of integrating the electric signal at a certain zero-crossing point after it passes the positive peak and calculating the zero-crossing point is omitted.
[0083] After sampling the electrical signal, the frequency is calculated and measured near each zero point. Figure 4 , Figure 5 . Figure 4 The traditional zero-crossing point comparison method is used to obtain the zero-crossing point after two negative peaks, and after calculating the integral start point, the virtual occurrence time of the integral end point is calculated by using the trapezoidal integration and trapezoidal interpolation method, so as to obtain the schematic diagram of the third zero-crossing point; Figure 5 The traditional zero-crossing point comparison method is used to obtain the zero-crossing point after two negative peaks. After calculating the starting point of the integral, the trapezoidal integration and trapezoidal interpolation methods are used to calculate the virtual occurrence time of the integral end point to obtain the schematic diagram of the 10th, 11th, and 12th zero-crossing points. Figure 4 The two zero-crossing points T are obtained by using the traditional zero-crossing comparison method. Z1 、T Z2 , by T Z1 、T Z2 Calculate T S3 , then in T S3 Start a digital integration, at T E3 End the integration, and finally by T S3 、T E3 Calculate TZ3 . Figure 5 This is a schematic diagram for calculating the 10th, 11th, and 12th zero-crossing points. Figure 5 The integral start and end points calculated above are indicated by hollow triangles, T Z10 、T Z11 and T Z12 are the 10th, 11th and 12th zero crossing points calculated. Then the period of the signal can be expressed as T p10 =T Z11 -T Z10 or T p11 =T Z12 -T Z11 , the frequency is the inverse of the period. The figure of obtaining the zero-crossing point and calculating the frequency by rectangular integration, rectangular interpolation or trapezoidal integration, rectangular interpolation is omitted; the figure of obtaining the zero-crossing point after two positive peaks and then measuring the frequency is omitted.
[0084] As can be seen from the accompanying drawings, the zero point obtained by using trapezoidal integration and trapezoidal interpolation is closest to the zero point of the actual signal, the zero point obtained by using trapezoidal integration and rectangular interpolation has a certain error with the zero point of the actual signal, and the zero point obtained by using rectangular integration and rectangular interpolation has the largest error with the zero point of the actual signal. Of course, as the number of sampling points increases, this error will become smaller and smaller. Considering the characteristics of embedded systems, the preferred solution is to use trapezoidal integration and rectangular interpolation to calculate the zero point of the signal.
[0085] The traditional zero-crossing method uses two consecutive points with opposite signs to determine the zero-crossing point. Although the algorithm has a clear physical concept, it is easily interfered by harmonics, noise, etc., and the measurement accuracy is low. The sinusoidal signal signal-to-noise ratio measurement method designed by the present invention is based on the characteristic that most target sinusoidal digital signals are symmetrical. According to the calculated integration start time, a linear interpolation operation is performed to select a sampling point P. S As the starting point of integration, digital integration is then performed, and an integration end point is obtained by interpolation, so that the digital integral from the integration starting point to the integration end point is zero, and the zero point of the electrical signal is calculated by the sampling occurrence time of the integration starting point and the virtual occurrence time of the integration end point. After determining the zero-crossing point of the signal, the frequency and period of the electrical signal can be calculated, and the signal-to-noise ratio of the sinusoidal signal can be further calculated. The accuracy of the corresponding signal-to-noise ratio measurement is also greatly improved, and the design method is very convenient and simple when performing calculations, and is suitable for use in embedded systems.
[0086] In practical applications, for the target sinusoidal analog signal, the design executes the following steps i to ix.
[0087] Step i. Obtaining a continuous zero-crossing time series T after at least two cycles of the sampling signal have both passed the negative peak or the positive peak by analog or digital methods z1 , …, T zk , …, T zK , K represents the number of zero-crossing times in the continuous zero-crossing time series, T zk Represents the kth zero-crossing time in the continuous zero-crossing time sequence, then initialize j=K+1, and enter step ii.
[0088] Step ii. According to T z(j-1) , …, T z(j-m) , calculate the average period T, and further according to the preset parameter c in the range of (0.5, 1), press T sj =T z(j-1) +T×c, calculate the jth zero-crossing time T zj The corresponding digital starting integration point time T sj , then proceed to step iii, where 1<m<j, T zj represents the jth zero-crossing time.
[0089] In the application, according to T z(j-1) , …, T z(j-m) ,according to Calculate the average period T; and in step ii, obtain the jth zero crossing time T zj The corresponding digital starting integration point time T sj After that, according to the circuit delay parameters, for T sj Perform correction and update; and regarding the value of the preset parameter c, c should not be too close to 1. If c is close to 1, the integration time will be too short, affecting the measurement accuracy of the measurement period and further affecting the measurement accuracy of the signal-to-noise ratio.
[0090] Step iii. At time T sj Initialize the integrator before returning the integrator output voltage to zero and start the integration at the digital start point time T sj Start the simulation integration, and end the integration when the integrator output voltage returns to zero again. Record the integration end point time T ej , then proceed to step iv; and in step iii, obtain T ej After that, according to the circuit delay parameters, for T ej Correction update is performed; and the analog integration here is implemented using an operational amplifier or other devices with integration function.
[0091] Step iv. Press Get the jth zero-crossing time T zj ; Press T further tj =T ej-T sj , get the jth zero-crossing time T zj The corresponding integration time T tj , which constitutes the jth target zero-crossing time T zj The corresponding integration time T tj ; Then go to step v.
[0092] Step v. According to the target zero crossing time T zj , press T p(j-1) =T zj -T z(j-1) To obtain the measured signal period, press Get the frequency of the signal under test, and then go to step vi.
[0093] Step vi. Determine the signal zero-crossing time series {T z(K+1 ), ..., T zj} is less than the preset threshold w+1, if yes, proceed to step ix; otherwise, perform the following operation: t(K+1 ), ..., T tj} Select the latest w integral durations and calculate the average integral duration T ta , converted into the count value n corresponding to the counter period multiple; by the signal period sequence {T p(K+1) , ..., T p(j-1)} Select the latest w signal cycles generated in the calculation to obtain the cycle average value T pa , converted into the count value N corresponding to the counter period multiple, and then enters step vii.
[0094] Step vii. Based on the signal period sequence {T p(K+1) , ..., T p(j-1)}, and calculate the standard deviation σ of the w signal cycles generated most recently. T ,pass Get the parameter σ R ; or by the signal frequency sequence {F (K+1) , ..., F (j-1)}, select the latest w signal frequencies generated, and calculate the standard deviation σ of the obtained frequencies F ,pass Get the parameter σ R , then go to step viii.
[0095] Step viii. Since N corresponds to the signal period (N will be affected by noise and thus vary), and the size of n is controlled by c (n will be affected by noise and by factors such as rounding during calculation), the formula n / N is approximately equal to 2*(1-c). Therefore, there will be variations of the formula. Therefore, here we use the count values n, N, and the parameter σ R , combined with Use any of the following four formulas:
[0096]
[0097]
[0098]
[0099]
[0100] The signal-to-noise ratio (SNR) of the target sinusoidal signal is calculated, where A is the peak value of the sinusoidal signal and σ is the effective value of the noise signal, and then the process proceeds to step ix. In practical applications, the process is not limited to the above four formulas, and other formulas are also possible.
[0101] Step ix. Update the value of j by adding 1 and return to step iii.
[0102] The above-mentioned design method of target sinusoidal analog signal is applied in practice.
[0103] For specific operations, see Figure 6 , Figure 6 It is divided into two parts, the upper part is the measured electrical signal (the horizontal axis T is time, and the vertical axis voltage is the measured electrical signal voltage), and the lower part is the integrated waveform of the measured signal. si is the integration start time, T ei is the integration end time, T zi is the calculated zero-crossing point. si is the calculated integration start time, which is calculated by the formula T si =T z(i-1) +(T z(i-1) -T z(i-2) )×0.89, that is, c=0.89, T=(T z(i-1) -T z(i-2) ), it is recommended to use T=(T z(i-1) -T z(i-3) ) / 2. The following method can also be used: when calculating the integration start time, the number of zero-crossing points previously obtained is judged. If there are only two zero-crossing points previously obtained, T=(T z(i-1) -T z(i-2)); If the number of zero-crossing points obtained before is greater than two, T=(T z(i-1) -T z(i-3) ) / 2. The schematic diagram of integrating the electric signal at a certain zero-crossing point after it passes the positive peak and calculating the zero-crossing point is omitted.
[0104] See also Figure 7 , Figure 8 , Fig. 9 . Figure 7 , Figure 8 , Fig. 9 They are divided into two parts, the upper part is the electrical signal being measured, and the lower part is the integrated waveform of the signal being measured. Figure 7 The two zero-crossing points T are obtained by using the traditional zero-crossing comparison method. Z1 、T Z2 , by T Z1 、T Z2 Calculate T S3 , then in T S3 Start an integration, at T E3 End the integration, and finally by T S3 、T E3 Calculate T Z3 The schematic diagram of integrating the electrical signal after it passes the positive peak and obtaining the third zero-crossing point is shown in FIG. Figure 8 It is a schematic diagram of analog integration after the measured electrical signal passes the negative peak, that is, integrating once per cycle and calculating the signal period. Figure 8 T S10 and T S11 is the calculated integration start time, T E10 and T E11 is the corresponding integration end time, T Z10 and T Z11 are the calculated 10th and 11th zero crossings. Fig. 9 It is a schematic diagram of analog integration after the measured electrical signal passes the positive peak, that is, integrating once per cycle and calculating the signal period. Fig. 9 T S10 and T S11 is the calculated integration start time, T E10 and T E11 is the corresponding integration end time, T Z10 and T Z11 are the calculated 10th and 11th zero crossings.
[0105] The traditional zero-crossing method uses two consecutive points with opposite signs to determine the zero-crossing point. Although the algorithm has a clear physical concept, it is easily interfered by harmonics, noise, etc., and the measurement accuracy is low. The present invention designs a sinusoidal signal signal-to-noise ratio measurement method. According to the upper and lower symmetric characteristics of the target sinusoidal analog signal, analog integration is performed according to the calculated integration start time, and the integration is stopped when the analog integration outputs zero. The zero point of the electrical signal is calculated from the integration start time and the integration end time. After the zero-crossing point of the signal is determined, the frequency and period of the electrical signal can be calculated, and the signal-to-noise ratio of the sinusoidal signal can be further calculated. The accuracy of the corresponding signal-to-noise ratio measurement is also greatly improved, and the design method is very convenient and simple when performing calculations, and is suitable for use in embedded systems.
[0106] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A method for measuring the signal-to-noise ratio of a sinusoidal signal, for obtaining the signal-to-noise ratio of a target sinusoidal signal, characterized in that: The target sinusoidal signal is a target sinusoidal digital signal, comprising the following steps: Step A: Sampling the target periodic signal to obtain a sampling signal, and then proceeding to step B; Step B: Obtain a continuous zero-crossing time series T after at least two cycles of the sampling signal have both passed the negative peak value or the positive peak value by analog or digital method. z1 ,…,T zk ,…,T zK , K represents the number of zero-crossing times in the continuous zero-crossing time series, T zk represents the kth zero-crossing time in the continuous zero-crossing time sequence, then initializes j=K+1, and enters step C; Step C. According to T z ( j -1),…,T z ( j -m), calculate the average period T, and according to the preset parameter c in the range of (0.5,1), press T sj =T z ( j-1 )+T×c, calculate the jth zero-crossing time T zj The corresponding digital starting integration point time T sj , and then proceed to step D, where 1 <m<j,T zj represents the jth zero-crossing time; Step D: Based on each sampling point on the sampled signal, select the time T corresponding to the digital starting integration point sj The two adjacent sampling points constitute the first sampling point to be analyzed and the second sampling point to be analyzed in turn, and the time corresponding to the sampling point to be analyzed and the sampling value corresponding to the sampling point to be analyzed are combined to form the coordinates of the sampling point to be analyzed, and then enter step E; step E. according to the digital starting integration point time T sj , through rectangular interpolation or trapezoidal interpolation, obtain the value T between the first sampling point and the second sampling point sj The corresponding sample value x sj , which constitutes the coordinates of the starting point of the numerical integration (T sj ,x sj ), then initialize v=2, and sequentially define the first sampling point to be analyzed and each sampling point after the second sampling point to be analyzed on the sampling signal as each sampling point to be analyzed, and enter step F; Step F: Perform a digital integration operation on the sampling signal from the coordinate position of the digital integration starting point to the coordinate position of the vth sampling point to be analyzed, forming a digital integration result S v ; and perform a digital integration operation on the sampling signal from the coordinate position of the digital integration starting point to the coordinate position of the v+1th sampling point to be analyzed, forming a digital integration result S v+1 , then go to step G; Step G. Determine the digital integration result S v And the numerical integration result S v+1 Is the product of greater than 0? If yes, then add 1 to the value of v and return to step F; otherwise, go to step H; Step H. Based on the condition that the sum of the digital integration from the digital integration start point to the digital integration end point is zero, the coordinates of the digital integration end point located between the vth sampling point to be analyzed and the v+1th sampling point to be analyzed are obtained by rectangular interpolation or trapezoidal interpolation (T ej ,x ej ), then proceed to step I; Step I. Press Get the jth zero-crossing time T zj ; Press T tj =T ej -T sj , get the jth zero-crossing time T zj The corresponding integration time T tj , which constitutes the jth target zero-crossing time T zj The corresponding integration time T tj ; Then proceed to step J; Step J: According to the target zero crossing time T zj , press T p(j-1) =T zj -T z(j-1) To obtain the measured signal period, press Obtain the frequency of the signal under test, and then proceed to step K; Step K. Determine the signal zero-crossing time series {T z(K+1) ,…,T zj } is less than the preset threshold w+1, if yes, go to step N; otherwise, perform the following operation: t(K+1) ,…,T tj } Select the latest w points durations generated in the calculation to obtain the average point duration T ta , converted into the count value n corresponding to the sampling period multiple; from the signal period sequence {T p(K+1) ,…,T p(j-1) } Select the latest w signal cycles generated in the calculation to obtain the cycle average value T pa , converted into the count value N corresponding to the sampling period multiple, and then enter step L; Step L. Based on the signal period sequence {T p(K+1) ,…,T p(j-1) }, calculate the standard deviation σ of the period T ,pass Get the parameter σ R ; or by the signal frequency sequence {F (K+1) ,…,F (j-1) }, select the latest w signal frequencies generated, and calculate the standard deviation σ of the obtained frequencies F ,pass Get the parameter σ R , then proceed to step M; Step M: According to the count values n, N, and parameter σ R , combined with Calculate and obtain the signal-to-noise ratio (SNR) of the target sinusoidal signal, where A is the peak value of the sinusoidal signal and σ is the effective value of the noise signal, and then proceed to step N; Step N: For the value of j, add 1 to update, and return to step C; In the above step M, according to the count values n, N, and the parameter σ R , combined with Use any of the following four formulas: Calculate the signal-to-noise ratio (SNR) of the target sinusoidal signal.
2. The method for measuring the signal-to-noise ratio of a sinusoidal signal according to claim 1, characterized in that: In step C, according to T z ( j -1),…,T z ( j -m), press The average period T is calculated.
3. The method for measuring the signal-to-noise ratio of a sinusoidal signal according to claim 1, characterized in that: In the step A, a sampling method with equal time intervals or unequal time intervals is adopted to sample the target periodic signal to obtain a sampling signal; and a whole cycle sampling is performed on the target periodic signal to obtain a sampling signal.
4. The method for measuring the signal-to-noise ratio of a sinusoidal signal according to claim 1, characterized in that: The digital integration operation in step F is trapezoidal integration or rectangular integration.
5. A method for measuring the signal-to-noise ratio of a sinusoidal signal, for obtaining the signal-to-noise ratio of a target sinusoidal signal, characterized in that: The target sinusoidal signal is a target sinusoidal analog signal, comprising the following steps: Step i. Obtaining a continuous zero-crossing time series T after at least two cycles of the sampling signal have both passed the negative peak or the positive peak by analog or digital methods z1 ,…,T zk ,…,T zK , K represents the number of zero-crossing times in the continuous zero-crossing time series, T zk represents the kth zero-crossing time in the continuous zero-crossing time series, then initialize j=K+1, and enter step ii; Step ii. According to T z(j-1) ,…,T z(j-m) , calculate the average period T, and according to the preset parameter c in the range of (0.5,1), press T sj =T z(j-1) +T×c, calculate the jth zero-crossing time T zj The corresponding digital starting integration point time T sj , then proceed to step iii, where 1 <m<j,T zj represents the jth zero-crossing time; Step iii. At time T sj Initialize the integrator before returning the integrator output voltage to zero and start the integration at the digital start point time T sj Start the simulation integration, and end the integration when the integrator output voltage returns to zero again. Record the integration end point time T ej , then go to step iv; Step iv. Press Get the jth zero-crossing time T zj ; Press T tj =T ej -T sj , get the jth zero-crossing time T zj The corresponding integration time T tj , which constitutes the jth target zero-crossing time T zj The corresponding integration time T tj ; Then proceed to step v; Step v. According to the target zero crossing time T zj , press T p(j-1) =T zj -T z(j-1) To obtain the measured signal period, press Obtain the frequency of the signal under test, and then proceed to step vi; Step vi. Determine the signal zero-crossing time series {T z(K+1) ,…,T zj } is less than the preset threshold w+1, if yes, proceed to step ix; otherwise, perform the following operation: t(K+1) ,…,T tj } Select the latest w points durations generated in the calculation to obtain the average point duration T ta , converted into the count value n corresponding to the counter period multiple; by the signal period sequence {T p(K+1) ,…,T p(j-1) } Select the latest w signal cycles generated in the calculation to obtain the cycle average value T pa , converted into a count value N corresponding to a multiple of the counter period, and then proceeding to step vii; Step vii. Based on the signal period sequence {T p(K+1) ,…,T p(j-1) }, calculate the standard deviation σ of the period T ,pass Get the parameter σ R ; or by the signal frequency sequence {F (K+1) ,…,F (j-1) }, select the latest w signal frequencies generated, and calculate the standard deviation σ of the obtained frequencies F ,pass Get the parameter σ R , then proceed to step viii; Step viii. According to the count values n, N, and parameter σ R , combined with Calculate and obtain the signal-to-noise ratio (SNR) of the target sinusoidal signal, where A is the peak value of the sinusoidal signal and σ is the effective value of the noise signal, and then proceed to step ix; Step ix. For the value of j, add 1 to update and return to step iii; In the above step viii, according to the count values n, N, and the parameter σ R , combined with Use any of the following four formulas: Calculate the signal-to-noise ratio (SNR) of the target sinusoidal signal.
6. A method for measuring the signal-to-noise ratio of a sinusoidal signal according to claim 5, characterized in that: According to T z(j-1) ,…,T z(j-m) ,according to The average period T is calculated.
7. The method for measuring the signal-to-noise ratio of a sinusoidal signal according to claim 5, characterized in that: Get the starting integration point time T sj and end point time T ej Then, according to the circuit delay parameters, the sj , T ej Perform a correction update.
8. A method for measuring the signal-to-noise ratio of a sinusoidal signal according to claim 7, characterized in that: The analog integration in step iii is implemented by using an operational amplifier or other devices with integration function.
