Phase distortion compensation method and device for audio data, equipment and storage medium

By acquiring peak filter parameters, the phase compensation filter is designed, and the phase distortion problem in audio equipment is solved, which improves the sound quality and adapts to the phase compensation effect of different devices.

CN120264198APending Publication Date: 2025-07-04HAIWEI ZHIZAO TECH (WUHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510367296.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, phase distortion problems caused by peak filters in audio equipment lead to a degradation of sound quality, affecting the auditory experience, and lacking effective compensation methods.

Method used

By obtaining the operating parameters of the peak filter, calculating the compensation phase and weighted vectors, designing the phase compensation filter, and connecting it in series with the peak filter to eliminate phase distortion.

Benefits of technology

Significantly improve sound quality, adapt to different audio equipment, and ensure optimal phase compensation effect is maintained under various peak filter parameter configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120264198A_ABST
    Figure CN120264198A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of audio data processing, in particular to a phase distortion compensation method, device and equipment for audio data and a storage medium. According to working parameters of a peak filter, a compensation phase and a weighted vector are correspondingly calculated, and then phase compensation working parameters are obtained; a compensation filter is then set according to the parameter to eliminate phase distortion in the audio data. According to the scheme, the phase error vector and the expected phase matrix are obtained through the working parameters of the peak filter, and the linear equation set is constructed and solved, so that the working parameters of the compensation filter are determined, and accurate compensation of the audio signal phase is realized. The method not only can remarkably improve the tone quality, but also can adapt to different audio devices, and ensures that the optimal phase compensation effect can be maintained under the parameter configuration of various peak filters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio data processing, and particularly to a method, device, equipment and storage medium for compensating phase distortion of audio data. Background Art

[0002] Today, with the rapid development of information technology, digital audio technology has become an indispensable part of our daily lives. From music playback, video conferencing to professional audio production, high-quality audio processing technology is crucial for enhancing the user experience. With the diversification of digital audio devices and playback formats, the processing and transmission of audio signals have become more complex. Against this backdrop, the fidelity and quality of audio signals have become important criteria for measuring the development level of audio technology.

[0003] In the wide application of digital audio technology, a common problem is the phase distortion of audio signals. Phase distortion is usually caused by non-linear filters (such as peak filters) in audio devices. Since the peak filter in the acoustic system causes a small phase shift in the original audio during the audio gain process, when using the peak filter in small amounts, the change in sound quality caused by the overall phase shift is not obvious. However, when multiple peak filters are included in the same acoustic system, the overall phase shift generated will be noticeable to people. This distortion is particularly obvious during the playback and recording of audio signals, which will reduce the sound quality and affect the listening experience of the audience.

[0004] Therefore, how to design a parameter configuration method that can effectively compensate for the phase distortion caused by using peak filters in the acoustic system and improve the overall audio quality has become an urgent problem to be solved in this field. Summary of the Invention

[0005] The main objective of the present invention is to provide a method, device, equipment and storage medium for compensating phase distortion of audio data, aiming to solve the technical problem of how to design a parameter configuration method that can effectively compensate for the phase distortion caused by using peak filters in the acoustic system in the prior art.

[0006] To achieve the above objective, the present invention provides a method for compensating phase distortion of audio data, the method comprising the following steps: Obtain the working parameters of the peak filter; According to the working parameters of the peak filter, obtain a phase compensation filter that matches the peak filter; Connect the phase compensation filter in series after the peak filter to achieve compensation for the phase distortion of audio data.

[0007] Optionally, obtaining a phase compensation filter that matches the peak filter according to the operating parameters of the peak filter includes: Obtaining a compensation phase and a weighting vector according to the operating parameters of the peak filter; Obtaining phase compensation operating parameters according to the compensation phase and the weighting vector; Setting an all-pass filter according to the phase compensation operating parameters to obtain a phase compensation filter that matches the peak filter.

[0008] Optionally, obtaining a compensation phase and a weighting vector according to the operating parameters of the peak filter includes: Obtaining phase response data according to the operating parameters of the peak filter; Obtaining the actual phase of each frequency point according to the phase response data; Obtaining a compensation phase according to the actual phase of each frequency point and the corresponding compensation weighting coefficient; Obtaining a weighting vector according to the compensation weighting coefficient of each frequency point.

[0009] Optionally, before obtaining a compensation phase according to the actual phase of each frequency point and the compensation weighting coefficient, further includes: Determining a passband compensation range according to the operating frequency range of the speaker; Determining compensation frequency points according to the passband compensation range; Obtaining the compensation weighting coefficient of each compensation frequency point based on a frequency point compensation strategy.

[0010] Optionally, obtaining phase compensation operating parameters according to the compensation phase and the weighting vector includes: Obtaining a phase error vector and an expected phase matrix according to the frequency of the compensation frequency point, the compensation phase, the filter order, and the weighting vector; Obtaining phase compensation operating parameters according to the phase error vector and the expected phase matrix.

[0011] Optionally, before cascading the phase compensation filter after the peak filter to implement phase distortion compensation of audio data, further includes: Obtaining the hardware environment parameters of the peak filter; Indexing and matching environment adaptation compensation parameters from a preset environment adaptation compensation database according to the hardware environment parameters, where the hardware environment parameters include the real-time temperature, impedance dynamic change value, and audio stream sampling rate of the peak filter; Updating the operating parameters of the phase compensation filter based on the environment adaptation compensation parameters to obtain an updated phase compensation filter.

[0012] Optionally, before indexing and matching the environment adaptation compensation parameters from the preset environment adaptation compensation database according to the hardware environment parameters, it further includes: Obtain the phase response calibration data set of peak filters with the same specifications under multiple hardware environment parameters, where the hardware environment parameters include temperature range, impedance characteristic curve, input signal sampling rate set, and load current fluctuation threshold; According to the phase response calibration data set and the hardware environment parameters, obtain an environmental impact factor calculation model, where the environmental impact factor calculation model at least includes a temperature-impedance coupling compensation term, a sampling rate smoothing factor, and a non-linear phase lag correction coefficient; Based on the environmental impact factor calculation model, obtain the environment adaptation compensation database.

[0013] In addition, to achieve the above object, the present invention also proposes a phase distortion compensation device for audio data, where the phase distortion compensation device for audio data includes: A data acquisition module, configured to obtain the working parameters of the peak filter; A data processing module, configured to obtain a phase compensation filter matching the peak filter according to the working parameters of the peak filter; A parameter configuration module, configured to connect the phase compensation filter in series after the peak filter to achieve phase distortion compensation of audio data.

[0014] In addition, to achieve the above object, the present invention also proposes a phase distortion compensation device for audio data, where the phase distortion compensation device for audio data includes a memory, a processor, and a phase distortion compensation program for audio data stored on the memory and executable on the processor, and the phase distortion compensation program for audio data is configured to implement the steps of the phase distortion compensation method for audio data as described above.

[0015] In addition, to achieve the above object, the present invention also proposes a storage medium, on which a phase distortion compensation program for audio data is stored, and when the phase distortion compensation program for audio data is executed by a processor, it implements the steps of the phase distortion compensation method for audio data as described above.

[0016] One or more technical solutions proposed in this application have at least the following technical effects: Through the working parameters of the peak filter, this application calculates the compensation phase and the weighting vector accordingly, and then obtains the phase compensation working parameters. Then, a compensation filter is set according to this parameter to eliminate the phase distortion in the audio data. In this solution, a phase error vector and an expected phase matrix are obtained through the working parameters of the peak filter, and a linear equation system is constructed and solved based on this to determine the numerator coefficient and the denominator coefficient of the compensation filter working function, so as to achieve precise compensation for the phase of the audio signal. This method can not only significantly improve the sound quality, but also adapt to different audio devices to ensure the best phase compensation effect under various parameter configurations of the peak filter. Description of the Drawings

[0017] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application.

[0018] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0019] Figure 1 Schematic flowchart of the first embodiment of the method for compensating phase distortion of audio data in the present invention; Figure 2 Schematic flowchart of the second embodiment of the method for compensating phase distortion of audio data in the present invention; Figure 3 Schematic flowchart of the third embodiment of the method for compensating phase distortion of audio data in the present invention; Figure 4 Schematic flowchart of the fourth embodiment of the method for compensating phase distortion of audio data in the present invention; Figure 5 Block diagram of the structure of the first embodiment of the device for compensating phase distortion of audio data in the present invention; Figure 6 Schematic diagram of the structure of the audio data phase distortion compensation device in the hardware operating environment related to the embodiment solution of the present invention.

