Audio signal smoothing processing method and device, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202311250070.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-09-26
AI Technical Summary
然而,由于帧内每个点的数据在更新时需要分别计算对应的系数,且在多通道音频应用场景中还涉及一些嵌套乘除运算,这就使得音频信号处理的计算复杂度较高
[0015] This application proposes an audio signal smoothing processing method, apparatus, electronic device, and computer-readable storage medium. First, when a target head movement is detected in a target area, a previous time frame is divided from the previous data frame of the original audio signal, and a current time frame is divided from the current data frame of the original audio signal. An amplitude coefficient is determined based on the volume values in the previous and current time frames. Based on the amplitude coefficient, the audio signal in the current time frame is smoothed, and the target audio signal is output.
Smart Images

Figure CN117253503B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of audio signal processing technology, and in particular relates to an audio signal smoothing processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] When the volume of an audio signal changes suddenly at different points in a time frame, it may cause spikes in the output audio. In particular, when the volume suddenly changes from a low volume to a high value, it will produce obvious short pops, which will have a significant negative impact on the user's listening experience.
[0003] Traditional methods for processing plosive sounds typically involve dividing the audio signal into time frames, one at the beginning and one at the end. Each data point within the frame needs to be processed individually to smooth the audio signal by gradually increasing the volume from a small value at the beginning. However, because updating the data at each point within the frame requires calculating corresponding coefficients, and multiplication and division operations are involved in multi-channel audio applications, the computational complexity of audio signal processing is quite high. Summary of the Invention
[0004] The main objective of this application is to provide an audio signal smoothing processing method, apparatus, electronic device, and computer-readable storage medium. The aim is to reduce the computational complexity of the audio signal smoothing process through this method.
[0005] To achieve the above objectives, this application provides an audio signal smoothing processing method, the audio signal smoothing processing method comprising: When a target head in the target area is detected to have moved, the previous time frame is divided from the previous data frame of the original audio signal, and the current time frame is divided from the current data frame of the original audio signal. The amplitude coefficient is determined based on the volume values in the previous time frame and the current time frame; Based on the amplitude coefficient, the audio signal in the current time frame is smoothed to output the target audio signal.
[0006] Optionally, the step of dividing the corresponding current time frame and previous time frame from the current data frame and previous data frame of the original audio signal respectively includes: The time frame length is calculated based on the data sampling rate of the original audio signal and a preset time threshold. Divide the time frame at the end of the previous data frame into the previous time frame; The time frame with the length of the time frame located at the initial position in the current data frame is divided into the current time frame.
[0007] Optionally, the step of determining the amplitude coefficient based on the volume values in the previous time frame and the current time frame includes: Extract the maximum volume value from the previous time frame to obtain the first volume value; Extract the maximum volume value from the current time frame to obtain the second volume value; Calculate the ratio of the first volume value to the second volume value to obtain the amplitude coefficient.
[0008] Optionally, the step of extracting the maximum volume value from the previous time frame to obtain the first volume value includes: Calculate the absolute value of the amplitude corresponding to each position in the previous time frame to obtain the volume value corresponding to each position. The largest volume value among all the aforementioned positions is selected as the first volume value.
[0009] Optionally, before the step of smoothing the audio signal in the current time frame based on the amplitude coefficient, the method further includes: Determine whether the first volume value is less than the second volume value; If the first volume value is less than the second volume value, then the step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal is performed. If the first volume value is not less than the second volume value, then the original audio signal is output.
[0010] Optionally, the smoothing process includes data updating, and the target audio signal includes updated data and unupdated data from the original audio signal; The step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal includes: Based on the data sampling rate of the original audio signal, a time frame array is extracted from the audio signal of the current time frame; The updated data is obtained by calculating the product of each amplitude value in the time frame array and the amplitude coefficient. The data in the time frame array is updated using the updated data to output the target audio signal.
[0011] Optionally, prior to the step of detecting positional movement of the target head in the target region, the method further includes: The target head in the target area is identified by a preset target recognition algorithm, and the position of the target head is obtained. When the change in the position of the target head is detected to be greater than a preset distance, it is determined that the target head has moved.
[0012] In addition, to achieve the above objectives, this application also provides an audio signal smoothing processing apparatus, which is applied to an audio signal smoothing processing device; The audio signal smoothing processing device includes: The time frame segmentation module is used to segment the previous time frame from the previous data frame of the original audio signal and the current time frame from the current data frame of the original audio signal when the target head in the target area is detected to have moved. The coefficient determination module is used to determine the amplitude coefficient based on the volume values in the previous time frame and the current time frame; The signal output module is used to smooth the audio signal in the current time frame based on the amplitude coefficient and output the target audio signal.
[0013] In addition, to achieve the above objectives, this application also provides an electronic device, which includes: a memory, a processor, and an audio signal smoothing processing program stored in the memory and executable on the processor. When the audio signal smoothing processing program is executed by the processor, it implements the steps of the audio signal smoothing processing method as described above.
[0014] In addition, to achieve the above objectives, this application also provides a computer-readable storage medium storing an audio signal smoothing program, which, when executed by a processor, implements the steps of the audio signal smoothing method described above.
[0015] This application proposes an audio signal smoothing processing method, apparatus, electronic device, and computer-readable storage medium. First, when a target head movement is detected in a target area, a previous time frame is divided from the previous data frame of the original audio signal, and a current time frame is divided from the current data frame of the original audio signal. An amplitude coefficient is determined based on the volume values in the previous and current time frames. Based on the amplitude coefficient, the audio signal in the current time frame is smoothed, and the target audio signal is output.
[0016] Thus, in this embodiment of the application, when the target head in the target area is detected to have moved, the original audio signal is divided into the current time frame and the previous time frame, and an adaptive amplitude coefficient is determined based on the volume values of the previous time frame and the current time frame. The amplitude coefficient is then used for smoothing. Compared with traditional audio signal smoothing schemes, the calculation process of processing the original audio signal using only the amplitude coefficient in this embodiment of the application is simpler. It does not require calculating the coefficient of each data point separately, thereby greatly reducing the computational complexity and the amount of computation.
[0017] Furthermore, since the embodiments of this application employ adaptive amplitude coefficients to smooth the audio signal in the current time frame, the coefficients of each data point in the current time frame are consistent, and there will be no abrupt changes in volume, thereby further ensuring the continuity of amplitude between frames.
[0018] In addition, the embodiments of this application also retain the tail data of the current time frame without processing, ensuring the output of the original audio and improving the fidelity of the output audio signal. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the device structure of the hardware operating environment of the electronic device involved in the embodiments of this application; Figure 2 This is a flowchart illustrating the steps of the first embodiment of the audio signal smoothing processing method of this application; Figure 3 This is a schematic diagram of the egg hopper structure involved in the first embodiment of the audio signal smoothing processing method of this application; Figure 4 This is a schematic diagram of the time frame division involved in the first embodiment of the audio signal smoothing processing method of this application; Figure 5 This is a schematic diagram illustrating the smoothing process of the original audio signal corresponding to the current data frame in the first embodiment of the audio signal smoothing method of this application. Figure 6 This is a schematic diagram of the functional modules of an embodiment of the audio signal smoothing processing apparatus of this application.
[0020] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0022] Reference Figure 1 , Figure 1 This is a schematic diagram of the device structure of the hardware operating environment of the electronic device involved in the embodiments of this application.
[0023] It should be noted that the terminal device in this application embodiment may be an audio signal processing device, a camera device, an audio playback device, and a speaker terminal device that executes the audio signal smoothing processing method of this application. In addition, the terminal device in this application embodiment may also be a computing unit such as a PC, smartphone, or tablet connected to the above-mentioned terminal devices.
[0024] It should be understood that, based on different design needs of practical applications, the terminal device in the embodiments of this application may of course also be other devices or device modules. For example, the terminal device may specifically be a data storage control terminal or a portable computer, or other mobile or non-mobile terminal devices.
[0025] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0026] Those skilled in the art will understand that Figure 1 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0027] like Figure 1 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an audio signal smoothing program.
[0028] exist Figure 1 In the terminal shown, network interface 1004 is mainly used to connect to the backend server and communicate data with it; user interface 1003 is mainly used to connect to the client and communicate data with it; and processor 1001 can be used to call the audio signal smoothing processing program stored in memory 1005 and perform the following operations: When a target head in the target area is detected to have moved, the previous time frame is divided from the previous data frame of the original audio signal, and the current time frame is divided from the current data frame of the original audio signal. The amplitude coefficient is determined based on the volume values in the previous time frame and the current time frame; Based on the amplitude coefficient, the audio signal in the current time frame is smoothed to output the target audio signal.
[0029] Optionally, the processor 1001 can also be used to call an audio signal smoothing program stored in the memory 1005 and perform the following operations: The time frame length is calculated based on the data sampling rate of the original audio signal and a preset time threshold. Divide the time frame at the end of the previous data frame into the previous time frame; The time frame with the length of the time frame located at the initial position in the current data frame is divided into the current time frame.
[0030] Optionally, the processor 1001 can also be used to call the audio signal smoothing processing program stored in the memory 1005 to perform the following operations: Extract the maximum volume value from the previous time frame to obtain the first volume value; Extract the maximum volume value from the current time frame to obtain the second volume value; Calculate the ratio of the first volume value to the second volume value to obtain the amplitude coefficient.
[0031] Optionally, the processor 1001 can also be used to call an audio signal smoothing program stored in the memory 1005 and perform the following operations: Calculate the absolute value of the amplitude corresponding to each position in the previous time frame to obtain the volume value corresponding to each position. The largest volume value among all the aforementioned positions is selected as the first volume value.
[0032] Optionally, the processor 1001 can also be used to call an audio signal smoothing processing program stored in the memory 1005, and before performing the step of smoothing the audio signal in the current time frame based on the amplitude coefficient, it also performs the following operations: Determine whether the first volume value is less than the second volume value; If the first volume value is less than the second volume value, then the step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal is performed. If the first volume value is not less than the second volume value, then the original audio signal is output.
[0033] Optionally, the processor 1001 can also be used to call an audio signal smoothing program stored in the memory 1005 and perform the following operations: Based on the data sampling rate of the original audio signal, a time frame array is extracted from the audio signal of the current time frame; The updated data is obtained by calculating the product of each amplitude value in the time frame array and the amplitude coefficient. The data in the time frame array is updated using the updated data to output the target audio signal.
[0034] Optionally, the processor 1001 can also be used to call an audio signal smoothing processing program stored in the memory 1005, and perform the following operations before detecting a positional movement of the target head in the target area: The target head in the target area is identified by a preset target recognition algorithm, and the position of the target head is obtained. When the change in the position of the target head is detected to be greater than a preset distance, it is determined that the target head has moved.
[0035] Based on the aforementioned electronic device, various embodiments of the audio signal smoothing processing method of this application are proposed.
[0036] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the audio signal smoothing method of this application. In the first embodiment of the audio signal smoothing method of this application, the audio signal smoothing method includes: Step S10: When the target head in the target area is detected to have moved, the previous time frame is divided from the previous data frame of the original audio signal, and the current time frame is divided from the current data frame of the original audio signal. The audio signal smoothing method in this embodiment can be applied to multi-channel audio scenarios. For example, when a user moves their head inside an egg pod, the audio signal received may suddenly produce spikes and plosives, which need to be smoothed. Figure 3The diagram illustrates the structure of an egg-shaped enclosure, which includes a subwoofer (audio source device) and multiple speakers distributed at different locations to provide audio signals to the user from different directions. The audio signal smoothing method in this application determines the timing of smoothing by detecting the positional movement of the target's head. This is because the positional movement of the user's head (i.e., the audio signal receiving position) may cause spikes in the received audio signal, especially when the volume suddenly changes from a low volume to a high value, which will produce obvious pop (brief plosive) sounds. Therefore, in order to improve the user's audio experience, it is necessary to perform certain smoothing processing on the audio signal to avoid spikes or plosive sounds.
[0037] In one feasible embodiment, the target area is the inside of the egg pod, the target head is the head of the user inside the egg pod, the original audio signal is the audio signal received at the location of the user's head, the previous data frame is a data frame taken before the position movement according to the duration set by the user, and the current data frame is a data frame taken after the position movement according to the preset duration. The divided current time frame and previous time frame are used to calculate the amplitude coefficient. In addition, the current time frame is the time frame to be processed in this smoothing process, that is, each data point in the current time frame is updated to smooth the original audio signal.
[0038] Step S20: Determine the amplitude coefficient based on the volume values in the previous time frame and the current time frame; In this embodiment, an appropriate amplitude coefficient is calculated by comparing the volume values of the time frame before and after the position movement. This makes the volume value of the time frame after the position movement closer to the volume value before the position movement, reducing the gradient of sudden changes in volume received by the user's head, making the transition of volume changes smoother, and improving the user's listening experience.
[0039] In one feasible embodiment, the amplitude coefficient can be determined based on the ratio of the volume value in the previous time frame to the volume value in the current time frame. The smaller the volume value in the previous time frame is compared to the volume value in the current time frame, the smaller the amplitude coefficient, and the greater the reduction in volume when processing the audio signal in the current time frame according to the amplitude coefficient. On the other hand, if the volume value in the previous time frame is greater than the volume value in the current time frame, smoothing processing is not required because the sudden drop in volume will not produce a pop sound and will not affect the user's listening experience.
[0040] Step S30: Based on the amplitude coefficient, smooth the audio signal in the current time frame and output the target audio signal.
[0041] In this embodiment, the target audio signal is the sum of audio signals emitted by each speaker at the user's head location after smoothing, i.e., the audio signal that affects the user's actual hearing experience. The amplitude coefficient is used to process the audio signal in the current time frame. Specifically, the audio signal in the current time frame includes audio signals within a certain duration. In the audio signal smoothing method of this embodiment, the audio signal can be divided into an array composed of multiple data points according to the sampling rate of the original audio signal. The amplitude coefficient is used to update each data point in the array, and the updated data points are output to generate the target audio signal (smoothed audio signal). Each data point corresponds to an amplitude. The smoothing process mainly reduces the amplitude of the data points so that the amplitude of the output target audio signal is not too different from that of the audio signal in the previous time frame.
[0042] The ultimate goal of this application embodiment is to output a target audio signal after smoothing the audio signal in the current time frame for listening, so that the user will not hear spikes or pops, giving the user a better audio experience. In order for the user to hear the target audio signal, the audio signals output by each speaker need to be processed separately in a multi-channel audio usage scenario. The specific processing method is the same as the smoothing method described above, that is, the audio signal corresponding to the current time frame in the audio signal output by each speaker is updated by the amplitude coefficient, and the smoothed target audio signal is output.
[0043] Furthermore, in a feasible embodiment, step S10, which involves dividing the previous time frame from the previous data frame of the original audio signal and the current time frame from the current data frame of the original audio signal, may include: Step S11: Calculate the time frame length based on the data sampling rate of the original audio signal and a preset time threshold; In this embodiment of the application, the data sampling rate Fs is the sampling rate of the audio signal, the unit is Hz, the time threshold t is the length of the time frame to be divided (e.g., 5ms), and the time frame length Len is the number of data points in the time frame.
[0044] As an example, the mathematical expression for calculating the length of a time frame is: Len = Fs * t.
[0045] Step S12: Divide the time frame with the length of the time frame located at the end of the previous data frame into the previous time frame. Step S13: Divide the time frame of the time frame length located at the initial position in the current data frame into the current time frame.
[0046] Reference Figure 4In this embodiment, the time frame at the end of the previous data frame is divided into the previous time frame, and the time frame at the beginning of the current data frame is divided into the next time frame, with the time frames having equal lengths. Therefore, the time periods corresponding to the two time frames are consecutive time periods. The current time frame, as the data being smoothed, is closer to the volume value of the previous time frame at the previous time point, resulting in a better smoothing effect. Furthermore, this embodiment only smooths the initial portion of the current data frame, leaving the tail data unprocessed, ensuring the true output of the original audio signal and improving audio continuity and fidelity.
[0047] Furthermore, the step of determining the amplitude coefficient based on the volume values in the previous time frame and the current time frame may further include: Step S21: Extract the maximum volume value from the previous time frame to obtain the first volume value; Step S22: Extract the maximum volume value from the current time frame to obtain the second volume value; Step S23: Calculate the ratio of the first volume value to the second volume value to obtain the amplitude coefficient.
[0048] In this embodiment, a method for calculating the amplitude coefficient based on the maximum volume value in a time frame is disclosed. Since the maximum volume value is the data point with the largest amplitude in the audio signal, the amplitude coefficient is calculated by the ratio between the maximum volume values. This method can well reflect the difference between the peak value of the audio signal in the previous time frame and the peak value of the audio signal in the current time frame, thereby minimizing the abruptness of the smoothed target audio signal to the user.
[0049] As an example, the mathematical expression for the amplitude coefficient calculation method is: ;
[0050] Where Lmax is the maximum absolute value of the previous time frame, and Cmax is the maximum absolute value of the current time frame. This is the amplitude coefficient.
[0051] Furthermore, the step of extracting the maximum volume value from the previous time frame to obtain the first volume value may further include: Step S211: Calculate the absolute value of the amplitude corresponding to each position in the previous time frame to obtain the volume value corresponding to each position. Step S212: Select the largest volume value among all the positions as the first volume value.
[0052] Similarly, the step of extracting the maximum volume value from the current time frame to obtain the second volume value may further include: Step S221: Calculate the absolute value of the amplitude corresponding to each position in the current time frame to obtain the volume value corresponding to each position. Step S222: Select the largest volume value among the positions to obtain the second volume value.
[0053] As an example, in extracting the maximum volume value, the maximum value can be taken from the absolute values of the amplitudes corresponding to each data point in the previous and current time frames. The mathematical expression is as follows: Lmax = max(abs(len1)); Cmax = max(abs(len2)); Where Lmax is the maximum absolute value of the previous time frame, Cmax is the maximum absolute value of the current time frame, len1 is the amplitude of the previous time frame, and len2 is the amplitude of the current time frame.
[0054] In the audio signal smoothing method of this application embodiment, when the target head in the target area is detected to have moved, a previous time frame is divided from the previous data frame of the original audio signal, and a current time frame is divided from the current data frame of the original audio signal; an amplitude coefficient is determined based on the volume values in the previous time frame and the current time frame; based on the amplitude coefficient, the audio signal in the current time frame is smoothed to output the target audio signal.
[0055] Thus, in this embodiment of the application, when the target head in the target area is detected to have moved, the original audio signal is divided into the current time frame and the previous time frame, and an adaptive amplitude coefficient is determined based on the volume values of the previous time frame and the current time frame. The amplitude coefficient is then used for smoothing. Compared with traditional audio signal smoothing schemes, the calculation process of processing the original audio signal using only the amplitude coefficient in this embodiment of the application is simpler. It does not require calculating the coefficient of each data point separately, which greatly reduces the computational complexity and the amount of computation.
[0056] Furthermore, since the embodiments of this application employ adaptive amplitude coefficients to smooth the audio signal in the current time frame, the coefficients of each data point in the current time frame are consistent, and there will be no abrupt changes in volume, thereby further ensuring the continuity of amplitude between frames.
[0057] In addition, the embodiments of this application also retain the tail data of the current time frame without processing, ensuring the output of the original audio and improving the fidelity of the output audio signal.
[0058] Furthermore, based on the first embodiment of the audio signal smoothing processing method of this application described above, a second embodiment of the audio signal smoothing processing method of this application is proposed.
[0059] In this embodiment, before the step of smoothing the audio signal in the current time frame based on the amplitude coefficient, the method may further include: Step A10: Determine whether the first volume value is less than the second volume value; Step A20: If the first volume value is less than the second volume value, then perform the step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal. Step A30: If the first volume value is not less than the second volume value, then output the original audio signal.
[0060] In this embodiment of the application, it should be noted that after determining the amplitude coefficient and before the step of smoothing the audio signal in the current time frame, a method is provided to determine whether smoothing processing is needed based on the determined relationship between the first volume value and the second volume value. This is because when the first volume value is less than the second volume value, it indicates that after the position is moved, the volume of the audio signal received by the user suddenly increases, which may result in brief popping sounds or sharp sounds, negatively impacting the user's audio experience. Therefore, smoothing processing is required to update the volume values of each data point in the current time frame corresponding to the position movement. Specifically, since the first volume value is less than the second volume value, the amplitude coefficient is greater than 0 and less than 1. Therefore, after updating the volume values of each data point in the current time frame, the volume values of each data point in the current time frame are reduced. Moreover, the larger the difference between the first volume value and the second volume value, the smaller the amplitude coefficient, and the greater the reduction in the volume values of each data point in the current time frame.
[0061] On the other hand, when the first volume value is greater than or equal to the second volume value, it means that after the position is moved, the volume of the audio signal received by the user has decreased or remained unchanged. There will be no brief popping sound, nor will it bring a bad experience to the user's audio experience. Therefore, there is no need to smooth the amplitude of the data points in the current time frame, saving computing power. Only the original audio signal needs to be output.
[0062] As an example, the amplitude coefficient is determined before smoothing the audio signal in the current time frame. The range of values for , if 0 < If <1, then continue with step S30: based on the amplitude coefficient, smooth the audio signal in the current time frame and output the target audio signal; if If the value is ≥1, then no smoothing is required, and the original audio signal can be output directly.
[0063] In this embodiment, the need to perform smoothing processing on the audio signal in the current time frame is mainly determined by the difference between the first volume value and the second volume value. This avoids calling the device's computing resources for signal processing even when the volume remains unchanged or decreases, thereby reducing the device's computational pressure and computational complexity.
[0064] Furthermore, based on the first embodiment of the audio signal smoothing processing method of this application described above, a third embodiment of the audio signal smoothing processing method of this application is proposed.
[0065] In this embodiment, in step S30, the smoothing process includes data updating, and the target audio signal includes updated data and unupdated data in the original audio signal; The step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal may further include: Step S31: Based on the data sampling rate of the original audio signal, extract the time frame array from the audio signal of the current time frame; Step S32: Update data is obtained by calculating the product of each amplitude value in the time frame array and the amplitude coefficient respectively; Step S33: Update the data in the time frame array using the updated data to output the target audio signal.
[0066] In this embodiment, a method for smoothing audio signals in the current time frame based on amplitude coefficients is provided. This method mainly converts continuous audio signals into a corresponding time frame array based on the data sampling rate. The time frame array includes the amplitude (volume value) corresponding to each sampled data point in the time frame. Then, an adaptively determined amplitude coefficient is multiplied by the amplitude of each data point to reduce the amplitude of each data point in the time frame array. This reduces the gradient of sudden volume increases after position movement, avoids spikes or pops, and improves the user's audio experience.
[0067] Additionally, refer to Figure 5 In this embodiment, when smoothing the audio signal in the current data frame, only the audio signal in the current time frame starting from the initial position is processed, and the subsequent part is output as is without any calculation processing. Therefore, a single amplitude coefficient multiplication operation is used within this time frame, and the data frame is processed in blocks, which reduces the computational complexity while retaining the tail data of the data frame without processing, ensuring the true output of the original audio.
[0068] As an example, a time frame array, xlen, is extracted from the audio signal of the current time frame based on the data sampling rate. Specifically, the data within the time frame is updated using the following formula: ;
[0069] in, This represents the i-th data point (amplitude) in the time frame array. This is the amplitude coefficient.
[0070] In this embodiment, the audio signal smoothing method of this application obtains the updated data in the time frame array by multiplying the amplitude coefficient with each data in the array corresponding to the current time frame. This achieves smoothing processing simply by multiplying the amplitude coefficients obtained through the adaptive method, and by processing data frames in blocks, it effectively reduces the computational complexity of audio signal smoothing, saves the computing resources and energy consumption of audio devices, and significantly improves the user experience.
[0071] Furthermore, based on the first, second, and / or third embodiments of the audio signal smoothing processing method of this application described above, a fourth embodiment of the audio signal smoothing processing method of this application is proposed.
[0072] In this embodiment, before step S10, when the positional movement of the target head in the target area is detected, the method may further include: Step B10: Identify the target head in the target area using a preset target recognition algorithm to obtain the position of the target head; In this embodiment of the application, it should be noted that the audio signal smoothing processing method can be applied to multi-channel audio usage scenarios in enclosed spaces. The target area is an enclosed or semi-enclosed space, such as an egg pod, a car, or a room. A camera is installed in the enclosed space to detect, identify, and locate the user's head position. The target recognition algorithm can be a pre-trained target recognition algorithm, or various mature target detection algorithms in the prior art, such as the YOLO (you only look once) target detection algorithm. It can identify the user's head position in the target area to determine the timing of the audio signal smoothing processing step.
[0073] Step B20: When the change in the position of the target head is detected to be greater than a preset distance, it is determined that the target head has moved.
[0074] In this embodiment, a preset distance is pre-defined to determine whether the user's head position has changed, thereby avoiding the impact of detection errors in the process of identifying the target head through the target recognition algorithm. In addition, the preset distance can be set according to the user's needs. If a high degree of smoothness is required when playing the audio signal, the preset distance can be set to a smaller value. Correspondingly, the audio device will use this audio signal smoothing processing method more frequently, consuming more computing resources. If a lower degree of smoothness is required when playing the audio signal, the value of the preset distance can be appropriately increased, which saves the computing resources of the audio device to a certain extent.
[0075] In this embodiment of the application, since the change in the position of the user's head in the target area may cause a sudden increase in volume in the received original audio signal, resulting in a noticeable pop sound, the user's head position is identified and located by a preset target recognition algorithm, and the steps of the audio signal smoothing method are executed in a timely manner when the head position changes, so as to smooth the audio signal within a certain period of time after the position change, and produce a smoother transition effect.
[0076] In addition, this application also provides an audio signal smoothing processing device, please refer to... Figure 6 , Figure 6 This is a functional block diagram of an embodiment of the audio signal smoothing processing apparatus of this application, as shown below. Figure 6 As shown, the audio signal smoothing processing apparatus of this application includes: The audio signal smoothing processing device includes: The time frame division module 10 is used to divide the previous time frame from the previous data frame of the original audio signal and the current time frame from the current data frame of the original audio signal when the target head in the target area is detected to have moved. The coefficient determination module 20 is used to determine the amplitude coefficient based on the volume values in the previous time frame and the current time frame; The signal output module 30 is used to smooth the audio signal in the current time frame based on the amplitude coefficient and output the target audio signal.
[0077] Optionally, the time frame division module 10 is further configured to: The time frame length is calculated based on the data sampling rate of the original audio signal and a preset time threshold. Divide the time frame at the end of the previous data frame into the previous time frame; The time frame with the length of the time frame located at the initial position in the current data frame is divided into the current time frame.
[0078] Optionally, the coefficient determination module 20 is further configured to: Extract the maximum volume value from the previous time frame to obtain the first volume value; Extract the maximum volume value from the current time frame to obtain the second volume value; Calculate the ratio of the first volume value to the second volume value to obtain the amplitude coefficient.
[0079] Optionally, the coefficient determination module 20 is further configured to: Calculate the absolute value of the amplitude corresponding to each position in the previous time frame to obtain the volume value corresponding to each position. The largest volume value among all the aforementioned positions is selected as the first volume value.
[0080] Optionally, the signal output module 30 is further configured to: Determine whether the first volume value is less than the second volume value; If the first volume value is less than the second volume value, then the step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal is performed. If the first volume value is not less than the second volume value, then the original audio signal is output.
[0081] Optionally, the smoothing process includes data updating, and the target audio signal includes updated data and unupdated data from the original audio signal; The signal output module 30 is also used for: Based on the data sampling rate of the original audio signal, a time frame array is extracted from the audio signal of the current time frame; The updated data is obtained by calculating the product of each amplitude value in the time frame array and the amplitude coefficient. The data in the time frame array is updated using the updated data to output the target audio signal.
[0082] Optionally, the audio signal smoothing processing device further includes a target detection module, the target detection module being used for: The target head in the target area is identified by a preset target recognition algorithm, and the position of the target head is obtained. When the change in the position of the target head is detected to be greater than a preset distance, it is determined that the target head has moved.
[0083] The specific implementations of the various functional modules of the audio signal smoothing processing device of this application during operation are basically the same as the implementations of the audio signal smoothing processing method of this application described above, and will not be repeated here.
[0084] This application also provides a computer storage medium storing an audio signal smoothing program, which, when executed by a processor, implements the steps of the audio signal smoothing program method as described in any of the above embodiments.
[0085] The specific embodiments of the computer storage medium in this application are basically the same as the embodiments of the audio signal smoothing processing method described above, and will not be repeated here.
[0086] This application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the audio signal smoothing processing method of this application as described in any of the above embodiments, which will not be elaborated here.
[0087] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0088] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0089] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause an electronic device (such as TWS earphones) to execute the methods described in the various embodiments of this application.
[0090] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An audio signal smoothing processing method, characterized in that, The audio signal smoothing processing method includes: When a target head in the target area is detected to have moved, the previous time frame is divided from the previous data frame of the original audio signal, and the current time frame is divided from the current data frame of the original audio signal. The amplitude coefficient is determined based on the volume values in the previous time frame and the current time frame; Based on the amplitude coefficient, the audio signal in the current time frame is smoothed to output the target audio signal; The smoothing process includes data updating, and the target audio signal includes updated data and unupdated data from the original audio signal. The step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal includes: Based on the data sampling rate of the original audio signal, a time frame array is extracted from the audio signal of the current time frame; The updated data is obtained by calculating the product of each amplitude value in the time frame array and the amplitude coefficient. The data in the time frame array is updated using the updated data to output the target audio signal.
2. The audio signal smoothing processing method as described in claim 1, characterized in that, The steps of dividing the previous time frame from the previous data frame of the original audio signal and dividing the current time frame from the current data frame of the original audio signal include: The time frame length is calculated based on the data sampling rate of the original audio signal and a preset time threshold. Divide the time frame at the end of the previous data frame into the previous time frame; The time frame with the length of the time frame located at the initial position in the current data frame is divided into the current time frame.
3. The audio signal smoothing processing method as described in claim 1, characterized in that, The step of determining the amplitude coefficient based on the volume values in the previous time frame and the current time frame includes: Extract the maximum volume value from the previous time frame to obtain the first volume value; Extract the maximum volume value from the current time frame to obtain the second volume value; Calculate the ratio of the first volume value to the second volume value to obtain the amplitude coefficient.
4. The audio signal smoothing processing method as described in claim 3, characterized in that, The step of extracting the maximum volume value from the previous time frame to obtain the first volume value includes: Calculate the absolute value of the amplitude corresponding to each position in the previous time frame to obtain the volume value corresponding to each position. The largest volume value among all the aforementioned positions is selected as the first volume value.
5. The audio signal smoothing processing method as described in claim 3, characterized in that, The method further includes: Determine whether the first volume value is less than the second volume value; If the first volume value is less than the second volume value, then the step of smoothing the audio signal in the current time frame based on the amplitude coefficient and outputting the target audio signal is performed. If the first volume value is not less than the second volume value, then the original audio signal is output.
6. The audio signal smoothing processing method according to any one of claims 1-5, characterized in that, The method further includes: The target head in the target area is identified by a preset target recognition algorithm, and the position of the target head is obtained. When the change in the position of the target head is detected to be greater than a preset distance, it is determined that the target head has moved.
7. An audio signal smoothing processing device, characterized in that, The audio signal smoothing processing device includes: The time frame segmentation module is used to segment the previous time frame from the previous data frame of the original audio signal and the current time frame from the current data frame of the original audio signal when the target head in the target area is detected to have moved. The coefficient determination module is used to determine the amplitude coefficient based on the volume values in the previous time frame and the current time frame; The signal output module is used to smooth the audio signal in the current time frame based on the amplitude coefficient and output the target audio signal. The smoothing process includes data updating, and the target audio signal includes updated data and unupdated data from the original audio signal. The signal output module is further configured to: extract a time frame array from the audio signal of the current time frame based on the data sampling rate of the original audio signal; obtain updated data by calculating the product of each amplitude value in the time frame array with the amplitude coefficient; and update the data in the time frame array with the updated data to output the target audio signal.
8. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and an audio signal smoothing processing program stored in the memory and executable on the processor, wherein the audio signal smoothing processing program, when executed by the processor, implements the steps of the audio signal smoothing processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an audio signal smoothing program, which, when executed by a processor, implements the steps of the audio signal smoothing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for adaptively adjusting sound effect and equipment thereof
CN102436821A
Processing method, device and system of audio signals
CN103796150A