VC implementation of similarity to different signal waveforms

zhaozj2021-02-08  497

· Ministry of Information Industry Electronics 222 Institute Qingdao Dumi Lang Rui

Abstract: This paper introduces a method of similaritic similarities with the associated signal waveform. The similarity between the acquired multiple types of data signals can be discriminated by this technique. This algorithm is implemented by Microsoft Visual C 6.0.

I. Introduction

In the engineering we often determine if the actual waveform signal generated by a device can be combined with pre-design, but because the actual waveform is not just simple, cosine waveforms, but often contains a rich frequency distribution. The rule waveform, and the equipment components itself and the external electromagnetic interference are inevitably introduced to interference noise, and it is difficult to analyze the degree of discrimination of pre-design waveforms. In addition, the actual waveform and pre-design waveform tends to have different sequential differences, and the phase change is also not conducive to the fitting discrimination of the signal. This paper uses high mathematics and signal and systematic knowledge to propose solutions to this problem.

Second, the theoretical basis for judging the similarities

In signal and system this discipline, correlation is an important method for describing signal characteristics in the time domain. Since its communication power spectral function is a pair of Fourier transforms, it is often used to analyze the power spectrum distribution of random signals in signal analysis, so that many people will immediately associate the calculation of signal power spectrum, but related There is also a certain application on the analysis of the determined signal. Since the relevant concept is introduced to study the statistical characteristics of the random signal, we can also apply it to two determination signals (one of our collected signal waveforms and a theoretical waveform) similarity.

To compare the similarities of the two waveforms, it is necessary to start from the related concept. It is assumed that the two signals are X (t), y (t), respectively, and may be selected to remove the A * Y (T) to approximate X (T). Furthermore, we can use the error energy to measure the similarities of the waveform, the specific method is basically similar to the method of judging the orthogonality between the functionality of the function:

Error energy is represented by the square of X (t) -a * y (t) in the time domain; the selection of multiple A must ensure that the energy error can be minimized, and it can be learned by the function of the function. When A is X (t) * y (t) at the time domain integral with Y (t), it can meet the conditions when the integration ratio of the time domain, and the error energy under this condition may be under all conditions. the smallest. Definition X (T) and Y (t) of the correlation number of PXY, the difference between the square and 1 of 1 is the ratio of the relative error energy, that is, the error energy and X (t) * x (t) at time domain integration. Where XY can be used to characterize the similarities of the two waveforms. The equation for PXY is solved, and its molecule is X (t) * y (t) at the time domain integration; divided into two square meters of the square points of the two signals. From mathematics, the molecules can be proved to be smaller than the denominator, that is, the correlation number of PXY does not greater than 1. Since the energy is determined, the energy of the correlation coefficient PXY is determined by the integration of X (t) * y (t). If the two completely disconnected waveforms are independent, the occurrence of each other is independent, and X (t) * y (t) = 0, the integration result is also 0, so similarity when the correlation coefficient is 0 The worst, that is, it is not relevant. When the correlation coefficient is 1, the error energy is 0, indicating that the two signals are similar, and are linearly related. Therefore, a measure of similarity (or line-related) of the correlation coefficient (or linear correlation) is completely affected, reasonable.

Third, the design and implementation of the algorithm

Before we compare the signal, we first make the theoretical waveform into a data file, and the waveform output by the actual device is also acquired and data files are collected by the computer interface. The program we have written can be given the fit of the actual waveform with theoretical waveform signal by comparison the correlation between the two data files. The following is a brief sum of key code such as reading, data correlation degree calculation of data files:

First, to read the two-sequence data of the participating computation from the file from the file (stack) before calculating the relationship coefficient, in order to facilitate the read multiple data formats to make the program more flexible, select the CFiledialog class of the MFC base class library. The member function is selected to select the file, and then read it to the memory via the relevant member function of the CFILE class: ... CFiledialog DLG (True, "DAT", "*. DAT", // true is "Open File" Window OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, "Signal Data File (* .dat) | * .dat | All files (*. *) | *. * ||", null; if (DLG.Domodal () == idok) {cstring FileName = ""; filename = DLG.GetPathName (); // Take the full path where the file is located. File File; file.open (filename, cfile :: modeReadwrite); // Open file buf1 = new char [file " .Getlength ()]; // Dynamically allocate stack file.read (buf1, file.getlength ()); // read data to memory m_ndata1len = file.getlength (); // Get file length file.close (); // Close the file} ......

The above is a correlation code for reading a signal file, where buf1 is a CHAR * type pointer, which is pointed to by the memory stores data of the data file, and M_NDATA1LEN holds the length of the first data file. Use the same method to read the second data file into the memory, pointing to the pointer of its first address is buf2, the file length is m_ndata2len. After the data sequence involved in the calculation is ready, the correlation coefficient of the two sets of signal waveforms can be performed, and the following is the key part of the code:

... int N = m_ndata1len> m_ndata2len? M_ndata2len: m_ndata1len;

Since the length of the two sequences may be different, if the short sequence is quasi, the short sequence is insufficient to supplement 0, according to the concept of the correlation coefficient, the integration of X (t) * Y (t) of the 0 part is 0, no actual Significance, so that the shorter sequence can avoid unnecessary calculations, the operation is high.

... float a, b, c, pxy; a = b = c = pxy = 0.0f; ......

Points approximated the integral approximation in the computer:

For (int i = 0; i

{

A = BUF1 [i] * buf2 [i]; // Points for X (T) * Y (t)

B = BUF1 [I] * buf1 [i]; // Points for x (t) * x (t)

C = BUF2 [i] * buf2 [i]; / / Points for Y (t) * y (t)

}

PXY = A / (SQRT (B * C)); / / calculate the correlation coefficient

......

Finally release the memory of the application:

DELETE [] BUF1; Delete [] BUF2;

Fourth, the test of the experimental effect

The above procedure is checked by an actual example. We want to obtain the ideal waveform as shown in Figure 12, and the waveform shown by the DATA2 is the actual waveform generated after the device has occurred after noise suppression and phase correction. Data3 Waveform is a rough waveform obtained under any protection measures, apparent that DATA2 is better than Data3 can be better than the ideal waveform DATA1 designed to design, but only stays in qualitative analysis, how is the degree of similarity, quantitative analysis The naked eye is obviously unable to do. First, the Data1 and Data2 waveform signals are calculated, and the correlation coefficient is 0.793931, which is basically the line-related, that is, the ideal signal DATA1 of the actual DATA2 signal design is still acceptable; then Data1 The correlation coefficient calculation is performed with the DATA3 two-waveform signal. The correlation coefficient of the group signal is -0.013341, which is substantially linearly irrelevant; and then analyzes Data2 and Data3, the calculation results are 0.011665, and the conclusion is essentially irrelevant. The quantitative analysis of the waveform signal is kiss with the intuitive qualitative analysis by the above procedure. The test by actual experiment proves that the program is reliable and practical. Summary: The judgment of the similarity of the waveform signal proposed in this paper has a wide range of applications in electrical engineering, which can accurately determine the similar degree of similarity of the two waveform signals of the comparison, and provide the improvement of the equipment, the selection of components, etc. Reference basis. Further, when it is determined whether or not the moving signal has a line-related correlation, such as the analysis of the reflected signals of the two different distances received by the radar station can be used in this algorithm. The power spectrum of the signal can be drawn by improvement of the related algorithms described herein, and the waveform signal is more comprehensive analysis. This program is compiled by Microsoft Visual C 6.0 under Windows 98.

转载请注明原文地址:https://www.9cbs.com/read-483.html

New Post(0)