[0020] The realization, functional features, and advantages of the purpose of the present invention will be further described in conjunction with the embodiments with reference to the drawings. Detailed Embodiments

[0021] It should be understood that the specific embodiments described here are only used to explain the technical solutions of this application and are not used to limit this application.

[0022] To better understand the technical solution of the present application, the following will be described in detail in conjunction with the accompanying drawings of the specification and specific embodiments.

[0023] The main solution of the embodiment of the present application is: obtaining the working parameters of the peak filter; obtaining a phase compensation filter matching the peak filter according to the working parameters of the peak filter; connecting the phase compensation filter in series after the peak filter to achieve phase distortion compensation of audio data.

[0024] Since the peak filter in the acoustic system will cause a small amount of phase shift in the original audio during the process of audio gain, when using the peak filter in a small amount, the change in sound quality caused by the overall phase shift is not obvious. However, when multiple peak filters are included in the same acoustic system, the overall phase shift generated finally will be noticed by people.

[0025] The present application provides a solution. By the working parameters of the peak filter, the compensation phase and the weighting vector are calculated accordingly, and then the phase compensation working parameters are obtained. Then, a compensation filter is set according to this parameter to eliminate the phase distortion in the audio data. This solution obtains the phase error vector and the desired phase matrix through the working parameters of the peak filter, and constructs and solves a linear equation system based on this, so as to determine the numerator coefficient and the denominator coefficient of the compensation filter working function, thereby realizing the precise compensation of the phase of the audio signal. This method can not only significantly improve the sound quality, but also adapt to different audio devices, ensuring the best phase compensation effect under the parameter configurations of various peak filters.

[0026] Based on this, the embodiment of the present invention provides a method for compensating phase distortion of audio data. Refer to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of a method for compensating phase distortion of audio data according to the present invention.

[0027] In this embodiment, the method for compensating phase distortion of the audio data includes the steps: Step S10: Obtaining the working parameters of the peak filter.

