Signal time sequence alignment method, device and equipment and readable storage medium
By determining and selecting highly relevant candidate alignment points for timing alignment of audio signals, the problem of audio signal timing mismatch in acoustic equipment is solved, and the accuracy of signal alignment and equipment failure analysis are improved.
Patent Information
- Application Number
- CN202410822488.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-10
AI Technical Summary
In the production process of acoustic equipment, the initial moment of the audio signal does not match the timing of the standard audio signal, resulting in difficulty in signal alignment and affecting equipment failure analysis and product quality.
By obtaining the standard audio signal and the target audio signal to be aligned, all candidate alignment points are determined, the correlation under each candidate point is calculated, and the candidate point corresponding to the target correlation that is greater than or equal to the preset correlation threshold is selected. As a target alignment point, perform signal timing alignment.
It effectively aligns the timing of audio signals, improves signal correlation and alignment accuracy, and ensures fault analysis and product quality of acoustic equipment.
Smart Images

Figure CN118629428A
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal processing technology, and in particular to a signal timing alignment method, device, equipment and readable storage medium. Background Art
[0002] During the production process of acoustic equipment, by playing specific sound signals in different frequency bands, it is possible to analyze and determine whether the audio played by the acoustic equipment is consistent with the expected audio, thereby determining whether the acoustic equipment has a fault, and analyzing the frequency band and time when the fault occurs, so as to improve the production process and enhance the overall product quality.
[0003] Generally, the location of the abnormal signal can be determined by collecting an audio signal generated by the device under test and comparing it with the standard audio signal. However, due to the reasons of the acquisition device or operation, directly aligning the initial time of the audio signal collected by the device with the initial time of the standard audio signal usually results in a low correlation and timing mismatch between the two. Therefore, it is necessary to perform timing alignment operation on the collected audio signal and the standard audio signal to facilitate subsequent further processing.
[0004] Therefore, how to effectively align the timing of audio signals is a technical problem that needs to be solved urgently in this technical field. Summary of the invention
[0005] The main purpose of the present application is to provide a signal timing alignment method, device, equipment and readable storage medium, aiming to solve the technical problem of how to effectively align the timing of audio signals.
[0006] To achieve the above object, the present application provides a signal timing alignment method, the signal timing alignment method comprising:
[0007] Obtain a standard audio signal and a target audio signal to be aligned, and determine all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal;
[0008] For each of the candidate alignment points, determining a correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with a starting signal sampling point of the target audio signal;
[0009] Determine a target correlation among all the correlations, select a candidate alignment point corresponding to the target correlation as the target alignment point, and align the standard audio signal with the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
[0010] In one embodiment, the step of determining a target relevance among all the relevances comprises:
[0011] The maximum value among all the correlations is selected as the target correlation.
[0012] In one embodiment, the step of determining a target relevance among all the relevances comprises:
[0013] Combining all the correlations in sequence to obtain a correlation sequence, determining a maximum value in the correlation sequence as a maximum correlation, and determining correlations adjacent to the maximum correlation in the correlation sequence;
[0014] The correlation degree adjacent to the maximum correlation degree on the left in the correlation degree sequence is used as the first correlation degree, and the correlation degree adjacent to the maximum correlation degree on the right in the correlation degree sequence is used as the second correlation degree;
[0015] sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence;
[0016] Calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence;
[0017] The correlation degree in the candidate mutual correlation sequence corresponding to the maximum value in the optimized mutual correlation sequence is determined as the target correlation degree.
[0018] In one embodiment, the step of determining a target relevance among all the relevances comprises:
[0019] Combining all the correlations in sequence to obtain a correlation sequence, determining a maximum value in the correlation sequence as a maximum correlation, and determining correlations adjacent to the maximum correlation in the correlation sequence;
[0020] The correlation degree adjacent to the maximum correlation degree on the left in the correlation degree sequence is used as the first correlation degree, and the correlation degree adjacent to the maximum correlation degree on the right in the correlation degree sequence is used as the second correlation degree;
[0021] sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence;
[0022] Calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence;
[0023] Updating the values of each element in the optimized mutual correlation sequence, wherein the value of the second element in the updated optimized mutual correlation sequence is the square of the value of the first element in the updated optimized mutual correlation sequence, and the value of the third element in the updated optimized mutual correlation sequence is a preset fixed constant;
[0024] Calculating the product between the updated optimized mutual correlation sequence and the preset third-order matrix to obtain an accurate mutual correlation sequence;
[0025] The correlation degree in the candidate mutual correlation sequence corresponding to the maximum value in the precise mutual correlation sequence is determined as the target correlation degree.
[0026] In one embodiment, the step of determining the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the start signal sampling point of the target audio signal comprises:
[0027] When the candidate alignment point is aligned with the start signal sampling point of the target audio signal, a convolution calculation is performed on the standard audio signal and the target audio signal to obtain a correlation between the standard audio signal and the target audio signal.
[0028] In one embodiment, after the step of aligning the standard audio signal and the target audio signal according to the target alignment point, wherein the target correlation is a correlation greater than or equal to a preset correlation threshold among all the correlations, the method further includes:
[0029] Performing Fourier transformation on the aligned target audio signal and the standard audio signal to obtain the target audio signal in the frequency domain and the standard audio signal in the frequency domain;
[0030] Calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain;
[0031] If the similarity is greater than a preset similarity threshold, it is determined that the target audio signal is aligned successfully with the standard audio signal.
[0032] In one embodiment, the step of calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain comprises:
[0033] Combining the signal power of the target audio signal in each frame frequency domain in sequence to obtain a first signal power vector;
[0034] Combining the signal power of the standard audio signal in each frame frequency domain in sequence to obtain a second signal power vector;
[0035] The distance between the first signal power vector and the second signal power vector is calculated, and the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain is determined based on the distance, wherein the distance is negatively correlated with the similarity.
[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a signal timing alignment device, the signal timing alignment device comprising:
[0037] an acquisition module, configured to acquire a standard audio signal and a target audio signal to be aligned, and determine all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal;
[0038] A calculation module, configured to determine, for each of the candidate alignment points, a correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with a starting signal sampling point of the target audio signal;
[0039] An alignment module is used to determine a target correlation among all the correlations, select a candidate alignment point corresponding to the target correlation as the target alignment point, and align the standard audio signal with the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a signal timing alignment device, which includes a microphone array and a processor, and the microphone array is electrically connected to the processor; the processor is used to execute the steps of the signal timing alignment method as described above.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a readable storage medium, which is a computer-readable storage medium, and a program for implementing the signal timing alignment method is stored on the computer-readable storage medium. The program for implementing the signal timing alignment method is executed by a processor to implement the steps of the signal timing alignment method as described above.
[0042] The present application also provides a computer program product, including a computer program, which implements the steps of the signal timing alignment method as described above when the computer program is executed by a processor.
[0043] In the present application, a standard audio signal and a target audio signal to be aligned are obtained, and all candidate alignment points are determined; for each of the candidate alignment points, the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal is determined; a target correlation among all the correlations is determined, and the candidate alignment point corresponding to the target correlation is selected as the target alignment point, and the standard audio signal and the target audio signal are aligned according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold. In this way, the embodiment of the present application determines all possible alignment points (all candidate alignment points) of the starting signal sampling point of the target audio signal, that is, determines all possible alignment points between the target audio signal and the standard audio signal, calculates the correlation between the two signals when the target audio signal and the standard audio signal are aligned with each candidate alignment point, and then selects the candidate alignment point corresponding to the target correlation greater than the preset correlation threshold as the target alignment point, so that after the target audio signal and the standard audio signal are aligned with the target alignment point, there is a higher correlation between the two signals, thereby effectively aligning the timing of the two audio signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 This is a flow chart of the first embodiment of the signal timing alignment method of the present application;
[0047] Figure 2 This is a simulation diagram of an ideal alignment point experiment involved in an embodiment of the signal timing alignment method of the present application;
[0048] Figure 3 This is an experimental simulation diagram of target alignment points selected before matrix multiplication optimization involved in an embodiment of the signal timing alignment method of the present application;
[0049] Figure 4 This is a simulation diagram of a target alignment point experiment selected after a matrix multiplication optimization according to an embodiment of the signal timing alignment method of the present application;
[0050] Figure 5This is an experimental simulation diagram of target alignment points selected after the optimization of the quadratic matrix multiplication involved in an embodiment of the signal timing alignment method of the present application;
[0051] Figure 6 This is a schematic diagram of the device structure of the signal timing alignment device of the present application;
[0052] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the signal timing alignment device in the embodiment of the present application.
[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0054] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0055] The main solution of the present application is: obtaining a standard audio signal and a target audio signal to be aligned, and determining all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal; for each of the candidate alignment points, determining the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal; determining a target correlation among all the correlations, selecting the candidate alignment point corresponding to the target correlation as the target alignment point, and aligning the standard audio signal and the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
[0056] The present application determines all possible alignment points (all candidate alignment points) of the starting signal sampling point of the target audio signal, that is, determines all possible alignment points between the target audio signal and the standard audio signal, calculates the correlation between the two signals when the target audio signal and the standard audio signal are aligned with each candidate alignment point, and then selects the candidate alignment point corresponding to the target correlation greater than the preset correlation threshold as the target alignment point, so that after the target audio signal and the standard audio signal are aligned with the target alignment point, the two signals have a higher correlation, thereby effectively aligning the timing of the two audio signals.
[0057] It should be noted that the executor of each embodiment of the signal timing alignment method of the present application can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a signal timing alignment device that can realize the above functions, such as headphones, wearable devices, etc. This embodiment does not impose specific restrictions on this.
[0058] Based on this, the present application proposes a signal timing alignment method of the first embodiment, please refer to Figure 1 The signal timing alignment method comprises steps S10 to S30:
[0059] Step S10, obtaining a standard audio signal and a target audio signal to be aligned, and determining all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal;
[0060] Signal timing alignment (Timing Alignment or Signal Alignment) refers to the process of synchronizing signals in time so that they reach a consistent state at a specific reference point or event.
[0061] It can be understood that the audio signal heard by the human ear is an analog signal. When collecting analog signals, the signals need to be sampled, quantized and encoded before they can finally be stored or transmitted. Specifically, sampling is the process of converting continuous analog signals into discrete signals. By sampling the signal at fixed time intervals, a series of sample values can be obtained. Therefore, the collected audio signal consists of one or more signal sampling points.
[0062] It should be noted that when initially obtaining the target audio signal and the standard audio signal, the starting signal sampling point of the target audio signal is aligned with the starting signal sampling point of the standard audio signal. For the convenience of subsequent elaboration and explanation, the moment when the starting signal sampling point is located is denoted as the zero moment, the moments before the zero moment are negative moments, and the moments after the zero moment are positive moments.
[0063] The standard audio signal can specifically be an audio signal set in advance, or it can be a standard audio signal selected from a pre-set standard audio signal library. Exemplarily, in the application scenario of audio recognition, it is necessary to determine whether the structures of the target audio signal to be recognized and the standard audio signal are consistent to determine whether the target audio signal is qualified. Specifically, the audio recognition model is trained using the pre-prepared audio data. The audio data is divided into two parts, one part is used as the training set, and the other part is used as the test set. A machine learning algorithm is used to establish the audio recognition model, such as identifying the language category to which the audio signal belongs. It is trained through the training set to optimize the model parameters. The test set is substituted into the model for calculation to perform model verification. After the verification is passed, the trained audio recognition model is obtained. At this time, after obtaining the target audio signal, the target audio signal can be input into the trained audio recognition model to obtain the audio recognition result of the target audio signal. Then, an audio signal with the same audio recognition result is selected from the test set as the standard audio signal to perform time series alignment on the target audio signal and this standard audio signal, and whether the structures are consistent is determined based on the time series aligned audio signal, which can improve the accuracy of the determination result of whether the structures are consistent.
[0064] Furthermore, in the above example, after obtaining the pre-prepared audio data, the audio data can also be preprocessed. Specifically, the preprocessing includes resampling, pre-emphasis, and / or windowing. Among them, resampling is to resample the audio data at a target sampling rate lower than the original sampling rate of the audio data to reduce the data volume and improve the training efficiency of the model. Pre-emphasis is to emphasize the high-frequency part of the speech to remove the influence of lip radiation and increase the resolution of the high-frequency part of the speech. Pre-emphasis is achieved through a high-pass digital filter. Specifically, the high-pass digital filter can be represented as a transfer function. Let the signal sampling value at time n be x(n), and the result after pre-emphasis processing is y(n)) = x(n) - ax(n - 1), where a is the pre-emphasis coefficient and 0.9 < a < 1.0. Windowing is to divide the audio data into shorter frames and apply a window function to each frame to reduce the sudden changes at the beginning and end of the frame, thereby reducing spectral leakage. The window function includes the Hamming window, the Hanning window, etc. This embodiment does not make specific limitations on this.
[0065] Furthermore, in the above example, after the audio data is obtained, the time-frequency features of the audio data can be extracted, and the model can be trained using the time-frequency features as the input of the model. Specifically, the time-frequency features of the audio data can be extracted by MFCCs (Mel Frequency Cepstral Coefficients), STFT (Short-Time Fourier Transform), etc., and this embodiment does not impose specific restrictions on this.
[0066] Furthermore, in the above example, the machine learning algorithm may specifically be SVM (Support Vector Machine), the kernel function of which may be RBF (Radial Basis Function) kernel, and the optimized model parameters include penalty coefficient C, gamma parameter, and the like.
[0067] It should be noted that the target number of virtual signal sampling points is a uniformly distributed signal sampling point, and the time interval between adjacent virtual signal sampling points is consistent with the time interval between adjacent signal sampling points in the standard audio signal. As one embodiment, the virtual signal sampling point can be a virtual signal sampling point, that is, it is not a real signal sampling point. It can be understood that there is no signal before the standard audio signal, and naturally there will be no signal sampling point. The virtual signal sampling point is a virtual signal sampling point for the convenience of understanding all possible alignment points of the target audio signal. As another embodiment, the shorter audio signal of the standard audio signal and the target audio signal can be copied to the front of the standard audio signal, and the signal sampling points included in the signal copied before the standard audio signal are used as virtual signal sampling points. This embodiment does not make specific restrictions on this. For example, assuming that the target audio signal is shorter than the standard audio signal and the target audio signal, the target audio signal can be copied to the front of the standard audio signal in a manner that the end signal sampling point of the target audio signal is adjacent to the start signal sampling point of the standard audio signal, and the signal sampling points included in the target audio signal copied before the standard audio signal are used as virtual signal sampling points.
[0068] Step S20, for each of the candidate alignment points, determining a correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with a starting signal sampling point of the target audio signal;
[0069] The candidate alignment point is aligned with the starting signal sampling point of the target audio signal to indicate that the candidate alignment point and the starting signal sampling point of the target audio signal are at the same time.
[0070] The correlation represents the correlation between the standard audio signal and the target audio signal. Specifically, the correlation between the two can be evaluated in a known manner, such as Pearson correlation coefficient, mutual information, convolution value, etc., and this embodiment does not make any specific limitation thereto.
[0071] Step S30, determining a target correlation among all the correlations, selecting a candidate alignment point corresponding to the target correlation as the target alignment point, and aligning the standard audio signal with the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
[0072] The preset correlation threshold is smaller than the maximum value of all correlations by a threshold value, and preferably larger than 0.5. The candidate alignment point corresponding to the target correlation is the candidate alignment point used to calculate the correlation in the above step.
[0073] It should be noted that if there are multiple target correlations, and the candidate alignment points corresponding to the target correlations are all virtual signal sampling points, then the candidate alignment point with the latest timing among the candidate alignment points corresponding to the target correlations can be selected as the target alignment point; if there are multiple target correlations, and the candidate alignment points corresponding to the target correlations are all signal sampling points of the standard audio signal, then the candidate alignment point with the earliest timing among the candidate alignment points corresponding to the target correlations can be selected as the target alignment point; if there are multiple target correlations, and the candidate alignment points corresponding to the target correlations include the starting signal sampling point of the standard audio signal, then the starting signal sampling point of the standard audio signal can be selected as the target alignment point, so that the signal length of the timing alignment between the standard audio signal and the target audio signal is the longest.
[0074] In this embodiment, the standard audio signal and the target audio signal are aligned according to the target alignment point. Specifically, the standard audio signal is fixed, and the target audio signal is moved along the time axis until the starting signal sampling point of the target audio signal and the target alignment point are at the same time, so as to obtain the aligned standard audio signal and the target audio signal. Specifically, if the target alignment point is a virtual signal sampling point, the target audio signal is moved forward along the time axis. If the target alignment point is a signal sampling point of the standard audio signal, the target audio signal is moved backward along the time axis or does not move (when the target alignment point is the starting signal sampling point of the standard audio signal, the target audio signal does not move). For example, in one scenario, assuming that the target alignment point is the signal sampling point of the standard audio signal at the kth moment, the starting signal sampling point at the zero moment of the target alignment point moves along the time axis to the kth moment, and the signals before the k moments are empty, which is equivalent to inserting an empty signal at the kth moment between the target audio signals. The audio playback effect is that the target audio signal starts to be played at the kth moment. In another scenario, assuming that the target alignment point is the virtual signal sampling point at the -kth moment, the starting signal sampling point at the zero moment of the target alignment point moves along the time axis to the -kth moment, which is equivalent to the signal of the target audio signal before the k moments being cut off, and the audio playback effect is to start playing from the target audio signal at the kth moment.
[0075] In this embodiment, a standard audio signal and a target audio signal to be aligned are obtained, and all candidate alignment points are determined, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal; for each of the candidate alignment points, the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal is determined; a target correlation among all the correlations is determined, and the candidate alignment point corresponding to the target correlation is selected as the target alignment point, and the standard audio signal and the target audio signal are aligned according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold. In this way, the present embodiment determines all possible alignment points (all candidate alignment points) of the starting signal sampling point of the target audio signal, that is, determines all possible alignment points between the target audio signal and the standard audio signal, calculates the correlation between the two signals when the target audio signal and the standard audio signal are aligned with each candidate alignment point, and then selects the candidate alignment point corresponding to the target correlation greater than the preset correlation threshold as the target alignment point, so that after the target audio signal and the standard audio signal are aligned with the target alignment point, the two signals have a higher correlation, thereby effectively aligning the timing of the two audio signals.
[0076] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. On this basis, the step of determining the target relevance among all the relevances includes:
[0077] Step A10: Select the maximum value among all the correlations as the target correlation.
[0078] In this embodiment, the maximum correlation among all correlations is selected as the target correlation. It can be understood that the longer the time delay between signals, the lower the calculated correlation will usually be. The maximum value among the correlations is selected as the target correlation, which ensures that the correlation between the target audio signal and the standard audio signal is the highest after the two are aligned, so that the timing trends between the two signals after alignment are completely consistent.
[0079] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. On this basis, the step of determining the target relevance among all the relevances includes:
[0080] Step B10, sequentially combining all the correlations to obtain a correlation sequence, and determining the maximum value in the correlation sequence as the maximum correlation;
[0081] Combine each correlation in sequence to obtain a correlation sequence. Specifically, combine each correlation in sequence according to the time sequence of all candidate alignment points, so that each element in the correlation sequence can be quickly determined to which candidate alignment point each element corresponds. For example, assuming that the candidate alignment points arranged in time sequence are [point 1, point 2, point 3, point 4, point 5], when each candidate alignment point is aligned with the starting signal sampling point of the target audio signal, the correlations obtained are correlation 1, correlation 2, correlation 3, correlation 4, and correlation 5, respectively. Then, the correlation sequence obtained by combining each correlation in sequence according to the time sequence of the candidate alignment points is [correlation 1, correlation 2, correlation 3, correlation 4, correlation 5]. At this time, the i-th element in the correlation sequence corresponds to the i-th candidate alignment point.
[0082] Step B20, taking the correlation adjacent to the maximum correlation on the left in the correlation sequence as the first correlation, and taking the correlation adjacent to the maximum correlation on the right in the correlation sequence as the second correlation;
[0083] Step B30, sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence;
[0084] The candidate mutual correlation sequence is z, the first correlation is w1, the maximum correlation is w2, and the second correlation is w3, then z can be expressed as [w1, w2, w3].
[0085] Step B40, calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence;
[0086] The preset third-order matrix can be specifically Wherein, b=-2a, b is an integer, and the value range of b is [1, 2].
[0087] It is easy to understand that the product of the candidate cross-correlation sequence and the preset third-order matrix results in a vector containing 3 elements. Let the optimized cross-correlation sequence be m, then m can be expressed as [d1, d2, d3].
[0088] Step B50: Determine the correlation in the candidate mutual correlation sequence corresponding to the maximum value in the optimized mutual correlation sequence as the target correlation.
[0089] It should be noted that the elements in the optimized mutual correlation sequence correspond to the elements in the candidate mutual correlation sequence in order. Specifically, d1 corresponds to w1, and when d1 is the maximum value in m, w1 is the target correlation; d2 corresponds to w2, and when d2 is the maximum value in m, w2 is the target correlation; d3 corresponds to w3, and when d3 is the maximum value in m, w3 is the target correlation.
[0090] The method of selecting the target alignment point with the maximum correlation to align the target audio signal with the standard audio signal has a large impact on the alignment accuracy due to the environmental noise (there is a certain error between the actual correlation and the calculated correlation). Therefore, in this embodiment, the matrix multiplication method is used to improve the alignment accuracy. Figures 2 to 4 As shown, Figures 2 to 4 The red line in the middle is a straight line passing through the alignment point and perpendicular to the horizontal axis. The horizontal axis represents time (seconds) and the vertical axis represents the signal value. Figure 2 The ideal alignment point is shown (i.e., the alignment point where the actual correlation is the largest when the target audio signal is completely aligned with the standard audio signal). Figure 3 Where is the target alignment point selected based on the maximum correlation, Figure 4 The target alignment points selected by matrix multiplication are shown in Figure 4 The alignment point in is closer to the ideal alignment point.
[0091] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. On this basis, the step of determining the target relevance among all the relevances includes:
[0092] Step C10, sequentially combining all the correlations to obtain a correlation sequence, determining the maximum value in the correlation sequence as the maximum correlation, and determining the correlations adjacent to the maximum correlation in the correlation sequence;
[0093] Step C20, taking the correlation adjacent to the maximum correlation on the left in the correlation sequence as the first correlation, and taking the correlation adjacent to the maximum correlation on the right in the correlation sequence as the second correlation;
[0094] Step C30, sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence;
[0095] Step C40, calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence;
[0096] The specific method for obtaining the optimized mutual correlation sequence may refer to the relevant content described in the third embodiment above, and will not be described in detail in this embodiment.
[0097] Step C50, updating the values of each element in the optimized mutual correlation sequence, wherein the value of the second element in the updated optimized mutual correlation sequence is the square of the value of the first element in the updated optimized mutual correlation sequence, and the value of the third element in the updated optimized mutual correlation sequence is a preset fixed constant;
[0098] Specifically, the updated optimized cross-correlation sequence is recorded as m', then m' is [m1^2, m, -b], where m1 = -a*d2 / d1, b is a preset fixed constant, and the values of a and b are consistent with the values of a and b in the preset third-order matrix.
[0099] Step C60, calculating the product between the updated optimized mutual correlation sequence and the preset third-order matrix to obtain an accurate mutual correlation sequence;
[0100] The updated optimized cross-correlation sequence is multiplied by the preset third-order matrix process twice to obtain the exact cross-correlation sequence. Let the exact cross-correlation sequence be z1, then z1 can be expressed as [e1, e2, e3]
[0101] Step C70: Determine the correlation in the candidate mutual correlation sequence corresponding to the maximum value in the precise mutual correlation sequence as the target correlation.
[0102] Similarly, it should be noted that the elements in the precise mutual correlation sequence correspond to the elements in the candidate mutual correlation sequence in order. Specifically, e1 corresponds to w1, and when e1 is the maximum value in m, w1 is the target correlation; e2 corresponds to w2, and when e2 is the maximum value in m, e2 is the target correlation; e3 corresponds to w3, and when e3 is the maximum value in m, e3 is the target correlation.
[0103] The optimized sequence points are updated, and a quadratic product operation is performed based on the updated optimized sequence points and the preset third-order matrix, which can further reduce the impact of environmental noise and improve alignment accuracy. Figure 5 As shown, Figure 5 The red line in the middle is a straight line passing through the alignment point and perpendicular to the horizontal axis. The horizontal axis represents time (seconds) and the vertical axis represents the signal value. Figure 5 The target alignment points selected by quadratic matrix multiplication in this embodiment are shown in FIG. Figure 3 to Figure 4 The selected target alignment point in Figure 5 The alignment point in is closest to the ideal alignment point.
[0104] Based on the first embodiment, the second embodiment, the third embodiment and / or the fourth embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the above-mentioned embodiments 1, 2, 3 and 4 can be referred to the above description, and will not be described in detail later. On this basis, the step of determining the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal includes:
[0105] Step D10, when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal, convolution calculation is performed on the standard audio signal and the target audio signal to obtain the correlation between the standard audio signal and the target audio signal.
[0106] The specific calculation process of the convolution calculation refers to the existing implementation method, and this embodiment does not involve the specific calculation process of the convolution calculation. In this embodiment, the convolution calculation is performed on the standard audio signal and the target audio signal, and the calculation result of the convolution calculation is determined as the correlation between the two signals, thereby achieving effective quantification of the signal correlation.
[0107] In a possible implementation, after the step of aligning the standard audio signal and the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold, the method further includes:
[0108] Step E10, performing Fourier transformation on the aligned target audio signal and the standard audio signal to obtain the target audio signal in the frequency domain and the standard audio signal in the frequency domain;
[0109] It should be noted that, since the target audio signal and the standard audio signal need to be aligned in time sequence, based on this, the initially acquired target audio signal and the standard audio signal are time domain signals.
[0110] Before performing Fourier transform on the target audio signal and the standard audio signal, the target audio signal and the standard audio signal may be firstly processed by dividing the frames, such as selecting n signal sampling points as one frame to perform the processing on the target audio signal and the standard audio signal by dividing the frames.
[0111] Specifically, Fourier transform is performed on the overlapping portion of the aligned target audio signal and the standard audio signal.
[0112] Step E20, calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain;
[0113] Specifically, the similarity between the two signals in the frequency domain may be calculated in a known manner, such as calculating the similarity based on zero-crossing rate features, calculating the similarity based on signal amplitude features, calculating the similarity based on signal power features, and so on.
[0114] Step E30: If the similarity is greater than a preset similarity threshold, it is determined that the target audio signal is successfully aligned with the standard audio signal.
[0115] If the similarity is greater than the preset similarity threshold, it is determined that the target audio signal and the standard audio signal have the same structure and the alignment is successful. The preset similarity threshold is a value set in advance that is less than the maximum similarity. For example, if the maximum similarity when the two signals are completely consistent is 1, the preset similarity threshold can be 0.85, 0.9, 0.95, etc. This embodiment does not impose any specific restrictions on this.
[0116] In this embodiment, after the target alignment point is determined in the time domain to align the standard audio signal with the target audio signal, Fourier transform is performed on the two signals to verify whether the similarity of the two signals is greater than a preset similarity threshold from the frequency domain, that is, the effectiveness of the signal alignment is verified from the frequency domain. Only when the target audio signal and the standard audio signal are similar in both the time domain and the frequency domain, is it determined that the alignment is successful, thereby further ensuring the effectiveness of the alignment of the target audio signal and the standard audio signal.
[0117] If the similarity is less than or equal to the preset similarity threshold, it is determined that the structures of the target audio signal and the standard audio signal are inconsistent, and the alignment between the two fails.
[0118] In a possible implementation, the step of calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain includes:
[0119] Step F10, sequentially combining the signal power of the target audio signal in each frame frequency domain to obtain a first signal power vector;
[0120] Step F20, sequentially combining the signal power of the standard audio signal in each frame frequency domain to obtain a second signal power vector;
[0121] The signal power vector (including the first signal power vector and the second signal power vector) specifically includes the signal power of each frame signal. The signal power can be calculated based on a known method. This embodiment does not describe the calculation process of the signal power in detail, and does not impose any specific restrictions on the specific calculation method of the signal power.
[0122] Step F30, calculating the distance between the first signal power vector and the second signal power vector, and determining the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain based on the distance, wherein the distance is negatively correlated with the similarity.
[0123] The distance may specifically be the Euclidean distance between the first signal power vector and the second signal power vector. Considering that the signals that need to be time-aligned have a certain degree of similarity (for example, there is only a playback delay between the two signals), the zero-crossing rate, signal amplitude and other characteristics of the two signals may be relatively similar, and the signal power can reflect the energy characteristics of the signal, which can better evaluate whether the structure of the signal is consistent, and then evaluate the similarity between the two. Based on this, the present embodiment uses signal power to evaluate the similarity between frequency domain signals, thereby improving the accuracy of the determined similarity.
[0124] For example, in order to help understand the technical concept or technical principle of signal timing alignment after combining this embodiment with the above-mentioned embodiment 1 and embodiment 4, a specific embodiment is listed. In this specific embodiment, the signal timing alignment process is:
[0125] S1, read the audio data file, perform preprocessing, and obtain the audio signal;
[0126] S2, obtaining time-frequency features of the audio signal, and dividing the audio signal into two parts, one part as a training set, and the other part as a test set;
[0127] S3, using machine learning algorithms to establish a prediction model, training the prediction model based on the training set, and optimizing the model parameters;
[0128] S4, substituting the test set into the model for calculation, performing model verification, and obtaining the language category to which the audio signal in the test set belongs, such as Chinese, English, German, etc.
[0129] S5, receiving a target audio signal input by a user, selecting a standard audio signal from a test set that is consistent with the language category of the target audio signal, and performing time domain alignment on the standard audio signal and the target audio signal using a cross-correlation method and a matrix multiplication method, specifically comprising:
[0130] S5-1, shift the target audio signal along the time axis so that the starting signal sampling point of the target audio signal is aligned with the candidate alignment point, and reverse the shifted target audio signal x on the time axis to obtain a reverse signal x'
[0131] S5-2, performing element-by-element multiplication of x' and the standard audio signal y;
[0132] S5-3, integrating the above product in the entire time range (for continuous signals) or summing (for discrete signals) to obtain a convolution result, and combining each candidate alignment point to obtain the convolution result to obtain a correlation sequence z;
[0133] S5-4, the value in the correlation sequence z represents the similarity between the signals. The higher the similarity, the greater the correlation value.
[0134] S5-5, read the maximum value in the correlation sequence z, the first correlation adjacent to the maximum value on the left, and the second correlation adjacent to the maximum value on the right as candidate mutual correlation sequence w, multiply them with the preset third-order matrix array to obtain the optimized mutual correlation sequence m=[d1,d2,d3], and calculate m1=-a*d2 / d1 to obtain the updated optimized mutual correlation sequence m'=[m1^2,m1,-b], multiply m' with the preset third-order matrix to obtain the precise mutual correlation queue, wherein the correlation corresponding to the correlation sequence z and the maximum value in the precise mutual correlation queue is the target correlation, and the point corresponding to the target correlation is the target alignment point.
[0135] Among them, the preset third-order matrix is b=-2a, b is an integer, and the value range of b is [1,2].
[0136] S6, frame the standard audio signal and the target audio signal, perform Fourier transform on the framed signals, calculate the power spectrum of each frame signal, form a set of signal power vectors, and calculate the Euler distance r between the signal power vectors of the two signals. If r is less than a preset threshold, it is determined that the structures are consistent and the alignment is successful. If r is greater than or equal to the preset threshold, the structures are inconsistent and the alignment fails.
[0137] It should be noted that the above specific embodiments are only used to understand the present application and do not constitute a limitation on the signal timing alignment process of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0138] In addition, the present application also provides a signal timing alignment device, referring to Figure 6 , the signal timing alignment device comprises:
[0139] An acquisition module 10 is used to acquire a standard audio signal and a target audio signal to be aligned, and determine all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal;
[0140] A calculation module 20, configured to determine, for each of the candidate alignment points, a correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with a starting signal sampling point of the target audio signal;
[0141] The alignment module 30 is used to determine a target correlation among all the correlations, select a candidate alignment point corresponding to the target correlation as the target alignment point, and align the standard audio signal with the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
[0142] In one embodiment, the alignment module 30 is further used for:
[0143] The maximum value among all the correlations is selected as the target correlation.
[0144] In one embodiment, the alignment module 30 is further used for:
[0145] Combining all the correlations in sequence to obtain a correlation sequence, determining a maximum value in the correlation sequence as a maximum correlation, and determining correlations adjacent to the maximum correlation in the correlation sequence;
[0146] The correlation degree adjacent to the maximum correlation degree on the left in the correlation degree sequence is used as the first correlation degree, and the correlation degree adjacent to the maximum correlation degree on the right in the correlation degree sequence is used as the second correlation degree;
[0147] sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence;
[0148] Calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence;
[0149] The correlation degree in the candidate mutual correlation sequence corresponding to the maximum value in the optimized mutual correlation sequence is determined as the target correlation degree.
[0150] In one embodiment, the alignment module 30 is further used for:
[0151] Combining all the correlations in sequence to obtain a correlation sequence, determining a maximum value in the correlation sequence as a maximum correlation, and determining correlations adjacent to the maximum correlation in the correlation sequence;
[0152] The correlation degree adjacent to the maximum correlation degree on the left in the correlation degree sequence is used as the first correlation degree, and the correlation degree adjacent to the maximum correlation degree on the right in the correlation degree sequence is used as the second correlation degree;
[0153] sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence;
[0154] Calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence;
[0155] Updating the values of each element in the optimized mutual correlation sequence, wherein the value of the second element in the updated optimized mutual correlation sequence is the square of the value of the first element in the updated optimized mutual correlation sequence, and the value of the third element in the updated optimized mutual correlation sequence is a preset fixed constant;
[0156] Calculating the product between the updated optimized mutual correlation sequence and the preset third-order matrix to obtain an accurate mutual correlation sequence;
[0157] The correlation degree in the candidate mutual correlation sequence corresponding to the maximum value in the precise mutual correlation sequence is determined as the target correlation degree.
[0158] In one embodiment, the calculation module 20 is further used for:
[0159] When the candidate alignment point is aligned with the start signal sampling point of the target audio signal, a convolution calculation is performed on the standard audio signal and the target audio signal to obtain a correlation between the standard audio signal and the target audio signal.
[0160] In one embodiment, the signal timing alignment device further includes a verification module, wherein the verification module is used to:
[0161] Performing Fourier transformation on the aligned target audio signal and the standard audio signal to obtain the target audio signal in the frequency domain and the standard audio signal in the frequency domain;
[0162] Calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain;
[0163] If the similarity is greater than a preset similarity threshold, it is determined that the target audio signal is aligned successfully with the standard audio signal.
[0164] In one embodiment, the verification module is further used to:
[0165] Combining the signal power of the target audio signal in each frame frequency domain in sequence to obtain a first signal power vector;
[0166] Combining the signal power of the standard audio signal in each frame frequency domain in sequence to obtain a second signal power vector;
[0167] The distance between the first signal power vector and the second signal power vector is calculated, and the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain is determined based on the distance, wherein the distance is negatively correlated with the similarity.
[0168] In addition, an embodiment of the present application also proposes a signal timing alignment device, which includes a memory, a processor, and a signal timing alignment program stored in the memory and executable on the processor. When the signal timing alignment program is executed by the processor, the steps of the signal timing alignment method as described above are implemented.
[0169] Reference below Figure 7 , which shows a schematic diagram of the structure of a signal timing alignment device suitable for implementing an embodiment of the present application. The signal timing alignment device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The signal timing alignment device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0170] like Figure 7As shown, the signal timing alignment device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the signal timing alignment device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the signal timing alignment device to communicate with other devices wirelessly or by wire to exchange data. Although the signal timing alignment device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0171] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0172] The signal timing alignment device provided in the embodiment of the present application adopts the signal timing alignment method in the above embodiment to solve the technical problem of signal timing alignment. Compared with the prior art, the beneficial effects of the signal timing alignment device provided in the present application are the same as the beneficial effects of the signal timing alignment method provided in the above embodiment, and other technical features in the signal timing alignment device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0173] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0174] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0175] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides a readable storage medium having computer-readable program instructions (ie, computer program) stored thereon, and the computer-readable program instructions are used to execute the signal timing alignment method in the above-mentioned embodiment.
[0176] The computer-readable storage medium provided in the embodiment of the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0177] The computer-readable storage medium may be included in the signal timing alignment device; or may exist independently without being assembled into the signal timing alignment device.
[0178] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the signal timing alignment device, the signal timing alignment device: obtains a standard audio signal and a target audio signal to be aligned, and determines all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal; for each of the candidate alignment points, determines the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal; determines a target correlation among all the correlations, selects the candidate alignment point corresponding to the target correlation as the target alignment point, and aligns the standard audio signal and the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
[0179] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0180] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0181] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0182] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned signal timing alignment method, and can solve the technical problem of signal timing alignment. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the signal timing alignment method provided in the above-mentioned embodiment, and will not be repeated here.
[0183] In addition, an embodiment of the present application further proposes a computer program product, including a signal timing alignment program, which implements the steps of the signal timing alignment method described above when executed by a processor.
[0184] The specific implementation of the computer program product of the present application is basically the same as the various embodiments of the above-mentioned signal timing alignment method, and will not be repeated here.
[0185] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0186] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0187] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software sensor, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, including a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0188] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A signal timing alignment method, characterized in that: The signal timing alignment method comprises the following steps: Obtain a standard audio signal and a target audio signal to be aligned, and determine all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal; For each of the candidate alignment points, determining a correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with a starting signal sampling point of the target audio signal; Determine a target correlation among all the correlations, select a candidate alignment point corresponding to the target correlation as the target alignment point, and align the standard audio signal with the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
2. The method according to claim 1, characterized in that The step of determining a target relevance among all the relevances comprises: The maximum value among all the correlations is selected as the target correlation.
3. The method according to claim 1, characterized in that The step of determining a target relevance among all the relevances comprises: Combining all the correlations in sequence to obtain a correlation sequence, and determining the maximum value in the correlation sequence as the maximum correlation; The correlation degree adjacent to the maximum correlation degree on the left in the correlation degree sequence is used as the first correlation degree, and the correlation degree adjacent to the maximum correlation degree on the right in the correlation degree sequence is used as the second correlation degree; sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence; Calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence; The correlation degree in the candidate mutual correlation sequence corresponding to the maximum value in the optimized mutual correlation sequence is determined as the target correlation degree.
4. The method according to claim 1, characterized in that The step of determining a target relevance among all the relevances comprises: Combining all the correlations in sequence to obtain a correlation sequence, and determining the maximum value in the correlation sequence as the maximum correlation; The correlation degree adjacent to the maximum correlation degree on the left in the correlation degree sequence is used as the first correlation degree, and the correlation degree adjacent to the maximum correlation degree on the right in the correlation degree sequence is used as the second correlation degree; sequentially combining the first correlation, the maximum correlation and the second correlation to obtain a candidate mutual correlation sequence; Calculating the product between the candidate mutual correlation sequence and a preset third-order matrix to obtain an optimized mutual correlation sequence; Updating the values of each element in the optimized mutual correlation sequence, wherein the value of the second element in the updated optimized mutual correlation sequence is the square of the value of the first element in the updated optimized mutual correlation sequence, and the value of the third element in the updated optimized mutual correlation sequence is a preset fixed constant; Calculating the product between the updated optimized mutual correlation sequence and the preset third-order matrix to obtain an accurate mutual correlation sequence; The correlation degree in the candidate mutual correlation sequence corresponding to the maximum value in the precise mutual correlation sequence is determined as the target correlation degree.
5. The method according to claim 1, characterized in that The step of determining the correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with the starting signal sampling point of the target audio signal comprises: When the candidate alignment point is aligned with the start signal sampling point of the target audio signal, a convolution calculation is performed on the standard audio signal and the target audio signal to obtain a correlation between the standard audio signal and the target audio signal.
6. The method according to any one of claims 1 to 5, characterized in that: After the step of aligning the standard audio signal and the target audio signal according to the target alignment point, wherein the target correlation is a correlation greater than or equal to a preset correlation threshold among all the correlations, the method further includes: Performing Fourier transformation on the aligned target audio signal and the standard audio signal to obtain the target audio signal in the frequency domain and the standard audio signal in the frequency domain; Calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain; If the similarity is greater than a preset similarity threshold, it is determined that the target audio signal is aligned successfully with the standard audio signal.
7. The method according to claim 6, characterized in that The step of calculating the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain comprises: Combining the signal power of the target audio signal in each frame frequency domain in sequence to obtain a first signal power vector; Combining the signal power of the standard audio signal in each frame frequency domain in sequence to obtain a second signal power vector; The distance between the first signal power vector and the second signal power vector is calculated, and the similarity between the target audio signal in the frequency domain and the standard audio signal in the frequency domain is determined based on the distance, wherein the distance is negatively correlated with the similarity.
8. A signal timing alignment device, characterized in that: The signal timing alignment device comprises: an acquisition module, configured to acquire a standard audio signal and a target audio signal to be aligned, and determine all candidate alignment points, wherein all the candidate alignment points include all signal sampling points of the standard audio signal and a target number of virtual signal sampling points before the standard audio signal, and the target number is the minimum value between the total number of signal sampling points of the standard audio signal and the total number of signal sampling points of the target audio signal; A calculation module, configured to determine, for each of the candidate alignment points, a correlation between the standard audio signal and the target audio signal when the candidate alignment point is aligned with a starting signal sampling point of the target audio signal; An alignment module is used to determine a target correlation among all the correlations, select a candidate alignment point corresponding to the target correlation as the target alignment point, and align the standard audio signal with the target audio signal according to the target alignment point, wherein the target correlation is a correlation among all the correlations that is greater than or equal to a preset correlation threshold.
9. A signal timing alignment device, characterized in that: The signal timing alignment device comprises: a memory, a processor, and a signal timing alignment program stored in the memory and executable on the processor. When the signal timing alignment program is executed by the processor, the steps of the signal timing alignment method as described in any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium is a computer-readable storage medium, on which is stored a program for implementing the signal timing alignment method, and the program for implementing the signal timing alignment method is executed by a processor to implement the steps of the signal timing alignment method as described in any one of claims 1 to 7.
