Audio signal phase adjustment method and device, equipment and storage medium

By performing frequency division processing, delay compensation and equalizer adjustment on the audio signal, combined with fine phase adjustment of the all-pass filter and maximum phase filter coefficients, the phase distortion problem of the frequency response curve of the car speakers is solved, and the sound quality performance of the audio system is improved.

CN120640198APending Publication Date: 2025-09-12HAIWEI ZHIZAO TECH (WUHAN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510613213.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies are unable to effectively solve the phase distortion problem of the speaker frequency response curve in the complex acoustic environment inside the car, especially at the crossover point and the peaks and troughs of the frequency response curve, which makes the tuning work difficult.

Method used

By performing frequency division processing, delay compensation, and equalizer adjustment on the audio signal, the current frequency response curve is measured, the all-pass filter and maximum phase filter coefficients are calculated, and these coefficients are used to adjust the signal phase until the preset flatness requirements are met.

Benefits of technology

It significantly improves the flatness of the speaker's frequency response curve, reduces phase distortion, and enhances sound quality to meet the needs of high-fidelity audio systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120640198A_ABST
    Figure CN120640198A_ABST
Patent Text Reader

Abstract

The invention discloses an audio signal phase adjustment method, device and equipment and a storage medium, and relates to the technical field of vehicle-mounted loudspeakers, and the method comprises the steps: carrying out the frequency division processing, delay compensation and equalizer adjustment of an input audio signal, and obtaining an initial processing signal; outputting the initial processing signal to a target loudspeaker, and measuring a current frequency response curve of the target loudspeaker; determining an all-pass filter coefficient and a maximum phase filter coefficient according to the frequency division point, the wave crest and the wave trough of the current frequency response curve; performing phase adjustment on the initial processing signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal; and outputting the audio signal to the target loudspeaker, and returning to the step of measuring the current frequency response curve of the target loudspeaker until the current frequency response curve meets a preset flatness requirement, thereby completing phase adjustment. Phase distortion at the frequency division point and the wave crest and the wave trough of the frequency response curve can be improved through phase adjustment, so that the frequency response curve of the loudspeaker is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle-mounted loudspeakers, and in particular to a method, apparatus, device, and storage medium for adjusting the phase of an audio signal. Background Art

[0002] In the field of in-cabin audio, to create an immersive listening experience, a large number of speakers are often installed in a vehicle. Speakers are categorized by operating frequency range: tweeters, mid-range speakers, woofers, and subwoofers. In practice, the signal is first filtered through frequency division to obtain different frequency components, which are then reproduced by different speakers. However, the irregular geometry of the vehicle interior, with windows, doors, seats, and various interior materials absorbing and reflecting sound to varying degrees, makes the cabin acoustic environment complex and challenging to tune.

[0003] When tuning the entire vehicle, the following methods are usually used to solve the phase problem: (1) Crossover filter: By setting different crossover points, different crossover filter orders and types, the distortion problems caused by the speakers themselves and after the crossover are alleviated, so that the low, medium and high tones are naturally connected. (2) Delay compensation: Adding delay to each speaker channel to compensate for the distance difference between the different speaker positions and the listening position, playing a certain phase adjustment role. (3) EQ (Equalizer): By using EQ to adjust the gain of the peaks and troughs of the frequency response curve, the frequency response curve is improved.

[0004] While the above methods can improve the frequency response curve to a certain extent, it's difficult to achieve an ideal frequency response curve by relying solely on crossover, delay, and EQ. The complex acoustic environment inside a car, with its numerous peaks and valleys, makes phase adjustment difficult. Existing methods are also unable to effectively address phase distortion at the crossover point and at the peaks and valleys of the frequency response curve. Therefore, optimizing the speaker's frequency response curve by finely adjusting the phase to improve the crossover point and at the peaks and valleys of the frequency response curve has become a pressing issue.

[0005] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0006] The purpose of this application is to provide a phase adjustment method, device, equipment and storage medium for audio signals, aiming to solve the technical problem of how to improve the phase distortion at the crossover point and the peaks and troughs of the frequency response curve through fine phase adjustment, thereby optimizing the frequency response curve of the speaker.

[0007] To achieve the above objectives, the present application proposes a method for adjusting the phase of an audio signal, the method comprising:

[0008] Perform frequency division processing, delay compensation and equalizer adjustment on the input audio signal to obtain the initial processed signal;

[0009] Outputting the initial processed signal to a target speaker and measuring a current frequency response curve of the target speaker;

[0010] Determining all-pass filter coefficients and maximum phase filter coefficients according to the crossover points and peaks and troughs in the current frequency response curve;

[0011] performing phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal;

[0012] The adjusted audio signal is output to the target speaker, and the process returns to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets the preset flatness requirement, thereby completing the phase adjustment.

[0013] In one embodiment, the step of determining the all-pass filter coefficient and the maximum phase filter coefficient according to the crossover points and the peaks and troughs in the current frequency response curve includes:

[0014] Calculating all-pass filter coefficients according to the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and a preset quality factor;

[0015] The maximum phase filter coefficient is calculated according to the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point position, the weighting vector and the preset filter order.

[0016] In one embodiment, the step of calculating the all-pass filter coefficients according to the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and the preset quality factor includes:

[0017] Calculating a normalized angular frequency according to the center frequency of the crossover point in the current frequency response curve and the sampling frequency;

[0018] Calculating a numerator coefficient and a denominator coefficient of an all-pass filter according to the normalized angular frequency and a preset quality factor;

[0019] An all-pass filter coefficient is obtained according to the numerator coefficient and the denominator coefficient.

[0020] In one embodiment, the step of calculating the maximum phase filter coefficient according to the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point position, the weighting vector, and the preset filter order includes:

[0021] Constructing a system of linear equations based on the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point positions, the weighting vectors, and the preset filter order;

[0022] Solving the linear equations to obtain linear phase filter coefficients;

[0023] Obtaining a minimum phase filter coefficient according to the linear phase filter coefficient, a preset all-ones function, and a preset all-zeros function;

[0024] Perform a flip operation on the minimum phase filter coefficient to obtain a maximum phase filter coefficient.

[0025] In one embodiment, the step of obtaining the minimum phase filter coefficient according to the linear phase filter coefficient, the preset all-ones function, and the preset all-zeros function comprises:

[0026] Performing a fast Fourier transform on the linear phase filter coefficients to obtain a frequency domain amplitude spectrum;

[0027] Taking the natural logarithm of the frequency domain amplitude spectrum and performing an inverse fast Fourier transform to obtain a time domain signal;

[0028] Obtaining a weighting function according to a preset all-ones function, a preset all-zeros function, and the length of the linear phase filter coefficient;

[0029] Minimum phase filter coefficients are generated based on the time domain signal and the weighting function.

[0030] In one embodiment, the step of performing phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain the adjusted audio signal includes:

[0031] When an infinite impulse response all-pass filter is selected, constructing the infinite impulse response all-pass filter according to the all-pass filter coefficients;

[0032] adjusting the phase offset at the crossover point of the initial processed signal by using the infinite impulse response all-pass filter to obtain an adjusted audio signal;

[0033] When a finite impulse response maximum phase filter is selected, constructing the finite impulse response maximum phase filter according to the maximum phase filter coefficients;

[0034] adjusting the phase offsets at the peaks and troughs of the initial processed signal by using the finite impulse response maximum phase filter to obtain an adjusted audio signal;