[0028] It should be noted that the peak filter parameters here include but are not limited to the peak filter order, filter coefficients, group delay characteristics, etc. These parameters jointly determine the performance and characteristics of the peak filter and have a direct impact on the phase distortion compensation effect of the audio signal. The peak filter order determines the complexity of the filter and the width of the transition band, and the group delay characteristics involve the delay change when the signal passes through the filter, which is particularly important for phase compensation because it is directly related to the timing accuracy and phase consistency of the audio signal.

[0029] It is understandable that both the peak filter and the all - pass filter in this application are IIR (Infinite Impulse Response) filters.

[0030] Among them, the transfer function of the IIR filter is as follows:

[0031] It should be understood that in the above formula, M is the filter order, b j and a j are filter coefficients. Among them, the numerator part is the Z - transform of the output signal, and the denominator part is the Z - transform of the input signal.

[0032] Step S20: Obtain a phase compensation filter that matches the peak filter according to the working parameters of the peak filter.

[0033] It should be noted that this process involves analyzing the characteristics of the peak filter, including its frequency response and phase response, to determine the phase distortion characteristics that need to be compensated. Through these working parameters, an all - pass filter can be designed whose phase response can cancel the phase distortion introduced by the peak filter, thus maintaining the integrity and quality of the audio signal.

[0034] It is understandable that the design of the phase compensation filter is to work in coordination with a specific peak filter to ensure that the overall system's phase response meets expectations, which is usually to improve the sound quality or meet specific system performance requirements.

[0035] Step S30: Connect the phase compensation filter in series after the peak filter to achieve phase distortion compensation for audio data.

[0036] It should be noted that this series configuration allows the peak filter to process the audio signal first, and then the phase compensation filter to correct the phase of the processed signal, thus effectively correcting any unwanted phase changes that the peak filter may introduce, ensuring that the audio signal maintains its original phase relationship after passing through the entire filter chain.

[0037] It is understandable that this compensation technique is crucial for maintaining the quality and clarity of the audio signal, especially in applications with strict requirements for sound quality, such as professional recording, broadcasting, and high - quality audio production. In this way, the overall performance of the audio processing system can be significantly improved, ensuring that listeners can enjoy a natural, clear, and distortion - free audio experience.

[0038] This embodiment obtains the working parameters of the peak filter; obtains a phase compensation filter that matches the peak filter according to the working parameters of the peak filter; connects the phase compensation filter in series after the peak filter to achieve phase distortion compensation for audio data.

[0039] In summary, in this embodiment, the compensation phase and the weighting vector are calculated according to the working parameters of the peak filter, and then the phase compensation working parameters are obtained. Then, the compensation filter is set according to these parameters to eliminate the phase distortion in the audio data. This solution obtains the phase error vector and the desired phase matrix through the working parameters of the peak filter, constructs a linear equation system based on this and solves it, so as to determine the numerator coefficient and the denominator coefficient of the compensation filter working function, thereby realizing the precise compensation of the audio signal phase. This method can not only significantly improve the sound quality, but also adapt to different audio devices, ensuring the best phase compensation effect under various parameter configurations of the peak filter.

[0040] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar content as in the above-mentioned first embodiment can be referred to the above introduction and will not be repeated hereinafter. On this basis, please refer to Figure 2 , Figure 2 which is a schematic flowchart of the second embodiment of the method for compensating phase distortion of audio data of the present invention. The step S20 includes: Step S201: Obtain the compensation phase and the weighting vector according to the working parameters of the peak filter.

[0041] In one embodiment, the obtaining the compensation phase and the weighting vector according to the working parameters of the peak filter includes: obtaining the phase response data according to the working parameters of the peak filter; obtaining the actual phase of each frequency point according to the phase response data; obtaining the compensation phase according to the actual phase of each frequency point and the corresponding compensation weighting coefficient; and obtaining the weighting vector according to the compensation weighting coefficient of each frequency point.

[0042] It should be noted that first, the phase-frequency characteristic of the peak filter needs to be obtained according to the peak filter coefficient. The formula is as follows:

[0043] It can be understood that angle represents finding the phase angle, fft represents the Fourier transform, b n and a n are filter coefficients, N represents the number of Fourier transform points, and the obtained phase response PhaseResponse is the phase of the filter at N frequency points within the range of [0, 2π], that is, the phase change of the signal at N frequency points after passing through the filter.

[0044] It should be understood that the phase response refers to the effect of a system (such as a filter) on the phase change of signals with different frequencies. In frequency-domain analysis, the phase response describes how the phases of various frequency components are changed when the input signal passes through the system, which directly affects the timing and waveform of the signal. In addition, in the present invention, N is usually selected as a power of 2 because the computational efficiency of the FFT algorithm is the highest in this case. This is because the FFT algorithm has the lowest computational complexity when N is a power of 2. This is because the FFT algorithm is based on a divide-and-conquer strategy, decomposing the DFT into smaller DFTs and then recursively solving these smaller problems. When N is a power of 2, this decomposition can be carried out optimally.

[0045] It should be noted that according to the phase response data, the specific operation to obtain the actual phase of each frequency point is as follows: Take the phases of 0.5N frequency points of the phase response PhaseResponse in the range of [0, π], denoted as the actual phase P. actual ; Then, according to the actual phases of each frequency point and the corresponding compensation weighting coefficients, the compensation phase is obtained. The specific steps are to normalize the frequencies corresponding to 0.5N frequency points to the interval [0, π], denoted as ω, and the compensation phase P of each frequency point offset is obtained by the following formula:

