Audio processing methods, devices, electronic equipment and storage media
By acquiring the frequency response characteristics of the target output device and generating a frequency response compensation curve from the model, which is then mapped to filter parameters, the audio signal is processed to solve the problems of abrupt changes in timbre and discontinuity in listening experience when switching audio output devices, thus achieving a smooth audio transition effect.
Patent Information
- Application Number
- CN202611343592.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-17
AI Technical Summary
When switching audio output devices, existing technologies struggle to effectively reduce abrupt changes in timbre and discontinuities in listening experience.
By acquiring the output link frequency response characteristics and target frequency response model of the target output device after switching, a target frequency response compensation curve is generated and mapped to the target filter compensation parameters. The audio signal to be output is then subjected to transition processing to gradually update the filter compensation parameters, so that the audio signal transitions smoothly during the switching process.
It reduces issues such as timbre abruptness, frequency band-level auditory abruptness, and audio output discontinuity caused by output device switching, thereby improving auditory continuity and system stability.
Smart Images

Figure CN123123787A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio processing technology, specifically to an audio processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the improvement of audio playback capabilities of electronic devices, more and more electronic devices support multiple audio output methods. For example, devices such as smart TVs, set-top boxes, smart speakers, in-vehicle terminals, and mobile terminals can typically play audio through different output devices such as built-in speakers, headphones, Bluetooth audio devices, HDMI audio devices, Line Out devices, or external speaker systems.
[0003] In practical use, users may switch between different audio output devices depending on the scenario. For example, in a normal viewing scenario, electronic devices can play sound through built-in speakers; when connected to an external amplifier or sound system, electronic devices can switch to Line Out or HDMI audio output; in a personal listening scenario, electronic devices can switch to headphones or Bluetooth audio devices. Due to differences in hardware structure, acoustic characteristics, output capabilities, and signal transmission links, the response capabilities of different output devices in different frequency bands such as low frequency, mid frequency, and high frequency may also vary.
[0004] Currently, when an audio output device switch is detected, electronic devices typically adjust the audio playback status according to the new output device. For example, some solutions directly switch the audio output link to the new output device; some solutions load preset audio configuration parameters corresponding to the target output device, such as preset equalization parameters, sound effect modes, or device profiles; and some solutions perform a gradual change in overall volume when the output device switches to reduce the sudden loudness change at the moment of switching.
[0005] However, simply switching the output link or loading preset parameters may result in users perceiving sudden changes in timbre or discontinuities in sound before and after the switch. On the other hand, simply applying a gradual change to the overall volume can mainly alleviate abrupt changes in loudness, but it is difficult to address issues such as sudden changes in timbre or discontinuities in sound. Therefore, how to reduce sudden changes in timbre and discontinuities in sound during the switching process when audio output devices are switched is a problem that urgently needs to be solved. Summary of the Invention
[0006] This application provides an audio processing method, apparatus, electronic device, and storage medium that can reduce audio abrupt changes and listening discontinuities when switching audio output devices.
[0007] In a first aspect, embodiments of this application provide an audio processing method, the method comprising: Obtain the output link frequency response characteristics and target frequency response model of the target output device after switching; Generate a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model; Map the target frequency response compensation curve to the target filter compensation parameters; Based on the target filter compensation parameters, the audio signal to be output is subjected to transition processing and then output to the target output device.
[0008] Secondly, embodiments of this application also provide an audio processing apparatus, the apparatus comprising: The acquisition module is used to acquire the output link frequency response characteristics and target frequency response model of the target output device after the switch. The generation module is used to generate a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model; The mapping module is used to map the target frequency response compensation curve to the target filter compensation parameters; The output module is used to perform transition processing on the audio signal to be output according to the target filter compensation parameters, and output it to the target output device.
[0009] Optionally, in some embodiments of this application, mapping the target frequency response compensation curve to target filter compensation parameters includes: The target frequency response compensation curve is mapped to the parameters of a multi-segment parametric equalizer to obtain the target filter compensation parameters; Each parametric equalizer segment corresponds to a dual second-order filter unit and / or the parameters of each parametric equalizer segment include at least one of center frequency, gain, or quality factor.
[0010] Optionally, in some embodiments of this application, the step of performing transition processing on the audio signal to be output according to the target filter compensation parameters and outputting it to the target output device includes: Based on the update step size, the current filter compensation parameters corresponding to the current output device before the switch are gradually updated to the target filter compensation parameters. During the gradual update process, the audio signal is continuously compensated using the updated intermediate transition filter compensation parameters, and then output to the target output device after processing. The update step size is determined based on the transition time constant of the corresponding frequency band.
[0011] Optionally, in some embodiments of this application, the step of progressively updating the current filter compensation parameters corresponding to the current output device before the switch to the target filter compensation parameters based on the update step size includes: Based on the update step size and update constraints, the current filter compensation parameters of the current output device before the switch are gradually updated to the target filter compensation parameters; The update constraints include at least one of the following: maximum change in a single update constraint, upper limit of gain in the low-frequency band constraint, or pole stability region constraint.
[0012] Optionally, in some embodiments of this application, the step of performing transition processing on the audio signal to be output according to the target filter compensation parameters and outputting it to the target output device includes: Get the preset switching conditions; When the preset switching condition is met, the audio signal is processed by the target filter compensation parameters and output to the target output device. The preset switching conditions include at least one of the following: frame boundary conditions, low energy window conditions, non-transient conditions, zero crossover point conditions, silent window conditions, or steady-state interval conditions.
[0013] Optionally, in some embodiments of this application, generating the target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model includes: At at least one preset discrete frequency band center frequency, the difference between the target frequency response model and the output link frequency response characteristic information is calculated to obtain the original compensation gain. The original compensation gain is limited according to the minimum and maximum allowable compensation gain to obtain the limited compensation gain. The bandwidth compensation gain is smoothed to obtain the target frequency response compensation curve.
[0014] Optionally, in some embodiments of this application, the output link frequency response characteristic information is obtained by estimating the response result of the target output device, wherein the response result is generated by the response of the target output link corresponding to the target output device to the test signal; The target frequency response model is determined based on at least one of the following: output device type, output device product model, playback scenario, volume level, user preference, or content type.
[0015] Thirdly, embodiments of this application also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps in the audio processing method described above.
[0016] Fourthly, embodiments of this application also provide a storage medium, which includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the audio processing method described above.
[0017] Fifthly, embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in embodiments of this application.
[0018] In summary, this application embodiment obtains the output link frequency response characteristic information and target frequency response model of the target output device after switching, generates a target frequency response compensation curve based on the output link frequency response characteristic information and target frequency response model, maps the target frequency response compensation curve to target filter compensation parameters, performs transition processing on the audio signal to be output based on the target filter compensation parameters, and outputs it to the target output device.
[0019] In this application, the transition processing at the filter compensation parameter level based on the frequency response characteristics of the target output link helps to reduce the problems of timbre jump, frequency band-level auditory abrupt change and audio output discontinuity caused by output device switching. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram illustrating a scenario where an electronic device provided in an embodiment of this application executes the audio processing method; Figure 2 This is a schematic flowchart of the audio processing method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of the audio processing device provided in the embodiments of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.
[0022] Explanation of icon numbers: 101 - Electronic device; 301 - Acquisition module; 302 - Generation module; 303 - Mapping module; 304 - Output module; 401 - Processor; 402 - Memory; 403 - Power supply; 404 - Input unit. Detailed Implementation
[0023] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0025] This application provides an audio processing method, apparatus, electronic device, and storage medium. Specifically, this application provides an audio processing apparatus suitable for electronic devices, including smart TVs, set-top boxes, smart speakers, vehicle terminals, mobile terminals, tablet computers, projection devices, or other devices with audio output functions and multiple audio output links. The audio output links are connected to audio output devices, through which audio is played externally.
[0026] Audio output devices can include built-in speakers, headphones, Bluetooth audio devices, HDMI audio devices, line-out devices, external subwoofers, and speaker and bass unit combination output devices. It is understandable that different audio output devices may differ in frequency response, acoustic efficiency, dynamic range, distortion margin, and low-frequency handling capability. When the audio output link of an electronic device switches from the current output device to the target output device, directly loading the audio processing parameters corresponding to the target output device can easily lead to problems such as abrupt changes in timbre, low-frequency overshoot, click sounds, popping sounds, or discontinuous listening experiences.
[0027] Based on this, the audio processing method provided in this application embodiment is not simply to gradually control the overall volume, nor is it merely to perform abstract smoothing at the gain curve level. Instead, it generates a target frequency response compensation curve based on the output link frequency response characteristic information of the target output device and the target frequency response model, and further maps the target frequency response compensation curve to target filter compensation parameters. Then, it performs transition processing on the audio signal to be output based on the target filter compensation parameters, so that the audio signal can be output to the target output device in a smoother and more stable manner, thereby alleviating or reducing problems such as timbre jumps, frequency band-level auditory abrupt changes, and audio output discontinuity caused by output device switching.
[0028] For example, please see Figure 1 , Figure 1 This is a schematic diagram illustrating a scenario where an electronic device, according to an embodiment of this application, performs the audio processing method. Specifically, the execution process of the audio processing method by the electronic device is as follows: Electronic device 101 acquires the output link frequency response characteristic information and target frequency response model of target output device 102 after switching, generates a target frequency response compensation curve based on the output link frequency response characteristic information and target frequency response model, maps the target frequency response compensation curve to target filter compensation parameters, performs transition processing on the audio signal to be output based on the target filter compensation parameters, and outputs it to the target output device 102.
[0029] Then, the target output device will output and play the received, processed audio signal.
[0030] In summary, the embodiments of this application perform transition processing at the filter compensation parameter level based on the frequency response characteristics of the target output link, which helps to reduce the problems of timbre jump, frequency band-level auditory abrupt change and audio output discontinuity caused by output device switching.
[0031] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0032] Please see Figure 2 , Figure 2 This is a flowchart illustrating the audio processing method provided in an embodiment of this application. Although the flowchart shows a logical order, in some cases, the steps shown or described may be performed in a different order than that shown in the flowchart. Specifically, the specific flow of this audio processing method is as follows: S201. Obtain the output link frequency response characteristics and target frequency response model of the target output device after switching.
[0033] The target output device after switching refers to the audio output device that the audio output link will switch to after the switch is completed or will be switched to. For example, when an electronic device originally played audio through its built-in speaker and then switched to a Line Out device to play audio, the Line Out device can be used as the target output device after switching. As another example, when an electronic device switches from its built-in speaker to an HDMI audio device, Bluetooth speaker, headphones, or external subwoofer, the HDMI audio device, Bluetooth speaker, headphones, or external subwoofer can all be used as the target output device after switching.
[0034] Output link frequency response characteristics refer to parameters or data used to characterize the frequency response characteristics of the corresponding output link of the target output device. Frequency response characteristics can reflect the ability of the target output device or output link to respond to audio signals at different frequencies. For example, output link frequency response characteristics may include response values across multiple frequency bands, low-frequency attenuation characteristics, high-frequency roll-off characteristics, resonant peak parameters, frequency band gain distribution, frequency band attenuation distribution, etc.
[0035] In this embodiment of the application, the frequency response characteristic information of the output link can be represented as Hdev=[Hdev(f1), Hdev(f2), ..., Hdev(fM)], where f1 to fM are preset discrete frequency band center frequencies, and Hdev(fk) represents the frequency response characteristic value of the target output link at the frequency band center frequency fk.
[0036] In this context, an output link refers to the output path or channel through which an audio signal travels from the audio processing link of an electronic device to the corresponding audio output device. This output link can include digital audio output links, analog audio output links, wireless audio output links, or combined output links. For example, an HDMI audio link can be considered a digital audio output link, Line Out can be considered a linear audio output link, and a Bluetooth audio link can be considered a wireless audio output link.
[0037] In this context, a target frequency response model refers to a reference model or template used to represent the desired target frequency response in a specific output device or playback scenario. The target frequency response model is not necessarily equivalent to the actual response of the target output device, but rather indicates the desired sound response target after compensation. For example, target frequency response models can include built-in speaker target models, Line Out target models, HDMI audio target models, Bluetooth audio device target models, and speaker and subwoofer combination target models, etc.
[0038] In this embodiment of the application, the target frequency response model can be expressed as H ref =[H ref (f1), H ref (f2), ...,Href (fM)], where H ref (fk) represents the target frequency response value that is expected to be achieved at the center frequency fk of the frequency band.
[0039] That is, in this step, after detecting a switch in the audio output link, the electronic device can determine the target output device after the switch, and obtain the frequency response characteristic information of the output link corresponding to the target output device, as well as the target frequency response model that matches the target output device. In this way, the compensation direction and compensation magnitude for the target output device can be determined based on the actual or approximate output capability of the target output device and the desired sound response target.
[0040] Understandably, this step allows subsequent audio compensation to no longer rely solely on fixed device profiles or general equalization parameters, but to simultaneously consider the output link characteristics of the target output device and the target sound response requirements, thus providing a basis for generating compensation parameters that better match the characteristics of the target output link.
[0041] S202. Generate a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model.
[0042] The target frequency response compensation curve refers to a curve or data set used to represent the amount of compensation that needs to be applied to the audio signal at different frequencies or different frequency bands. The target frequency response compensation curve may include compensation gains corresponding to multiple frequency bands, or compensation values corresponding to multiple frequency points. For example, in this embodiment, the target frequency response compensation curve can be represented as G. target =[G target (f1), G target (f2), ..., G target (fM)], where G target (fk) represents the compensation gain that needs to be applied at the center frequency fk of the frequency band.
[0043] In this embodiment, a compensation curve is obtained based on the relationship between the actual frequency response characteristics of the target output link and the desired frequency response target, which is used to make the target output link approach the target frequency response model.
[0044] For example, when the target response model of the target frequency response model in a certain low-frequency band is higher than the actual response of the target output link in that low-frequency band, a positive compensation gain can be generated in that band; when the actual response of the target output link in a certain high-frequency band is higher than the target response of the target frequency response model, a negative compensation gain or attenuation compensation can be generated in that band. Therefore, the target frequency response compensation curve can reflect the band-level compensation requirements of the target output device relative to the target frequency response model.
[0045] In this embodiment, the target frequency response compensation curve is not limited to being generated by a specific formula. Any method that can determine the compensation requirements at different frequencies or frequency bands based on the output link frequency response characteristics and the target frequency response model can be used to implement this step. For example, the target frequency response compensation curve can be generated through difference calculation, table lookup, fitting, interpolation, model matching, or a combination of the above methods.
[0046] Understandably, this step converts the frequency response differences of the target output device into band-level compensation requirements, enabling subsequent audio processing to compensate for differences in different frequency bands such as low, mid, and high frequencies, rather than simply adjusting the overall volume uniformly. Therefore, this step helps reduce problems such as abrupt changes in timbre and discontinuities in listening experience caused by sudden changes in band compensation relationships when switching output devices.
[0047] S203. Map the target frequency response compensation curve to the target filter compensation parameters.
[0048] Mapping refers to the process of converting one data representation into another that can be used by the audio processing link. For example, the compensation gain in the frequency response curve can be converted into filter parameters, and the compensation values on multiple frequency bands can be converted into equalizer parameters, IIR filter parameters, FIR filter parameters, or bi-second-order filter parameters.
[0049] The target filter compensation parameters refer to the filter parameters used to enable the audio processing link to achieve the compensation effect corresponding to the target frequency response compensation curve. These target filter compensation parameters can be filter coefficients or a set of parameters that can further generate filter coefficients. For example, target filter compensation parameters may include IIR filter parameters, FIR filter parameters, multi-band equalizer parameters, a set of dual second-order filter parameters, center frequency, gain, quality factor, filter order, and filter coefficients.
[0050] A filter is a signal processing structure used to adjust the gain, attenuation, phase, or spectral shape of different frequency components in an audio signal. An equalizer can be understood as a specific application of a filter, typically used to apply different gains to different frequency bands. A dual second-order filter unit is a common digital audio filtering implementation structure, which can be used to implement frequency band compensation in a parametric equalizer.
[0051] Understandably, mapping the target frequency response compensation curve to target filter compensation parameters is to ensure that the abstract target frequency response compensation requirement can be translated into executable filter parameters within the actual audio processing chain. In other words, the target frequency response compensation curve primarily describes the desired frequency compensation effect, while the target filter compensation parameters describe how the audio processing module achieves this compensation effect through filters.
[0052] For example, if the target frequency response compensation curve indicates that the low-frequency response needs to be boosted near 100Hz and the high-frequency response needs to be appropriately attenuated near 8kHz, then the target frequency response compensation curve can be converted into the parameters of one or more filter units, so that these filter units can perform the corresponding frequency band boosting or attenuation in actual audio processing.
[0053] Understandably, this step avoids simply abstracting the compensation parameters at the gain curve level, instead converting the compensation curve into filter compensation parameters that can be directly executed or further executed by the audio processing link, thereby improving the engineering feasibility of the solution.
[0054] S204. According to the target filter compensation parameters, perform transition processing on the audio signal to be output and output it to the target output device.
[0055] The audio signal to be output refers to the audio data that needs to be played or output through the target output device. This audio signal can be music, video audio, voice, system prompts, game audio, or other audio content.
[0056] Transition processing refers to the process of gradually changing the audio processing state from the pre-switching state to the target state during or after an output device switching process. Transition processing is not limited to a gradual change in overall volume, but can include the gradual updating of filter compensation parameters, the gradual migration of compensation effects, and the continuous application of intermediate compensation parameters.
[0057] Outputting to the target output device refers to transmitting the processed audio signal to the switched target output device for playback or further output. For example, outputting the processed audio signal to a Line Out device, HDMI audio device, Bluetooth audio device, headphones, or built-in speakers.
[0058] In other words, in this step, the electronic device performs transition processing on the audio signal to be output according to the target filter compensation parameters, so that when the audio signal is output to the target output device, there will be no obvious timbre jump or transient abnormality due to the instantaneous switching of the filter compensation parameters. This transition processing allows the audio processing link to smoothly transition from the compensation state corresponding to the output device before the switch to the compensation state corresponding to the target output device.
[0059] Understandably, this step can reduce the sudden changes in listening experience caused by direct parameter switching when playing audio on the target output device, allowing the audio output to transition naturally from the state before switching to the compensated state corresponding to the target output device, thereby improving the continuity of listening experience and system stability during the switching process of the output device.
[0060] In summary, the embodiments of this application perform transition processing at the filter compensation parameter level based on the frequency response characteristics of the target output link, which helps to reduce the problems of timbre jump, frequency band-level auditory abrupt change and audio output discontinuity caused by output device switching.
[0061] It should be noted that when converting the target frequency response compensation curve into executable target filter compensation parameters, directly using an abstract curve for audio processing may be difficult to adapt to the actual audio processing chain. Therefore, in some embodiments, a multi-band parametric equalizer can be used as a specific implementation of the filter compensation parameters, so as to achieve the target frequency response compensation curve through equalization control of multiple frequency bands. That is, optionally, in some embodiments of this application, the step "mapping the target frequency response compensation curve into target filter compensation parameters" includes: The target frequency response compensation curve is mapped to the parameters of a multi-segment parametric equalizer to obtain the target filter compensation parameters; Each parametric equalizer segment corresponds to a dual second-order filter unit and / or the parameters of each parametric equalizer segment include at least one of center frequency, gain, or quality factor.
[0062] A multi-band parametric equalizer refers to an audio equalization processing structure that includes multiple parametric equalizer segments. Each parametric equalizer segment can be used to boost or attenuate the frequency band near a center frequency. For example, a multi-band parametric equalizer may include multiple equalizer segments in the low-frequency, mid-frequency, and high-frequency bands, and may also include 5, 7, 10, or more parametric equalizer segments.
[0063] The parameters of a parametric equalizer are those used to describe the frequency processing characteristics of a specific frequency band. For example, the parameters of a parametric equalizer may include at least one of the following: center frequency (f), gain (g), and quality factor (Q). The center frequency refers to the frequency range where the equalizer primarily operates, such as 100Hz, 1kHz, or 8kHz; the gain refers to the amount of boost or attenuation applied by the equalizer to audio components near the corresponding frequency, such as +3dB or -2dB; and the quality factor is a parameter used to characterize the bandwidth of the equalizer's operating frequency band. A higher quality factor generally indicates a narrower operating bandwidth, while a lower quality factor generally indicates a wider operating bandwidth.
[0064] A dual second-order filter unit refers to a second-order digital filter structure, commonly used in audio equalization processing as a filter segment. Each segment of the parametric equalizer corresponds to one dual second-order filter unit, meaning that the frequency band compensation function of that segment of the equalizer can be achieved through a single dual second-order filter unit. For example, when the center frequency of a certain parametric equalizer is 250Hz, the gain is +2dB, and the quality factor is 1.0, the filter parameters of the corresponding dual second-order filter unit can be generated based on this center frequency, gain, and quality factor.
[0065] In this embodiment, the target frequency response compensation curve can be split or fitted into compensation requirements for multiple frequency bands, and mapped to parameters of a multi-segment parametric equalizer. For example, when the target frequency response compensation curve has different compensation requirements at low, mid, and high frequencies, compensation for different frequency bands can be achieved through multiple equalizer segments. Each parametric equalizer segment can correspond to a dual second-order filter unit, thereby forming the target filter compensation parameters.
[0066] Understandably, this embodiment enables the conversion of the target frequency response compensation curve into commonly used equalizer parameters in actual audio processing links, facilitating the deployment of the compensation scheme in digital audio processing modules of devices such as smart TVs, speakers, set-top boxes, and in-vehicle terminals. Furthermore, by describing each equalizer band using parameters such as center frequency, gain, and quality factor, the compensation position, compensation amplitude, and effective range of each frequency band can be clearly defined, thereby improving the accuracy and feasibility of compensation parameter generation.
[0067] It should be noted that during output device switching, directly switching the current filter compensation parameters to the target filter compensation parameters at once may cause a sudden change in the filter state, leading to click sounds, popping sounds, local resonance, or sudden changes in timbre. Therefore, in some embodiments, the filter compensation parameters can be updated gradually based on the update step size, and intermediate transition filter compensation parameters can be continuously used to process the audio signal during the update process. That is, optionally, in some embodiments of this application, the step "perform transition processing on the audio signal to be output according to the target filter compensation parameters and output it to the target output device" includes: Based on the update step size, the current filter compensation parameters corresponding to the current output device before the switch are gradually updated to the target filter compensation parameters. During the gradual update process, the audio signal is continuously compensated using the updated intermediate transition filter compensation parameters, and then output to the target output device after processing. The update step size is determined based on the transition time constant of the corresponding frequency band.
[0068] In this context, the current output device before switching refers to the audio output device that is active or in use before switching to the target output device. For example, when an electronic device switches from a built-in speaker to a Line Out device, the built-in speaker can be considered the current output device before switching, and the Line Out device can be considered the target output device.
[0069] The current filter compensation parameters refer to the filter compensation parameters that were already in effect before the output device switch and correspond to the current output device before the switch. For example, when playing through the built-in speaker before the switch, the current filter compensation parameters could be the compensation filter parameters corresponding to the built-in speaker. The current filter compensation parameters are not the filter compensation parameters of the target output device, but rather the parameters that the audio processing chain was using before the switch.
[0070] In this context, gradual updating refers to the process of making the filter compensation parameters gradually approach the target filter compensation parameters from the current parameters. For example, a portion of the current filter compensation parameters can be adjusted sequentially over multiple parameter update cycles to gradually bring them closer to the target filter compensation parameters, rather than replacing them with the target filter compensation parameters all at once.
[0071] The update step size refers to the magnitude or proportion by which the current filter compensation parameter changes towards the target filter compensation parameter each time the parameter is updated. The update step size can be a fixed value or determined based on the frequency band, output device type, content type, volume level, or transition time constant. For example, for filter compensation parameters in a certain frequency band, a smaller update step size can be set to allow it to slowly approach the target parameter; alternatively, a larger update step size can be set to allow it to approach the target parameter more quickly.
[0072] Intermediate transition filter compensation parameters refer to intermediate parameters generated during the process of gradually updating the current filter compensation parameters to the target filter compensation parameters. These intermediate parameters differ from the initial current filter compensation parameters and are not necessarily identical to the final target filter compensation parameters; rather, they represent a transitional state between the two. For example, the filter compensation parameters obtained after the nth update can be used as the nth intermediate transition filter compensation parameters.
[0073] Continuous compensation processing refers to continuously filtering or equalizing the output audio signal using intermediate transition filter parameters obtained from each update during the gradual parameter update process. In this way, the compensation state of the audio signal can gradually change over time when it is output to the target output device.
[0074] The corresponding frequency band refers to the frequency range or frequency position corresponding to the filter compensation parameter. For example, if one parameter equalizer band operates in the low-frequency range around 100Hz, then that parameter corresponds to the low-frequency band; if another parameter equalizer band operates in the mid-frequency range around 2kHz, then that parameter corresponds to the mid-frequency band.
[0075] The transition time constant is a time parameter used to characterize how quickly the filter compensation parameters for a corresponding frequency band change from their current state to the target state. For example, a larger transition time constant can correspond to a lower frequency band, allowing for slower changes in low-frequency compensation; a smaller transition time constant can correspond to a higher frequency band, allowing for faster transitions in high-frequency compensation. For instance, when the center frequency of a frequency band is less than 250Hz, a larger transition time constant in the range of 400ms to 800ms is used; when the center frequency of a frequency band is greater than or equal to 250Hz and less than or equal to 4kHz, a medium-sized transition time constant in the range of 200ms to 400ms is used; and when the center frequency of a frequency band is greater than 4kHz, a smaller transition time constant in the range of 100ms to 250ms is used.
[0076] That is, in this embodiment, the electronic device can first read the current filter compensation parameters corresponding to the current output device before switching, and then obtain the target filter compensation parameters according to the target frequency response compensation curve. Subsequently, the electronic device gradually adjusts the current filter compensation parameters based on the update step size, so that they gradually approach the target filter compensation parameters. The parameters obtained after each update are used as intermediate transition filter compensation parameters and are used for continuous compensation processing of the output audio signal.
[0077] For example, a filter compensation parameter c can be recursively updated so that the current parameter gradually approaches the target parameter with a certain update step size. The specific formula for this recursive update can be determined according to the actual filter type and system requirements. For example, the formula for this recursive update includes: c i (n+1) =c i (n) +λ i (c i,target c i (n) ).
[0078] Among them, c i Let λ represent the filter compensation parameter c of the i-th filter segment. i This represents the update step size corresponding to the i-th filter segment, ci (n) is the current coefficient after the n-th update, and ci,target is the target coefficient.
[0079] The update step size λ i With the transition time constant τ i The relationship can be represented as: λ i =1-e -Δt / τi .
[0080] Where Δt is the parameter update period, τ i This represents the transition time constant of the frequency band corresponding to the i-th filter segment.
[0081] Understandably, through this gradual update method, the audio compensation state can smoothly change from the state corresponding to the current output device before the switch to the state corresponding to the target output device.
[0082] Understandably, since the update step size is determined based on the transition time constant of the corresponding frequency band, different frequency bands can have different parameter migration speeds. For example, low-frequency energy is relatively large and prone to overshoot, so a larger transition time constant can be used to make the low-frequency compensation change more gradual; high-frequency energy is relatively low and has a significant impact on timbre brightness, so a smaller transition time constant can be used to make the high-frequency compensation complete the migration faster.
[0083] This embodiment reduces transient anomalies caused by direct jumps in filter compensation parameters, ensuring good auditory continuity of the audio signal after switching to the target output device. Furthermore, by determining the update step size using the transition time constants of different frequency bands, it balances low-frequency protection, mid-frequency continuity, and high-frequency convergence speed.
[0084] It is understandable that during the gradual update of filter compensation parameters, even with an update step size, if the update magnitude is too large, the low-frequency compensation is too strong, or the filter poles deviate from the stable region, overshoot, resonance, or filter instability may still occur. Therefore, in some embodiments, update constraints can be further introduced during the gradual update process to improve the stability of the transition process. That is, optionally, in some embodiments of this application, the step "based on the update step size, gradually update the current filter compensation parameters corresponding to the current output device before the switch to the target filter compensation parameters" includes: Based on the update step size and update constraints, the current filter compensation parameters of the current output device before the switch are gradually updated to the target filter compensation parameters; The update constraints include at least one of the following: maximum change in a single update constraint, upper limit of gain in the low-frequency band constraint, or pole stability region constraint.
[0085] In this context, update constraints refer to the constraints used to limit the range of parameter changes, the rate of parameter change, the magnitude of compensation gain, or the steady state of the filter during the gradual update process of filter compensation parameters. Update constraints can be used to prevent abnormal jumps, overcompensation, or instability of parameters during the transition process.
[0086] The maximum change in a single update constraint refers to limiting the maximum change in the filter compensation parameters during each parameter update. For example, for a certain filter coefficient c... i If the change calculated according to the update step size exceeds the maximum allowable change Δc max Then the change can be limited to Δc. max Within this range, if the transformation quantity is Δcmax This prevents excessively large updates from causing abnormal click sounds or filter transients.
[0087] The low-frequency gain upper limit constraint refers to setting a maximum allowable value for the compensation gain within the low-frequency range. For example, for a center frequency lower than a preset low-frequency threshold f... LF The frequency band can limit its compensation gain to no more than the maximum compensation gain G at low frequencies. LF,max Since low-frequency energy is usually large, and the low-frequency carrying capacity of different output devices varies significantly, limiting the low-frequency compensation gain can reduce the risk of low-frequency overshoot and target output device overload.
[0088] Among them, the pole stability region constraint refers to restricting the filter poles to be located within a preset stability region when the filter adopts a structure with poles. For example, when the target filter compensation parameters or intermediate transition filter compensation parameters adopt a double second-order filter structure, it can be determined whether the filter pole radius exceeds a preset upper limit r. max If the limit is exceeded, the poles will be projected or adjusted back to the preset stable region. This constraint helps prevent the filter from becoming unstable in the intermediate transition state.
[0089] In this embodiment, when the electronic device updates the current filter compensation parameters step by step based on the update step size, it also incorporates update constraints to limit or correct the update results. For example, after calculating the compensation parameters for the next intermediate transition filter, it can determine whether the change in the parameter relative to the previous parameter exceeds the maximum change in a single update; it can determine whether the low-frequency compensation gain exceeds the upper limit of the low-frequency gain; and it can determine whether the poles of the dual second-order filter units are within the stable region. If there are cases where the update constraints are not met, the corresponding parameters can be trimmed, limited, projected, or corrected.
[0090] This embodiment can achieve smooth migration of filter compensation parameters while reducing the risk of abnormal overshoot, click sounds, low-frequency impacts, local resonance, or filter instability during the transition process, thereby improving system stability and auditory reliability during audio output link switching.
[0091] It is understandable that the timing of parameter updates during output device switching can also affect the listening experience. Updating filter compensation parameters during high-energy audio segments, strong transient segments, or inappropriate sampling times can easily produce perceptible abrupt changes. Therefore, in some embodiments, the timing of transition processing can be controlled by preset switching conditions. That is, optionally, in some embodiments of this application, the step "perform transition processing on the audio signal to be output according to the target filter compensation parameters and output it to the target output device" includes: Get the preset switching conditions; When the preset switching condition is met, the audio signal is processed by the target filter compensation parameters and output to the target output device. The preset switching conditions include at least one of the following: frame boundary conditions, low energy window conditions, non-transient conditions, zero crossover point conditions, silent window conditions, or steady-state interval conditions.
[0092] Among them, preset switching conditions refer to pre-set conditions used to determine whether audio transition processing or parameter updates are allowed. Preset switching conditions can be stored in the audio processing module, system configuration file, or audio policy module of the electronic device, or they can be dynamically determined based on the audio playback status.
[0093] Obtaining preset switching conditions refers to reading, recalling, or determining the conditions used to control the timing of transition processing. For example, electronic devices can read frame boundary conditions, low-energy window conditions, or non-transient conditions from the audio processing configuration; they can also determine the switching conditions to be used based on the type of content being played or the type of output device.
[0094] Reaching the preset switching condition means that the current audio signal state, playback timing state, or system state meets the conditions that allow transition processing to be performed. For example, when the current processing position is at the audio frame boundary, it can be considered that the frame boundary condition has been reached; when the energy of the current audio frame is lower than the preset low energy threshold, it can be considered that the low energy window condition has been reached; when the spectrum change of adjacent frames is small, indicating that the current state is in a relatively steady-state range, it can be considered that the non-transient condition or steady-state range condition has been reached.
[0095] Frame boundary conditions refer to performing parameter updates or transition processing at the boundary positions of audio frames. An audio frame can be a processing unit in the audio processing chain divided by a fixed number of sampling points, for example, a frame includes N sampling points. Compared to performing updates at arbitrary positions within a frame, it is easier for the audio processing module to synchronously process parameter changes.
[0096] The low-energy window condition refers to performing transition processing within a time window when the audio signal energy is low. For example, when the energy of the current audio frame is less than the low-energy threshold, it can be considered that the current state is in a low-energy window. Because the sound in the low-energy region is weak, parameter updates performed during this period are not easily perceived by the user. The formula for calculating the energy of an audio frame is as follows: .
[0097] Where Em represents the frame energy of the m-th frame, indicating the overall energy of the audio signal in that frame. m represents the frame number, used to indicate which frame of audio data is currently being analyzed. N f This represents the audio frame length, i.e., the number of sample points contained in one frame. n represents the index of the sample point within the frame, typically ranging from 0 to Nf-1.2 m [n] represents the squared term of the nth sampling point in the mth frame, which reflects the contribution of that sampling point to the frame energy.
[0098] Non-transient conditions refer to conditions where the current audio signal is not in a phase of significant transient change. For example, the degree of spectral change between adjacent frames can be determined by spectral flux. If the spectral flux is less than the steady-state interval threshold, it indicates that the current audio signal is relatively stable and suitable for parameter updates. The formula for calculating this spectral flux is as follows: .
[0099] Where SFm represents the spectral flux of the m-th frame, used to indicate the magnitude of the spectral change between the current frame and the previous frame. m represents the frame number, indicating which frame of audio data is being analyzed. k represents the frequency index or frequency bin index. K represents the total number of frequency points involved in the calculation, or the number of valid frequency points after the FFT. X m (k) represents the spectral amplitude of the m-th frame at the k-th frequency point, typically the amplitude spectrum or power spectrum value. X m-1 (k) represents the spectral amplitude of the (m-1)th frame at the k-th frequency point. [X m [k]-X m-1 [k]] represents the amount of change between two adjacent frames at that frequency point, indicating the degree of spectral change at that frequency point.
[0100] The zero-crossing condition refers to performing transition processing when the audio waveform passes near zero amplitude. Because the audio signal amplitude is small at this position, the abrupt change caused by parameter switching is relatively insignificant.
[0101] The silence window condition refers to performing transition processing within a time window when the audio signal is silent or nearly silent. The steady-state range condition refers to performing transition processing within a range where the audio signal's spectrum or energy changes relatively smoothly.
[0102] In this embodiment, the electronic device can first obtain a preset switching condition and continuously determine whether the preset switching condition has been met during audio processing. When the preset switching condition is met, the audio signal is then processed using the target filter compensation parameters and output to the target output device. It should be noted that this transition processing can begin when the preset switching condition is met, or it can be performed once or multiple times each time the preset switching condition is met.
[0103] Understandably, this embodiment can avoid sudden changes in filter compensation state at inappropriate audio moments, reduce the probability of clicks, pops, and transient anomalies, and make the output device switching process smoother.
[0104] In order to make the target frequency response compensation curve more accurate and avoid introducing overcompensation or inter-band abrupt changes, in some embodiments, the original compensation gain can be generated based on the difference between the target frequency response model and the output link frequency response characteristic information, and further clipping and smoothing processing can be performed. That is, optionally, in some embodiments of this application, the step of "generating the target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model" includes: At at least one preset discrete frequency band center frequency, the difference between the target frequency response model and the output link frequency response characteristic information is calculated to obtain the original compensation gain. The original compensation gain is limited according to the minimum and maximum allowable compensation gain to obtain the limited compensation gain. The bandwidth compensation gain is smoothed to obtain the target frequency response compensation curve.
[0105] The preset discrete frequency band center frequency refers to a set of representative frequency points that are pre-defined to represent the audio frequency range. For example, the preset discrete frequency band center frequency may include 60Hz, 100Hz, 250Hz, 1kHz, 4kHz, 8kHz, etc., and can also be set according to the number of equalizer bands or filter design requirements of the audio processing system.
[0106] Calculating the difference between the target frequency response model and the output link frequency response characteristics means comparing the target response value represented by the target frequency response model with the actual or estimated response value represented by the output link frequency response characteristics at the center frequency of the corresponding frequency band to determine the magnitude of compensation required for that frequency band. For example, at the center frequency fk of the frequency band, G can be calculated. raw (fk)=H ref (fk)-H dev (fk), k=1,2,...,M, where H ref (fk) represents the target response value of the target frequency response model at fk, H dev (fk) represents the response value of the output link frequency response characteristic information at point fk, G raw (fk) represents the original compensation gain.
[0107] The initial compensation gain refers to the preliminary compensation gain obtained based on the difference between the target frequency response model and the frequency response characteristics of the output link. This initial compensation gain can represent the amount by which the target output link needs to be boosted or attenuated relative to the target frequency response model in the corresponding frequency band.
[0108] The minimum allowable compensation gain refers to the lower limit of the compensation gain that can be applied to a corresponding frequency band. The maximum allowable compensation gain refers to the upper limit of the compensation gain that can be applied to a corresponding frequency band. For example, for a certain low-frequency band, a maximum allowable compensation gain can be set to avoid excessive boosting of low frequencies; for a certain high-frequency band, a minimum allowable compensation gain can be set to avoid excessive attenuation of high frequencies.
[0109] Limiting refers to the process of restricting the original compensation gain to between the minimum and maximum permissible compensation gain. For example, this can be achieved through G... lim (fk)=min(max(G raw (fk),G min (fk)),G max (fk)) yields the limiting compensation gain. Where, G min (fk) represents the minimum allowable compensation gain for frequency band fk, G max (fk) represents the maximum allowable compensation gain for the frequency band fk.
[0110] Among them, the limiting compensation gain refers to the compensation gain after limiting processing. Compared with the original compensation gain, the limiting compensation gain can avoid the compensation range being too large or too small, thereby reducing the risk of overload, distortion or abnormal sound of the target output device.
[0111] Band smoothing refers to smoothing the compensation gain between adjacent frequency bands, making the compensation changes between different frequency bands more continuous. For example, a three-point weighted smoothing method can be used, which calculates the smoothed compensation gain of the current frequency band by weighting the limiting compensation gain of the previous, current, and next frequency bands. For instance, G... sm (fk)=w1G lim (fk-1)+w2G lim (fk)+w3G lim (fk+1), where w1, w2, and w3 are weights, and w1+w2+w3=1. The preferred values are w1=0.25, w2=0.5, and w3=0.25.
[0112] In this embodiment, the compensation requirements between the target frequency response model and the target output link can be determined through difference calculation; overcompensation can be avoided through amplitude limiting; and excessively sharp changes in compensation between adjacent frequency bands can be avoided through frequency band smoothing. The resulting target frequency response compensation curve can reflect the frequency response differences of the target output device and also has good stability and continuity.
[0113] It is understood that this embodiment can reduce the risk of low-frequency overshoot, distortion or overload caused by excessive compensation gain, and can also reduce the risk of unnatural timbre or local resonance caused by abrupt changes in compensation between frequency bands.
[0114] In order to make the output link frequency response characteristics and target frequency response model more closely match the actual target output device and usage scenario, in some embodiments, the output link frequency response characteristics can be estimated based on the response result of the target output link to the test signal, and the target frequency response model can be determined based on device, scenario, or user-related factors. That is, optionally, in some embodiments of this application, the output link frequency response characteristics are estimated based on the response result of the target output device, wherein the response result is generated by the response of the target output link corresponding to the target output device to the test signal; The target frequency response model is determined based on at least one of the following: output device type, output device product model, playback scenario, volume level, user preference, or content type.
[0115] The response result refers to the output response or acquisition response generated by the target output link corresponding to the target output device after receiving the test signal. For example, the electronic device can output a swept frequency signal, pink noise, white noise, or short-time pulse signal to the target output link and acquire the response result generated by the target output link. This response result can be used to reflect the strength of the target output link's response at different frequencies.
[0116] A test signal is a preset audio signal used to detect the frequency response characteristics of a target output link. Test signals can include sweep signals, pink noise, white noise, short-time pulse signals, etc. Sweep signals can be used to sequentially cover multiple frequency ranges; pink noise can be used to simulate a spectrum distribution that is closer to actual listening experience; white noise can be used to provide a wider bandwidth of test excitation; and short-time pulse signals can be used to estimate the impulse response or related frequency response characteristics of the target output link.
[0117] Estimation refers to calculating, analyzing, or deriving the frequency response characteristics of the output link based on its response to the test signal. For example, the response values of the target output link at the center frequencies of multiple preset discrete frequency bands can be estimated based on the spectral relationship between the output test signal and the acquired response results, thus forming the frequency response characteristics of the output link.
[0118] Output device type refers to the category of the target output device, such as built-in speakers, headphones, Bluetooth audio devices, HDMI audio devices, Line Out devices, external subwoofers, etc. Output device product model refers to the specific product model or device identifier of the target output device. Playback scenario refers to the application environment or usage mode of the audio playback, such as movie playback, music playback, game playback, voice playback, etc. Volume level refers to the current or target playback volume. User preference refers to the sound preferences set by the user or learned by the system, such as a preference for low-frequency enhancement, vocal enhancement, or high-frequency brightness. Content type refers to the content category of the audio signal to be output, such as music, movies, vocals, news, game sound effects, etc.
[0119] This application embodiment selects or determines a target frequency response model suitable for the current output scenario based on one or more factors, including output device type, output device product model, playback scenario, volume level, user preference, or content type. For example, when the target output device is a Line Out device, a Line Out target frequency response model can be selected; when the target output device is a speaker and subwoofer combination, a speaker and subwoofer combination target frequency response model can be selected; when the user selects a low-frequency enhancement preference, a target frequency response model with a higher low-frequency target response can be selected; when the playback content is human voice content, a target frequency response model that emphasizes mid-frequency clarity can be selected.
[0120] In this embodiment, by estimating the response of the target output device, the frequency response characteristics of the output link can be made to better match the actual output characteristics of the target output device. By determining the target frequency response model based on the output device type, output device product model, playback scenario, volume level, user preferences, or content type, the target frequency response model can be made to better match the actual usage scenario and user listening needs.
[0121] It is understandable that this embodiment can improve the accuracy of the target frequency response compensation curve generation, so that audio compensation not only takes into account the hardware differences of the target output device, but also takes into account the playback scenario, volume status, content type and user preferences, thereby further improving the consistency and adaptability of the listening experience after switching audio output devices.
[0122] In summary, the embodiments of this application perform transition processing at the filter compensation parameter level based on the frequency response characteristics of the target output link, which helps to reduce the problems of timbre jump, frequency band-level auditory abrupt change and audio output discontinuity caused by output device switching.
[0123] This application maps the target frequency response compensation curve to the parameters of a multi-segment parametric equalizer, and realizes the target filter compensation parameters through parameters such as dual second-order filter units, center frequency, gain, and quality factor, so that the target frequency response compensation curve can be applied to the executable filter or equalizer structure in the actual audio processing link, thereby improving the feasibility of the project.
[0124] This application can progressively update the current filter compensation parameters corresponding to the current output device before switching to the target filter compensation parameters based on the update step size. During the progressive update process, intermediate transition filter compensation parameters are used to continuously process the audio signal, thereby avoiding clicks, pops, low-frequency impacts, or abrupt changes in timbre caused by a one-time switch of filter compensation parameters. At the same time, since the update step size is determined based on the transition time constant of the corresponding frequency band, different frequency bands can complete the compensation migration at different speeds, taking into account both smoothness and convergence speed.
[0125] This application can introduce constraints on the maximum change in a single update, the upper limit of gain in the low-frequency band, or the stable region of the pole during the gradual update of parameters, thereby reducing the risk of parameter mutation, low-frequency overload, filter instability, or abnormal resonance during the transition process and improving the system stability during the switching process of output devices.
[0126] This application can perform transition processing when frame boundary conditions, low energy window conditions, non-transient conditions, zero crossover conditions, silent window conditions, or steady-state interval conditions are met, thereby avoiding high-energy or strong transient audio segments, reducing the impact of parameter updates on the user's listening experience, and further reducing click sounds and abruptness.
[0127] This application can obtain the original compensation gain through difference calculation, and perform amplitude limiting and frequency band smoothing processing on the original compensation gain, so that the target frequency response compensation curve can reflect the difference between the target frequency response model and the frequency response characteristics of the output link, and avoid overcompensation and abrupt changes in adjacent frequency bands, thereby improving the stability and naturalness of the compensation curve.
[0128] This application can estimate the frequency response characteristics of the output link based on the response results of the target output link to the test signal, and determine the target frequency response model based on the output device type, output device product model, playback scenario, volume level, user preference or content type, so that the compensation parameters are more in line with the actual frequency response characteristics and specific usage scenarios of the target output device, and improve the listening consistency after switching between different output devices.
[0129] To facilitate better implementation of the audio processing method of this application, this application also provides an audio processing apparatus based on the above-described audio processing method. The meanings of the terms used are the same as in the audio processing method described above, and specific implementation details can be found in the descriptions of the method embodiments.
[0130] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of the audio processing device provided in the embodiments of this application, wherein the audio processing device may specifically be as follows: The acquisition module 301 is used to acquire the output link frequency response characteristic information and target frequency response model of the target output device after switching. The generation module 302 is used to generate a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model; Mapping module 303 is used to map the target frequency response compensation curve to target filter compensation parameters; The output module 304 is used to perform transition processing on the audio signal to be output according to the target filter compensation parameters, and output it to the target output device.
[0131] Optionally, in some embodiments of this application, mapping the target frequency response compensation curve to target filter compensation parameters includes: The target frequency response compensation curve is mapped to the parameters of a multi-segment parametric equalizer to obtain the target filter compensation parameters; Each parametric equalizer segment corresponds to a dual second-order filter unit and / or the parameters of each parametric equalizer segment include at least one of center frequency, gain, or quality factor.
[0132] Optionally, in some embodiments of this application, the step of performing transition processing on the audio signal to be output according to the target filter compensation parameters and outputting it to the target output device includes: Based on the update step size, the current filter compensation parameters corresponding to the current output device before the switch are gradually updated to the target filter compensation parameters. During the gradual update process, the audio signal is continuously compensated using the updated intermediate transition filter compensation parameters, and then output to the target output device after processing. The update step size is determined based on the transition time constant of the corresponding frequency band.
[0133] Optionally, in some embodiments of this application, the step of progressively updating the current filter compensation parameters corresponding to the current output device before the switch to the target filter compensation parameters based on the update step size includes: Based on the update step size and update constraints, the current filter compensation parameters of the current output device before the switch are gradually updated to the target filter compensation parameters; The update constraints include at least one of the following: maximum change in a single update constraint, upper limit of gain in the low-frequency band constraint, or pole stability region constraint.
[0134] Optionally, in some embodiments of this application, the step of performing transition processing on the audio signal to be output according to the target filter compensation parameters and outputting it to the target output device includes: Get the preset switching conditions; When the preset switching condition is met, the audio signal is processed by the target filter compensation parameters and output to the target output device. The preset switching conditions include at least one of the following: frame boundary conditions, low energy window conditions, non-transient conditions, zero crossover point conditions, silent window conditions, or steady-state interval conditions.
[0135] Optionally, in some embodiments of this application, generating the target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model includes: At at least one preset discrete frequency band center frequency, the difference between the target frequency response model and the output link frequency response characteristic information is calculated to obtain the original compensation gain. The original compensation gain is limited according to the minimum and maximum allowable compensation gain to obtain the limited compensation gain. The bandwidth compensation gain is smoothed to obtain the target frequency response compensation curve.
[0136] Optionally, in some embodiments of this application, the output link frequency response characteristic information is obtained by estimating the response result of the target output device, wherein the response result is generated by the response of the target output link corresponding to the target output device to the test signal; The target frequency response model is determined based on at least one of the following: output device type, output device product model, playback scenario, volume level, user preference, or content type.
[0137] In this embodiment, the acquisition module 301 acquires the output link frequency response characteristic information and target frequency response model of the target output device after switching. The generation module 302 generates a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model. The mapping module 303 maps the target frequency response compensation curve to target filter compensation parameters. The output module 304 performs transition processing on the audio signal to be output based on the target filter compensation parameters and outputs it to the target output device.
[0138] In summary, the embodiments of this application perform transition processing at the filter compensation parameter level based on the frequency response characteristics of the target output link, which helps to reduce the problems of timbre jump, frequency band-level auditory abrupt change and audio output discontinuity caused by output device switching.
[0139] In addition, this application also provides an electronic device, such as Figure 4 As shown, it illustrates a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically: The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 4 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. Wherein: The processor 401 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0140] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and audio processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function, etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0141] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power equipment debugging circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0142] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0143] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402, thereby implementing the steps in any of the audio processing methods provided in the embodiments of this application.
[0144] This application embodiment obtains the output link frequency response characteristic information and target frequency response model of the target output device after switching, generates a target frequency response compensation curve based on the output link frequency response characteristic information and target frequency response model, maps the target frequency response compensation curve to target filter compensation parameters, performs transition processing on the audio signal to be output based on the target filter compensation parameters, and outputs it to the target output device.
[0145] In this application, the transition processing at the filter compensation parameter level based on the frequency response characteristics of the target output link helps to reduce the problems of timbre jump, frequency band-level auditory abrupt change and audio output discontinuity caused by output device switching.
[0146] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0147] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0148] Therefore, this application provides a storage medium, including a computer-readable storage medium on which a computer program is stored, the computer program being loadable by a processor to execute the steps of any of the audio processing methods provided in this application.
[0149] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0150] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0151] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the audio processing methods provided in this application, the beneficial effects that any of the audio processing methods provided in this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0152] The above provides a detailed description of an audio processing method, apparatus, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
[0153] It is understood that in the specific implementation of this application, data related to the output link frequency response characteristics of the output device, target frequency response model, device type, product model, playback scenario, user preferences, etc. are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
Claims
1. An audio processing method, characterized in that, The method includes: Obtain the output link frequency response characteristics and target frequency response model of the target output device after switching; Generate a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model; Map the target frequency response compensation curve to the target filter compensation parameters; Based on the target filter compensation parameters, the audio signal to be output is subjected to transition processing and then output to the target output device.
2. The audio processing method according to claim 1, characterized in that, The step of mapping the target frequency response compensation curve to target filter compensation parameters includes: The target frequency response compensation curve is mapped to the parameters of a multi-segment parametric equalizer to obtain the target filter compensation parameters; Each parametric equalizer segment corresponds to a dual second-order filter unit and / or the parameters of each parametric equalizer segment include at least one of center frequency, gain, or quality factor.
3. The audio processing method according to claim 1, characterized in that, The step of performing transition processing on the audio signal to be output according to the target filter compensation parameters and outputting it to the target output device includes: Based on the update step size, the current filter compensation parameters corresponding to the current output device before the switch are gradually updated to the target filter compensation parameters. During the gradual update process, the audio signal is continuously compensated using the updated intermediate transition filter compensation parameters, and then output to the target output device after processing. The update step size is determined based on the transition time constant of the corresponding frequency band.
4. The audio processing method according to claim 3, characterized in that, The step of progressively updating the current filter compensation parameters corresponding to the current output device before the switch to the target filter compensation parameters based on the update step size includes: Based on the update step size and update constraints, the current filter compensation parameters of the current output device before the switch are gradually updated to the target filter compensation parameters; The update constraints include at least one of the following: maximum change in a single update constraint, upper limit of gain in the low-frequency band constraint, or pole stability region constraint.
5. The audio processing method according to claim 1, characterized in that, The step of performing transition processing on the audio signal to be output according to the target filter compensation parameters and outputting it to the target output device includes: Get the preset switching conditions; When the preset switching condition is met, the audio signal is processed by the target filter compensation parameters and output to the target output device. The preset switching conditions include at least one of the following: frame boundary conditions, low energy window conditions, non-transient conditions, zero crossover point conditions, silent window conditions, or steady-state interval conditions.
6. The audio processing method according to claim 1, characterized in that, The step of generating the target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model includes: At at least one preset discrete frequency band center frequency, the difference between the target frequency response model and the output link frequency response characteristic information is calculated to obtain the original compensation gain. The original compensation gain is limited according to the minimum and maximum allowable compensation gain to obtain the limited compensation gain. The bandwidth compensation gain is smoothed to obtain the target frequency response compensation curve.
7. The audio processing method according to claim 1, characterized in that, The output link frequency response characteristic information is obtained by estimating the response result of the target output device, wherein the response result is generated by the response of the target output link corresponding to the target output device to the test signal; The target frequency response model is determined based on at least one of the following: output device type, output device product model, playback scenario, volume level, user preference, or content type.
8. An audio processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire the output link frequency response characteristics and target frequency response model of the target output device after the switch. The generation module is used to generate a target frequency response compensation curve based on the output link frequency response characteristic information and the target frequency response model; The mapping module is used to map the target frequency response compensation curve to the target filter compensation parameters; The output module is used to perform transition processing on the audio signal to be output according to the target filter compensation parameters, and output it to the target output device.
9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the audio processing method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the audio processing method as described in any one of claims 1-7.