[0035] When the all-pass filter and the maximum phase filter are selected, the phase offset at the crossover point of the initial processed signal is adjusted by the infinite impulse response all-pass filter, and the phase offset at the peaks and troughs of the initial processed signal is adjusted by the finite impulse response maximum phase filter to obtain an adjusted audio signal.

[0036] In one embodiment, the step of performing frequency division processing, delay compensation, and equalizer adjustment on the input audio signal to obtain an initial processed signal includes:

[0037] Perform frequency division processing on the input audio signal according to a preset frequency division point, a preset frequency division order, and a preset frequency division type to obtain a frequency division signal;

[0038] Calculate the delay factor based on the distance between the target speaker and the listening position;

[0039] Performing delay compensation on the frequency-divided signal according to the delay coefficient to obtain a compensated frequency-divided signal;

[0040] The compensated frequency-divided signal is gain-adjusted according to a preset equalizer coefficient to obtain an initial processed signal.

[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes a phase adjustment device for an audio signal, the device comprising:

[0042] The signal processing module is used to perform frequency division processing, delay compensation and equalizer adjustment on the input audio signal to obtain the initial processed signal;

[0043] a measuring module, configured to output the initial processed signal to a target speaker and measure a current frequency response curve of the target speaker;

[0044] A coefficient determination module, configured to determine an all-pass filter coefficient and a maximum phase filter coefficient according to the crossover points and peaks and troughs in the current frequency response curve;

[0045] a phase adjustment module, configured to perform phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal;

[0046] The iterative control module is configured to output the adjusted audio signal to the target speaker and return to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets a preset flatness requirement, thereby completing the phase adjustment.

[0047] In addition, to achieve the above-mentioned purpose, the present application also proposes a phase adjustment device for an audio signal, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the phase adjustment method for an audio signal as described above.

[0048] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the phase adjustment method of the audio signal as described above are implemented.

[0049] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the phase adjustment method of the audio signal as described above.

[0050] One or more technical solutions proposed in this application have at least the following technical effects:

[0051] First, the audio processing device performs frequency division, delay compensation, and equalization on the input audio signal to produce an initial processed signal. Frequency division ensures that signals in different frequency bands are reproduced by the appropriate speakers, improving sound clarity and layering. Delay compensation addresses the issue of sound arrival asynchrony caused by speaker placement, enhancing sound coherence and spatial perception. Equalization optimizes the frequency response curve, compensating for the effects of the vehicle's acoustic environment, and bringing the initial processed signal closer to ideal audio characteristics. The device then outputs the initial processed signal to the target speaker and measures the target speaker's current frequency response curve. Based on the crossover points and peaks and valleys in the current frequency response curve, the device determines the all-pass filter coefficients and maximum phase filter coefficients. These precise filter coefficients enable targeted phase adjustments at key frequencies, reducing phase distortion at the crossover points and peaks and valleys, and providing precise parameters for fine-tuning phase adjustments. The device then performs phase adjustments on the initial processed signal based on the all-pass filter coefficients or maximum phase filter coefficients to produce the adjusted audio signal. Phase adjustment optimizes the phase characteristics of the audio signal at key frequencies, reducing phase distortion and smoothing the frequency response curve, further improving sound quality. Finally, the device outputs the adjusted audio signal to the target speaker and returns to the step of measuring the target speaker's current frequency response curve until the current frequency response curve meets the preset flatness requirements, completing the phase adjustment. Through multiple measurements and adjustments, the frequency response curve is gradually optimized, ultimately achieving the preset flatness requirements, significantly improving sound quality and meeting the requirements of high-fidelity audio systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0054] Figure 1 A flowchart of a first embodiment of a method for adjusting the phase of an audio signal according to the present invention is provided;

[0055] Figure 2 A flowchart of a second embodiment of the method for adjusting the phase of an audio signal of the present application is provided;

[0056] Figure 3 This is a schematic diagram of the module structure of the phase adjustment device for audio signals according to an embodiment of the present application;

[0057] Figure 4 Schematic diagram of the device structure of the hardware operating environment involved in the phase adjustment method of the audio signal in the embodiment of the present application.

[0058] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0059] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0060] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0061] In the cockpit audio field, to create an immersive listening experience, a large number of speakers are installed in vehicles, categorized by operating frequency into high, mid, low, and subwoofer types. In practice, signals are filtered and then reproduced by different speakers after frequency division. However, the complex geometry of the vehicle interior and the absorptive and reflective properties of the interior materials make tuning difficult. Existing tuning methods, including crossover filters, delay compensation, and equalization (EQ), can partially improve the frequency response curve, but are ineffective in addressing phase distortion at the crossover point and at the peaks and valleys of the frequency response curve.

[0062] The main solution of the embodiment of the present application is: first, the input audio signal is subjected to frequency division processing, delay compensation and equalizer adjustment to obtain an initial processed signal. This process improves the clarity, layering and spatial sense of the sound, and makes the frequency response curve closer to the ideal state. Next, the initial processed signal is output to the target speaker and its frequency response curve is measured. Then, the coefficients of the all-pass filter and the maximum phase filter are determined according to the frequency division points and peaks and troughs in the curve to accurately adjust the phase characteristics of the key frequency points and reduce phase distortion. Afterwards, the initial processed signal is phase-adjusted based on these coefficients to obtain an optimized audio signal, further improving the sound quality. Finally, the adjusted signal is output to the speaker and the frequency response curve is repeatedly measured until it meets the preset flatness requirements. The phase adjustment is completed, which significantly improves the sound quality performance and meets the needs of high-fidelity audio systems.

[0063] It should be noted that the execution subject of the embodiments of the present application can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or audio processing device capable of implementing the above functions. The following uses an audio processing device as an example to illustrate this embodiment and the following embodiments.

[0064] Based on this, the embodiment of the present application provides a phase adjustment method for an audio signal, referring to Figure 1 , Figure 1 FIG. 1 is a flow chart of a first embodiment of a method for adjusting the phase of an audio signal of the present application.

[0065] In this embodiment, the phase adjustment method of the audio signal includes steps S10 to S50:

[0066] Step S10 , performing frequency division processing, delay compensation, and equalizer adjustment on the input audio signal to obtain an initial processed signal.

[0067] It should be noted that the input audio signal refers to the original audio signal output from the audio source device (such as a music player, radio, multimedia system, etc.) in the audio system. This signal contains the sound information of the full frequency band and has not been processed in any way.

[0068] The initial processed signal refers to the audio signal after frequency division processing, delay compensation and equalizer adjustment.

[0069] It can be understood that the crossover process divides the audio signal into different frequency bands, the delay compensation adjusts the signal propagation time to match the physical position of the speaker, and the equalizer adjustment is used to optimize the frequency response curve.

[0070] As an example, the steps of performing frequency division processing, delay compensation and equalizer adjustment on the input audio signal to obtain the initial processed signal include: performing frequency division processing on the input audio signal according to a preset frequency division point, a preset frequency division order and a preset frequency division type to obtain a frequency division signal; calculating the delay coefficient based on the distance between the target speaker and the listening position; performing delay compensation on the frequency division signal according to the delay coefficient to obtain a compensated frequency division signal; and performing gain adjustment on the compensated frequency division signal according to a preset equalizer coefficient to obtain the initial processed signal.

[0071] Preset crossover frequencies are pre-set frequency values ​​used in audio signal processing to divide the audio signal into different frequency bands. For example, common crossover points might include 150Hz (for the boundary between low and mid-range frequencies) and 3kHz (for the boundary between mid-range and high frequencies). These crossover points are selected based on the speaker's frequency response range and the requirements of the vehicle's acoustic environment, ensuring that each speaker can handle signals appropriate to its frequency range.