[0046] It can be understood that among them, the compensation coefficient ∆t > 1. To achieve passband phase compensation, the weighting coefficients of each frequency point are set. The weighting coefficient values of the frequency points within the passband are ∆t, and the weighting coefficient values of the frequency points outside the passband are 1. The square root of the weighting coefficient corresponding to each frequency point is taken, and thus the weighting vector is obtained.

[0047] It should be understood that since speakers are divided into bass speakers, midrange speakers, and tweeters according to the working frequency range, it is only necessary to perform phase distortion compensation within a certain frequency range (the passband range). This is equivalent to calculating only the phase offset of each peak filter for the frequency points within the passband range, then calculating the phase offset generated by superimposing each peak filter at each frequency point within the passband range, and then setting the parameters of the all-pass filter according to the calculation results to eliminate this part of the phase offset, thereby solving the problem of phase distortion.

[0048] In one embodiment, before obtaining the compensation phase according to the actual phases of each frequency point and the compensation weighting coefficients, it further includes: determining the passband compensation range according to the speaker working frequency range; determining the compensation frequency points according to the passband compensation range; and obtaining the compensation weighting coefficients of each of the compensation frequency points based on the frequency point compensation strategy.

[0049] It should be noted that the passband range that requires phase compensation is usually the low-frequency part, specifically in the range of 20 Hz to 2 kHz, because the human ear is more sensitive to phase changes at these frequencies.

[0050] It can be understood that the compensation frequency points refer to the frequency points within the passband compensation range in the frequency range directly affected by the working parameters of the peak filter. After determining the compensation frequency points, the next step is to obtain the compensation weighting coefficients for each compensation frequency point based on the frequency point compensation strategy. The purpose of this step is to calculate a compensation coefficient for each selected frequency point, which will determine the intensity of compensation at that frequency point. The determination of the compensation weighting coefficients can be based on various factors, including but not limited to the degree of phase distortion at that frequency point, the perceived sensitivity of the human ear to that frequency point, and the goal of overall sound quality improvement. By adjusting these weighting coefficients, the compensation process can be finely controlled to achieve the best sound quality effect. Step S202: Obtain the phase compensation working parameters according to the compensation phase and the weighting vector.

[0051] It should be noted that the compensation phase reflects the phase offset that needs to be compensated for each frequency point to correct phase distortion, and the weighting vector is a set of coefficients used to adjust the compensation intensity at different frequency points. These coefficients can be determined according to the sensitivity of the human ear to different frequencies, the characteristics of the filter, or the goal of sound quality improvement.

[0052] It can be understood that since an all-pass filter is used in this embodiment to perform phase compensation on the peak filter, therefore, according to the compensation phase and the weighting vector at each frequency point, the all-pass filter of a specified order can be solved by the equation error method to achieve passband phase compensation.

[0053] Step S203: Set the all-pass filter according to the phase compensation working parameters to obtain a phase compensation filter that matches the peak filter.

[0054] It should be noted that the phase compensation working parameters calculated in the previous steps are applied to the configuration of the all-pass filter to ensure that the frequency response of the filter can meet specific phase compensation requirements.

[0055] It can be understood that this process includes importing the numerator coefficient vector and the denominator coefficient vector into filter design software or hardware. These coefficients define the transfer function of the filter, thus determining its phase response at different frequencies. In this way, the all-pass filter can adjust the phase of the signal as necessary without changing the signal amplitude to match the phase characteristics of the peak filter and achieve phase balance and optimization of the entire system.

[0056] In this embodiment, the compensation phase and the weighting vector are obtained through the working parameters of the peak filter. Based on the compensation phase and the weighting vector, the working parameters of phase compensation are obtained. The all-pass filter is set according to the working parameters of phase compensation to obtain a phase compensation filter that matches the peak filter.

[0057] In summary, in this embodiment, this compensation method is crucial for maintaining the quality and clarity of audio signals, especially when processing broadband signals or complex audio scenarios. In this way, the overall performance of the audio processing system can be significantly improved, ensuring that listeners can enjoy a natural, clear, and distortion-free audio experience.

[0058] Based on the second embodiment of the present application, in the third embodiment of the present application, the same or similar content as in the above-mentioned second embodiment can be referred to the above introduction and will not be elaborated hereinafter. On this basis, please refer to Figure 3 , Figure 3 which is a schematic flowchart of the third embodiment of the phase distortion compensation method for audio data of the present invention. Step S202 includes: Step S20201: Obtain a phase error vector according to the frequency of the compensation frequency point, the compensation phase, the filter order, and the weighting vector.

[0059] It should be noted that the currently known parameters include: the number of frequency points in the range of [0, π] is 0.5N, the filter order is M, the compensation phase of each frequency point is represented by P offset and the square root of the weighting coefficient corresponding to each frequency point is taken to obtain the weighting vector, denoted as V weight . Therefore, H0, H1, H2, and H3 can be obtained according to the following four formulas.

[0060]

[0061]

[0062]

[0063]

