A signal frequency measurement method, device, equipment and storage medium
By extracting the characteristic information of the signal to be measured and generating the fitted signal, the problem of not having both frequency measurement speed and resolution in the prior art is solved, and high-precision and fast frequency measurement are achieved.
Patent Information
- Application Number
- CN202510163341.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-02-14
AI Technical Summary
When the prior art performs frequency measurement of continuous wave signals, it is difficult to increase the measurement speed while maintaining high frequency resolution, resulting in a contradiction between resolution and speed.
By extracting the amplitude value, DC component and initial phase point of the signal to be measured, the fitted signal is generated, and its frequency is adjusted until it coincides with the waveform of the signal to be measured, so as to quickly obtain the frequency of the continuous wave signal.
High-precision and fast frequency measurement of continuous wave signals is realized, which can increase frequency resolution within the same time, or increase measurement speed when the same frequency resolution is reached.
Smart Images

Figure CN119619623B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of signal analysis, and in particular to a signal frequency measurement method, device, equipment and storage medium. Background Art
[0002] In the field of radio frequency (RF) and microwave signal analysis, accurate frequency measurement is crucial. In order to accurately identify and analyze the frequency components of the signal, test equipment such as spectrum analyzers need to have a sufficiently high frequency resolution. Frequency resolution refers to the minimum frequency interval at which a spectrum analyzer can distinguish two adjacent frequency components. Ideally, it is hoped that the frequency of the signal can be resolved infinitely finely, but this is subject to various limitations in practical applications. In order to achieve a frequency resolution of 1 Hz, the signal needs to be sampled for at least 1 second. This means that if you want to accurately distinguish two signal components with a frequency difference of 1 Hz, you must collect at least 1 second of signal data.
[0003] However, in many practical application scenarios, such as measuring continuous wave signals, it is necessary to quickly obtain the frequency information of the signal, which conflicts with the need for high resolution. If you insist on requiring 1Hz accuracy, you will inevitably have to pay the price of longer sampling time. In other words, resolution and speed cannot be achieved at the same time. To increase the measurement speed, you have to sacrifice resolution, and to increase the resolution, you have to sacrifice speed.
[0004] Therefore, there is an urgent need for a method that can achieve high-precision and fast frequency measurement of continuous wave signals, increase the frequency resolution of the measurement in the same time, or increase the measurement speed while achieving the same frequency resolution. Summary of the invention
[0005] In view of this, the present application provides a signal frequency measurement method, device, equipment and storage medium, which can realize high-precision and fast frequency measurement of continuous wave signals. The technical solution is as follows.
[0006] In a first aspect, the present invention provides a signal frequency measurement method, the method comprising:
[0007] Acquire a signal to be tested; the signal to be tested is obtained by collecting at least one cycle of a target continuous wave signal;
[0008] Extracting the amplitude value, DC component, initial phase point and signal type of the signal to be measured;
[0009] According to the amplitude value and the DC component of the signal to be measured, a fitting signal of the signal type is generated with the initial phase point as the starting point of the fitting signal;
[0010] Adjusting the frequency of the fitting signal until the waveform of the signal to be measured coincides with the waveform of the fitting signal;
[0011] The frequency of the target continuous wave signal is obtained according to the frequency of the adjusted fitting signal.
[0012] In an optional implementation manner, extracting the amplitude value of the signal to be measured includes:
[0013] The DC component of the signal to be measured is removed to obtain the amplitude value of the signal to be measured.
[0014] In an optional implementation manner, extracting the DC component of the signal to be measured includes:
[0015] The average value of the signal to be measured is calculated to obtain the DC component of the signal to be measured.
[0016] In an optional implementation, extracting the initial phase point of the signal to be measured includes:
[0017] The zero phase point of the signal to be measured is determined to obtain the initial phase point of the signal to be measured.
[0018] In an optional implementation manner, determining the zero phase point of the signal to be measured includes:
[0019] When the signal type is a sine wave, obtaining the sign change of each adjacent data point of the signal to be tested;
[0020] According to the sign change of each adjacent data point, the initial rising edge zero crossing point pair of the signal to be measured is obtained; the rising edge zero crossing point pair is a point pair that changes from a negative value to a positive value;
[0021] Based on the initial rising edge zero crossing point pair, the zero phase point of the signal to be measured is determined by interpolation.
[0022] A signal frequency measurement method provided by the present invention has the following advantages.
[0023] The signal frequency measurement method of the present invention is applied to the frequency measurement of continuous wave signals. First, the target continuous wave signal is sampled for at least one cycle to obtain the signal to be measured, and the waveform type of the signal to be measured is determined. Then, the collected signal to be measured is subjected to step-by-step information extraction to extract the amplitude value, DC component and initial phase point of the signal to be measured. Since the DC component is a constant and does not change with time, the average value of the collected signal can be calculated. The average value can effectively eliminate the AC part in the signal, thereby obtaining the DC component. After the DC component is removed from the collected signal, its peak value or maximum value is the amplitude value. A reference point (such as a peak or a zero crossing point) in the waveform of the signal to be measured can be selected as the zero phase point. For example, when the continuous wave signal is a sine wave signal, by traversing all data points of the signal to be measured, the sign change of each adjacent point is identified, and the point pair where the negative value changes to the positive value for the first time is found. Then, the zero crossing point is found using the interpolation method to obtain the zero phase point, thereby extracting the initial phase point. Then, taking the initial phase point as the starting point, a fitting signal of the signal to be measured is fitted according to the DC component and amplitude value of the signal to be measured, and the frequency of the fitting signal is adjusted until the waveform of the signal to be measured coincides with the waveform of the fitting signal. According to the frequency of the adjusted fitting signal, the frequency of the target continuous wave signal can be obtained. A high-precision and fast frequency measurement method for continuous wave signals can be realized, which greatly increases the frequency resolution of the measurement in the same time, or greatly improves the measurement speed when the same frequency resolution is achieved.
[0024] In a second aspect, the present invention provides a signal frequency measuring device, the device comprising:
[0025] An acquisition module is used to acquire a signal to be tested; the signal to be tested is obtained by performing signal acquisition of at least one cycle of the target continuous wave signal;
[0026] An extraction module, used for extracting the amplitude value, DC component, initial phase point and signal type of the signal to be measured;
[0027] A fitting module, used to generate a fitting signal of the signal type according to the amplitude value and the DC component of the signal to be measured and taking the initial phase point as the starting point of the fitting signal;
[0028] An adjustment module, used for adjusting the frequency of the fitting signal until the waveform of the signal to be measured coincides with the waveform of the fitting signal;
[0029] The generating module is used to obtain the frequency of the target continuous wave signal according to the frequency of the adjusted fitting signal.
[0030] In an optional implementation, the extraction module is specifically used to:
[0031] The DC component of the signal to be measured is removed to obtain the amplitude value of the signal to be measured.
[0032] In an optional implementation, the extraction module is specifically used to:
[0033] The average value of the signal to be measured is calculated to obtain the DC component of the signal to be measured.
[0034] In an optional implementation, the extraction module is specifically used to:
[0035] The zero phase point of the signal to be measured is determined to obtain the initial phase point of the signal to be measured.
[0036] In an optional implementation, the extraction module is further used to:
[0037] When the signal type is a sine wave, obtaining the sign change of each adjacent data point of the signal to be tested;
[0038] According to the sign change of each adjacent data point, the initial rising edge zero crossing point pair of the signal to be measured is obtained; the rising edge zero crossing point pair is a point pair that changes from a negative value to a positive value;
[0039] Based on the initial rising edge zero crossing point pair, the zero phase point of the signal to be measured is determined by interpolation.
[0040] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the signal frequency measurement method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0041] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the signal frequency measurement method of the first aspect or any corresponding embodiment thereof.
[0042] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the signal frequency measurement method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 The figure is a flowchart of a signal frequency measurement method according to an exemplary embodiment.
[0045] Figure 2 is a waveform diagram of a generated fitting signal according to an exemplary embodiment.
[0046] Figure 3 is a schematic diagram showing confirmation of a zero phase point of a sinusoidal wave signal according to an exemplary embodiment.
[0047] Figure 4 It is a schematic diagram showing how to translate the starting phase point of the fitting signal to coincide with the starting phase point of the signal to be measured according to an exemplary embodiment.
[0048] Figure 5 is a schematic diagram showing adjusting the frequency of a fitting signal according to an exemplary embodiment.
[0049] Figure 6 It is a structural schematic diagram of a signal frequency measurement device provided in an embodiment of the present application.
[0050] Figure 7 It is a structural schematic diagram of a computer device provided by an optional embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0052] It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.
[0053] In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.
[0054] In an embodiment of the present application, "predefinition" may be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a terminal device and a network device). The present application does not limit its specific implementation method.
[0055] According to the Nyquist theorem, measuring the frequency of a signal requires a sampling rate at least twice that of the frequency. That is to say, if the highest frequency of a signal is fm, the sampling rate of this signal must be at least 2fm to fully measure the signal. The resolution of the measurement depends on the sampling duration. The relationship between the frequency resolution Δf and the sampling duration T is Δf=1 / T. The longer the sampling time, the larger T, and the smaller Δf, which means that the frequency interval that can be distinguished is smaller, indicating that more subtle frequency differences can be identified, which means that the frequency resolution is higher. Frequency resolution refers to the ability to distinguish two very close frequencies. If the frequency resolution is 1 Hz, then two frequencies with an interval of 1 Hz can be distinguished, such as 100 Hz and 101 Hz. If the frequency resolution is 5 Hz, then two frequencies with an interval of 5 Hz can be distinguished, such as 100 Hz and 105 Hz, but 100 Hz and 101 Hz cannot be distinguished. The lower the frequency resolution value, the higher the frequency resolution. Assuming that our sampling duration is 1s, the frequency resolution that can be achieved is 1 Hz. If the sampling duration is 1ms, the frequency resolution that can be achieved is 1 kHz. In short, the longer the sampling time, the higher the frequency resolution. For any waveform, the above rules apply.
[0056] In other words, the longer the sampling time, the higher the frequency resolution. In other words, speed and resolution cannot be achieved at the same time. To increase the measurement speed, the resolution must be sacrificed, and to increase the resolution, the speed must be sacrificed.
[0057] Therefore, the embodiment of the present invention provides a signal frequency measurement method, which can quickly measure the frequency hopping time, so as to break through the above-stated rules and limitations, so as to achieve the purpose of high-precision and fast frequency measurement, increase the frequency resolution of the measurement in the same time, or improve the measurement speed when the same frequency resolution is achieved. This method can be extended to the frequency measurement of all CW (continuous wave) signals.
[0058] The method flow of a signal frequency measurement method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the following steps are included.
[0059] S101, obtaining a signal to be tested; the signal to be tested is obtained by collecting at least one cycle of a target continuous wave signal.
[0060] Specifically, the signal frequency measurement method provided in this embodiment is applied to the frequency measurement of continuous waves. The continuous wave to be measured is collected, and at least one cycle of the continuous wave signal needs to be collected to obtain the signal to be measured. There is no need to collect signals for a long time like the traditional measurement method, which greatly shortens the time of frequency measurement.
[0061] S102: extracting the amplitude value, DC component, initial phase point and signal type of the signal to be measured.
[0062] Specifically, the signal type of the signal to be measured, that is, the waveform type of the signal, is first determined to facilitate the subsequent generation of the fitting signal. Then, based on the acquired signal to be measured, the amplitude value and DC component of the signal to be measured are extracted. Since the DC component is a constant and does not change with time, it can be estimated by calculating the average value of the signal to be measured. After removing the DC component, the peak value (maximum value) of the signal can be used as an estimate of the amplitude value of the signal to be measured. In order to extract the phase of the signal to be measured, a reference point in the signal waveform (such as a peak or a zero crossing point) can be selected as the zero phase point.
[0063] S103 . Generate a fitting signal of the signal type according to the amplitude value and the DC component of the signal to be measured and taking the initial phase point as the starting point of the fitting signal.
[0064] Specifically, in step S103, after the waveform, amplitude value and DC component of the signal to be measured are determined, a fitting signal of the signal to be measured can be generated. The fitting signal can be generated with the initial phase point as the starting point of the fitting signal. After the fitting signal is generated, the fitting waveform can be shifted left or right to ensure the maximum overlap between the target waveform and the fitting waveform, which can be achieved by least squares fitting to ensure that the fitting error is minimized.
[0065] S104 , adjusting the frequency of the fitting signal until the waveform of the signal to be measured coincides with the waveform of the fitting signal.
[0066] Specifically, since the amplitude value, DC component and initial phase point are determined, the frequency of the fitting signal is adjusted until the waveform of the fitting signal coincides with the waveform of the signal to be measured, and the frequency of the signal to be measured is the same as the frequency of the fitting signal.
[0067] S105. Acquire the frequency of the target continuous wave signal according to the frequency of the adjusted fitting signal.
[0068] Specifically, when the waveform of the fitting signal coincides with the waveform of the signal to be measured, the frequency of the signal to be measured is the same as the frequency of the fitting signal. At this time, we only need to obtain the frequency of the fitting signal to obtain the frequency of the signal to be measured, and thus obtain the frequency of the continuous wave whose frequency needs to be measured.
[0069] By using the signal frequency measurement method provided in the above embodiment, high-precision and fast frequency measurement can be achieved for the continuous wave to be measured, thereby increasing the frequency resolution of the measurement in the same time, or improving the measurement speed while achieving the same frequency resolution.
[0070] Optionally, due to the presence of noise, in actual operation, step S102 usually uses the mean value of the signal to eliminate the influence of the AC part. Especially when the signal contains noise, the mean value can effectively reflect the real DC component. When calculating the amplitude value, some smoothing or filtering methods may be required to reduce the interference of stray signals on the peak value. If the noise influence is large, it may be necessary to use methods such as the root mean square (RMS) value to more accurately reflect the amplitude of the signal.
[0071] Optionally, in step S102, a sine wave signal is taken as an example to specifically illustrate the extraction of the zero phase point, including: traversing all data points in the signal to be tested and identifying the sign change of each adjacent data point. If the amplitude of one point is greater than 0 and the amplitude of the other point is less than 0, it means passing through the zero point, and vice versa. The first rising edge zero crossing point can be found by traversing the signal to find the point pair that changes from negative value to positive value. Then, the interpolation method is used to find the zero crossing point, thereby extracting the zero phase point of the signal to be tested.
[0072] For example, when measuring the frequency of a square wave signal, extracting the amplitude value and the DC component is the same as the above steps. The main difference lies in the extraction of the zero phase. The determination of the square wave zero phase usually depends on the selection of a specific transition point of the signal. It is necessary to determine a certain transition point of the signal (for example, from 0 to the amplitude value or from the amplitude value to 0), and then infer the phase based on this point.
[0073] In order to better illustrate the signal frequency measurement method provided by the above embodiment, a sine wave signal in a continuous wave signal is used as an example for specific explanation below.
[0074] The frequency value of the sine wave to be measured is 100123456Hz. First, the signal image of 50ns is collected by the spectrum analyzer. This is a sine wave signal. The function expression of the sine signal is F(A,B,C,D) = Asin(Bx+C)+D; where A is the amplitude, B is the frequency, C is the phase, and D is the DC component.
[0075] Then, the collected signal is subjected to step-by-step information extraction. According to the method of the above embodiment, the DC component D is first extracted. The DC component is a constant and does not change with time. Therefore, the average value of the collected signal can be calculated. The average value can effectively eliminate the AC part of the signal, thereby obtaining the DC component. Next, the amplitude A is extracted, and its peak value (or maximum value) is calculated after the collected signal is removed from the DC component.
[0076] Then determine the phase value, taking the waveform of the signal to be measured for one cycle as an example, Figure 2 As shown, Figure 2 The black solid line in the middle is the waveform of the signal to be measured. After obtaining parameters A and D, a rough fitting waveform can also be generated, such as Figure 2 The dotted line in the waveform is shown in the figure.
[0077] In the above steps, the phase value needs to be confirmed by selecting a characteristic point in the signal waveform as the reference point. A common choice is to select the zero crossing point of the waveform (the signal changes from positive to negative or from negative to positive), for example, Figure 2 Point A in the figure is 0 phase. The confirmation of the 0 phase point is that the point where the sinusoidal signal waveform intersects with the x-axis after removing the influence of the DC component D is the 0 phase point. It is necessary to find the 0 phase point of the rising edge. Specifically, since the sine wave is composed of multiple data points and is discrete, it is necessary to first traverse all points of the target waveform and identify the sign changes of each adjacent point. If the amplitude of one point is greater than 0 and the other point is less than 0, it means passing through the zero point, and vice versa. Find the first rising edge zero crossing point, that is, find the point pair that changes from negative value to positive value by traversing the signal. Specifically, if the amplitude of point 1 is greater than 0 and the amplitude of point 2 is less than 0, then point 1 and point 2 are a set of 0 phase related points of the falling edge. If the amplitude of point 1 is less than 0 and the amplitude of point 2 is greater than 0, then point 1 and point 2 are a set of 0 phase related points of the rising edge. It is necessary to find the 0 phase related points of the rising edge. After obtaining the first rising edge zero crossing point, use the interpolation method to find the specific 0 phase point. Reference Figure 3 , the zero crossing points of the first rising edge are points M and N. The coordinates of points M and N are known, and the coordinates of point A can be obtained through the coordinates of points M and N. This point is the required 0 phase point.
[0078] After the phase value is determined, the fitted waveform is shifted to the left so that point B coincides with point A, as shown in Figure 4 As shown. You can also directly use the 0 phase point as the starting point of the fitting signal to generate a fitting signal without further translation. Finally, you need to adjust the frequency of the fitting signal so that the fitting waveform and the waveform of the signal to be measured overlap as much as possible. The frequency of the signal to be measured can be obtained based on the frequency of the fitting signal at this time, and the frequency of the target continuous wave signal can also be obtained.
[0079] Since the sampling time of this example is 50ns, the resolution is 20MHz, so only 100MHz can be measured at the beginning, which is a little bit away from the target frequency of 100123456Hz.
[0080] If the current variance value decreases compared with the last time, the frequency will continue to decrease for fitting. If the current variance value increases compared with the last time, the frequency will increase for fitting. Each time the frequency decreases or increases, the frequency value will be increased by 20MHz to 120MHz. When the target waveform and the fitting waveform x of the overlapping part are equal, the square root of the amplitude difference is calculated, that is, the variance is calculated, recorded as S1. Figure 5 As shown, point D is on the left of point C at this time, so point D needs to move to the right, that is, the frequency value needs to decrease.
[0081] Continue fitting according to the above method, reduce 120MHz by 10MHz to 110MHz, calculate the variance, record it as S2, judge the size of S1 and S2, if S2<S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 110MHz by 5MHz to 105MHz, calculate the variance, assign it to S2, judge the size of S1 and S2, if S2<S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 105MHz by 2.5MHz to 102.5MHz, calculate the variance, assign it to S2, judge the size of S1 and S2, if S2<S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 102.5MHz by 1.25MHz to 101.25MHz, calculate the variance, assign it to S2, determine the size of S1 and S2, if S2<S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 101.25MHz by 0.625MHz to 100.625MHz, calculate the variance, assign it to S2, determine the size of S1 and S2, if S2<S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 100.625MHz by 0.3125MHz to 100.3125MHz, calculate the variance, assign it to S2, determine the size of S1 and S2, if S2<S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 100.3125MHz by 0.15625MHz to 100.15625MHz, calculate the variance, assign it to S2, determine the size of S1 and S2, if S2 is greater than S1, set S1=S2, the moving direction of point D remains unchanged, and it continues to move to the right, which means that the frequency continues to decrease. Reduce 100.15625MHz by 0.078125MHz to 100.078125MHz. At this time, the frequency resolution has reached 1Hz, and you can stop fitting. Of course, if you want a higher resolution, you can continue fitting.
[0082] The frequency value of the sine wave that needs to be measured in this example is 100123456Hz. If the resolution is to reach 1Hz, it usually takes 1s. However, using the method in this example, only 50ns of signal information needs to be collected, and then tens of ms of calculation time are added to achieve the same resolution. The test speed of the signal frequency measurement method provided by this example is greatly improved.
[0083] It should be noted that, although this example uses a sine wave signal as an example to illustrate the signal frequency measurement method provided in the above embodiment, the signal frequency measurement method can also be applied to the frequency measurement of other types of continuous wave signals. Depending on the type of continuous wave signal to be measured, different fitting methods can be used to generate its fitting signal.
[0084] Taking square waves as an example, we can first use Fourier transform to obtain its fundamental wave, specifically, convert the square wave from the time domain to the frequency domain to find the fundamental wave. By converting the time domain signal to the frequency domain through Fourier transform, the frequency components of the signal can be decomposed. For square waves, Fourier transform can extract its fundamental wave (that is, the lowest frequency sine wave component), which provides a basis for frequency measurement. This method is not only applicable to square waves, but also to other periodic waveforms (such as triangle waves, sawtooth waves, etc.), because Fourier transform can effectively decompose the frequency components of various waveforms. The result after Fourier transform will contain multiple frequency components. Usually the fundamental wave is the most important frequency component, which determines the period of the waveform. After Fourier transform, extracting the fundamental wave is the key step. For square waves, the fundamental wave frequency is half of its fundamental period, so the frequency of the fundamental wave is the basic frequency of the square wave.
[0085] Next, the fundamental wave is processed by the sine wave fitting method in the above method. The amplitude value, DC component, initial phase point and other parameters of the fundamental wave are determined, and a fitting signal is generated with the initial phase point as the starting point. The frequency is adjusted so that the fitting signal coincides with the fundamental wave waveform. At this time, the frequency of the fitting signal is the frequency of the square wave fundamental wave.
[0086] Finally, the fundamental wave is converted from the frequency domain back to the time domain through the inverse Fourier transform, and the square wave is restored to complete the frequency measurement. The fundamental wave is inversely transformed from the frequency domain back to the time domain to restore the waveform of the original signal. For a square wave, the inverse Fourier transform can restore its original periodic waveform. This operation realizes the mutual conversion between the frequency domain and the time domain, so that the frequency measurement result can be consistent with the time domain performance of the original signal.
[0087] For other waveforms such as triangular waves, the measurement ideas are similar. The Fourier transform of a triangular wave will contain the fundamental wave and its odd-order harmonics. Its spectrum characteristics are different from those of a square wave, but the fundamental wave and its harmonics can still be identified through Fourier transform. For a triangular wave, the inverse Fourier transform combines these frequency components (fundamental wave and higher harmonics) into a triangular wave form in the time domain. First, use the Fourier transform to decompose the waveform to find the key components, use the above-mentioned sine wave fitting to determine the key component frequency, and then restore the waveform through the corresponding mathematical method to achieve frequency measurement. For example, when processing complex waveforms, if there are many high-frequency components in the spectrum, spline interpolation can be used to smooth the signal and reduce the high-frequency noise in the restoration process. For noisy signals, the Kalman filter method can be used to smooth the signal and improve the accuracy of frequency measurement.
[0088] In summary, the signal frequency measurement method of the present invention is applied to the frequency measurement of continuous wave signals. First, the target continuous wave signal is sampled for at least one cycle to obtain the signal to be measured, and the waveform type of the signal to be measured is determined. Then, the collected signal to be measured is subjected to step-by-step information extraction to extract the amplitude value, DC component and initial phase point of the signal to be measured. Since the DC component is a constant and does not change with time, the average value of the collected signal can be calculated. The average value can effectively eliminate the AC part in the signal, thereby obtaining the DC component. After the DC component is removed from the collected signal, its peak value or maximum value is the amplitude value. A reference point (such as a peak or a zero crossing point) in the waveform of the signal to be measured can be selected as the zero phase point. For example, when the continuous wave signal is a sine wave signal, by traversing all data points of the signal to be measured, the sign change of each adjacent point is identified, and the point pair where the negative value changes to the positive value for the first time is found. Then, the zero crossing point is found using the interpolation method to obtain the zero phase point, thereby extracting the initial phase point. Then, taking the initial phase point as the starting point, a fitting signal of the signal to be measured is fitted according to the DC component and amplitude value of the signal to be measured, and the frequency of the fitting signal is adjusted until the waveform of the signal to be measured coincides with the waveform of the fitting signal. According to the frequency of the adjusted fitting signal, the frequency of the target continuous wave signal can be obtained. A high-precision and fast frequency measurement method for continuous wave signals can be realized, which greatly increases the frequency resolution of the measurement in the same time, or greatly improves the measurement speed when the same frequency resolution is achieved.
[0089] In the present application, a signal frequency measuring device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.
[0090] The present application provides a signal frequency measurement device. Figure 6 : is a structural schematic diagram of a signal frequency measurement device provided in an embodiment of the present application, the device comprising:
[0091] The acquisition module 601 is used to acquire a signal to be tested; the signal to be tested is obtained by collecting a target continuous wave signal for at least one cycle;
[0092] An extraction module 602 is used to extract the amplitude value, DC component, initial phase point and signal type of the signal to be measured;
[0093] A fitting module 603 is used to generate a fitting signal of the signal type according to the amplitude value and the DC component of the signal to be measured and taking the initial phase point as the starting point of the fitting signal;
[0094] An adjustment module 604 is used to adjust the frequency of the fitting signal until the waveform of the signal to be measured coincides with the waveform of the fitting signal;
[0095] The generating module 605 is used to obtain the frequency of the target continuous wave signal according to the frequency of the adjusted fitting signal.
[0096] In an optional implementation, the extraction module 602 is specifically configured to:
[0097] The DC component of the signal to be measured is removed to obtain the amplitude value of the signal to be measured.
[0098] In an optional implementation, the extraction module 602 is specifically configured to:
[0099] The average value of the signal to be measured is calculated to obtain the DC component of the signal to be measured.
[0100] In an optional implementation, the extraction module 602 is specifically configured to:
[0101] The zero phase point of the signal to be measured is determined to obtain the initial phase point of the signal to be measured.
[0102] In an optional implementation, the extraction module 602 is further configured to:
[0103] When the signal type is a sine wave, obtaining the sign change of each adjacent data point of the signal to be tested;
[0104] According to the sign change of each adjacent data point, the initial rising edge zero crossing point pair of the signal to be measured is obtained; the rising edge zero crossing point pair is a point pair that changes from a negative value to a positive value;
[0105] Based on the initial rising edge zero crossing point pair, the zero phase point of the signal to be measured is determined by interpolation.
[0106] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0107] The signal frequency measurement device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0108] The embodiment of the present invention also provides a computer device having the above Figure 6 The signal frequency measurement device shown.
[0109] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphic information in a graphical user interface on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0110] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0111] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0112] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0113] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0114] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0115] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0116] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0117] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A signal frequency measurement method, characterized in that: The method comprises: Acquire a signal to be tested; the signal to be tested is obtained by collecting at least one cycle of a target continuous wave signal; Extracting the amplitude value, DC component, initial phase point and signal type of the signal to be measured; According to the amplitude value and the DC component of the signal to be measured, a fitting signal of the signal type is generated with the initial phase point as the starting point of the fitting signal; Adjusting the frequency of the fitting signal until the waveform of the signal to be measured coincides with the waveform of the fitting signal; According to the frequency of the adjusted fitting signal, obtaining the frequency of the target continuous wave signal; Wherein, adjusting the frequency of the fitting signal includes: Calculating the current variance between the measured signal and the fitted signal waveform; If the current variance value is smaller than the variance after the last adjustment, the frequency of the fitting signal is reduced for fitting; if the current variance value is larger than the variance after the last adjustment, the frequency of the fitting signal is increased for fitting.
2. The method according to claim 1, characterized in that: Extracting the amplitude value of the signal to be measured includes: The DC component of the signal to be measured is removed to obtain the amplitude value of the signal to be measured.
3. The method according to claim 2, characterized in that Extracting the DC component of the signal to be measured includes: The average value of the signal to be measured is calculated to obtain a DC component of the signal to be measured.
4. The method according to claim 3, characterized in that: Extracting the initial phase point of the signal to be measured includes: The zero phase point of the signal to be measured is determined to obtain the initial phase point of the signal to be measured.
5. The method according to claim 4, characterized in that Determining the zero phase point of the signal to be measured includes: When the signal type is a sine wave, obtaining a sign change of each adjacent data point of the signal to be measured; According to the sign change of each adjacent data point, the initial rising edge zero crossing point pair of the signal to be measured is obtained; the rising edge zero crossing point pair is a point pair that changes from a negative value to a positive value; Based on the initial rising edge zero crossing point pair, the zero phase point of the signal to be measured is determined by interpolation.
6. A signal frequency measuring device, characterized in that: The device comprises: An acquisition module is used to acquire a signal to be tested; the signal to be tested is obtained by performing signal acquisition of at least one cycle of a target continuous wave signal; An extraction module, used to extract the amplitude value, DC component, initial phase point and signal type of the signal to be measured; A fitting module, used to generate a fitting signal of the signal type according to the amplitude value and the DC component of the signal to be measured and taking the initial phase point as the starting point of the fitting signal; An adjustment module, used for adjusting the frequency of the fitting signal until the waveform of the signal to be measured coincides with the waveform of the fitting signal; A generating module, used for acquiring the frequency of the target continuous wave signal according to the frequency of the adjusted fitting signal; Wherein, the adjustment module is specifically used for: Calculating the current variance between the measured signal and the fitted signal waveform; If the current variance value is smaller than the variance after the last adjustment, the frequency of the fitting signal is reduced for fitting; if the current variance value is larger than the variance after the last adjustment, the frequency of the fitting signal is increased for fitting.
7. The device according to claim 6, characterized in that The extraction module is specifically used for: The zero phase point of the signal to be measured is determined to obtain the initial phase point of the signal to be measured.
8. The device according to claim 7, characterized in that The extraction module is further used for: When the signal type is a sine wave, obtaining a sign change of each adjacent data point of the signal to be measured; According to the sign change of each adjacent data point, the initial rising edge zero crossing point pair of the signal to be measured is obtained; the rising edge zero crossing point pair is a point pair that changes from a negative value to a positive value; Based on the initial rising edge zero crossing point pair, the zero phase point of the signal to be measured is determined by interpolation.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the signal frequency measurement method according to any one of claims 1 to 5 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the signal frequency measurement method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Rapid measurement method and device of super-low-frequency vibration parameter quantity value
CN102661782A
Digital demodulation method and device for frequency modulation and amplitude modulation signals
CN102664588A