[0072] The preset crossover order refers to the order of the crossover filter, which determines the steepness of the filter near the crossover point. A higher order results in a steeper transition band near the crossover point, but this may also introduce more phase distortion. For example, a second-order filter has a rolloff rate of 12dB per octave at the crossover point, while a fourth-order filter has a rolloff rate of 24dB per octave. Choosing the preset crossover order requires a trade-off between filtering effectiveness and phase distortion.

[0073] The preset crossover type refers to the design of the crossover filter. Common ones include Butterworth, Chebyshev, and Bessel filters. Each filter type has different frequency response characteristics. For example, the Butterworth filter has a flat response within the passband, the Chebyshev filter allows some fluctuation within the passband in exchange for a steeper transition band, and the Bessel filter exhibits better phase linearity. The choice of preset crossover type depends on the frequency response and phase characteristics requirements of the specific application scenario.

[0074] The crossover signal is the audio signal after the frequency division process. It is divided into multiple frequency bands, each corresponding to a specific frequency range. For example, the low-frequency signal may contain frequency components from 20Hz to 150Hz, the mid-frequency signal may contain frequency components from 150Hz to 3kHz, and the high-frequency signal may contain frequency components from 3kHz to 20kHz. The crossover signal is the basis for subsequent processing (such as delay compensation and equalizer adjustment).

[0075] Target speakers are the speakers in an audio system responsible for reproducing audio signals within a specific frequency range. For example, a woofer reproduces low frequencies, a midrange reproduces mid-range frequencies, and a tweeter reproduces high frequencies. Target speakers are selected based on their frequency response range and mounting location, ensuring that each speaker can efficiently handle signals appropriate to its frequency range.

[0076] The listening position refers to the user's primary listening position in an in-car audio system. In a car audio system, this position is typically the driver's seat, the front passenger seat, or a rear seat. The selection of the listening position is crucial for audio processing, as it determines the target location for audio signal processing. For example, delay compensation and equalizer adjustments require optimization based on the listening position.

[0077] The delay factor is the delay value calculated based on the distance between the target speaker and the listening position. It is used to compensate for the distance differences between different speakers and the listening position, ensuring that the sound from all speakers arrives at the listening position synchronously.

[0078] Preset equalizer coefficients are pre-set gain values ​​used in equalizer adjustments to adjust the signal strength of specific frequency bands. These coefficients are typically optimized based on the vehicle's in-vehicle acoustic environment and target sound quality requirements.

[0079] First, the audio processing device divides the input audio signal into multiple frequency bands of frequency-divided signals through a frequency-dividing filter according to the preset frequency-dividing point, frequency-dividing order and frequency-dividing type. For example, the signal is divided into low-frequency, medium-frequency and high-frequency parts. The purpose of this is to enable the signals of different frequency bands to be reproduced by speakers suitable for the frequency bands, thereby improving the clarity and layering of the sound. Secondly, the device calculates the delay coefficient based on the distance between the target speaker and the listening position. The calculation formula of the delay coefficient is: delay coefficient = distance difference / speed of sound (340 meters / second). Then, the device performs delay compensation on the frequency-dividing signal according to the calculated delay coefficient. The specific operation is to delay the phase of each frequency-dividing signal by a time value corresponding to the delay coefficient. The purpose of this is to ensure that the sounds emitted by different speakers can arrive at the listening position synchronously, enhancing the continuity and spatial sense of the sound. Finally, the device adjusts the gain of the compensated crossover signal according to the preset equalizer coefficient, and optimizes the frequency response curve by adjusting the signal strength of the specific frequency band. For example, if the low-frequency response in the car is insufficient, the gain of the low-frequency band is increased; if the high-frequency response is too strong, the gain of the high-frequency band is reduced. The purpose of this is to compensate for the impact of the acoustic environment in the car on the sound and make the frequency response curve flatter, thereby obtaining the initial processed signal and providing a basis for further optimization processing such as subsequent fine phase adjustment.

[0080] Step S20: outputting the initial processed signal to a target speaker, and measuring a current frequency response curve of the target speaker.

[0081] It's important to note that the current frequency response curve refers to the actual frequency response curve measured when the target speaker plays the initially processed signal. This curve reflects the speaker's sound intensity (usually measured in decibels) at different frequencies. It intuitively demonstrates the speaker's sound output characteristics across frequency bands under the current audio processing state, including which frequency bands may have excessive gain (peaks) or low gain (troughs).

[0082] It is understandable that the audio processing device first sends the initial processed signal to the target speaker. After receiving the signal, the target speaker converts it into a sound signal and plays it out. At the same time, the audio processing device starts the measurement module and captures the sound signal played by the speaker by placing an acoustic sensor (such as a microphone) at a specific measurement point in the car (usually the listening position). The measurement module analyzes the captured sound signal and calculates the sound intensity at different frequencies to obtain the frequency response curve of the target speaker in the current playback state. This frequency response curve can intuitively reflect the actual sound output of the speaker in each frequency band, including whether there are abnormal conditions such as peaks or troughs, providing an important basis for subsequent further optimization processing.

[0083] Step S30 , determining an all-pass filter coefficient and a maximum phase filter coefficient according to the crossover points and peaks and troughs in the current frequency response curve.

[0084] It should be noted that the crossover frequency refers to a pre-set frequency value in audio signal processing, which is used to divide the audio signal into different frequency bands. For example, 150Hz (for the boundary between low frequency and medium frequency) and 3kHz (for the boundary between medium frequency and high frequency).

[0085] Peaks and troughs refer to the phenomenon where the sound intensity (amplitude) at certain frequency points in the frequency response curve is significantly higher or lower than that at surrounding frequency points. A peak is a local maximum on the frequency response curve, indicating higher sound intensity at that frequency; a trough is a local minimum on the frequency response curve, indicating lower sound intensity at that frequency. These peaks and troughs are typically caused by factors such as the complexity of the vehicle's in-vehicle acoustic environment (such as the absorption and reflection properties of windows, doors, seats, and interior materials) and the physical placement of the speakers. The presence of peaks and troughs affects the balance of sound quality, necessitating optimization through methods such as phase adjustment.

[0086] All-pass filter coefficients refer to a set of parameters used to design an all-pass filter. These parameters determine the filter's frequency response. An all-pass filter is a special filter that maintains a constant amplitude response across all frequencies but modifies the signal's phase. In audio processing, all-pass filters are often used to adjust a signal's phase characteristics without affecting its amplitude.

[0087] Maximum phase filter coefficients are a set of parameters used to design a maximum phase filter. These parameters determine the filter's frequency response. A maximum phase filter is a special type of FIR (Finite Impulse Response) filter whose phase characteristic exhibits the largest phase delay of all possible filters. In audio processing, maximum phase filters are often used to fine-tune peaks and valleys in a frequency response curve, improving its flatness by shifting the signal's phase.

[0088] It can be understood that first, the audio processing device analyzes the current frequency response curve of the target speaker and accurately locates the crossover point and the peak and trough positions. Then, for each crossover point, the device calculates the corresponding all-pass filter coefficients based on a preset algorithm, combined with parameters such as the frequency value of the crossover point, sampling frequency, and quality factor. These coefficients will be used for subsequent phase adjustments to optimize the phase characteristics at the crossover point and ensure that signals of different frequency bands can smoothly transition at the crossover point. Next, for the peaks and troughs in the frequency response curve, the device also uses a specific algorithm to calculate the maximum phase filter coefficients. These coefficients will be used to adjust the phase at the peaks and troughs, further improving the flatness of the frequency response curve and providing key parameter support for subsequent fine phase adjustments.

