A method and system for digital audio signal processing based on delay compensation
By performing delay compensation processing on the stereo audio signal, the crosstalk problem between speakers was solved, achieving accurate sound source localization and a wide sound field experience, while reducing the consumption of computing resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU DISCUS INFORMATION TECH CO LTD
- Filing Date
- 2026-05-18
- Publication Date
- 2026-06-12
AI Technical Summary
Traditional stereo playback systems cannot effectively handle crosstalk between speakers, resulting in blurred sound image positioning, compressed stereo spatial perception, and an inability to create a spacious listening experience.
By acquiring the original left and right channel audio signals, performing signal preprocessing and phase inversion, calculating the delay based on the distance difference between the speaker and the ear, performing delay inversion, and then performing addition and superposition operations in the digital domain to generate a mixed audio signal to drive the speaker to produce sound.
It effectively solves the crosstalk problem between speakers, enhances auditory separation, makes sound source localization more accurate, achieves a wide virtual sound field experience, and reduces computing resource consumption.
Smart Images

Figure CN122205318A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital audio signal processing technology, specifically relating to a digital audio signal processing method and system based on delay compensation. Background Technology
[0002] With the widespread use of portable electronic devices, users' demands for immersive stereo sound effects are increasing. Traditional stereo playback systems simply output left and right channel signals to their respective speakers, ignoring the physiological characteristics of human hearing. In actual listening, the left ear receives not only the direct sound from the left speaker but also the sound from the right speaker after diffraction and attenuation (crosstalk). This physical crosstalk causes interference between the left and right channel information, blurring the sound image localization and compressing the sense of stereo space, failing to create a spacious external listening experience. Current technology lacks an active processing mechanism for this crosstalk sound wave, resulting in a significant reduction in the realism of audio reproduction.
[0003] As mentioned above, how to provide a delay-compensated digital audio signal processing method and system that achieves stereo effect through digital signal processing using only two speakers and reduces computational costs has become an urgent problem to be solved. Summary of the Invention
[0004] The purpose of this invention is to provide a digital audio signal processing method and system based on delay compensation, so as to solve the above-mentioned problems existing in the prior art.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a digital audio signal processing method based on delay compensation, comprising: The original left channel audio signal and the original right channel audio signal are acquired. The original left channel audio signal and the original right channel audio signal are preprocessed to obtain the left channel audio signal and the right channel audio signal. The left channel audio signal and the right channel audio signal are inverted to obtain the inverted left channel signal and the inverted right channel signal. The inverted left channel signal and the inverted right channel signal are respectively delayed to obtain delayed inverted left channel signal and delayed inverted right channel signal, wherein the delay amount of the delay processing is determined according to the distance difference from the speaker to the two ears. The delayed, inverted left channel signal and the right channel audio signal are added together in the digital domain to generate a first mixed audio signal. The delayed, inverted right channel signal and the left channel audio signal are added together in the digital domain to generate a second mixed audio signal. The first mixed audio signal is output to the right channel amplifier to drive the right speaker to produce sound, and the second mixed audio signal is output to the left channel amplifier to drive the left speaker to produce sound.
[0006] In one possible design, the original left channel audio signal and the original right channel audio signal are acquired, and the original left channel audio signal and the original right channel audio signal are preprocessed to obtain the left channel audio signal and the right channel audio signal, including: The original audio data stream is acquired through the SoC, and the original audio data stream is separated into channels to obtain the original left channel audio signal and the original right channel audio signal. The original left channel audio signal and the original right channel audio signal are subjected to data formatting and digital filtering to obtain the pre-left channel audio signal and the pre-right channel audio signal; Based on the dynamic range control algorithm, the signal range of the pre-left channel audio signal and the pre-right channel audio signal is compressed to obtain the left channel audio signal and the right channel audio signal.
[0007] In one possible design, the left channel audio signal and the right channel audio signal are inverted to obtain an inverted left channel signal and an inverted right channel signal, including: Invert the sign bits of the left channel audio signal and the right channel audio signal respectively to obtain the pre-inverted left channel signal and the pre-inverted right channel signal; The pre-inverted left channel signal and the pre-inverted right channel signal are respectively subjected to last bit complement to obtain the inverted left channel signal and the inverted right channel signal.
[0008] In one possible design, the inverted left channel signal and the inverted right channel signal are respectively delayed to obtain a delayed inverted left channel signal and a delayed inverted right channel signal, including: Based on a preset delay, a first circular buffer and a second circular buffer are established, wherein the storage capacity of the first circular buffer and the second circular buffer is greater than the number of audio sampling points corresponding to the delay. Write the inverted left channel signal to the current position of the write pointer in the first circular buffer, and write the inverted right channel signal to the current position of the write pointer in the second circular buffer; Based on the preset delay, the read pointer offset in the first and second circular buffers is calculated, so as to read the offset channel signal of the current position of the write pointer from the first and second circular buffers according to the read pointer offset in the first and second circular buffers. The offset channel signal is used as the delayed phase-inverted left channel signal and the delayed phase-inverted right channel signal.
[0009] In one possible design, the method for presetting the delay amount includes: Obtain the distance from the speaker to the ear on the same side and the distance from the speaker to the ear on the opposite side. Calculate the distance difference between the speaker and the ear on the same side and the ear on the opposite side based on these distances. ; The delay amount is calculated using the following formula (1). : (1) in, Speed of sound; Accordingly, based on the preset delay, the read pointer offsets in the first and second circular buffers are calculated, including: Obtain the preset audio sampling frequency, and based on the delay and the audio sampling frequency, calculate the read pointer offset in the first and second circular buffers using the following formula (2). ; (2) in, This is the preset audio sampling frequency.
[0010] In one possible design, the delayed-phase inverted left channel signal and the right channel audio signal are added together in the digital domain to generate a first mixed audio signal, and the delayed-phase inverted right channel signal and the left channel audio signal are added together in the digital domain to generate a second mixed audio signal, including: Extract the corresponding right channel audio time information from the right channel audio signal, and perform addition and superposition operations on the delayed inverted left channel signal and the right channel audio signal at the same time in the digital domain based on the right channel audio time information to generate a first mixed audio signal; Extract the corresponding left channel audio time information from the left channel audio signal, and perform addition and superposition operations on the delayed inverted right channel signal and the left channel audio signal at the same time in the digital domain based on the left channel audio time information to generate a second mixed audio signal.
[0011] In one possible design, the first mixed audio signal is output to the right channel amplifier to drive the right speaker, and the second mixed audio signal is output to the left channel amplifier to drive the left speaker, including: The first mixed audio signal and the second mixed audio signal are converted from digital to analog to obtain a first mixed audio analog signal corresponding to the first mixed audio signal and a second mixed audio analog signal corresponding to the second mixed audio signal; The first mixed audio analog signal is output to the input of the right channel power amplifier to generate a right channel high-power audio analog signal, and the second mixed audio analog signal is output to the input of the left channel power amplifier to generate a left channel high-power audio analog signal. The high-power analog audio signal of the right channel is output to the voice coil of the right speaker to drive the right speaker to vibrate and produce sound, and the high-power analog audio signal of the left channel is output to the voice coil of the left speaker to drive the left speaker to vibrate and produce sound.
[0012] Secondly, the present invention provides a digital audio signal processing system based on delay compensation, comprising: The channel signal inversion processing unit is used to acquire the original left channel audio signal and the original right channel audio signal, perform signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal, and perform inversion processing on the left channel audio signal and the right channel audio signal to obtain the inverted left channel signal and the inverted right channel signal. The channel signal delay processing unit is used to perform delay processing on the inverted left channel signal and the inverted right channel signal respectively to obtain the delayed inverted left channel signal and the delayed inverted right channel signal; An audio signal mixing output unit is used to perform an addition and superposition operation on the delayed and inverted left channel signal and the right channel audio signal in the digital domain to generate a first mixed audio signal, perform an addition and superposition operation on the delayed and inverted right channel signal and the left channel audio signal in the digital domain to generate a second mixed audio signal, output the first mixed audio signal to the right channel power amplifier to drive the right speaker to produce sound, and output the second mixed audio signal to the left channel power amplifier to drive the left speaker to produce sound.
[0013] Thirdly, the present invention provides an electronic device comprising a memory, a processor, and a transceiver connected in sequence and communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the delay-compensated digital audio signal processing method as described in the first aspect or any possible design of the first aspect.
[0014] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the delay-compensated digital audio signal processing method described in the first aspect or any possible design of the first aspect.
[0015] Fifthly, the present invention provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform a delay-compensated digital audio signal processing method as described in the first aspect or any possible design of the first aspect.
[0016] Beneficial Effects: This invention provides a digital audio signal processing method and system based on delay compensation, comprising: first, acquiring the original left channel audio signal and the original right channel audio signal; performing signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal; and then performing phase inversion processing on the left channel audio signal and the right channel audio signal to obtain the phase-inverted left channel signal and the phase-inverted right channel signal; second, performing delay processing on the phase-inverted left channel signal and the phase-inverted right channel signal respectively to obtain the delayed phase-inverted left channel signal. The system generates a first mixed audio signal and a second mixed audio signal by adding the delayed, inverted right channel signal and the right channel audio signal in the digital domain. The delay amount is determined based on the distance difference between the speaker and each ear. The system then adds the delayed, inverted left channel signal and the right channel audio signal in the digital domain to generate a second mixed audio signal. The first mixed audio signal is output to the right channel amplifier to drive the right speaker, and the second mixed audio signal is output to the left channel amplifier to drive the left speaker. By introducing cross-channel delayed, inverted superposition, the system effectively solves the problem of narrow sound field caused by crosstalk in traditional stereo systems. By accurately calculating the delay amount corresponding to the speaker spacing and listening distance, and then superimposing the channel signals after inverted delay processing back into the original channel, the crosstalk sound waves reaching the opposite ear are actively canceled in physical space using the principle of destructive interference of sound waves. This greatly enhances the auditory separation of both ears, making sound source localization more accurate and clear. Ultimately, this allows users to experience a virtual sound field that is wider and more immersive than the spacing between physical speakers, achieving a leap in experience from "planar listening" to "spatial listening." Moreover, this method only involves simple addition, subtraction, and delay operations, with low computational load, reducing the consumption of computing resources and making it easy to implement in real time on low-power DSPs. Attached Figure Description
[0017] Figure 1 A flowchart illustrating the digital audio signal processing method based on delay compensation provided in an embodiment of the present invention; Figure 2 This is a functional structure diagram of a delay-compensated digital audio signal processing system provided in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.
[0019] It should be understood that although the terms first, second, etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, without departing from the scope of the exemplary embodiments of the invention.
[0020] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.
[0021] Example: like Figure 1 As shown, the first aspect of this embodiment provides a digital audio signal processing method based on delay compensation, which may include, but is not limited to, the following steps: S1. Acquire the original left channel audio signal and the original right channel audio signal, perform signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal, and perform phase inversion processing on the left channel audio signal and the right channel audio signal to obtain the phase inverted left channel signal and the phase inverted right channel signal. The digital audio signal processing method based on delay compensation provided in this embodiment is actually based on the experimental finding that "time difference compensation is far more important than intensity difference". By accurately aligning the time, the antiphase sound wave causes destructive interference with the direct sound at the opposite ear, without relying on a complex intensity difference adjustment algorithm. Thus, only two speakers are needed to achieve a stereo angle of 60°-75° in a wide listening distance range of 0.5 meters to 3 meters.
[0022] In steps S2 and S4, the delay amount is determined based on the geometric distance difference between the listener's ears and the left and right speakers. The delay amount ranges from 80μs to 150μs and corresponds to a delay of 4 to 7 sampling points at a sampling rate of 48kHz. Specifically, the delay amount of the delay processing is determined based on the distance difference between the left and right speakers and the listener's ears, so that the time difference between the inverted component of the right channel audio signal and the left channel audio signal at the left ear is less than a preset threshold, and the time difference between the inverted component of the left channel audio signal and the right channel audio signal at the right ear is less than a preset threshold.
[0023] In one possible implementation, step S1 involves acquiring the original left channel audio signal and the original right channel audio signal, and performing signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal. This can be decomposed into, but is not limited to, the following steps S11-S13, specifically including: S11. Obtain the original audio data stream through the SoC, and perform channel separation on the original audio data stream to obtain the original left channel audio signal and the original right channel audio signal; S12. Perform data formatting and digital filtering on the original left channel audio signal and the original right channel audio signal to obtain the pre-left channel audio signal and the pre-right channel audio signal; S13. Based on the dynamic range control algorithm, the signal range of the pre-left channel audio signal and the pre-right channel audio signal is compressed to obtain the left channel audio signal and the right channel audio signal.
[0024] In practical applications, the raw audio data stream typically comes from the audio interface of the SoC (System-on-a-Chip) (such as I2S, TDM). The SoC's DSP driver reads the raw data stream from the hardware registers and unpacks the packaged raw data stream to separate the independent left channel sample points and right channel sample points. The left channel sample points and right channel sample points are then integrated to form the raw left channel audio signal and the raw right channel audio signal.
[0025] It should be noted that in the digital audio signal processing method provided in this embodiment, since the various audio signals in the original left channel audio signal and the original right channel audio signal may come from different sources (such as high-level DVD signals and low-level streaming media), and the data bit widths between the various audio signals are different (such as 16-bit and 24-bit), which is not conducive to subsequent data processing, it is necessary to perform data formatting processing on the original left channel audio signal and the original right channel audio signal. The data formatting processing includes at least level normalization and format conversion. Specifically, the original left channel audio signal and the original right channel audio signal are first converted into a floating-point number or high-precision fixed-point number format preset by the DSP (such as Q28 format), and then the gain is adjusted to map the signal amplitude to the standard range of the algorithm processing (such as between -1.0 and 1.0) to prevent data overflow or precision loss in subsequent calculations.
[0026] Accordingly, in the digital audio signal processing method provided in this embodiment, in order to improve the efficiency of subsequent delay calculation and eliminate noise interference, it is necessary to digitally filter the original left channel audio signal and the original right channel audio signal. Specifically, since the speaker size of most portable devices (such as mobile phones and tablets) is small, they cannot reproduce ultra-low frequencies (below 60Hz). It is necessary to filter out the infrasound and ultra-low frequency components in the original signal by high-pass filtering (HPF). Therefore, it is necessary to run an infinite impulse response (IIR) or finite impulse response (FIR) filter algorithm in the DSP to perform high-pass filtering on the original left channel audio signal and the original right channel audio signal to prevent large-amplitude low frequencies from damaging the diaphragm of the miniature speaker, thereby eliminating the interference of low frequencies on phase cancellation. Since the low frequency signal has a long wavelength and complex phase relationship, after filtering, the subsequent delay compensation algorithm mainly processes the mid-high frequencies, and the cancellation effect will be more accurate and easier to implement.
[0027] Furthermore, the dynamic range control algorithm described in this embodiment can actually be implemented using a compressor algorithm to attenuate signals with excessively large instantaneous peak values and boost signals with excessively small instantaneous peak values, thereby ensuring that the dynamic range of the input signal is suitable for subsequent "inverting superposition" processing and avoiding clipping of the superimposed signal at the power amplifier end.
[0028] In one possible implementation, step S1 involves inverting the left channel audio signal and the right channel audio signal to obtain an inverted left channel signal and an inverted right channel signal. This can be, but is not limited to, decomposed into steps S14-S15, specifically including: S14. Invert the sign bits of the left channel audio signal and the right channel audio signal respectively to obtain the pre-inverted left channel signal and the pre-inverted right channel signal; S15. Perform last-bit complementation on the pre-inverted left channel signal and the pre-inverted right channel signal respectively to obtain the inverted left channel signal and the inverted right channel signal.
[0029] It should be noted that in the arithmetic unit (SOC) of a digital signal processing chip, the input left and right channel audio signals are multiplied by a constant -1. This can also be understood as using the two's complement property to invert all data bits of the left and right channel audio signals, and then adding 1 to the last bit, thereby generating the corresponding inverted left and right channel signals. This inversion process causes the waveforms of the output inverted left and right channel signals to be offset by 180 degrees in phase relative to the input left and right channel audio signals, providing a data basis for subsequent algebraic addition with the opposite channel signals and achieving destructive interference of sound waves.
[0030] When two sound waves with the same amplitude but opposite phase (180 degrees out of phase) meet, they will cancel each other out. Therefore, through this phase inversion process, a signal mirrored with the original signal is generated. After the mirrored signal is delayed, it is superimposed on the original signal at a specific position, thus ensuring that the sum of the values is 0, achieving destructive interference.
[0031] S2. Delay processing is performed on the inverted left channel signal and the inverted right channel signal respectively to obtain delayed inverted left channel signal and delayed inverted right channel signal, wherein the delay amount of the delay processing is determined according to the distance difference from the speaker to the two ears; In one possible implementation, step S2 involves delaying the inverted left channel signal and the inverted right channel signal to obtain a delayed inverted left channel signal and a delayed inverted right channel signal. This can be decomposed, but is not limited to, steps S21-S24, specifically including: S21. Based on a preset delay amount, a first circular buffer and a second circular buffer are established, wherein the storage capacity of the first circular buffer and the second circular buffer is greater than the number of audio sampling points corresponding to the delay amount; S22. Write the inverted left channel signal to the current position of the write pointer of the first circular buffer, and write the inverted right channel signal to the current position of the write pointer of the second circular buffer; S23. Calculate the read pointer offset in the first and second circular buffers according to the preset delay amount, so as to read the offset channel signal of the current position of the write pointer from the first and second circular buffers according to the read pointer offset in the first and second circular buffers; S24. The offset channel signal is used as the delayed phase-inverted left channel signal and the delayed phase-inverted right channel signal.
[0032] It should be noted that in the digital audio signal processing method provided in this embodiment, the size of the first circular buffer and the second circular buffer needs to be greater than the number of sampling points corresponding to the preset delay amount. When writing, the inverted left channel signal and the inverted right channel signal at the current moment need to be written to the current position of the write pointer of the first circular buffer and the second circular buffer respectively, so as to calculate the read pointer according to the preset delay amount, and read the historical data at the current position of the write pointer offset forward by multiple sampling points (determined based on the offset) from the first circular buffer and the second circular buffer as the offset channel signal. Furthermore, after each read and write operation, the position of the write pointer is updated, and when the pointer reaches the end of the circular buffer, it is reset to the beginning position of the circular buffer, thus forming a circular structure for cyclic data storage and reading.
[0033] Through this circular structure, the output data consists of delayed and inverted left and right channel signals that lag behind the input signal by a certain amount of time (delay). Specifically, the first and second circular buffers are actually fixed-size, contiguous, circular storage spaces in the DSP's RAM. The write pointer is used to write the current audio data into the circular buffer, and the read pointer is used to read data backward from the previously written position, find the delayed data, and output it. The distance between the write pointer and the read pointer determines the delay time of the delayed data.
[0034] In one possible implementation, the method for presetting the delay amount in step S21 includes: Obtain the distance from the speaker to the ear on the same side and the distance from the speaker to the ear on the opposite side. Calculate the distance difference between the speaker and the ear on the same side and the ear on the opposite side based on these distances. ; The delay amount is calculated using the following formula (1). : (1) in, Speed of sound; Accordingly, in step S23, the read pointer offsets in the first and second circular buffers are calculated based on a preset delay amount, including: Obtain the preset audio sampling frequency, and based on the delay and the audio sampling frequency, calculate the read pointer offset in the first and second circular buffers using the following formula (2). ; (2) in, This is the preset audio sampling frequency.
[0035] S3. The delayed and inverted left channel signal and the right channel audio signal are added together in the digital domain to generate a first mixed audio signal. The delayed and inverted right channel signal and the left channel audio signal are added together in the digital domain to generate a second mixed audio signal. The first mixed audio signal is output to the right channel power amplifier to drive the right speaker to produce sound, and the second mixed audio signal is output to the left channel power amplifier to drive the left speaker to produce sound.
[0036] In one possible implementation, step S3 involves performing an addition operation in the digital domain on the delayed, inverted left channel signal and the right channel audio signal to generate a first mixed audio signal, and performing an addition operation in the digital domain on the delayed, inverted right channel signal and the left channel audio signal to generate a second mixed audio signal. This can be broken down into, but is not limited to, the following steps S31-S32, specifically including: S31. Extract the corresponding right channel audio time information from the right channel audio signal, and perform addition and superposition operations on the delayed inverted left channel signal and the right channel audio signal at the same time in the digital domain based on the right channel audio time information to generate a first mixed audio signal; S32. Extract the corresponding left channel audio time information from the left channel audio signal, and perform addition and superposition operations on the delayed inverted right channel signal and the left channel audio signal at the same time in the digital domain based on the left channel audio time information to generate a second mixed audio signal.
[0037] It should be noted that when performing audio signal superposition calculations, the arithmetic unit of the digital signal processing chip (SOC) can perform addition and superposition operations in the digital domain on the delayed and inverted left channel signal and the right channel audio signal, as well as the delayed and inverted right channel signal and the left channel audio signal. Furthermore, in specific application scenarios, it is necessary to determine whether the summed result exceeds the physical quantization range of the digital audio system (e.g., the range of a 16-bit signed integer). If it does, it is truncated to the maximum allowable value or overall gain attenuation is applied to prevent clipping distortion caused by signal overflow. When processing the channel signals on both sides, the same addition and limiting processing is performed to generate the first and second mixed audio signals.
[0038] In one possible implementation, step S3, where the first mixed audio signal is output to the right channel amplifier to drive the right speaker to produce sound, and the second mixed audio signal is output to the left channel amplifier to drive the left speaker to produce sound, can be broken down into steps S33-S35, specifically including: S33. Perform digital-to-analog conversion on the first mixed audio signal and the second mixed audio signal to obtain a first mixed audio analog signal corresponding to the first mixed audio signal and a second mixed audio analog signal corresponding to the second mixed audio signal; S34. Output the first mixed audio analog signal to the input terminal of the right channel power amplifier to generate a right channel high-power audio analog signal, and output the second mixed audio analog signal to the input terminal of the left channel power amplifier to generate a left channel high-power audio analog signal. S35. Output the high-power audio analog signal of the right channel to the voice coil of the right speaker to drive the right speaker to vibrate and produce sound, and output the high-power audio analog signal of the left channel to the voice coil of the left speaker to drive the left speaker to vibrate and produce sound.
[0039] It should be noted that, in the digital audio signal processing method provided in this embodiment, before performing digital-to-analog signal conversion on the first mixed audio signal and the second mixed audio signal, the first mixed audio signal and the second mixed audio signal (digital signal) stored in the digital signal processing chip need to be transmitted in real time to the digital-to-analog converter (DAC) via an I2S serial bus. The DAC chip converts the received digital signal into a corresponding analog voltage signal (line level signal), forming the first mixed audio analog signal and the second mixed audio analog signal. Furthermore, both the first mixed audio analog signal and the second mixed audio analog signal are input to the input terminal of a power amplifier. The power amplifier amplifies the first mixed audio analog signal and the second mixed audio analog signal to generate a right-channel high-power audio analog signal and a left-channel high-power audio analog signal capable of driving the load. Finally, the amplified right-channel high-power audio analog signal and the left-channel high-power audio analog signal are transmitted to the voice coils of the right speaker and the left speaker respectively through wires to drive the speaker diaphragms on both sides to vibrate, thereby radiating sound waves into the air to produce sound.
[0040] In the prior art, the intensity difference technique of audio signals is a conventional technique in the field, and the sound field openness can be adjusted by changing the intensity difference of audio signals, which is also a conventional technique in the field; while the cross-drive processing method in this embodiment (i.e., the processed left signal (delayed and inverted left channel signal) drives the right speaker, and the processed right signal (delayed and inverted right channel signal) drives the left speaker) forms a "holographic projection" of audio in physical space to construct an interference field of sound waves and realize the expansion of the sound image in hearing.
[0041] like Figure 2 As shown, the second aspect of this embodiment provides a hardware system for implementing the delay-compensated digital audio signal processing method described in the first aspect of the embodiment, including: The channel signal inversion processing unit is used to acquire the original left channel audio signal and the original right channel audio signal, perform signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal, and perform inversion processing on the left channel audio signal and the right channel audio signal to obtain the inverted left channel signal and the inverted right channel signal. The channel signal delay processing unit is used to perform delay processing on the inverted left channel signal and the inverted right channel signal respectively to obtain the delayed inverted left channel signal and the delayed inverted right channel signal; An audio signal mixing output unit is used to perform an addition and superposition operation on the delayed and inverted left channel signal and the right channel audio signal in the digital domain to generate a first mixed audio signal, perform an addition and superposition operation on the delayed and inverted right channel signal and the left channel audio signal in the digital domain to generate a second mixed audio signal, output the first mixed audio signal to the right channel power amplifier to drive the right speaker to produce sound, and output the second mixed audio signal to the left channel power amplifier to drive the left speaker to produce sound.
[0042] The working process, working details and technical effects of the system provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.
[0043] like Figure 3 As shown, the third aspect of this embodiment provides an electronic device, including: a memory, a processor, and a transceiver that are sequentially and communicatively connected, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the delay-compensated digital audio signal processing method as described in the first aspect of the embodiment.
[0044] For specific examples, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state.
[0045] In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. For example, the processor may not be limited to microprocessors of the STM32F105 series, reduced instruction set computer (RISC) microprocessors, x86 architecture processors, or processors with integrated neural network processing units (NPUs). The transceiver may be, but is not limited to, a Wi-Fi transceiver, a Bluetooth transceiver, a General Packet Radio Service (GPRS) transceiver, a ZigBee (a low-power LAN protocol based on the IEEE 802.15.4 standard) transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver. Furthermore, the electronic device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0046] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.
[0047] The fourth aspect of this embodiment provides a storage medium that stores instructions for a delay-compensated digital audio signal processing method as described in the first aspect of the embodiment. That is, the storage medium stores instructions that, when executed on a computer, perform the delay-compensated digital audio signal processing method as described in the first aspect of the embodiment.
[0048] The storage medium refers to a carrier for storing data, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0049] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.
[0050] The fifth aspect of this embodiment provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the delay-compensated digital audio signal processing method as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0051] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A digital audio signal processing method based on delay compensation, characterized in that, include: The original left channel audio signal and the original right channel audio signal are acquired. The original left channel audio signal and the original right channel audio signal are preprocessed to obtain the left channel audio signal and the right channel audio signal. The left channel audio signal and the right channel audio signal are inverted to obtain the inverted left channel signal and the inverted right channel signal. The inverted left channel signal and the inverted right channel signal are respectively delayed to obtain delayed inverted left channel signal and delayed inverted right channel signal, wherein the delay amount of the delay processing is determined according to the distance difference from the speaker to the two ears. The delayed, inverted left channel signal and the right channel audio signal are added together in the digital domain to generate a first mixed audio signal. The delayed, inverted right channel signal and the left channel audio signal are added together in the digital domain to generate a second mixed audio signal. The first mixed audio signal is output to the right channel amplifier to drive the right speaker to produce sound, and the second mixed audio signal is output to the left channel amplifier to drive the left speaker to produce sound.
2. The digital audio signal processing method based on delay compensation according to claim 1, characterized in that, Acquire the original left channel audio signal and the original right channel audio signal, and perform signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal, including: The original audio data stream is acquired through the SoC, and the original audio data stream is separated into channels to obtain the original left channel audio signal and the original right channel audio signal. The original left channel audio signal and the original right channel audio signal are subjected to data formatting and digital filtering to obtain the pre-left channel audio signal and the pre-right channel audio signal; Based on the dynamic range control algorithm, the signal range of the pre-left channel audio signal and the pre-right channel audio signal is compressed to obtain the left channel audio signal and the right channel audio signal.
3. The digital audio signal processing method based on delay compensation according to claim 1, characterized in that, The left channel audio signal and the right channel audio signal are inverted to obtain an inverted left channel signal and an inverted right channel signal, including: Invert the sign bits of the left channel audio signal and the right channel audio signal respectively to obtain the pre-inverted left channel signal and the pre-inverted right channel signal; The pre-inverted left channel signal and the pre-inverted right channel signal are respectively subjected to last bit complement to obtain the inverted left channel signal and the inverted right channel signal.
4. The digital audio signal processing method based on delay compensation according to claim 1, characterized in that, The inverted left channel signal and the inverted right channel signal are respectively delayed to obtain a delayed inverted left channel signal and a delayed inverted right channel signal, including: Based on a preset delay, a first circular buffer and a second circular buffer are established, wherein the storage capacity of the first circular buffer and the second circular buffer is greater than the number of audio sampling points corresponding to the delay. Write the inverted left channel signal to the current position of the write pointer in the first circular buffer, and write the inverted right channel signal to the current position of the write pointer in the second circular buffer; Based on the preset delay, the read pointer offset in the first and second circular buffers is calculated, so as to read the offset channel signal of the current position of the write pointer from the first and second circular buffers according to the read pointer offset in the first and second circular buffers. The offset channel signal is used as the delayed phase-inverted left channel signal and the delayed phase-inverted right channel signal.
5. The digital audio signal processing method based on delay compensation according to claim 4, characterized in that, The method for presetting the delay amount includes: Obtain the distance from the speaker to the ear on the same side and the distance from the speaker to the ear on the opposite side. Calculate the distance difference between the speaker and the ear on the same side and the ear on the opposite side based on these distances. ; The delay amount is calculated using the following formula (1). : (1) in, Speed of sound; Accordingly, based on the preset delay, the read pointer offsets in the first and second circular buffers are calculated, including: Obtain the preset audio sampling frequency, and based on the delay and the audio sampling frequency, calculate the read pointer offset in the first and second circular buffers using the following formula (2). ; (2) in, This is the preset audio sampling frequency.
6. The digital audio signal processing method based on delay compensation according to claim 1, characterized in that, The process involves performing an addition operation in the digital domain on the delayed, inverted left channel signal and the right channel audio signal to generate a first mixed audio signal, and performing an addition operation in the digital domain on the delayed, inverted right channel signal and the left channel audio signal to generate a second mixed audio signal, including: Extract the corresponding right channel audio time information from the right channel audio signal, and perform addition and superposition operations on the delayed inverted left channel signal and the right channel audio signal at the same time in the digital domain based on the right channel audio time information to generate a first mixed audio signal; Extract the corresponding left channel audio time information from the left channel audio signal, and perform addition and superposition operations on the delayed inverted right channel signal and the left channel audio signal at the same time in the digital domain based on the left channel audio time information to generate a second mixed audio signal.
7. The digital audio signal processing method based on delay compensation according to claim 1, characterized in that, Outputting the first mixed audio signal to the right channel amplifier to drive the right speaker to produce sound, and outputting the second mixed audio signal to the left channel amplifier to drive the left speaker to produce sound, includes: The first mixed audio signal and the second mixed audio signal are converted from digital to analog to obtain a first mixed audio analog signal corresponding to the first mixed audio signal and a second mixed audio analog signal corresponding to the second mixed audio signal; The first mixed audio analog signal is output to the input of the right channel power amplifier to generate a right channel high-power audio analog signal, and the second mixed audio analog signal is output to the input of the left channel power amplifier to generate a left channel high-power audio analog signal. The high-power analog audio signal of the right channel is output to the voice coil of the right speaker to drive the right speaker to vibrate and produce sound, and the high-power analog audio signal of the left channel is output to the voice coil of the left speaker to drive the left speaker to vibrate and produce sound.
8. A digital audio signal processing system based on delay compensation, characterized in that, The method for processing digital audio signals based on delay compensation as described in any one of claims 1 to 7 includes: The channel signal inversion processing unit is used to acquire the original left channel audio signal and the original right channel audio signal, perform signal preprocessing on the original left channel audio signal and the original right channel audio signal to obtain the left channel audio signal and the right channel audio signal, and perform inversion processing on the left channel audio signal and the right channel audio signal to obtain the inverted left channel signal and the inverted right channel signal. The channel signal delay processing unit is used to perform delay processing on the inverted left channel signal and the inverted right channel signal respectively to obtain the delayed inverted left channel signal and the delayed inverted right channel signal; An audio signal mixing output unit is used to perform an addition and superposition operation on the delayed and inverted left channel signal and the right channel audio signal in the digital domain to generate a first mixed audio signal, perform an addition and superposition operation on the delayed and inverted right channel signal and the left channel audio signal in the digital domain to generate a second mixed audio signal, output the first mixed audio signal to the right channel power amplifier to drive the right speaker to produce sound, and output the second mixed audio signal to the left channel power amplifier to drive the left speaker to produce sound.
9. An electronic device, characterized in that, The device includes a memory, a processor, and a transceiver that are sequentially and communicatively connected. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the delay-compensated digital audio signal processing method as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or the instructions are executed by the computer, they implement the digital audio signal processing method based on delay compensation as described in any one of claims 1 to 7.