A signal processing method, device and storage medium
By comparing signal lengths and truncating long signals, combined with waveform and mean similarity calculations, the problem of misjudgment caused by inconsistent lengths or magnitudes in signal matching by the normalized cross-correlation algorithm is solved, thus achieving accuracy and adaptability in signal similarity judgment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNITED AUTOMOTIVE ELECTRONICS SYST
- Filing Date
- 2023-05-16
- Publication Date
- 2026-07-24
Smart Images

Figure CN116578883B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of signal processing technology, and specifically relates to a signal processing method, apparatus and storage medium. Background Technology
[0002] With the development of vehicle intelligence, electrification, and informatization, the amount of vehicle data that can be obtained is increasing. Processing this data and extracting key information helps automakers improve their products. Accurately extracting the key information needed by the company from a large amount of data has become a key challenge.
[0003] Identifying vehicle-collected signals through template signal matching can be used to determine vehicle operating conditions, statistically analyze vehicle behavior, and more. Traditional template signal matching methods typically employ standard normalized cross-correlation algorithms to compare signal similarity. However, existing normalized cross-correlation matching algorithms can produce undesirable results during signal matching, primarily manifested in the following issues:
[0004] 1. Application problem of signals with the same waveform and magnitude but different lengths: When comparing two signals, the standard normalized cross-correlation algorithm may classify them as two different types of signals if their waveforms and magnitudes are identical but their lengths are different. For example, if signals x and y are constant at 1, x has a length of 500, and y has a length of 1000, then... This result may misclassify x and y as two different types of signals, failing to meet application requirements.
[0005] 2. Application problems involving signals with identical waveforms and lengths but different magnitudes: Standard normalized cross-correlation algorithms can only identify similar signals. Even if the signal magnitudes differ significantly, as long as the waveforms are similar, they will be classified as the same type of signal. For example, if signals x and y both have a length of 100, with x having a constant magnitude of 1 and y having a constant magnitude of 10, then... This result may misclassify x and y as the same type of signal, failing to meet application requirements. Summary of the Invention
[0006] This invention discloses a signal processing method, apparatus, and storage medium that can solve the problem of misjudgment caused by inconsistent lengths in the process of signal similarity judgment.
[0007] To achieve the above objectives, a signal processing method is disclosed, comprising: a first signal acquisition step, a second similarity calculation step, a third similarity judgment step, a signal length comparison step, and a long signal truncation step; wherein,
[0008] The first signal acquisition step involves acquiring, scanning, or exchanging the first and second signals to be judged.
[0009] The signal length comparison step determines whether the lengths of the first signal and the second signal are not the same. If the lengths are not the same, proceed to the long signal truncation step; if the lengths are the same, proceed to the second similarity calculation step.
[0010] In the long signal truncation step, a portion of the longer first signal or second signal is removed. The length of the truncated first signal or second truncated signal after removing the portion of the signal is equal to that of the second signal or the first signal. Then proceed to the second similarity calculation step.
[0011] The second similarity calculation step is to calculate the waveform similarity between the first signal and the second signal, or between the first truncated signal and the second signal, or between the second truncated signal and the first signal;
[0012] The third similarity judgment step is to determine whether the first signal and the second signal are similar.
[0013] The advantage of this embodiment is that, for two signals of different lengths, the most similar parts can be extracted for comparison, which can solve the problem of misjudgment caused by the difference in signal lengths and make the judgment result accurate.
[0014] Specifically, in the long signal truncation step, a portion of the longer first or second signal is truncated. The specific method is as follows:
[0015] Calculate the phase difference t_shift between the second signal and the first signal. Based on the phase difference t_shift, obtain the part of the longer first signal or the second signal that overlaps with the shorter second signal or the first signal. Take the starting point of the overlap as the starting point of the longer signal, retain the same length as the shorter signal, and truncate the rest of the longer signal.
[0016] Where t_shift is At its maximum, the phase difference between the second signal and the first signal.
[0017] The advantage of this embodiment is that by calculating the maximum phase difference between two signals, the most similar parts of the two signals can be found effectively, which makes it easier to truncate long signals.
[0018] Furthermore, after the first signal acquisition step acquires, scans, or exchanges the first signal and the second signal to be compared for similarity, it also includes preprocessing the first signal and the second signal.
[0019] Specifically, the preprocessing includes: synchronization processing and mean removal processing;
[0020] Synchronization processing ensures that the sampling frequencies of the first or second signal are consistent;
[0021] Mean removal processing removes the mean of either the first or second signal.
[0022] Furthermore, the second similarity calculation step also includes calculating the mean similarity between the first signal and the second signal; and then calculating the comprehensive similarity based on the waveform similarity and the mean similarity.
[0023] The advantage of this embodiment is that it judges the similarity of two signals from the perspectives of waveform and mean, and then combines the waveform similarity and mean similarity to obtain a judgment on whether the two signals are similar. The present invention considers all factors and has high accuracy. Under different application scenarios and needs, there can be different strategies for combining waveform similarity and mean similarity, all of which can achieve the purpose of accurately judging whether two signals are similar.
[0024] Specifically, the third similarity judgment step determines whether the first signal and the second signal are similar. The specific method is as follows:
[0025] The overall similarity is compared with the similarity threshold. If the overall similarity is greater than the similarity threshold, the first signal is considered to be similar to the second signal; otherwise, the first signal is considered to be dissimilar to the second signal.
[0026] Specifically, waveform similarity is calculated using a normalized cross-correlation algorithm.
[0027] The advantage of this embodiment is that the normalized cross-correlation algorithm has a small computational load and can accurately calculate the similarity between two signal waveforms.
[0028] Specifically, the mean similarity is calculated as follows: calculate the mean difference between the mean of the first signal and the mean of the second signal, calculate the maximum amplitude difference between the first signal and the second signal, and subtract the proportion of the mean difference to the maximum amplitude difference. This is the mean similarity.
[0029] The advantage of this embodiment is that the custom mean error calculation formula only needs to calculate the mean of the two signal strengths, which reduces the amount of computation and avoids the case where the denominator is zero. A value between - and , when its magnitude is , indicates that the means of x and y are the same; when its magnitude is -, it indicates that the means have opposite signs. The result of the mean similarity between the two signals is clear and easy to understand.
[0030] Furthermore, the comprehensive similarity is the waveform similarity multiplied by a preset first weight value, plus the mean similarity multiplied by a preset second weight value; the first weight value plus the second weight value equals...
[0031] The advantage of this embodiment is that it uses preset weights to adjust the importance of waveform similarity and mean similarity, which is easy to implement. In different application scenarios, the weight values can be adjusted according to different needs to meet the requirements, making it highly versatile. f(x,y) is between - and -. When its value is 0, it means that x and y have the same mean; when its value is -, it means that the mean signs are opposite. The overall similarity result of the two signals is clear and easy to understand.
[0032] On the other hand, the present invention discloses a signal processing apparatus, comprising: a first signal acquisition unit, a second similarity calculation unit, a third similarity judgment unit, a signal length comparison unit, and a long signal truncation unit; wherein,
[0033] The first signal acquisition unit acquires, scans, or exchanges the first and second signals to be judged.
[0034] The signal length comparison unit determines whether the lengths of the first signal and the second signal are not the same;
[0035] The long signal truncation unit truncates a portion of the longer first signal or second signal, and the truncated first or second truncated signal after truncating the portion of the signal is equal in length to the second signal or the first signal.
[0036] The second similarity calculation unit calculates the waveform similarity between the first signal and the second signal, or between the first truncated signal and the second signal, or between the second truncated signal and the first signal;
[0037] The third similarity judgment unit determines whether the first signal and the second signal are similar.
[0038] Specifically, the long signal truncation unit truncates a portion of the longer first or second signal, and the specific method is as follows:
[0039] Calculate the phase difference t_shift between the second signal and the first signal. Based on the phase difference t_shift, obtain the part of the longer first signal or the second signal that overlaps with the shorter second signal or the first signal. Take the starting point of the overlap as the starting point of the longer signal, retain the same length as the shorter signal, and truncate the rest of the longer signal.
[0040] Where t_shift is At its maximum, the phase difference between the second signal and the first signal.
[0041] Furthermore, it also includes a preprocessing unit, which preprocesses the first signal acquisition unit to acquire, scan, or exchange the first signal and the second signal to be compared for similarity.
[0042] Specifically, the preprocessing unit includes a synchronous processing module and a mean removal processing module;
[0043] The synchronization processing module ensures that the sampling frequencies of the first and second signals are consistent.
[0044] The mean-removal module removes the mean of the first and second signals.
[0045] Furthermore, the second similarity calculation unit also includes calculating the mean similarity between the first signal and the second signal; and then calculating the comprehensive similarity based on the waveform similarity and the mean similarity.
[0046] Specifically, the third similarity judgment unit compares the comprehensive similarity with the similarity threshold. If the comprehensive similarity is greater than the similarity threshold, the first signal is considered to be similar to the second signal; otherwise, the first signal is considered to be dissimilar to the second signal.
[0047] Specifically, the second similarity calculation unit calculates the waveform similarity using a normalized cross-correlation algorithm.
[0048] Specifically, the second similarity calculation unit calculates the mean difference between the mean of the first signal and the mean of the second signal, calculates the maximum amplitude difference between the first signal and the second signal, and subtracts the proportion of the mean difference to the maximum amplitude difference, which is the mean similarity.
[0049] Furthermore, the second similarity calculation unit obtains the comprehensive similarity by multiplying the waveform similarity by a preset first weight value and adding the mean similarity by a preset second weight value; the first weight value plus the second weight value equals the sum of the two weight values.
[0050] On the other hand, the present invention discloses a storage medium storing a number of instructions, which are suitable for a processor to load and execute any of the above signal processing methods.
[0051] It should be noted that the terms "first," "second," and similar terms used in this article are merely for describing the constituent elements of the technical solution and do not constitute a limitation on the technical solution, nor should they be interpreted as an indication or implication of the importance of the corresponding elements; elements with terms such as "first," "second," or similar terms indicate that at least one of the elements is included in the corresponding technical solution. Attached Figure Description
[0052] To more clearly illustrate the technical solution of the present invention and facilitate a further understanding of its technical effects, features, and objectives, the present invention will be described in detail below with reference to the accompanying drawings. The drawings constitute an essential part of the specification and are used together with Embodiment 1 of the present invention to illustrate the technical solution of the present invention, but do not constitute a limitation on the present invention.
[0053] The same reference numerals in the attached diagrams represent the same parts, specifically:
[0054] Figure 1 This is a schematic diagram of the first method in Example 1.
[0055] Figure 2 This is a schematic diagram of the second method in Example 1.
[0056] Figure 3 This is a flowchart of the third method in Example 1.
[0057] Figure 4 A schematic diagram of the signal processing step for truncating long signals.
[0058] Figure 5 This is a schematic diagram of the sample signals for the comparative experiment.
[0059] Figure 6 This is a comparison chart of the results of a comparative experiment.
[0060] Figure 7 This is a schematic diagram of the first device structure in Example 2.
[0061] Figure 8 This is a schematic diagram of the second device structure in Example 2.
[0062] Figure 9 This is a schematic diagram of the third device structure in Example 2.
[0063] Figure 10 This is a schematic diagram of the fourth device structure in Example 2.
[0064] Figure 11 This is a schematic diagram of the preprocessing unit.
[0065] in:
[0066] 100. First signal acquisition step;
[0067] 110. First signal;
[0068] 120. Second signal;
[0069] 140. Steps for comparing signal lengths;
[0070] 150. Steps for truncating long signals;
[0071] 160. First short signal;
[0072] 170. Second short signal;
[0073] 200. Second similarity calculation steps;
[0074] 210. Waveform similarity;
[0075] 220. Mean similarity;
[0076] 230. Overall similarity;
[0077] 300. Third similarity judgment step;
[0078] 310. Similarity Threshold
[0079] 600. Signal processing device;
[0080] 610. First signal acquisition unit;
[0081] 611. Preprocessing unit;
[0082] 6111. Synchronization processing module;
[0083] 6112. Mean removal module;
[0084] 614. Signal Length Comparison Unit;
[0085] 615. Long signal truncation unit;
[0086] 620. Second similarity calculation unit;
[0087] 630. Third similarity judgment unit. Detailed Implementation
[0088] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described below are merely illustrative of the technical solutions of the present invention, and not intended to limit the invention. Furthermore, the parts described in the embodiments or drawings are merely illustrative examples of relevant parts of the present invention, and not the entirety of the invention.
[0089] Example 1:
[0090] A signal processing method, such as Figure 1 and Figure 2 As shown, the specific steps are as follows:
[0091] S1, First signal acquisition step 100;
[0092] Acquire, scan, or exchange the first signal 110 and the second signal 120 to be judged; the purpose of this step is to obtain the complete first signal 110 and the second signal 120 that need to be compared for similarity. Specifically, this can be done by retrieving from a database, receiving signals from a sensor, or obtaining them through data interaction, etc.
[0093] S11. Preprocess the first signal 110 and the second signal 120. The preprocessing methods are synchronization processing and signal mean removal processing. Synchronization processing makes the sampling frequencies of the first signal 110 or the second signal 120 consistent. Signal mean removal processing removes the mean of the first signal 110 or the second signal 120. Preprocessing is a routine operation after signal acquisition. It can also be noise reduction processing, amplification processing, etc., and can be selected arbitrarily according to actual needs. Of course, signal preprocessing can also be omitted, such as... Figure 3 As shown, after scanning or exchanging the first signal 110 and the second signal 120 to be judged, the process directly proceeds to step S12 or step S2.
[0094] S12, Signal Length Comparison Step 140: Determine if the length len(x) of the first signal 110 is the same as the length len(y) of the second signal 120. If len(x) = len(y), proceed directly to step S2. If len(x) ≠ len(y), proceed to step S15, truncating a portion of the longer first signal 110 or second signal 120. The lengths of the truncated first signal 160 and second signal 170 are equal, and then proceed to step S2. Step S15 is optional and is only used when the lengths of the first signal 110 and the second signal 120 are not the same. In this step, the lengths of the first signal 110 and the second signal 120 can be compared by comparing the complete first signal 110 and the second signal 120, or by comparing the first signal 110 or the second signal 120 within one cycle, or by other methods as needed. The equality can also be adjusted as needed, allowing for a certain range of length differences. Of course, it is also possible to not compare the lengths of the first signal 110 and the second signal 120, such as... Figure 3 As shown, after scanning or exchanging the first signal 110 and the second signal 120 to be judged, the process directly proceeds to step S2.
[0095] S15, Long signal truncation step 150, as follows Figure 4 As shown, the phase difference t_shift between the second signal 120 and the first signal 110 is calculated. Based on the phase difference t_shift, the portion of the longer first signal 110 or the second signal 120 that overlaps with the shorter second signal 120 or the first signal 110 is obtained, and the remaining portion of the longer first signal 110 or the second signal 120 is deleted; where t_shift represents The phase difference corresponding to the time interval is the phase difference between the second signal 120 and the first signal 110. The purpose of this step is to find the most similar and equally long portion of the first signal 110 and the second signal 120, facilitating the comparison of the waveform similarity 210 between the two signals. Of course, other methods can also be used to find the most similar and equally long portion, such as comparing the similarity of the two signals segment by segment and extracting the part with the highest similarity for separate comparison. Alternatively, the long signal can be left untrunculated, such as... Figure 3 As shown, after scanning or exchanging the first signal 110 and the second signal 120 to be judged, the process directly proceeds to step S2.
[0096] S2, Second Similarity Calculation Step 200, the specific process is as follows:
[0097] S21. The waveform similarity 210 is calculated using the cross-correlation factor. The cross-correlation factor is calculated using a normalized cross-correlation algorithm, and the calculation formula is as follows:
[0098]
[0099]
[0100] In the formula, t represents the phase difference between the second signal 120 and the first signal 110;
[0101] The mean similarity of 220 is calculated using the mean error factor. The formula for calculating the mean error factor is as follows:
[0102]
[0103] In the formula, and This represents the average of the first signal 110 and the second signal 120, where ∈ represents a small value.
[0104] In this step, other formulas can also be used to calculate the similarity 210 between the two signal waveforms, or other formulas can be used to calculate the similarity of the mean or amplitude of the two signals.
[0105] S22. Calculate the comprehensive similarity score of 230 using the comprehensive factor. The formula for calculating the comprehensive factor is:
[0106]
[0107] Where ω1+ω2=1;
[0108] In the formula, f(x,y) is the comprehensive factor, x is the first signal 110, and y is the second signal 120. Let θ be the cross-correlation factor 210, θ be the mean error factor 220, and ω1 and ω2 be the first and second weight values, respectively, where 0 < ω1 and ω2 < 1. In this embodiment, the first weight value ω1 and the second weight value ω2 are both 0.5.
[0109] In this step, when using other formulas to calculate the similarity 210 between two signal waveforms, or to calculate the similarity between the mean or amplitude of two signals, the corresponding comprehensive factor calculation formula is adjusted accordingly, and the weight value is determined based on the actual situation.
[0110] S3, Third similarity judgment step 300;
[0111] The overall similarity score 230 is compared with the similarity threshold 310. If the overall similarity score 230 is greater than the similarity threshold 310, the first signal 110 and the second signal 120 are considered to be similar; otherwise, the first signal 110 and the second signal 120 are considered to be dissimilar.
[0112] In this step, the similarity threshold 310 can be an empirical value, a calculated value, or obtained by other means depending on the actual situation. The similarity threshold 310 can also be two values, an upper threshold and a lower threshold. Values exceeding the upper threshold are considered similar, and values below the lower threshold are considered dissimilar. Further judgment is needed between the upper and lower thresholds through other means.
[0113] In this embodiment, the accuracy of the judgment is significantly improved compared to the traditional judgment method. The effects of the comparative experiment are shown below. Figure 5 and Figure 6 As shown.
[0114] Example 2:
[0115] A signal processing device 600, such as Figure 7 As shown, it includes a first signal acquisition unit 610, a second similarity calculation unit 620, a third similarity judgment unit 630, a preprocessing unit 611, a signal length comparison unit 614, and a long signal truncation unit 615.
[0116] In this embodiment, the first signal acquisition unit 610 receives the first signal 110 and the second signal 120. The first signal acquisition unit 610 transmits the first signal 110 and the second signal 120 to the preprocessing unit 611. The preprocessing unit 611 transmits the preprocessed first signal 110 and the second signal 120 to the signal length comparison unit 614. The signal length comparison unit 614 processes the compared signals through the long signal truncation unit 615 and sends them to the second similarity calculation unit 620, or directly sends the compared signals to the second similarity calculation unit 620. The second similarity calculation unit 620 sends the calculation result to the third similarity judgment unit 630, and the third similarity judgment unit 630 outputs the judgment result.
[0117] The first signal acquisition unit 610 acquires, scans, or exchanges the first signal 110 and the second signal 120 to be judged; in this embodiment, the signal input terminal of the first signal acquisition unit 610 is connected to external data; such as Figure 7 As shown, the output of the first information acquisition unit 610 is connected to the second similarity calculation unit 620 in sequence through the preprocessing unit 611, the signal length comparison unit 614, and the long signal truncation unit 615; as shown Figure 8 As shown, the first information acquisition unit 610 can also be directly connected to the second similarity calculation unit 620 as needed; for example... Figure 9 As shown, the first information acquisition unit 610 can also be connected to the second similarity calculation unit 620 through the preprocessing unit 611; as Figure 10 As shown, the first information acquisition unit 620 can also be connected to the second similarity calculation unit 620 in sequence through the signal length comparison unit 614 and the long signal truncation unit 615.
[0118] The preprocessing unit 611 and the first signal acquisition unit 610 acquire, scan, or exchange the first signal 110 and the second signal 120 to be compared for similarity. For example... Figure 11 As shown, the preprocessing unit 611 includes a sampling frequency synchronization processing module 6111 and a signal averaging processing module 6112. The synchronization processing module 6111 makes the sampling frequencies of the first signal 110 or the second signal 120 consistent. The signal averaging processing module 6112 removes the average of the first signal 110 or the second signal 120. In this embodiment, the synchronization processing module 6111 receives the first signal 110 and the second signal 120 sent by the long signal truncation unit, processes them, and sends them to the averaging processing module 6112, and then to the signal length comparison unit 614. Of course, the preprocessing unit 611 may also include other processing modules, depending on the needs of signal preprocessing.
[0119] After receiving the information sent by the mean processing module 6112, the signal length comparison unit 614 compares the length len(x) of the first signal 110 and the length len(y) of the second signal 120.
[0120] If len(x) ≠ len(y), the signal length comparison unit 614 sends the first signal 110 and the second signal 120 to the long signal truncation unit 615; the long signal truncation unit 615 truncates part of the longer first signal 110 or second signal 120, and the lengths of the first truncated signal 160 and the second truncated signal 170 after truncating part of the signal are equal, and then the first truncated signal 160 and the second truncated signal 170 are sent to the second similarity calculation unit 620;
[0121] If len(x) = len(y), the signal length comparison unit 614 sends the first signal 110 and the second signal 120 to the second similarity calculation unit 620.
[0122] The long signal truncation unit 615 truncates a portion of the longer first signal 110 or second signal 120, specifically as follows:
[0123] Calculate the phase difference t_shift between the second signal 120 and the first signal 110. Based on the phase difference t_shift, obtain the part of the longer first signal 110 or the second signal 120 that overlaps with the shorter second signal 120 or the first signal 110. Delete the remaining part of the longer first signal 110 or the second signal 120.
[0124] Where t_shift is At its maximum, the phase difference between the second signal 120 and the first signal 110.
[0125] In this embodiment, the signal length comparison unit 614 and the long signal truncation unit 615 can also be integrated into one unit to complete the comparison and truncation functions of the two signals.
[0126] The second similarity calculation unit 620 calculates the waveform similarity 210 and the mean similarity 220 between the first signal 110 and the second signal 120, and calculates the comprehensive similarity 230 based on the waveform similarity 210 and the mean similarity 220.
[0127] The second similarity calculation unit 620 calculates the comprehensive similarity 230 using a comprehensive factor. The formula for calculating the comprehensive factor is as follows:
[0128]
[0129] Where ω1+ω2=1;
[0130] In the formula, f(x,y) is the comprehensive factor, x is the first signal 110, and y is the second signal 120. θ is the cross-correlation factor 210, θ is the mean error factor 220, ω1 and ω2 are the first weight value and the second weight value, respectively, 0<ω1, ω2<1.
[0131] The second similarity calculation unit 620 calculates the waveform similarity 210 using a cross-correlation factor. The cross-correlation factor is calculated using a normalized cross-correlation algorithm, and the calculation formula is as follows:
[0132]
[0133]
[0134] In the formula, t represents the phase difference between the second signal 120 and the first signal 110.
[0135] The second similarity calculation unit 620 calculates the mean similarity 220 using the mean error factor. The formula for calculating the mean error factor is as follows:
[0136]
[0137] In the formula, and This represents the average of the first signal 110 and the second signal 120, where ∈ represents a small value.
[0138] In this embodiment, the calculation formula built into the second similarity calculation unit 620 is programmable, and the formula can be programmed into the second similarity calculation unit 620 as needed. The second similarity calculation unit 620 can be a local vehicle control chip or it can be set up on a cloud platform and connected to the first signal acquisition unit 610 via wireless communication.
[0139] The third similarity judgment unit 630 compares the comprehensive similarity 230 with the similarity threshold 310. If the comprehensive similarity 230 is greater than the similarity threshold 310, then the first signal 110 and the second signal 120 are considered similar; otherwise, the first signal 110 and the second signal 120 are considered dissimilar.
[0140] In this embodiment, the third similarity judgment unit 630 can be a local car control chip or it can be set on a cloud platform and connected to the second similarity calculation unit 620 via wireless communication.
[0141] Example 3:
[0142] A storage medium, which can be a hard drive or a USB flash drive, is designed to be located locally in the vehicle and stores several instructions. These instructions can be loaded by the vehicle's onboard processor to execute any of the signal processing methods described above. Alternatively, the storage medium can be a storage device within a cloud server, receiving the first and second signals via wireless or wired communication technology and executing any of the signal processing methods described above. The storage medium can also be a storage device on a portable terminal, receiving the first and second signals via wireless or wired communication technology and executing any of the signal processing methods described above.
[0143] It should be noted that the above embodiments are only for more clearly illustrating the technical solution of the present invention. Those skilled in the art will understand that the implementation of the present invention is not limited to the above content. Any obvious changes, substitutions or replacements made based on the above content do not exceed the scope of the technical solution of the present invention. Other implementations will also fall within the scope of the present invention without departing from the concept of the present invention.
Claims
1. A signal processing method, characterized in that, include: The signal acquisition step (100), the similarity calculation step (200), the similarity judgment step (300), the signal length comparison step (140), and the long signal truncation step (150) are all included. The first signal acquisition step (100) involves acquiring, scanning, or exchanging the first signal (110) and the second signal (120) to be judged. The signal length comparison step (140) determines whether the lengths of the first signal (110) and the second signal (120) are the same. If the lengths are not the same, the process proceeds to the long signal truncation step (150); if the lengths are the same, the process proceeds to the second similarity calculation step (200). The long signal truncation step (150) truncates a portion of the longer first signal (110) or second signal (120). The first truncated signal (160) or the second truncated signal (170) after truncating the portion of the signal has the same length as the second signal (120) or the first signal (110), and then proceeds to the second similarity calculation step (200). The second similarity calculation step (200) calculates the waveform similarity (210) between the first signal (110) and the second signal (120), or between the first truncated signal (160) and the second signal (120), or between the second truncated signal (170) and the first signal (110), and calculates the mean similarity (220) between the first signal (110) and the second signal (120); then calculates the comprehensive similarity (230) based on the waveform similarity (210) and the mean similarity (220). The mean similarity (220) is calculated as follows: calculate the mean difference between the mean of the first signal and the mean of the second signal, calculate the maximum amplitude difference between the first signal and the second signal, and subtract the proportion of the mean difference to the maximum amplitude difference from 1 to get the mean similarity (220). The third similarity judgment step (300) determines whether the first signal (110) and the second signal (120) are similar; In the long signal truncation step (150), a portion of the longer first signal (110) or second signal (120) is truncated. The specific method is as follows: Calculate the phase difference between the second signal (120) and the first signal (110). According to the phase difference The portion of the longer first signal (110) or the second signal (120) that overlaps with the shorter second signal (120) or the first signal (110) is obtained. The starting point of the overlap is taken as the starting point of the longer signal, and the same length as the shorter signal is retained. The rest of the longer signal is truncated. in, for At its maximum, the phase difference between the second signal (120) and the first signal (110).
2. The signal processing method as described in claim 1, characterized in that, After the first signal acquisition step (100) acquires, scans, or exchanges the first signal (110) and the second signal (120) to be compared for similarity, it further includes preprocessing the first signal (110) and the second signal (120).
3. The signal processing method as described in claim 2, characterized in that, The preprocessing specifically includes: synchronization processing and mean removal processing; The synchronization process makes the sampling frequencies of the first signal (110) or the second signal (120) consistent; The mean removal process removes the mean of the first signal (110) or the second signal (120).
4. The signal processing method as described in claim 3, characterized in that, The third similarity judgment step (300) determines whether the first signal (110) and the second signal (120) are similar. The specific method is as follows: The comprehensive similarity (230) is compared with the similarity threshold (310). If the comprehensive similarity (230) is greater than the similarity threshold (310), the first signal (110) is considered to be similar to the second signal (120); otherwise, the first signal (110) is considered to be dissimilar to the second signal (120).
5. The signal processing method as described in claim 4, characterized in that, The waveform similarity (210) is calculated by a normalized cross-correlation algorithm.
6. The signal processing method as described in claim 5, characterized in that, The comprehensive similarity (230) is the waveform similarity (210) multiplied by a preset first weight value, plus the mean similarity (220) multiplied by a preset second weight value; the first weight value plus the second weight value equals 1.
7. A signal processing apparatus (600), characterized in that, include: The system comprises a first signal acquisition unit (610), a second similarity calculation unit (620), a third similarity judgment unit (630), a signal length comparison unit (614), and a long signal truncation unit (615); wherein, The first signal acquisition unit (610) acquires, scans, or exchanges the first signal (110) and the second signal (120) to be judged. The signal length comparison unit (614) determines whether the lengths of the first signal (110) and the second signal (120) are the same; The long signal truncating unit (615) truncates a portion of the longer first signal (110) or second signal (120), and the first truncated signal (160) or second truncated signal (170) after truncating the portion of the signal has the same length as the second signal (120) or the first signal (110). The second similarity calculation unit (620) calculates the waveform similarity (210) between the first signal (110) and the second signal (120), or between the first truncated signal (160) and the second signal (120), or between the second truncated signal (170) and the first signal (110), and calculates the mean similarity (220) between the first signal (110) and the second signal (120); and then calculates the comprehensive similarity (230) based on the waveform similarity (210) and the mean similarity (220). Calculate the mean difference between the first signal and the second signal, calculate the maximum amplitude difference between the first signal and the second signal, and subtract the proportion of the mean difference to the maximum amplitude difference from 1 to get the mean similarity (220). The third similarity judgment unit (630) determines whether the first signal (110) and the second signal (120) are similar; The long signal truncating unit (615) truncates a portion of the longer first signal (110) or second signal (120), specifically by: Calculate the phase difference between the second signal (120) and the first signal (110). According to the phase difference The portion of the longer first signal (110) or the second signal (120) that overlaps with the shorter second signal (120) or the first signal (110) is obtained. The starting point of the overlap is taken as the starting point of the longer signal, and the same length as the shorter signal is retained. The rest of the longer signal is truncated. in, for At its maximum, the phase difference between the second signal (120) and the first signal (110).
8. The signal processing apparatus (600) as claimed in claim 7, characterized in that, It also includes a preprocessing unit (611) for preprocessing the first signal acquisition unit to acquire, scan or exchange the first signal (110) and the second signal (120) to be compared for similarity.
9. The signal processing apparatus (600) as claimed in claim 8, characterized in that, The preprocessing unit (611) includes a synchronous processing module (6111) and a mean-removal processing module (6112). The synchronization processing module (6111) makes the sampling frequencies of the first signal (110) and the second signal (120) consistent; The mean removal processing module (6112) removes the mean of the first signal (110) and the second signal (120).
10. The signal processing apparatus (600) as claimed in claim 9, characterized in that, The third similarity judgment unit (630) compares the comprehensive similarity (230) with the similarity threshold (310). If the comprehensive similarity (230) is greater than the similarity threshold (310), the first signal (110) is considered to be similar to the second signal (120); otherwise, the first signal (110) is considered to be dissimilar to the second signal (120).
11. The signal processing apparatus (600) as claimed in claim 10, characterized in that, The second similarity calculation unit (620) calculates the waveform similarity (210) through a normalized cross-correlation algorithm.
12. The signal processing apparatus (600) as claimed in claim 11, characterized in that, The second similarity calculation unit (620) obtains a comprehensive similarity (230) by multiplying the waveform similarity (210) by a preset first weight value and adding the mean similarity (220) by multiplying it by a preset second weight value; the first weight value plus the second weight value equals 1.
13. A storage medium, characterized in that, The storage medium stores a plurality of instructions which are applicable to a processor for loading to execute any of the signal processing methods described in claims 1 to 6.