[0089] Step S40 : performing phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal.

[0090] It should be noted that phase adjustment refers to the process of optimizing the phase characteristics of the initial processed signal by applying an all-pass filter or a maximum phase filter. Specifically, the audio processing device filters the initial processed signal according to the all-pass filter coefficients or maximum phase filter coefficients determined by the crossover point and the peak and trough positions in the current frequency response curve. The all-pass filter adjusts the phase of the signal without changing the signal amplitude to optimize the phase connection at the crossover point and ensure that signals of different frequency bands can smoothly transition at the crossover point. The maximum phase filter improves the phase characteristics of the peaks and troughs in the frequency response curve by adjusting the phase of the signal, further optimizing the flatness of the frequency response curve.

[0091] It is understandable that the audio processing device first loads the calculated all-pass filter coefficients or maximum phase filter coefficients. For the initial processing signal, the device applies these filter coefficients to each frequency band of the signal through a digital signal processing algorithm. Specifically, the device performs a discrete convolution operation on the signal, and uses the all-pass filter coefficients to adjust the phase at the crossover point to ensure that the phase connection of signals in different frequency bands is smooth at the crossover point; at the same time, the maximum phase filter coefficients are used to optimize the phase at the peaks and troughs to improve the flatness of the frequency response curve. After processing by these filters, the phase characteristics of the initial processing signal are adjusted to obtain an adjusted audio signal, the phase distortion of which at the key frequency points is effectively reduced, and the sound quality is further optimized.

[0092] As an example, the step of performing phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal includes: when an infinite impulse response all-pass filter is selected, constructing the infinite impulse response all-pass filter according to the all-pass filter coefficient; adjusting the phase offset at the crossover point of the initial processed signal by the infinite impulse response all-pass filter to obtain an adjusted audio signal; when a finite impulse response maximum phase filter is selected, constructing the finite impulse response maximum phase filter according to the maximum phase filter coefficient; adjusting the phase offset at the peaks and troughs of the initial processed signal by the finite impulse response maximum phase filter to obtain an adjusted audio signal; when the all-pass filter and the maximum phase filter are selected, adjusting the phase offset at the crossover point of the initial processed signal by the infinite impulse response all-pass filter, and adjusting the phase offset at the peaks and troughs of the initial processed signal by the finite impulse response maximum phase filter to obtain an adjusted audio signal.

[0093] An IIR (Infinite Impulse Response) all-pass filter is a special digital filter characterized by an infinite impulse response and a constant amplitude response at all frequencies, but it can change the phase of the signal. In audio processing, IIR all-pass filters are often used to adjust the phase characteristics of a signal without affecting its amplitude characteristics. The IIR all-pass filter constructed based on the all-pass filter coefficients can adjust the phase at the crossover point of the initial processed signal to ensure that signals of different frequency bands can smoothly transition at the crossover point, thereby optimizing the phase characteristics of the frequency response curve. The formula for the IIR all-pass filter is as follows:

[0094]

[0095] Where y(n) is the output signal, x(n) is the input signal, b(n) is the filter numerator coefficient, N is its order, a(n) is the filter denominator coefficient, and M is its order. The numerator and denominator coefficients of the IIR all-pass filter used in this application are both second-order, and it is a second-order IIR all-pass filter. The formula for solving the coefficients of the second-order IIR all-pass filter is as follows:

[0096]

[0097] b0=1-α

[0098] b1=-2*cos(ω)

[0099] b2=1+α

[0100] a0=1+α

[0101] a1=-2*cos(ω)

[0102] a2=1-α

[0103] Among them, f center is the center frequency, f sample is the sampling frequency, and Q is the quality factor. Based on the above formula, we can obtain the numerator coefficients b0, b1, and b2, and the denominator coefficients a0, a1, and a2 of the second-order IIR all-pass filter, and then perform different degrees of phase adjustment at the specified center frequency.

[0104] Phase offset refers to the phase change of a signal at a specific frequency. In audio processing, phase offset is a crucial parameter for measuring a signal's phase characteristics. For example, at the crossover point, the phases of signals in different frequency bands may be inconsistent, resulting in phase discontinuity. By adjusting the phase offset, the phase transition between signals in different frequency bands at the crossover point can be smoothed, thereby reducing phase distortion and improving sound quality.

[0105] The FIR maximum phase filter is a special FIR filter whose phase characteristic has the largest phase delay of all possible filters. In audio processing, FIR maximum phase filters are often used to fine-tune the peaks and troughs in the frequency response curve. The FIR maximum phase filter constructed based on the maximum phase filter coefficients can adjust the phase at the peaks and troughs of the initial processed signal, improving the flatness of the frequency response curve and thus optimizing the sound quality. The formula for the FIR maximum phase filter is as follows:

[0106]

[0107] Where y(n) is the output signal, x(n) is the input signal, b(n) is the filter coefficient, and N is its order.

[0108] First, when using an IIR all-pass filter, the audio processing device constructs the IIR all-pass filter's transfer function based on the all-pass filter coefficients using a digital signal processing algorithm. Specifically, the filter coefficients are substituted into the IIR filter's differential equation, resulting in a digital filter model capable of adjusting the signal's phase. Next, the device inputs the initial processed signal sample by sample into the constructed IIR all-pass filter. The filter adjusts the signal's phase offset at the crossover point based on its transfer function. By changing the signal's phase relationship near the crossover point, it ensures a smooth transition between signals in different frequency bands at the crossover point, avoiding phase discontinuities and ultimately obtaining the adjusted audio signal. Secondly, when using an FIR maximum phase filter, the device constructs the FIR maximum phase filter's unit impulse response based on the maximum phase filter coefficients, using the filter coefficients as the filter's impulse response sequence. The device then convolves the initial processed signal with the unit impulse response of the constructed FIR maximum phase filter. This convolution operation optimizes the phase offset of the signal at peaks and troughs, improving the flatness of the frequency response curve and making it smoother, reducing the impact of peaks and troughs on sound quality, thereby producing an adjusted audio signal. Finally, when both an IIR all-pass filter and an FIR maximum phase filter are selected, the device first uses the IIR all-pass filter to adjust the phase offset of the initial processed signal at the crossover point to ensure smooth phase transitions at the crossover point. The signal adjusted by the IIR all-pass filter is then input into the FIR maximum phase filter to further adjust the phase offset at peaks and troughs. This dual optimization method ultimately results in a finely phased audio signal, achieving a more balanced and natural sound reproduction effect. This effectively resolves phase distortion issues at the crossover point and peaks and troughs, significantly improving the sound quality of the in-car audio system.

[0109] Step S50: output the adjusted audio signal to the target speaker, and return to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets the preset flatness requirement, thus completing the phase adjustment.

[0110] It should be noted that the preset flatness requirement refers to the flatness standard that a preset frequency response curve should achieve within a specific frequency range during audio processing. This standard is usually measured in decibels (dB) to measure the fluctuation range of the frequency response curve. For example, the preset flatness requirement may stipulate that the frequency response curve within the frequency range of 20Hz to 20kHz, its fluctuation should not exceed ±3dB. This means that the difference between the highest and lowest points of the frequency response curve should not exceed 3dB across the entire frequency range. This requirement is set based on the sound quality standards and user needs of specific application scenarios (such as in-vehicle audio systems).