[0064] It can be understood that in the above four formulas, both H0 and H1 are matrices of 0.5N×M. Among them, 0.5N represents the number of frequency points (usually half of the total number of frequency points, for example, from 0 to π), and M is the filter order. Therefore, each element of H0 is usually obtained by calculating the difference between the cosine terms of the expected phase response and the actual phase response. This matrix represents the influence of the cosine terms on the filter coefficients. Similarly, each element of H1 is obtained by calculating the difference between the sine terms of the expected phase response and the actual phase response. This matrix represents the influence of the sine terms on the filter coefficients.

[0065] It should be understood that H0 and H1 are key components in the all-pass filter design. The vertical superposition result of them can construct a system of linear equations, and the solution of this system of equations will give the coefficients of the filter. The all-pass filter constructed by these coefficients ensures that the filter has the required phase response in the passband, thus realizing phase compensation.

[0066] Step S20202: Obtain the desired phase matrix according to the frequency of the compensation frequency point, the compensation phase, the filter order, and the weighting vector.

[0067] It should be noted that each element of H2 and H3 is usually calculated based on the phase error at a specific frequency point. This error is the difference between the desired phase response and the compensation phase response. Since both H2 and H3 are 0.5N×1 vectors, they represent the phase error at a specific frequency point and are used to construct the desired phase matrix of the system of linear equations.

[0068] Step S20203: Obtain the parameter configuration vector according to the phase error vector and the desired phase matrix.

[0069] It should be noted that by splicing H0 and H1, we get A, and A is an N*M matrix, that is, A = [H0; H1]. By splicing H2 and H3, we get b, and b is an N*1 matrix b = [H2; H3].

[0070] It can be understood that since b is the desired phase result, the setting of the all-pass filter is unknown here. Taking X as the parameter configuration vector to be solved, we can construct the system of linear equations: A*X = b and solve for X here. The X obtained here is the parameter configuration vector.

[0071] It should be noted that appropriate numerical methods (such as the least squares method, QR decomposition, SVD, etc.) are used to solve the system of linear equations to obtain the coefficient vector. For example, if the matrix A is not a square matrix or is irreversible, the least squares method can be used to find the best approximate solution, specifically by solving the equation: X = (A T A) -1 A T b.

[0072] Step S20204: Obtain the all-pass filter numerator coefficient vector and the all-pass filter denominator coefficient vector according to the parameter configuration vector.

[0073] It can be understood that by solving the above system of linear equations, a M*1 vector X is obtained. Based on this, adding the basic scalar 1 in front of it, the obtained [1; X] is the all-pass filter denominator coefficient, and flipping [1; X] is the all-pass filter numerator coefficient. Thus, the all-pass filter is obtained to realize the passband phase compensation.

[0074] Step S20205: Obtain the phase compensation working parameters according to the all-pass filter numerator coefficient vector and the all-pass filter denominator coefficient vector.

[0075] It can be understood that the numerator coefficient vector [x; 1] and the denominator coefficient vector [1; x] define the transfer function H(z) of the all-pass filter. By setting the coefficients of the numerator and denominator of the transfer function in this way, the filter can have a predetermined phase response within a specific frequency range, thereby achieving phase compensation.

[0076] In this embodiment, according to the frequency of the compensation frequency point, the compensation phase, the filter order, and the weighting vector, a phase error vector and an expected phase matrix are obtained; according to the phase error vector and the expected phase matrix, the phase compensation working parameters are obtained.

[0077] In summary, in this embodiment, by finely adjusting the numerator and denominator coefficients of the all-pass filter, and using the compensation phase, filter order, weighting vector, and frequency point frequency information, a filter capable of realizing passband phase compensation is accurately constructed, effectively improving the overall performance and reliability of the signal processing system.

[0078] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar content as that in the above-mentioned first embodiment can be referred to the above introduction and will not be repeated hereinafter. On this basis, please refer to Figure 4 , Figure 4 is a schematic flowchart of the fourth embodiment of the phase distortion compensation method for audio data of the present invention. Before step S30, it further includes: Step A301: Obtain the hardware environment parameters of the peak filter.

[0079] It should be noted that since environmental factors will affect the working parameters of precision components in the circuit in real time. For example, temperature changes will affect the capacitance and inductance values of some components, and load fluctuations will cause power supply voltage fluctuations, resulting in synchronous fluctuations in the filter supply voltage. Therefore, it is necessary to obtain the hardware environment parameters of the peak filter to accurately understand its working state and performance changes.

[0080] It can be understood that the hardware environment parameters of this step need to include the following three types of core parameters: First, the local temperature covering the key modules of the filter (such as the junction temperature of the operational amplifier chip and the temperature of the inductor core). Second, the impedance dynamic change value calculated based on the differential of the load current and the output voltage. Finally, the audio stream sampling rate. By detecting the sampling rate switching event of the input signal (such as adjusting from 44.1kHz to 48kHz), the group delay parameter of the phase compensation filter can be adjusted. These above parameters can comprehensively reflect the working environment and operating state of the filter.

[0081] It should be understood that updating the operating parameters of the phase compensation filter based on the obtained environment adaptation compensation parameters is to enable the filter to take into account the current hardware data and operating environment conditions, thereby achieving more accurate phase distortion compensation.

[0082] Step A302: Index and match the environment adaptation compensation parameters from a preset environment adaptation compensation database according to the hardware environment parameters.