[0111] It can be understood that first, the audio processing device sends the phase-adjusted audio signal to the target speaker, which plays the signal after receiving it. At the same time, the device starts the measurement module and captures the sound signal played by the speaker through the acoustic sensor at the preset measurement point in the car. The measurement module analyzes the captured sound signal, calculates the sound intensity at different frequencies, and generates the current frequency response curve. Then, the device compares the generated current frequency response curve with the preset flatness requirements to check whether the curve meets the preset flatness standard (for example, whether the fluctuation of the frequency response curve is within the allowable range). If the current frequency response curve does not meet the preset flatness requirements, the device will return to the measurement step, re-measure the frequency response curve of the target speaker, and perform phase adjustment again based on the new measurement results. This process will be repeated until the measured current frequency response curve meets the preset flatness requirements. At this time, the phase adjustment is completed and the audio processing device stops the adjustment process to ensure that the audio system can provide a balanced and natural sound effect during playback.

[0112] This embodiment provides a method for adjusting the phase of an audio signal. First, an audio processing device performs frequency division processing, delay compensation, and equalizer adjustment on the input audio signal to obtain an initial processed signal. Frequency division ensures that signals in different frequency bands are reproduced by appropriate speakers, improving sound clarity and layering. Delay compensation resolves the problem of asynchronous sound arrival times caused by differences in speaker positions, enhancing sound coherence and spatial perception. Equalizer adjustment optimizes the frequency response curve, compensates for the impact of the vehicle's acoustic environment on the sound, and brings the initial processed signal closer to the ideal audio characteristics. Next, the device outputs the initial processed signal to the target speaker and measures the current frequency response curve of the target speaker. The device then determines the all-pass filter coefficients and maximum phase filter coefficients based on the crossover points and peaks and troughs in the current frequency response curve. By accurately calculating the filter coefficients, the phase characteristics of key frequency points can be adjusted in a targeted manner, reducing phase distortion at the crossover points and peaks and troughs, providing precise parameter support for fine phase adjustment. The device then performs phase adjustment on the initial processed signal based on the all-pass filter coefficients or maximum phase filter coefficients to obtain the adjusted audio signal. Phase adjustment optimizes the phase characteristics of the audio signal at key frequencies, reducing phase distortion and smoothing the frequency response curve, further improving sound quality. Finally, the device outputs the adjusted audio signal to the target speaker and returns to the step of measuring the target speaker's current frequency response curve until the current frequency response curve meets the preset flatness requirements, completing the phase adjustment. Through multiple measurements and adjustments, the frequency response curve is gradually optimized, ultimately achieving the preset flatness requirements, significantly improving sound quality and meeting the requirements of high-fidelity audio systems.

[0113] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 , Figure 2 This is a flow chart of a second embodiment of the method for adjusting the phase of an audio signal of the present application. Step S30 of the method for adjusting the phase of an audio signal includes steps S31 to S32:

[0114] Step S31 : calculating all-pass filter coefficients according to the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and a preset quality factor.

[0115] It should be noted that the center frequency refers to the specific frequency value at the crossover point in the frequency response curve. It is an important parameter in the design of the crossover filter, which is used to determine at which frequency point the filter performs signal crossover processing.

[0116] In digital audio processing, the sampling frequency refers to the number of times an audio signal is sampled per second, typically measured in Hertz (Hz). The sampling frequency determines the highest frequency component of an audio signal that is retained during the digitization process. According to the Nyquist theorem, the sampling frequency should be at least twice the highest frequency of the signal to avoid aliasing. The sampling frequency is a critical parameter when calculating all-pass filter coefficients, as it affects the filter's digital implementation and frequency response.

[0117] The preset quality factor (Q value) is a dimensionless parameter used to describe the frequency selectivity of a filter. The higher the Q value, the greater the filter's frequency selectivity near the center frequency, meaning the narrower the filter's bandwidth. In audio processing, the choice of Q value depends on the specific application requirements. For example, a higher Q value can make the filter's transition at the crossover point steeper, but may introduce more phase distortion. The preset quality factor is pre-set based on the overall design goals and performance requirements of the audio system, and is used to balance frequency selectivity and phase characteristics in all-pass filter design.

[0118] It can be understood that, first, the center frequency of the crossover point is accurately read from the current frequency response curve. This frequency value is usually pre-set according to the frequency response range and design requirements of the speaker system. For example, in a car audio system, the center frequency of the crossover point between low frequency and mid-frequency may be set to 150Hz. Secondly, the sampling frequency of the system is obtained. This frequency is a fixed parameter used by the audio processing system when digitizing the audio signal. It is usually determined by the audio processing chip or the hardware design of the system. For example, the common sampling frequency is 44.1kHz or 48kHz. Finally, combined with the preset Q value, these parameters are substituted into the calculation formula of the all-pass filter coefficient, and the all-pass filter coefficient is obtained through mathematical calculation.

[0119] As an example, the step of calculating the all-pass filter coefficient based on the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and the preset quality factor includes: calculating the normalized angular frequency based on the center frequency of the crossover point in the current frequency response curve and the sampling frequency; calculating the numerator coefficient and denominator coefficient of the all-pass filter based on the normalized angular frequency and the preset quality factor; and obtaining the all-pass filter coefficient based on the numerator coefficient and the denominator coefficient.

[0120] The normalized angular frequency refers to the value obtained by normalizing the actual angular frequency and the sampling frequency.

[0121] The numerator coefficient refers to the coefficient of the numerator part of the all-pass filter transfer function. These coefficients determine how the filter weights the input signal and directly affect the frequency response characteristics of the filter.

[0122] The denominator coefficient refers to the coefficient of the denominator part of the all-pass filter transfer function. These coefficients determine the feedback characteristics of the filter and also directly affect the frequency response characteristics of the filter.

[0123] First, the center frequency and sampling frequency are normalized to obtain the normalized angular frequency. This process converts the actual frequency into the normalized frequency range used in digital filter design, facilitating subsequent calculations. Next, the normalized angular frequency is used to calculate the numerator and denominator coefficients of the all-pass filter, combined with a preset quality factor. This process is accomplished using a specific algorithm to ensure that the filter has the desired phase adjustment characteristics at the crossover point. Finally, the calculated numerator and denominator coefficients are combined to form the complete coefficients of the all-pass filter. These coefficients are used in subsequent phase adjustment to optimize the phase characteristics of the audio signal at the crossover point, thereby improving the overall performance of the audio system.

[0124] Step S32 , calculating the maximum phase filter coefficient according to the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point position, the weighting vector, and the preset filter order.

[0125] It's important to note that the expected amplitude response refers to the signal amplitude (gain) level that's expected at a specific frequency point when designing a filter. In audio processing, this is often a target frequency response curve, used to guide filter design to achieve the desired gain or attenuation at a specific frequency point. For example, if you want to increase the intensity of a sound at a certain frequency point, the expected amplitude response at that frequency point would be set to a higher gain value; conversely, if you want to reduce the intensity of a sound at a certain frequency point, you would set a lower gain value.

[0126] Frequency locations refer to the specific locations of specific frequencies on a frequency response curve. These locations, typically measured in Hertz (Hz), represent the distribution of different frequency components within an audio signal. In audio processing, frequency locations are used to identify specific frequency ranges that require adjustment, such as peaks (frequency points with high sound intensity) and troughs (frequency points with low sound intensity). By accurately identifying these frequency locations, filters can be designed to optimize the frequency response characteristics of an audio signal.

[0127] A weight vector is a set of numerical values ​​used to weight the amplitude response at different frequencies during filter design. These values ​​reflect the importance of each frequency in the design objective. In audio processing, weight vectors are often used in optimization algorithms such as the least squares method to ensure that the filter achieves a more accurate amplitude response at critical frequencies. For example, if a frequency has a significant impact on sound quality, a higher weight can be assigned to that frequency, bringing the filter's performance at that frequency closer to the desired value.

[0128] The preset filter order is the order set during filter design, affecting the filter's complexity and frequency selectivity. A higher order results in a steeper transition band near the cutoff frequency, but this may also introduce increased phase distortion and computational complexity. It is used to create a trade-off between the filter's frequency selectivity and phase characteristics. For example, a higher filter order might be chosen for applications requiring fine-tuning at specific frequencies.

[0129] As you can understand, first, the peaks and troughs of the current frequency response curve are identified; these are the key frequency points that require adjustment. Next, the desired amplitude response at these frequency points is determined—that is, the ideal gain values ​​of the target frequency response curve at these frequency points. Then, based on the frequency point locations and the desired amplitude response, combined with the preset filter order, an optimization problem is constructed, typically solved using algorithms such as the least squares method. During this process, a weighting vector is used to weight the amplitude responses at different frequencies to ensure accurate adjustment of the key frequency points. Finally, by solving the optimization problem, the coefficients of the maximum phase filter are obtained.

[0130] As an example, the step of calculating the maximum phase filter coefficient based on the expected amplitude response, frequency point position, weighting vector and preset filter order of the peaks and troughs in the current frequency response curve includes: constructing a linear equation group according to the expected amplitude response, frequency point position, weighting vector and preset filter order of the peaks and troughs in the current frequency response curve; solving the linear equation group to obtain linear phase filter coefficients; obtaining minimum phase filter coefficients according to the linear phase filter coefficients, a preset all-one function and a preset all-zero function; and flipping the minimum phase filter coefficients to obtain maximum phase filter coefficients.

[0131] In filter design, a linear equation system is a set of linear equations constructed based on the expected amplitude response, frequency point location, weighting vector, and preset filter order. It describes the relationship between the filter coefficients and the expected frequency response. The formula is as follows:

[0132] H0(i)=cos(-1*pi*f(i)*j)*sqrt(w(i)),

[0133] i=0,1,2,…N-1,j=0,1,2,…,M-1

[0134] H1(i)=sin(-1*pi*f(i)*j)*sqrt(w(i)),

[0135] i=0,1,2,…N-1,j=0,1,2,…,M-1

[0136] A=[H0;H1]

[0137] b=d(i)*sqrt(w(i)),i=0,1,2,…N-1

[0138] A*x=b

[0139] Among them, H0(i) and H1(i) represent the cosine and sine functions, respectively, which are used to construct the frequency response of the filter; f(i) refers to the frequency point, which is usually the frequency position specified when designing the filter; w(i) is the weight function, which is used to adjust the importance of different frequency points; A is a matrix composed of H0 and H1. This matrix is ​​used to represent the frequency response characteristics of the filter; b is a vector representing the desired frequency response; d(i) is the desired amplitude response, that is, the gain value you hope to achieve at a specific frequency point when designing the filter; x is the unknown filter coefficient vector, which needs to be solved.

[0140] Linear phase filter coefficients are obtained by solving a system of linear equations. These coefficients define a linear phase filter. A linear phase filter has a linear phase response, meaning the phase varies linearly with frequency. This ensures that the signal's time domain waveform is not distorted by phase distortion.

[0141] The preset all-one function refers to a vector or matrix with all ones used in the calculation process, which is used as a weight or coefficient when constructing a linear equation system and calculating the minimum phase filter coefficient.

[0142] The preset all-zero function refers to a vector or matrix containing all zeros used in the calculation process, and is used as an initial value or placeholder when constructing a linear equation system and calculating minimum phase filter coefficients.

[0143] Minimum phase filter coefficients are derived from linear phase filter coefficients using a specific algorithm (such as the real cepstrum method). These coefficients define a minimum phase filter. A minimum phase filter has the smallest phase delay, meaning it has the smallest phase variation within the passband of all possible filters.

[0144] First, a system of linear equations is constructed based on the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency location, the weighting vector, and the preset filter order. This system of equations integrates these parameters to form a mathematical model, providing the basis for the subsequent calculation of the filter coefficients. Second, this system of linear equations is solved mathematically to obtain the linear phase filter coefficients. Then, using these linear phase filter coefficients, combined with the preset all-ones function and all-zeros function, the minimum phase filter coefficients are calculated using specific algorithms such as the real cepstrum method. This step is to convert the linear phase filter into a minimum phase filter so that the phase characteristics can be further optimized in subsequent steps. Finally, the minimum phase filter coefficients are flipped to obtain the maximum phase filter coefficients. The flipping operation is to convert the phase characteristics of the minimum phase filter into maximum phase characteristics, thereby achieving the required phase adjustment at specific frequency points to optimize the frequency response characteristics of the audio signal at the peaks and troughs and improve the sound quality.

[0145] As an example, the step of obtaining the minimum phase filter coefficient based on the linear phase filter coefficient, the preset all-one function and the preset all-zero function includes: performing fast Fourier transform on the linear phase filter coefficient to obtain a frequency domain amplitude spectrum; taking the natural logarithm of the frequency domain amplitude spectrum and performing inverse fast Fourier transform to obtain a time domain signal; obtaining a weighting function based on the preset all-one function, the preset all-zero function and the length of the linear phase filter coefficient; and generating the minimum phase filter coefficient based on the time domain signal and the weighting function.

[0146] The frequency domain amplitude spectrum refers to the signal amplitude distribution obtained by converting the linear phase filter coefficients from the time domain to the frequency domain through FFT (Fast Fourier Transform). It reflects the gain characteristics of the filter at different frequencies and is a complex modulus that represents the intensity of each frequency component.

[0147] The time-domain signal is the signal obtained by converting the frequency-domain amplitude spectrum back to the time domain using the Inverse Fast Fourier Transform (IFFT). This signal contains the filter's characteristics in the time dimension and reflects the filter's impulse response. In filter design, the time-domain signal is used for further processing and analysis, such as calculating the real cepstrum.

[0148] A weighting function is a function used to weight the time domain signal during calculations. It is typically generated based on a preset all-ones function and all-zeros function, as well as the length of the linear phase filter coefficients. The weighting function is used to weight signals at different time points in the least squares method or other optimization algorithms to ensure accurate adjustment of key frequency points. The formula is as follows:

[0149]

[0150] Among them, M is the length of the FIR linear phase filter coefficient, ones is the all-one function, zeros is the all-zero function, and the obtained weighting function wn is an M*2 matrix.

[0151] FIR minimum phase filter coefficient calculation formula:

[0152] y=real(ifft(exp(fft(wn′.*real(ifft(log(abs(fft(x)))))))))

[0153]

[0154] Where x is the original time-domain signal or filter coefficient sequence, fft refers to the fast Fourier transform operation, abs is the modulo operation, log is the natural logarithm operation, ifft is the inverse fast Fourier transform operation, real() takes the real part of the complex number in the brackets, wn' is the transpose of the weighting function, exp is the exponential function of the frequency-domain signal, and y is a vector of size 1*M / 2, i.e., the FIR minimum phase filter coefficient; flipping y obtains the FIR maximum phase filter coefficient. Flipping refers to reversing the filter coefficient sequence. For example, a sequence b0,b1,b2,...,bN becomes bN,bN-1,...,b1,b0 after flipping.