[0083] It should be noted that the environment adaptation compensation database is a database that pre-stores the corresponding environment adaptation compensation parameters under various hardware environment parameters. It is used to provide adapted compensation parameters for the system under different environmental conditions, thereby updating the operating parameters of the phase compensation filter and achieving more accurate phase distortion compensation.

[0084] In some embodiments, before indexing and matching the environment adaptation compensation parameters from a preset environment adaptation compensation database according to the hardware environment parameters, it further includes: Step B10: Obtain the phase response calibration data sets of peak filters with the same specifications under multiple hardware environment parameters.

[0085] It should be noted that the hardware environment parameters in this embodiment specifically include the temperature range, impedance characteristic curve, input signal sampling rate set, and load current fluctuation threshold. The core of this step is to construct a complete calibration data set covering the actual application scenarios through multi-dimensional hardware environment combination tests.

[0086] It can be understood that different temperature ranges correspond to different operating conditions. By adjusting the operating range, different operating conditions such as high-temperature aging and low-temperature cold start can be simulated; the impedance characteristic curve is used to clarify the phase response changes caused by static components such as resistor elements in the load circuit to dynamic components such as speaker coils; the sampling rate set covers different audio standards and acoustic requirement scenarios at the same time; the load current fluctuation threshold is used to quantify the correlation between the power supply transient response and the phase change; in the specific calibration process, the measured peak filter is under the coordinated control of a temperature control box, a variable load instrument, and a digital signal generator, and multiple combinations of environmental parameters are set for testing to obtain the measured phase fluctuation data, ensuring that the data set covers the boundaries of the vast majority of real scenarios, thereby obtaining a complete calibration data set covering the actual application scenarios.

[0087] It should be understood that the calibration results are stored in a triple structure of (environment parameter combination + phase response curve + key performance indicators) for subsequent model training.

[0088] Step B20: Obtain an environmental impact factor calculation model according to the phase response calibration data set and the hardware environment parameters.

[0089] It can be understood that the function of the environmental impact factor calculation model is to convert the physical change amounts of environmental parameters (such as temperature, impedance, sampling rate, etc.) into corresponding phase compensation parameters. The model includes the following core compensation terms: temperature-impedance coupling compensation term, sampling rate smoothing factor, and non-linear phase lag correction coefficient. Among them, the temperature-impedance coupling compensation term is used to quantify the combined phase distortion caused by the change in the operational amplifier gain under temperature change and low-impedance load. The sampling rate smoothing factor is used to eliminate the group delay jump of the digital filter when the sampling rate is switched. The non-linear phase lag correction coefficient is used to compensate for the influence of secondary effects such as power supply fluctuations and inductor saturation on the high-frequency phase.

[0090] It should be understood that by taking the hardware environmental parameters as input variables and the phase compensation parameters as output variables, the environmental impact factor calculation model can be obtained through methods such as fitting of experimental data, derivation of physical models, or training of machine learning algorithms. The model construction method preferably adopts a hybrid modeling technique: first, a lightweight neural network is trained with calibration data to predict the basic compensation parameters, and then correction terms based on circuit physical equations (such as the temperature drift component derived from a thermodynamic model) are superimposed, which can combine the advantages of data-driven and prior knowledge.

[0091] Step B30: Based on the environmental impact factor calculation model, obtain the environmental adaptation compensation database.

[0092] It can be understood that since the actual audio playback device does not have enough computing power to perform precise calculations and compensations according to real-time environmental parameters in combination with the model, a database form is used here to retrieve compensation data. In this way, an approximate effect can be achieved through local storage and simple data retrieval, without the need for complex real-time calculations on the audio playback device, reducing the improvement cost of the device.

[0093] It should be understood that by quickly obtaining the matching compensation parameters through database indexing, fast phase distortion compensation can also be achieved, which can efficiently and accurately achieve phase distortion compensation on audio playback devices with limited hardware resources and optimize the audio processing effect.

[0094] Step A303: Based on the environmental adaptation compensation parameters, update the working parameters of the phase compensation filter to obtain an updated phase compensation filter.

[0095] It can be understood that according to the environmental adaptation compensation parameters indexed from the environmental adaptation compensation database, the relevant working parameters of the phase compensation filter are adjusted. For example, the coefficients and frequency response characteristics of the filter are adjusted to enable it to better match the phase distortion characteristics in the current hardware environment, thereby achieving precise phase compensation.

[0096] It should be understood that by updating the working parameters and combining the relevant content generated by the compensation phase parameters in the previous embodiments, the final phase compensation filter can reduce or even eliminate the influence of the hardware environment, improve the effect and accuracy of phase distortion compensation. This helps to improve the processing quality of audio data, ensure that the phase characteristics of the audio signal are accurately restored during transmission and playback, and thus bring a better audio experience to users.

[0097] In this embodiment, by obtaining the hardware environment parameters of the peak filter (such as local temperature, impedance dynamic change value, audio stream sampling rate), indexing and matching the compensation parameters from the preset environment adaptation compensation database, and updating the working parameters of the phase compensation filter, phase distortion compensation is achieved. This method avoids complex real-time calculations on the audio playback device, reduces the device burden, and improves the compensation speed and accuracy.

[0098] In summary, in this embodiment, by retrieving compensation data from the database to correct the phase compensation parameters, the player can adapt to different hardware environments and working conditions, adaptively adjust the filter parameters, and enhance the system stability and reliability. The pre-constructed environment adaptation compensation database can reduce the device improvement cost and complexity, and is conducive to the application and popularization of the phase distortion compensation technology in actual audio devices.