[0155] First, perform FFT on the linear phase filter coefficients, convert these coefficients from the time domain to the frequency domain, and obtain the frequency domain amplitude spectrum. This step is to analyze the frequency response characteristics of the filter in the frequency domain, which is convenient for subsequent processing and adjustment. Next, take the natural logarithm of the obtained frequency domain amplitude spectrum, and convert the multiplication relationship of the amplitude spectrum into an addition relationship. This can simplify subsequent mathematical operations. Then, perform IFFT on the frequency domain amplitude spectrum after taking the logarithm, and convert it back to the time domain to obtain the time domain signal. Then, based on the preset all-one function, all-zero function and the length of the linear phase filter coefficient, a weighting function is generated. This weighting function is used to perform weighted processing on the time domain signal in subsequent steps to optimize the performance of the filter and ensure the adjustment accuracy of the key frequency points. Finally, the time domain signal is multiplied by the transpose of the weighting function to obtain the weighted time domain signal. The signal is then FFTed to obtain the frequency domain representation. The exponential function is taken to restore the amplitude spectrum, which corresponds to the inverse process of taking the logarithm. Then IFFT is performed to obtain the time domain signal. The real part is taken to obtain the real part, which is the FIR minimum phase filter coefficient. This step is to extract the minimum phase filter coefficient from the linear phase filter coefficient for subsequent phase adjustment and filter design to optimize the frequency response characteristics of the audio signal at the peaks and troughs and improve the sound quality.

[0156] This embodiment first calculates all-pass filter coefficients based on the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and a preset quality factor. By accurately calculating the numerator and denominator coefficients of the all-pass filter, it can specifically adjust the phase characteristics of key frequency points, reduce phase distortion at the crossover point, and provide precise parameter support for fine-grained phase adjustment. Next, it calculates the maximum phase filter coefficients based on the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency locations, the weighting vector, and the preset filter order. This step identifies the frequency locations and expected amplitude response of the peaks and troughs, combines the weighting vector and the filter order, and constructs and solves an optimization problem to obtain the maximum phase filter coefficients. This process fine-tunes the peaks and troughs in the frequency response curve, improving the flatness of the frequency response curve and making it smoother, reducing the impact of peaks and troughs on sound quality. The resulting adjusted audio signal achieves a more balanced and natural sound reproduction effect, significantly improving sound quality and meeting the requirements of high-fidelity audio systems.

[0157] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the phase adjustment method of the audio signal of the present application. More forms of simple transformations based on this technical concept are all within the scope of protection of the present application.

[0158] This application also provides a phase adjustment device for an audio signal, please refer to Figure 3 , the phase adjustment device of the audio signal includes:

[0159] The signal processing module 10 is used to perform frequency division processing, delay compensation and equalizer adjustment on the input audio signal to obtain an initial processed signal;

[0160] a measuring module 20, configured to output the initial processed signal to a target speaker and measure a current frequency response curve of the target speaker;

[0161] A coefficient determination module 30 is used to determine the all-pass filter coefficient and the maximum phase filter coefficient according to the crossover points and peaks and troughs in the current frequency response curve;

[0162] a phase adjustment module 40, configured to perform phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal;

[0163] The iterative control module 50 is configured to output the adjusted audio signal to the target speaker and return to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets a preset flatness requirement, thereby completing the phase adjustment.

[0164] In one embodiment, the coefficient determination module 30 is further configured to calculate all-pass filter coefficients based on the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and a preset quality factor; and calculate maximum phase filter coefficients based on the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point position, the weighting vector, and the preset filter order.

[0165] In one embodiment, the coefficient determination module 30 is further configured to calculate a normalized angular frequency based on the center frequency of the crossover point in the current frequency response curve and the sampling frequency; calculate a numerator coefficient and a denominator coefficient of the all-pass filter based on the normalized angular frequency and a preset quality factor; and obtain the all-pass filter coefficient based on the numerator coefficient and the denominator coefficient.

[0166] In one embodiment, the coefficient determination module 30 is further configured to construct a system of linear equations based on the expected amplitude response of peaks and troughs in the current frequency response curve, the frequency point positions, the weighting vectors, and the preset filter order; solve the system of linear equations to obtain linear phase filter coefficients; obtain minimum phase filter coefficients based on the linear phase filter coefficients, a preset all-ones function, and a preset all-zeros function; and perform a flip operation on the minimum phase filter coefficients to obtain maximum phase filter coefficients.

[0167] In one embodiment, the coefficient determination module 30 is further used to perform a fast Fourier transform on the linear phase filter coefficients to obtain a frequency domain amplitude spectrum; take the natural logarithm of the frequency domain amplitude spectrum and perform an inverse fast Fourier transform to obtain a time domain signal; obtain a weighting function based on a preset all-one function, a preset all-zero function and the length of the linear phase filter coefficients; and generate a minimum phase filter coefficient based on the time domain signal and the weighting function.

[0168] In one embodiment, the phase adjustment module 40 is further configured to, when an infinite impulse response all-pass filter is selected, construct the infinite impulse response all-pass filter based on the all-pass filter coefficients; adjust the phase offset at the crossover point of the initial processed signal using the infinite impulse response all-pass filter to obtain an adjusted audio signal; when a finite impulse response maximum phase filter is selected, construct the finite impulse response maximum phase filter based on the maximum phase filter coefficients; adjust the phase offset at the peaks and troughs of the initial processed signal using the finite impulse response maximum phase filter to obtain an adjusted audio signal; and when both the all-pass filter and the maximum phase filter are selected, adjust the phase offset at the crossover point of the initial processed signal using the infinite impulse response all-pass filter, and adjust the phase offset at the peaks and troughs of the initial processed signal using the finite impulse response maximum phase filter to obtain an adjusted audio signal.

[0169] In one embodiment, the signal processing module 10 is further used to perform frequency division processing on the input audio signal according to a preset frequency division point, a preset frequency division order, and a preset frequency division type to obtain a frequency division signal; calculate a delay coefficient based on the distance between the target speaker and the listening position; perform delay compensation on the frequency division signal according to the delay coefficient to obtain a compensated frequency division signal; and perform gain adjustment on the compensated frequency division signal according to a preset equalizer coefficient to obtain an initial processed signal.

[0170] The audio signal phase adjustment device provided in this application, employing the audio signal phase adjustment method described in the aforementioned embodiments, can address the technical problem of optimizing a loudspeaker's frequency response curve by improving phase distortion at the crossover point and at the peaks and valleys of the frequency response curve through fine phase adjustment. Compared to the prior art, the audio signal phase adjustment device provided in this application achieves the same beneficial effects as the audio signal phase adjustment method described in the aforementioned embodiments. Other technical features of the audio signal phase adjustment device are the same as those disclosed in the aforementioned embodiments and are not further elaborated here.

[0171] The present application provides a phase adjustment device for an audio signal, the phase adjustment device for an audio signal comprising: 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 so that the at least one processor can execute the phase adjustment method for an audio signal in the above-mentioned embodiment 1.

[0172] Reference below Figure 4 , which shows a schematic structural diagram of a phase adjustment device for audio signals suitable for implementing embodiments of the present application. The phase adjustment device for audio signals in 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), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The phase adjustment device for the audio signal shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0173] like Figure 4As shown, the phase adjustment device for audio signals may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a ROM (Read Only Memory) 1002 or a program loaded from a storage device 1003 into a RAM (Random Access Memory) 1004. Various programs and data required for the operation of the phase adjustment device for audio signals are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to I / O interface 1006: input device 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output device 1008 including, for example, an LCD (Liquid Crystal Display), speaker, vibrator, etc.; storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and communication device 1009. Communication device 1009 may allow the phase adjustment device for audio signals to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows the phase adjustment device for audio signals with various systems, it should be understood that implementation or presence of all the illustrated systems is not required. More or fewer systems may alternatively be implemented or present.