[0099] This application also provides a device for compensating phase distortion of audio data. Please refer to Figure 5 , the device for compensating phase distortion of audio data includes: A data acquisition module 10, configured to obtain the working parameters of the peak filter; A data processing module 20, configured to obtain a phase compensation filter matching the peak filter according to the working parameters of the peak filter; A parameter configuration module 30, configured to connect the phase compensation filter in series after the peak filter to achieve phase distortion compensation of audio data; In one embodiment, the data processing module 20 is further configured to obtain a compensation phase and a weighting vector according to the working parameters of the peak filter; obtain phase compensation working parameters according to the compensation phase and the weighting vector; and set an all-pass filter according to the phase compensation working parameters to obtain a phase compensation filter matching the peak filter.

[0100] In one embodiment, the data processing module 20 is further configured to obtain phase response data according to the working parameters of the peak filter; obtain the actual phase of each frequency point according to the phase response data; obtain a compensation phase according to the actual phase of each frequency point and the corresponding compensation weighting coefficient; and obtain a weighting vector according to the compensation weighting coefficients of each frequency point.

[0101] In one embodiment, the data processing module 20 is further configured to determine a passband compensation range according to the working frequency range of the speaker; determine compensation frequency points according to the passband compensation range; and obtain compensation weighting coefficients for the respective compensation frequency points based on a frequency point compensation strategy.

[0102] In one embodiment, the data processing module 20 is further configured to obtain a phase error vector and an expected phase matrix according to the frequency of the compensation frequency point, the compensation phase, the filter order, and the weighting vector; and obtain phase compensation working parameters according to the phase error vector and the expected phase matrix.

[0103] In one embodiment, the data processing module 20 is further configured to obtain hardware environment parameters of the peak filter; index and match environment adaptation compensation parameters from a preset environment adaptation compensation database according to the hardware environment parameters, where the hardware environment parameters include the real-time temperature of the peak filter, the impedance dynamic change value, and the audio stream sampling rate; and update the working parameters of the phase compensation filter based on the environment adaptation compensation parameters to obtain an updated phase compensation filter.

[0104] In one embodiment, the data processing module 20 is further configured to obtain a phase response calibration data set of peak filters with the same specifications under multiple hardware environment parameters, where the hardware environment parameters include a temperature range, an impedance characteristic curve, a set of input signal sampling rates, and a load current fluctuation threshold; obtain an environmental impact factor calculation model according to the phase response calibration data set and the hardware environment parameters, where the environmental impact factor calculation model at least includes a temperature-impedance coupling compensation term, a sampling rate smoothing factor, and a non-linear phase lag correction coefficient; and obtain the environment adaptation compensation database based on the environmental impact factor calculation model.

[0105] The phase distortion compensation device for audio data provided by this application adopts the phase distortion compensation method for audio data in the above embodiment, and can solve the technical problem of how to design a parameter configuration method that can effectively compensate for the phase distortion generated by using a peak filter in an acoustic system. Compared with the prior art, the beneficial effects of the phase distortion compensation device for audio data provided by this application are the same as those of the phase distortion compensation method for audio data provided in the above embodiment, and other technical features in the phase distortion compensation device for audio data are the same as the features disclosed in the method of the above embodiment, and will not be elaborated here.

[0106] The present application provides a phase distortion compensation device for audio data. The phase distortion compensation device for audio data includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the phase distortion compensation method for audio data in the first embodiment above.

[0107] Reference is made below to Figure 6 , which shows a schematic structural diagram of a phase distortion compensation device for audio data suitable for implementing the embodiments of the present application. The phase distortion compensation device for audio data in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions: tablet computers), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The phase distortion compensation device for audio data shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.

[0108] As Figure 6As shown, the phase distortion compensation device for audio data may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. In the RAM 1004, various programs and data required for the operation of the phase distortion compensation device for audio data are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the phase distortion compensation device for audio data to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a phase distortion compensation device for audio data having various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be alternatively implemented or had.

[0109] Particularly, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.

[0110] The phase distortion compensation device for audio data provided by this application adopts the phase distortion compensation method for audio data in the above-mentioned embodiment, and can solve the technical problem of how to design a parameter configuration method that can effectively compensate for the phase distortion generated by using a peak filter in an acoustic system. Compared with the prior art, the beneficial effects of the phase distortion compensation device for audio data provided by this application are the same as those of the phase distortion compensation method for audio data provided by the above-mentioned embodiment, and other technical features in the phase distortion compensation device for audio data are the same as those disclosed in the method of the previous embodiment, which will not be elaborated here.

[0111] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.

[0112] As mentioned above, the above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application, and all of them should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0113] This application provides a computer-readable storage medium with computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the phase distortion compensation method for audio data in the above-mentioned embodiment.

[0114] The computer-readable storage medium provided by the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0115] The above computer-readable storage medium may be included in a phase distortion compensation device for audio data; or may exist separately without being assembled into the phase distortion compensation device for audio data.

[0116] The above computer-readable storage medium carries one or more programs, which, when executed by a phase distortion compensation device for audio data, cause the phase distortion compensation device for audio data to perform phase distortion compensation of audio data.