[0174] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0175] The audio signal phase adjustment device provided in this application, employing the audio signal phase adjustment method of the aforementioned embodiment, can address the technical problem of improving phase distortion at the crossover point and at the peaks and valleys of the frequency response curve through fine phase adjustment, thereby optimizing the speaker's frequency response curve. Compared to the prior art, the audio signal phase adjustment device provided in this application achieves the same beneficial effects as the audio signal phase adjustment method provided in the aforementioned embodiment. Other technical features of this audio signal phase adjustment device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.

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

[0177] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

[0178] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the phase adjustment method of the audio signal in the above embodiment.

[0179] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash memory), optical fiber, CD-ROM (CD-Read Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination thereof. 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, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0180] The computer-readable storage medium may be included in the phase adjustment device for audio signals, or may exist independently without being incorporated into the phase adjustment device for audio signals.

[0181] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the phase adjustment device for an audio signal, the phase adjustment device for an audio signal: performs frequency division processing, delay compensation, and equalizer adjustment on an input audio signal to obtain an initial processed signal; outputs the initial processed signal to a target speaker and measures a current frequency response curve of the target speaker; determines an all-pass filter coefficient and a maximum phase filter coefficient based on the crossover points and peaks and troughs in the current frequency response curve; performs phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal; outputs the adjusted audio signal to the target speaker, and returns to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets a preset flatness requirement, thereby completing the phase adjustment.

[0182] The computer program code for performing the operations of the present application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).

[0183] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0184] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0185] The computer-readable storage medium provided herein stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned audio signal phase adjustment method. This computer-readable storage medium addresses the technical problem of optimizing a loudspeaker's frequency response curve by improving phase distortion at the crossover point and at the peaks and valleys of the frequency response curve through fine phase adjustment. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided herein are similar to those of the audio signal phase adjustment method provided in the aforementioned embodiments and are not further elaborated here.

[0186] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for adjusting the phase of an audio signal when executed by a processor.

[0187] The computer program product provided in this application solves the technical problem of optimizing a loudspeaker's frequency response curve by improving phase distortion at the crossover point and at the peaks and valleys of the frequency response curve through precise phase adjustment. Compared to the prior art, the beneficial effects of the computer program product provided in this application are similar to those of the audio signal phase adjustment method provided in the aforementioned embodiments, and are not further elaborated here.

[0188] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for adjusting the phase of an audio signal, characterized in that: The method comprises: Perform frequency division processing, delay compensation and equalizer adjustment on the input audio signal to obtain the initial processed signal; Outputting the initial processed signal to a target speaker and measuring a current frequency response curve of the target speaker; Determining all-pass filter coefficients and maximum phase filter coefficients according to the crossover points and peaks and troughs in the current frequency response curve; performing phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal; The adjusted audio signal is output to the target speaker, and the process returns to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets the preset flatness requirement, thereby completing the phase adjustment.

2. The method according to claim 1, wherein The step of determining the all-pass filter coefficient and the maximum phase filter coefficient according to the crossover points and the peaks and troughs in the current frequency response curve comprises: Calculating all-pass filter coefficients according to the center frequency of the crossover point in the current frequency response curve, the sampling frequency, and a preset quality factor; The maximum phase filter coefficient is calculated according to the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point position, the weighting vector and the preset filter order.

3. The method according to claim 2, wherein The step of calculating the all-pass filter coefficient according to the center frequency of the crossover point in the current frequency response curve, the sampling frequency and the preset quality factor includes: Calculating a normalized angular frequency according to the center frequency of the crossover point in the current frequency response curve and the sampling frequency; Calculating a numerator coefficient and a denominator coefficient of an all-pass filter according to the normalized angular frequency and a preset quality factor; An all-pass filter coefficient is obtained according to the numerator coefficient and the denominator coefficient.

4. The method according to claim 2, wherein The step of calculating the maximum phase filter coefficient according to the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point position, the weighting vector and the preset filter order includes: Constructing a system of linear equations based on the expected amplitude response of the peaks and troughs in the current frequency response curve, the frequency point positions, the weighting vectors, and the preset filter order; Solving the linear equations to obtain linear phase filter coefficients; Obtaining a minimum phase filter coefficient according to the linear phase filter coefficient, a preset all-ones function, and a preset all-zeros function; Perform a flip operation on the minimum phase filter coefficient to obtain a maximum phase filter coefficient.

5. The method according to claim 4, wherein The step of obtaining the minimum phase filter coefficient according to the linear phase filter coefficient, the preset all-ones function and the preset all-zeros function comprises: Performing a fast Fourier transform on the linear phase filter coefficients to obtain a frequency domain amplitude spectrum; Taking the natural logarithm of the frequency domain amplitude spectrum and performing an inverse fast Fourier transform to obtain a time domain signal; Obtaining a weighting function according to a preset all-ones function, a preset all-zeros function, and the length of the linear phase filter coefficient; Minimum phase filter coefficients are generated based on the time domain signal and the weighting function.

6. The method according to claim 1, wherein The step of performing phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal comprises: When an infinite impulse response all-pass filter is selected, constructing the infinite impulse response all-pass filter according to the all-pass filter coefficients; adjusting the phase offset at the crossover point of the initial processed signal by using the infinite impulse response all-pass filter to obtain an adjusted audio signal; When a finite impulse response maximum phase filter is selected, constructing the finite impulse response maximum phase filter according to the maximum phase filter coefficients; adjusting the phase offsets at the peaks and troughs of the initial processed signal by using the finite impulse response maximum phase filter to obtain an adjusted audio signal; When the all-pass filter and the maximum phase filter are selected, the phase offset at the crossover point of the initial processed signal is adjusted by the infinite impulse response all-pass filter, and the phase offset at the peaks and troughs of the initial processed signal is adjusted by the finite impulse response maximum phase filter to obtain an adjusted audio signal.

7. The method according to any one of claims 1 to 6, characterized in that The step of performing frequency division processing, delay compensation, and equalizer adjustment on the input audio signal to obtain an initial processed signal includes: Perform frequency division processing on the input audio signal according to a preset frequency division point, a preset frequency division order, and a preset frequency division type to obtain a frequency division signal; Calculate the delay factor based on the distance between the target speaker and the listening position; Performing delay compensation on the frequency-divided signal according to the delay coefficient to obtain a compensated frequency-divided signal; The compensated frequency-divided signal is gain-adjusted according to a preset equalizer coefficient to obtain an initial processed signal.

8. A phase adjustment device for an audio signal, characterized in that: The device comprises: The signal processing module is used to perform frequency division processing, delay compensation and equalizer adjustment on the input audio signal to obtain the initial processed signal; a measuring module, configured to output the initial processed signal to a target speaker and measure a current frequency response curve of the target speaker; A coefficient determination module, configured to determine an all-pass filter coefficient and a maximum phase filter coefficient according to the crossover points and peaks and troughs in the current frequency response curve; a phase adjustment module, configured to perform phase adjustment on the initial processed signal based on the all-pass filter coefficient or the maximum phase filter coefficient to obtain an adjusted audio signal; The iterative control module is configured to output the adjusted audio signal to the target speaker and return to the step of measuring the current frequency response curve of the target speaker until the current frequency response curve meets a preset flatness requirement, thereby completing the phase adjustment.

9. A phase adjustment device for an audio signal, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for adjusting the phase of an audio signal according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for adjusting the phase of an audio signal according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Audio signal enhancement method in tunnel environment based on directional sound waves

    CN121922145A