[0117] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN: Local Area Network) or a wide area network (WAN: Wide Area Network), or it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and this module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutively represented blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0119] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation to the unit itself in some cases.

[0120] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned phase distortion compensation method for audio data, and can solve the technical problem of how to design a parameter configuration method that can effectively compensate for the phase distortion generated by using a peak filter in an acoustic system. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the phase distortion compensation method for audio data provided in the above embodiments, and will not be elaborated here.

[0121] The computer program product provided by the present application can solve the technical problem of compensating for the phase distortion of audio data. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the method for compensating for the phase distortion of audio data provided in the above embodiments, and will not be elaborated herein.

[0122] The above are only partial embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or any direct / indirect application in other related technical fields, is included in the patent protection scope of the present application.

Claims

1. A method for compensating phase distortion of audio data, characterized in that, The method for compensating phase distortion of audio data includes: Obtaining the working parameters of the peak filter; Obtaining a phase compensation filter matching the peak filter according to the working parameters of the peak filter; Connecting the phase compensation filter in series after the peak filter to achieve phase distortion compensation of audio data.

2. The method for compensating phase distortion of audio data according to claim 1, characterized in that, The step of obtaining a phase compensation filter matching the peak filter according to the working parameters of the peak filter includes: Obtaining a compensation phase and a weighting vector according to the working parameters of the peak filter; Obtaining phase compensation working parameters according to the compensation phase and the weighting vector; Setting an all-pass filter according to the phase compensation working parameters to obtain a phase compensation filter matching the peak filter.

3. The method for compensating phase distortion of audio data according to claim 2, characterized in that, The step of obtaining a compensation phase and a weighting vector according to the working parameters of the peak filter includes: Obtaining phase response data according to the working parameters of the peak filter; Obtaining the actual phase of each frequency point according to the phase response data; Obtaining a compensation phase according to the actual phase of each frequency point and the corresponding compensation weighting coefficient; Obtaining a weighting vector according to the compensation weighting coefficient of each frequency point.

4. The method for compensating phase distortion of audio data according to claim 3, wherein Before obtaining the compensation phase according to the actual phase of each frequency point and the compensation weighting coefficient, it further includes: Determining a passband compensation range according to the working frequency range of the speaker; Determining compensation frequency points according to the passband compensation range; Obtaining the compensation weighting coefficient of each compensation frequency point based on a frequency point compensation strategy.

5. The method for compensating phase distortion of audio data according to claim 2, wherein The step of obtaining phase compensation working parameters according to the compensation phase and the weighting vector includes: Obtaining a phase error vector and an expected phase matrix according to the frequency of the compensation frequency point, the compensation phase, the filter order, and the weighting vector; Obtaining a parameter configuration vector according to the phase error vector and the expected phase matrix; Obtaining a numerator coefficient vector of the all-pass filter and a denominator coefficient vector of the all-pass filter according to the parameter configuration vector; Obtaining the phase compensation working parameters according to the numerator coefficient vector of the all-pass filter and the denominator coefficient vector of the all-pass filter.

6. The method for compensating phase distortion of audio data according to claim 1, characterized in that, Before connecting the phase compensation filter in series after the peak filter to achieve phase distortion compensation of audio data, it further includes: Obtaining the hardware environment parameters of the peak filter; Indexing and matching environment adaptation compensation parameters from a preset environment adaptation compensation database according to the hardware environment parameters, where the hardware environment parameters include the real-time temperature, impedance dynamic change value, and audio stream sampling rate of the peak filter; Updating the working parameters of the phase compensation filter based on the environment adaptation compensation parameters to obtain an updated phase compensation filter.

7. The method for compensating phase distortion of audio data according to claim 6, characterized in that, Before indexing and matching environment adaptation compensation parameters from a preset environment adaptation compensation database according to the hardware environment parameters, it further includes: Obtaining a phase response calibration data set of peak filters with the same specifications under multiple hardware environment parameters, where the hardware environment parameters include a temperature range, an impedance characteristic curve, a set of input signal sampling rates, and a load current fluctuation threshold; An environmental impact factor calculation model is obtained according to the phase response calibration data set and the hardware environment parameters, wherein the environmental impact factor calculation model at least includes a temperature-impedance coupling compensation term, a sampling rate smoothing factor, and a non-linear phase lag correction coefficient; Based on the environmental impact factor calculation model, the environment adaptation compensation database is obtained.

8. An apparatus for compensating phase distortion of audio data, characterized in that, The phase distortion compensation device for audio data includes: A data acquisition module, configured to obtain the working parameters of the peak filter; A data processing module, configured to obtain a phase compensation filter matching the peak filter according to the working parameters of the peak filter; A parameter configuration module, configured to connect the phase compensation filter in series after the peak filter to implement phase distortion compensation of audio data.

9. An apparatus for compensating phase distortion of audio data, characterized in that, The phase distortion compensation device for audio data includes a memory, a processor, and a phase distortion compensation program for audio data stored on the memory and executable on the processor, and the phase distortion compensation program for audio data is configured to implement the steps of the phase distortion compensation method for audio data according to any one of claims 1 to 7.

10. A storage medium, characterized in that, A phase distortion compensation program for audio data is stored on the storage medium, and when the phase distortion compensation program for audio data is executed by a processor, the steps of the phase distortion compensation method for audio data according to any one of claims 1 to 7 are implemented.