This application relates to the field of audio technologies, and in particular, to a method and an apparatus for determining a virtual speaker set.
A three-dimensional audio technology is an audio technology in which sound events and three-dimensional sound field information in real world are obtained, processed, transmitted, rendered, and played back via a computer, through signal processing, and the like. The three-dimensional audio technology makes sound have a strong sense of space, encirclement, and immersion, and gives people “virtual face-to-face” acoustic experience. Currently, a mainstream three-dimensional audio technology is a higher order ambisonics (HOA) technology. Because of a property that in recording and encoding, the HOA technology is irrelevant to a speaker layout during a playback stage and a feature of rotatability of data in an HOA format, the HOA technology has higher flexibility in three-dimensional audio playback, and therefore has gained more attention and wider research.
The HOA technology can convert an HOA signal into a virtual speaker signal, and then obtain, through mapping, a binaural signal for playback. In the foregoing process, even distribution of virtual speakers may achieve a best sampling effect. For example, the virtual speakers are distributed on vertices of a regular tetrahedron. However, in a three-dimensional space, there are only five types of regular polyhedrons: the regular tetrahedron, a regular hexahedron, a regular octahedron, a regular dodecahedron, and a regular icosahedron. Consequently, a quantity of virtual speakers that can be disposed is limited, and this is inapplicable to distribution of virtual speakers of a larger quantity.
This application provides a method and an apparatus for determining a virtual speaker set, so as to improve an audio signal playback effect.
According to a first aspect, this application provides a method for determining a virtual speaker set, including: determining a target virtual speaker from F preset virtual speakers based on a to-be-processed audio signal, where each of the F virtual speakers corresponds to S virtual speakers, F is a positive integer, and S is a positive integer greater than 1; and obtaining, from a preset virtual speaker distribution table, respective position information of S virtual speakers corresponding to the target virtual speaker, where the virtual speaker distribution table includes position information of K virtual speakers, the position information includes an elevation angle index and an azimuth angle index, K is a positive integer greater than 1, F≤K, and F×S≥K.
In this application, the virtual speaker distribution table is preset, so that a high average value of signal-to-noise ratios (SNRs) of HOA reconstructed signals can be obtained by deploying virtual speakers according to the distribution table, and the S virtual speakers having highest correlations with an HOA coefficient of the to-be-processed audio signal are selected based on such distribution, thereby achieving an optimal sampling effect and improving an audio signal playback effect.
In one embodiment, the determining a target virtual speaker from F preset virtual speakers based on a to-be-processed audio signal includes: obtaining a higher order ambisonics HOA coefficient of the audio signal; obtaining F groups of HOA coefficients corresponding to the F virtual speakers, where the F virtual speakers are in one-to-one correspondence with the F groups of HOA coefficients; and determining, as the target virtual speaker, a virtual speaker corresponding to a group of HOA coefficients that has a greatest correlation with the HOA coefficient of the audio signal and that is in the F groups of HOA coefficients.
Encoding analysis is performed on the to-be-processed audio signal. For example, sound field distribution of the to-be-processed audio signal is analyzed, including characteristics such as a quantity of sound sources, directivity, and dispersion of the audio signal, to obtain the HOA coefficient of the audio signal, and the HOA coefficient of the audio signal is used as one of determining conditions for determining how to select the target virtual speaker. A virtual speaker matching the to-be-processed audio signal may be selected based on the HOA coefficient of the to-be-processed audio signal and the HOA coefficients of candidate virtual speakers (namely, the foregoing F virtual speakers). In this application, the virtual speaker is referred to as the target virtual speaker. An inner product may be separately performed between the HOA coefficients of the F virtual speakers and the HOA coefficient of the audio signal, and a virtual speaker with a maximum absolute value of the inner product is selected as the target virtual speaker. It should be noted that the target virtual speaker may alternatively be determined by using another method, and this is not specifically limited in this application.
In one embodiment, the S virtual speakers corresponding to the target virtual speaker meet the following conditions: the S virtual speakers include the target virtual speaker and (S−1) virtual speakers located around the target virtual speaker, where any one of (S−1) correlations between the (S−1) virtual speakers and the target virtual speaker is greater than each of (K−S) correlations between (K−S) virtual speakers, other than the S virtual speakers, of the K virtual speakers and the target virtual speaker.
When the target virtual speaker is determined, the target virtual speaker is a central virtual speaker having a highest correlation with the HOA coefficient of the to-be-processed audio signal. S virtual speakers corresponding to each central virtual speaker are S virtual speakers having highest correlations with HOA coefficients of the central virtual speaker. Therefore, the S virtual speakers corresponding to the target virtual speaker are also S virtual speakers having highest correlations with the HOA coefficient of the to-be-processed audio signal.
In one embodiment, the K virtual speakers meet the following conditions: the K virtual speakers are distributed on a preset sphere, and the preset sphere includes L latitude regions, where L>1; and an mth latitude region of the L latitude regions includes Tm latitude circles, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on an mith latitude circle is αm, 1≤m≤L, Tm is a positive integer, and 1≤mi≤Tm, where when Tm>1, an elevation angle difference between any two adjacent latitude circles in the mth latitude region is αm.
In one embodiment, an nth latitude region of the L latitude regions includes Tn latitude circles, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on an nith latitude circle is αn, 1≤mi≤L, Tn is a positive integer, and 1≤ni≤Tn, where when Tn>1, an elevation angle difference between any two adjacent latitude circles in the nth latitude region is αn, where αn=αm or αn≠αm, and n≠m.
In one embodiment, a cth latitude region of the L latitude regions includes Tc latitude circles, one of the Tc latitude circles is an equatorial latitude circle, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on a cith latitude circle is αc, 1≤c≤L, Tc is a positive integer, and 1≤ci≤Tc, where when Tc>1, an elevation angle difference between any two adjacent latitude circles in the cth latitude region is αc, where αc<αm, and c≠m.
In one embodiment, the F virtual speakers meet the following conditions: an azimuth angle difference αmi between adjacent virtual speakers that are distributed on the mith latitude circle and that are in the F virtual speakers is greater than am.
In one embodiment, αmi=q×αm, where q is a positive integer greater than 1.
In one embodiment, a correlation Rfk between a kth virtual speaker of the K virtual speakers and the target virtual speaker satisfies the following formula:
R
fk
=B
f(θ,φ)·Bk(θ,φ),
where
θ represents an azimuth angle of the target virtual speaker, φ represents an elevation angle of the target virtual speaker, Bf(θ, φ) represents the HOA coefficients of the target virtual speaker, and Bk(θ, φ) represents HOA coefficients of the kth virtual speaker of the K virtual speakers.
According to a second aspect, this application provides an apparatus for determining a virtual speaker set, including: a determining module, configured to determine a target virtual speaker from F preset virtual speakers based on a to-be-processed audio signal, where each of the F virtual speakers corresponds to S virtual speakers, F is a positive integer, and S is a positive integer greater than 1; and an obtaining module, configured to obtain, from a preset virtual speaker distribution table, respective position information of S virtual speakers corresponding to the target virtual speaker, where the virtual speaker distribution table includes position information of K virtual speakers, the position information includes an elevation angle index and an azimuth angle index, K is a positive integer greater than 1, F≤K, and F×S≥K.
In one embodiment, the determining module is specifically configured to: obtain a higher order ambisonics HOA coefficient of the audio signal; obtain F groups of HOA coefficients corresponding to the F virtual speakers, where the F virtual speakers are in one-to-one correspondence with the F groups of HOA coefficients; and determine, as the target virtual speaker, a virtual speaker corresponding to a group of HOA coefficients that has a greatest correlation with the HOA coefficient of the audio signal and that is in the F groups of HOA coefficients.
In one embodiment, the S virtual speakers corresponding to the target virtual speaker meet the following conditions: the S virtual speakers include the target virtual speaker and (S−1) virtual speakers located around the target virtual speaker, where any one of (S−1) correlations between the (S−1) virtual speakers and the target virtual speaker is greater than each of (K−S) correlations between (K−S) virtual speakers, other than the S virtual speakers, of the K virtual speakers and the target virtual speaker.
In one embodiment, the K virtual speakers meet the following conditions: the K virtual speakers are distributed on a preset sphere, and the preset sphere includes L latitude regions, where L>1; and an mth latitude region of the L latitude regions includes Tm latitude circles, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on an mith latitude circle is αm, 1≤m≤L, Tm is a positive integer, and 1≤mi≤Tm, where when Tm>1, an elevation angle difference between any two adjacent latitude circles in the mth latitude region is αm.
In one embodiment, an nth latitude region of the L latitude regions includes Tn latitude circles, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on an nith latitude circle is αn, 1≤n≤L, Tn is a positive integer, and 1≤ni≤Tn, where when Tn>1, an elevation angle difference between any two adjacent latitude circles in the nth latitude region is αn, where αn=αm or αn≠αm, and n≠m.
In one embodiment, a cth latitude region of the L latitude regions includes Tc latitude circles, one of the Tc latitude circles is an equatorial latitude circle, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on a cith latitude circle is αc, 1≤c≤L, Tc is a positive integer, and 1≤ci≤Tc, where when Tc>1, an elevation angle difference between any two adjacent latitude circles in the cth latitude region is αc, where αc<αm, and c≠m.
In one embodiment, the F virtual speakers meet the following conditions: an azimuth angle difference αmi between adjacent virtual speakers that are distributed on the mith latitude circle and that are in the F virtual speakers is greater than αm.
In one embodiment, ami=q×αm, where q is a positive integer greater than 1.
In one embodiment, a correlation Rfk between a kth virtual speaker of the K virtual speakers and the target virtual speaker satisfies the following formula:
R
fk
=B
f(θ,φ)Bk(θ,φ),
where
θ represents an azimuth angle of the target virtual speaker, φ represents an elevation angle of the target virtual speaker, Bf(θ, φ) represents the HOA coefficients of the target virtual speaker, and Bk(θ, φ) represents HOA coefficients of the kth virtual speaker of the K virtual speakers.
According to a third aspect, this application provides an audio processing device, including: one or more processors; and a memory, configured to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any possible implementation of the first aspect.
According to a fourth aspect, this application provides a computer-readable storage medium, including a computer program. When the computer program is executed on a computer, the computer is enabled to perform the method according to any possible implementation of the first aspect.
To make the objectives, technical solutions, and advantages of this application clearer, the following clearly describes the technical solutions in this application with reference to the accompanying drawings in this application. It is clear that, the described embodiments are merely some rather than all of embodiments of this application. All other embodiments obtained by a person of ordinary skill in the art based on embodiments of this application without creative efforts shall fall within the protection scope of this application.
In the specification, embodiments, claims, and accompanying drawings of this application, terms “first”, “second”, and the like are merely intended for distinguishing and description, and shall not be understood as an indication or implication of relative importance or an indication or implication of an order. In addition, the terms “include”, “have”, and any variant thereof are intended to cover non-exclusive inclusion, for example, include a series of operations or units. Methods, systems, products, or devices are not necessarily limited to those operations or units that are literally listed, but may include other operations or units that are not literally listed or that are inherent to such processes, methods, products, or devices.
It should be understood that in this application, “at least one (item)” refers to one or more and “a plurality of” refers to two or more. The term “and/or” is used for describing an association relationship between associated objects, and represents that three relationships may exist. For example, “A and/or B” may represent the following three cases: Only A exists, only B exists, and both A and B exist, where A and B may be singular or plural. The character “I” generally indicates an “or” relationship between the associated objects. “At least one of the following item” or a similar expression thereof indicates any combination of the items, including any combination of a single item or a plural item. For example, at least one of a, b, or c may indicate a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c may be singular or plural. The two values connected by the character ˜ usually indicate a value range. The value range contains the two values connected by the character ˜.
Explanations of related terms this application are as follows.
Audio frame: Audio data is in a stream form. In an actual application, to facilitate audio processing and transmission, an audio data amount within one piece of duration is usually selected as one frame of audio. The duration is referred to as a “sampling time period”, and a value of the duration may be determined based on a requirement of a codec and a requirement of a specific application. For example, the duration ranges from 2.5 ms to 60 ms, where ms is millisecond.
Audio signal: An audio signal is a frequency and amplitude change information carrier of a regular sound wave with voice, music, and a sound effect. Audio is a continuously changing analog signal, and can be represented by a continuous curve and referred to as a sound wave. A digital signal generated from the audio through analog-to-digital conversion or by a computer is the audio signal. The sound wave has three important parameters: frequency, amplitude, and phase, and this determines characteristics of the audio signal.
The following is a system architecture to which this application is applied.
A Bluetooth connection may be established between the audio sending device and the audio receiving device, and voice and music transmission may be supported between the audio sending device and the audio receiving device. Broadly applied examples of the audio sending device and the audio receiving device are a mobile phone and the TWS earphones, a wireless head-mounted headset, or a wireless neck ring headset, or the mobile phone and another terminal device (such as a smart sound box, a smart watch, smart glasses, or an in-vehicle sound box). In one embodiment, examples of the audio sending device and the audio receiving device may alternatively be a tablet computer, a notebook computer, or a desktop computer and the TWS earphones, a wireless head-mounted headset, a wireless neck ring headset, or another terminal device (such as a smart sound box, a smart watch, smart glasses, or an in-vehicle sound box).
It should be noted that, in addition to the Bluetooth connection, the audio sending device and the audio receiving device may be connected in another communication manner, for example, a Wi-Fi connection, a wired connection, or another wireless connection. This is not specifically limited in this application.
The source device 12 includes an encoder 20, and In one embodiment, may include an audio source 16, an audio preprocessor 18, and a communication interface 22.
The audio source 16 may include or may be any type of audio capturing device, for example, capturing real-world sound, and/or any type of audio generation device, for example, a computer audio processor, or any type of device configured to obtain and/or provide real-world audio or computer animation audio (such as audio in screen content or virtual reality (VR)), and/or any combination thereof (for example, audio in augmented reality (AR), audio in mixed reality (MR), and/or audio in extended reality (XR)). The audio source 16 may be a microphone for capturing audio or a memory for storing audio. The audio source 16 may further include any type of (internal or external) interface for storing previously captured or generated audio and/or obtaining or receiving audio. When the audio source 16 is a microphone, the audio source 16 may be, for example, a local audio collection apparatus or an audio collection apparatus integrated into the source device. When the audio source 16 is a memory, the audio source 16 may be, for example, a local memory or a memory integrated into the source device. When the audio source 16 includes an interface, the interface may be, for example, an external interface for receiving audio from an external audio source. The external audio source is, for example, an external audio capturing device, such as a microphone, an external memory, or an external audio generation device. The external audio generation device is, for example, an external computer audio processor, a computer, or a server. The interface may be any type of interface, for example, a wired or wireless interface or an optical interface, according to any proprietary or standardized interface protocol.
In this application, the audio source 16 obtains a current-scenario audio signal. The current-scenario audio signal is an audio signal obtained by collecting a sound field at a position of a microphone in space, and the current-scenario audio signal may also be referred to as an original-scenario audio signal. For example, the current-scenario audio signal may be an audio signal obtained through a higher order ambisonics (HOA) technology. The audio source 16 obtains a to-be-encoded HOA signal, for example, may obtain the HOA signal by using an actual collection device, or may synthesize the HOA signal by using an artificial audio object. In one embodiment, the to-be-encoded HOA signal may be a time-domain HOA signal or a frequency-domain HOA signal.
The audio preprocessor 18 is configured to receive an original audio signal and perform preprocessing on the original audio signal, to obtain a preprocessed audio signal. For example, preprocessing performed by the audio preprocessor 18 may include trimming or denoising.
The encoder 20 is configured to: receive the preprocessed audio signal, and process the preprocessed audio signal, so as to provide the encoded bitstream.
The communication interface 22 in the source device 12 may be configured to: receive the bitstream and send the bitstream to the destination device 14 through a communication channel 13. The communication channel 13 is, for example, a direct wired or wireless connection, and any type of network is, for example, a wired or wireless network or any combination thereof, or any type of private network and public network, or any combination thereof.
The destination device 14 includes a decoder 30, and In one embodiment, may include a communication interface 28, an audio postprocessor 32, and a playing device 34.
The communication interface 28 in the destination device 14 is configured to: directly receive the bitstream from the source device 12, and provide the bitstream for the decoder 30. The communication interface 22 and the communication interface 28 may be configured to send or receive the bitstream through the communication channel 13 between the source device 12 and the destination device 14.
The communication interface 22 and the communication interface 28 each may be configured as a unidirectional communication interface indicated by an arrow that is from the source device 12 to the destination device 14 and that corresponds to the communication channel 13 in
The decoder 30 is configured to: receive the bitstream, and decode the bitstream to obtain decoded audio data.
The audio postprocessor 32 is configured to perform post-processing on the decoded audio data to obtain post-processed audio data. Post-processing performed by the audio postprocessor 32 may include, for example, trimming or resampling.
The playing device 34 is configured to receive the post-processed audio data, to play audio to a user or a listener. The playing device 34 may be or include any type of player configured to play reconstructed audio, for example, an integrated or external speaker. For example, the speaker may include a horn, a sound box, and the like.
The virtual speaker configuration unit is configured to configure a virtual speaker based on encoder configuration information, to obtain a virtual speaker configuration parameter. The encoder configuration information includes but is not limited to: an HOA order, an encoding bit rate, user-defined information, and the like. The virtual speaker configuration parameter includes but is not limited to: a quantity of virtual speakers, an HOA order of the virtual speaker, and the like.
The virtual speaker configuration parameter output by the virtual speaker configuration unit is used as an input of the virtual speaker set generation unit.
The encoding analysis unit is configured to perform encoding analysis on a to-be-encoded HOA signal, for example, analyze sound field distribution of the to-be-encoded HOA signal, including characteristics such as a quantity of sound sources, directivity, and dispersion of the to-be-encoded HOA signal for obtaining one of determining conditions for determining how to select a target virtual speaker.
In this application, the HOA encoding apparatus may alternatively not include an encoding analysis unit, in other words, the HOA encoding apparatus may not analyze an input signal. This is not limited. In this case, a default configuration is used to determine how to select the target virtual speaker.
The HOA encoding apparatus obtains the to-be-encoded HOA signal. For example, an HOA signal recorded by an actual collection device or an HOA signal synthesized by using an artificial audio object may be used as an input of the encoder, and the to-be-encoded HOA signal input into the encoder may be a time-domain HOA signal or a frequency-domain HOA signal.
The virtual speaker set generation unit is configured to generate a virtual speaker set, where the virtual speaker set may include a plurality of virtual speakers, and the virtual speaker in the virtual speaker set may also be referred to as a “candidate virtual speaker”.
The virtual speaker set generation unit generates HOA coefficients of a specified candidate virtual speaker. Coordinates (namely, position information) of the candidate virtual speaker and an HOA order of the candidate virtual speaker that are provided by the virtual speaker configuration unit are used to generate the HOA coefficients of the candidate virtual speaker. A method for determining the coordinates of the candidate virtual speaker includes but is not limited to generating K virtual speakers according to an equal-distance rule, and generating, according to an auditory perception principle, K candidate virtual speakers that are not evenly distributed. Coordinates of evenly distributed candidate virtual speakers are generated based on a quantity of candidate virtual speakers.
Next, HOA coefficients of a virtual speaker are generated.
A sound wave is transmitted in an ideal medium. A wave speed of the sound wave is k=w/c, and an angular frequency is w=2πf, where f indicates sound wave frequency, and c indicates a sound speed. Therefore, a sound pressure p satisfies the following formula (1):
∇2p+k2p=0 (1),
where
The following formula (2) may be obtained for the sound pressure p by solving the formula (1) in spherical coordinates:
p(r,θ,φ,k)=sΣm=0∞(2m+1)jmjmkr(kr)Σ0≤n≤m,σ=±1Ym,nσ(θs,φs)Ym,nσ(θ,φ) (2),
where r represents a spherical radius, θ represents an azimuth angle (azimuth) (where the azimuth angle may also be referred to as an azimuth), φ represents an elevation angle (elevation), k represents a wave velocity, s represents an amplitude of an ideal plane wave, m represents a sequence number of an HOA order, jmjmkr(kr) represents a spherical Bessel function, and is also referred to as a radial basis function, where the 1st j is an imaginary unit, (2m+1)jmjmkr(kr) does not change with an angle, Ym,nσ(θ, φ) is a spherical harmonics function corresponding to θ and φ, and Ym,nσ(θs, φs) is a spherical harmonics function in a sound source direction.
An ambisonics (Ambisonics) coefficient is: Bm,nσ=s·Ym,nσ(θs,φs) (3)
Therefore, a general expansion form (4) of the sound pressure p may be obtained as follows:
p(r,θ,φ,k)=Σm=0∞jmjmkr(kr)Σ0≤n≤m,o=±1Bm,nσYm,nσ(θ,φ) (4)
The foregoing formula (3) may indicate that a sound field may be expanded on a spherical surface based on a spherical harmonics function, and the sound field is represented based on the ambisonics coefficient.
Correspondingly, if the ambisonics coefficient is known, the sound field may be reconstructed. By using the ambisonics coefficient as an approximate description of the sound field, when the formula (3) is truncated to an Nth item, the ambisonics coefficient is referred to as an N-order HOA coefficient, where the HOA coefficient is also referred to as an ambisonics coefficient. The N-order ambisonics coefficient has (N+1)2 channels in total. In one embodiment, an HOA order may range from 2-order to 10-order. When the spherical harmonics function is superposed based on a coefficient corresponding to a sampling point of the HOA signal, a spatial sound field at a moment corresponding to the sampling point can be reconstructed. The HOA coefficients of the virtual speaker may be generated according to this principle. θs and φs in formula (3) are respectively set to the azimuth angle and the elevation angle, namely, the position information of the virtual speaker, and the HOA coefficients, also referred to as ambisonics coefficients, of the virtual speaker may be obtained according to the formula (3). For example, for a 3-order HOA signal, assuming that s=1, HOA coefficients that are of 16 channels and that correspond to the 3-order HOA signal may be obtained based on the spherical harmonic function Ym,nσ(θs, φs). A formula for calculating the HOA coefficients that are of 16 channels and that correspond to the 3-order HOA signal is specifically shown in Table 1.
In Table 1, 0 represents the azimuth angle in the position information of the virtual speaker on a preset sphere; φ represents the elevation angle in the position information of the virtual speaker on the preset sphere; 1 represents the HOA order, where 1=0, 1, . . . , N; and m represents a direction parameter in each order, where m=−1, . . . , 1. According to the expression in the polar coordinates in Table 1, the HOA coefficients that are of 16 channels and that correspond to the 3-order HOA signal of the virtual speaker may be obtained based on the position information of the virtual speaker.
The HOA coefficients of the candidate virtual speaker output by the virtual speaker set generation unit are used as an input of the virtual speaker selection unit.
The virtual speaker selection unit is configured to select, based on the to-be-encoded HOA signal, the target virtual speaker from the plurality of candidate virtual speakers that are in the virtual speaker set, where the target virtual speaker may be referred to as a “virtual speaker matching the to-be-encoded HOA signal”, or referred to as a matching virtual speaker for short.
The virtual speaker selection unit selects a specified matching virtual speaker based on the to-be-encoded HOA signal and the HOA coefficients of the candidate virtual speaker output by the virtual speaker set generation unit.
The following uses an example to describe a method for selecting a matching virtual speaker. In one embodiment, an inner product is performed between the HOA coefficient of the candidate virtual speaker and an HOA coefficient of the to-be-encoded HOA signal, a candidate virtual speaker with a maximum absolute value of the inner product is selected as the target virtual speaker, namely, the matching virtual speaker, a projection, on the candidate virtual speaker, of the to-be-encoded HOA signal is superposed on a linear combination of the HOA coefficients of the candidate virtual speaker, and then a projection vector is subtracted from the to-be-encoded HOA signal to obtain a difference. The foregoing process is repeated on the difference to implement iterative calculation. A matching virtual speaker is generated at each iteration, and coordinates of the matching virtual speaker and HOA coefficients of the matching virtual speaker are output. It may be understood that a plurality of matching virtual speakers are selected, and one matching virtual speaker is generated at each iteration. (In addition, other implementation methods are not limited.)
The coordinates of the target virtual speaker and the HOA coefficients of the target virtual speaker that are output by the virtual speaker selection unit are used as inputs of the virtual speaker signal generation unit.
The virtual speaker signal generation unit is configured to generate a virtual speaker signal based on the to-be-encoded HOA signal and attribute information of the target virtual speaker. When the attribute information is position information, the HOA coefficients of the target virtual speaker are determined based on the position information of the target virtual speaker. When the attribute information includes the HOA coefficients, the HOA coefficients of the target virtual speaker are obtained from the attribute information.
The virtual speaker signal generation unit calculates the virtual speaker signal based on the to-be-encoded HOA signal and the HOA coefficients of the target virtual speaker.
The HOA coefficients of the virtual speaker are represented by a matrix A, and the to-be-encoded HOA signal may be obtained through linear combination by using the matrix A.
Further, a theoretical optimal solution w, namely, the virtual speaker signal, may be obtained by using a least square method. For example, the following calculation formula may be used:
w=A
−1
X
A−1 represents an inverse matrix of the matrix A, a size of the matrix A is (M×C), C is a quantity of target virtual speakers, M is a quantity of channels of an N-order HOA coefficient, M=(N+1)2, and a represents the HOA coefficients of the target virtual speaker. For example,
X represents the to-be-encoded HOA signal, a size of the matrix X is (M×L), M is the quantity of channels of the N-order HOA coefficient, L is a quantity of time domain or frequency domain sampling points, and x represents a coefficient of the to-be-encoded HOA signal. For example,
The virtual speaker signal output by the virtual speaker signal generation unit is used as an input of the core encoder processing unit.
The core encoder processing unit is configured to perform core encoder processing on the virtual speaker signal to obtain a transmission bitstream.
The core encoder processing includes but is not limited to transformation, quantization, a psychoacoustic model, bitstream generation, and the like, and may process a frequency domain transmission channel or a time domain transmission channel. This is not limited herein.
Based on the descriptions of the foregoing embodiment, this application provides a method for determining a virtual speaker set. The method for determining a virtual speaker set is based on the following presetting.
1. Virtual Speaker Distribution Table
A virtual speaker distribution table includes position information of K virtual speakers, where the position information includes an elevation angle index and an azimuth angle index, and K is a positive integer greater than 1. The K virtual speakers are set to be distributed on a preset sphere. The preset sphere may include X latitude circles and Y longitude circles. X and Y may be the same or different. Both X and Y are positive integers. For example, X is 512, 768, 1024, or the like, and Y is 512, 768, 1024, or the like. The virtual speaker is located at an intersection point of the X latitude circles and the Y longitude circles. Larger values of X and Y indicate more candidate selection positions of the virtual speaker, and a better playback effect of a sound field formed by a finally selected virtual speaker.
It should be understood that, the K virtual speakers are distributed on one or more latitude circles in each latitude region, distances between adjacent virtual speakers located on a same latitude circle are represented by using an azimuth angle difference, and azimuth angle differences between all adjacent virtual speakers on a same latitude circle are equal. For example, an azimuth angle difference between any two adjacent virtual speakers on the mith latitude circle is αm. For virtual speakers located in a same latitude region, if the latitude region includes a plurality of latitude circles, there is a same azimuth angle difference between adjacent virtual speakers in any latitude circle in the latitude region. For example, in the mth latitude region, an azimuth angle difference between adjacent virtual speakers on the mith latitude circle and an azimuth angle difference between adjacent virtual speakers on an mi+1th latitude circle are both am. In addition, if a latitude region includes a plurality of latitude circles, a distance between the latitude circles in the latitude region is represented by an elevation angle difference, and an elevation angle difference between any two adjacent latitude circles is equal to the azimuth angle difference between adjacent virtual speakers in the latitude region.
In one embodiment, αn=αm or αn≠αm, where αn is an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on any latitude circle in an nth latitude region, and n≠m.
In other words, for virtual speakers located in different latitude regions, azimuth angle differences between adjacent virtual speakers may be equal, where αn=αm, or may be unequal, where αn≠αm. It should be understood that, in this application, azimuth angle differences between adjacent virtual speakers in L latitude regions may be all equal, or azimuth angle differences between adjacent virtual speakers in L latitude regions may be all unequal, or even azimuth angle differences between adjacent virtual speakers in some of L latitude regions may be equal, and such azimuth angle differences and azimuth angle differences between adjacent virtual speakers in the other latitude regions may be unequal. These are not limited.
In one embodiment, αc<αm, αc is an azimuth angle difference between adjacent virtual speakers distributed on an mcth latitude circle in the K virtual speakers, and the myth latitude circle is any latitude circle in a latitude region that is in the L latitude regions and that includes an equatorial latitude circle.
To be specific, in the L latitude regions, the azimuth angle difference between adjacent virtual speakers in the latitude region including the equatorial latitude circle is the smallest, in other words, in the L latitude regions, virtual speakers in the latitude region including the equatorial latitude circle are most densely distributed.
In one embodiment, positions of the K virtual speakers in the virtual speaker distribution table may be represented in an index manner, and an index may include an elevation angle index and an azimuth angle index. For example, on any latitude circle, an azimuth angle of one of virtual speakers distributed on the latitude circle is set to 0, and then a corresponding azimuth angle index is obtained through conversion according to a preset conversion formula between an azimuth angle and an azimuth angle index. Because azimuth angle differences between any adjacent virtual speakers on the latitude circle are equal, azimuth angles of other virtual speakers on the latitude circle may be obtained, so as to obtain azimuth angle indexes of the other virtual speakers according to the foregoing conversion formula. It should be noted that a specific virtual speaker, on the latitude circle, whose azimuth angle is set to 0 is not specifically limited in this application. Similarly, because elevation angle differences between adjacent virtual speakers in a longitude circle direction meet the foregoing requirement, after a virtual speaker whose elevation angle is 0 is set, elevation angles of other virtual speakers may be obtained, and elevation angle indexes of all virtual speakers on the longitude circle may be obtained according to a conversion formula between a preset elevation angle and an elevation angle index. It should be noted that, in this application, a virtual speaker, on the longitude circle, whose elevation angle is set to 0 is not specifically limited. For example, the virtual speaker may be a virtual speaker located on the equatorial circle, or a virtual speaker located on the south pole, or a virtual speaker located on the north pole.
In one embodiment, an elevation angle φk and an elevation angle index φk′ of a kth virtual speaker in the K virtual speakers satisfy the following formula (namely, the conversion formula between the elevation angle and the elevation angle index):
rk represents a radius of a longitude circle in which the kth virtual speaker is located, and round( ) represents rounding.
An azimuth angle θk and an azimuth angle index θk′ of the kth virtual speaker in the K virtual speakers satisfy the following formula (namely, the conversion formula between the azimuth angle and the azimuth angle index):
rk represents a radius of a latitude circle in which the kth virtual speaker is located, and round( ) represents rounding.
Table 1 shows a comparison between the distribution diagrams shown in
As shown in Table 1, 12 different types of test audios are used in this embodiment, and the file names from 1 to 12 are respectively a single sound source speech signal, a single sound source musical instrument signal, a dual sound source speech signal, a dual sound source musical instrument signal, a triple sound source speech and musical instrument mixed signal, a quad sound source speech and musical instrument mixed signal, a dual sound source noise signal 1, a dual sound source noise signal 2, a dual sound source noise signal 3, a dual sound source noise signal 4, a dual sound source ambisonics signal 1, and a dual sound source ambisonics signal 2.
Table 2 shows a comparison between the distribution diagrams shown in
As shown in Table 2, 12 different types of test audios are used in this embodiment, and the file names from 1 to 12 are respectively a single sound source speech signal, a single sound source musical instrument signal, a dual sound source speech signal, a dual sound source musical instrument signal, a triple sound source speech and musical instrument mixed signal, a quad sound source speech and musical instrument mixed signal, a dual sound source noise signal 1, a dual sound source noise signal 2, a dual sound source noise signal 3, a dual sound source noise signal 4, a dual sound source ambisonics signal 1, and a dual sound source ambisonics signal 2.
For example, Table 3 is an example of a virtual speaker distribution table. In this example, K is 530. To be specific, Table 3 describes specific distribution of 530 virtual speakers whose sequence numbers range from 0 to 529. “Position” represents an azimuth angle index and an elevation angle index of a virtual speaker of a corresponding sequence number. In a “position” column in the table, a number before “,” is an azimuth angle index, and a number after “,” is an elevation angle index.
It should be noted that, a sphere on which the virtual speakers are distributed in Table 3 includes 1024 longitude circles and 1024 latitude circles (where the south pole point and the north pole point also each correspond to one latitude circle), the 1024 longitude circles and the 1024 latitude circles correspond to 1024×1022+2=1046530 intersection points, and the 1046530 intersection points each have a respective elevation angle and azimuth angle. Correspondingly, the 1046530 intersection points each have a respective elevation angle index and azimuth angle index, and positions of the 530 virtual speakers in Table 3 are 530 of the 1046530 intersection points. The elevation angle indexes in Table 3 are obtained through calculation based on a fact that an elevation angle of an equator is 0. To be specific, elevation angles corresponding to an elevation angle index other than that of the equator are all elevation angles relative to a plane on which the equator is located.
2. F Preset Virtual Speakers
F virtual speakers meet the following condition: An azimuth angle difference αmi between adjacent virtual speakers distributed on an meth latitude circle in the F virtual speakers is greater than αm, and the mith latitude circle is one of latitude circles in an mth latitude region.
For ease of description, a virtual speaker in K virtual speakers is referred to as a candidate virtual speaker, and any virtual speaker in the F virtual speakers is referred to as a central virtual speaker (which may also be referred to as a first-round virtual speaker). To be specific, for any latitude circle on a preset sphere, one or more virtual speakers may be selected from a plurality of candidate virtual speakers distributed on the latitude circle as the central virtual speaker, and the central virtual speaker is added to the F virtual speakers. If a plurality of virtual speakers are selected, an azimuth angle difference αmi between adjacent central virtual speakers is greater than the azimuth angle difference am between the adjacent candidate virtual speakers, and this may be expressed as αmi>αm. That is, for a specific latitude circle, a plurality of candidate virtual speakers are distributed. The central virtual speakers are selected from the plurality of candidate virtual speakers, and have lower density. For example, an azimuth angle difference am between adjacent candidate virtual speakers on the latitude circle is equal to 5°, and an azimuth angle difference αmi between adjacent center virtual speakers is equal to 8°.
In one embodiment, αmi=q×αm, where q is a positive integer greater than 1. It can be seen that the azimuth angle difference between the adjacent central virtual speakers and the azimuth angle difference between the adjacent candidate virtual speakers are in a multiple relationship. For example, the azimuth angle difference am between the adjacent candidate virtual speakers on the latitude circle is equal to 5°, and the azimuth angle difference αmi between the adjacent center virtual speakers is equal to 10°.
3. Each of F Virtual Speakers Corresponds to S Virtual Speakers
For ease of description, a virtual speaker in S virtual speakers is referred to as a target virtual speaker. To be specific, S virtual speakers corresponding to any central virtual speaker meet the following conditions: The S virtual speakers include the any central virtual speaker and (S−1) virtual speakers located around the any central virtual speaker, where any one of (S−1) correlations between the any central virtual speaker and the (S−1) virtual speakers is greater than each of (K−S) correlations between (K−S) virtual speakers of the K virtual speakers other than the S virtual speakers and the any central virtual speaker.
That is, S RfkS corresponding to the S virtual speakers are S largest RfkS in K RfkS corresponding to the K virtual speakers. When the K RfkS are sorted in descending order, the first S RfkS are the largest S Rfks.
Rfk represents a correlation between the any central virtual speaker and a kth virtual speaker in the K virtual speakers, and Rfk satisfies the following formula:
R
fk
=B
f(θ,φ)·Bk(θ,φ)
θ represents an azimuth angle of the any virtual speaker, φ represents an elevation angle of the any virtual speaker, Bf(θ, φ) represents HOA coefficients of the any virtual speaker, and Bk(θ, φ) represents HOA coefficients of the kth virtual speaker of the K virtual speakers.
S virtual speakers may be determined for each central virtual speaker according to the foregoing method. It should be understood that, in this application, the F virtual speakers from the K virtual speakers are preset. Therefore, a position of each central virtual speaker may also be represented by an elevation angle index and an azimuth angle index. Besides, each central virtual speaker corresponds to the S virtual speakers, and the S virtual speakers are also from the K virtual speakers. Therefore, a position of each target virtual speaker may also be represented by an elevation angle index and an azimuth angle index.
Step 701: Determine a target virtual speaker from F preset virtual speakers based on a to-be-processed audio signal.
As described above, encoding analysis is performed on the to-be-processed audio signal. For example, sound field distribution of the to-be-processed audio signal is analyzed, including characteristics such as a quantity of sound sources, directivity, and dispersion of the audio signal, to obtain an HOA coefficient of the audio signal, and the HOA coefficient is used as one of determining conditions for determining how to select the target virtual speaker. A virtual speaker matching the to-be-processed audio signal may be selected based on the HOA coefficient of the to-be-processed audio signal and HOA coefficients of candidate virtual speakers (namely, the foregoing F virtual speakers). In this application, the virtual speaker is referred to as the target virtual speaker.
In one embodiment, the HOA coefficient of the audio signal may be obtained first, and then F groups of HOA coefficients corresponding to the F virtual speakers are obtained, where the F virtual speakers are in one-to-one correspondence with the F groups of HOA coefficients; and then a virtual speaker corresponding to a group of HOA coefficients that has a greatest correlation with the HOA coefficient of the audio signal and that is in the F groups of HOA coefficients is determined as the target virtual speaker.
In this application, an inner product may be separately performed between the HOA coefficients of the F virtual speakers and the HOA coefficient of the audio signal, and a virtual speaker with a maximum absolute value of the inner product is selected as the target virtual speaker. To be specific, each group of the F groups of HOA coefficients includes (N+1)2 coefficients, the HOA coefficient of the audio signal includes (N+1)2 coefficients, and N represents an order of the audio signal. Therefore, the HOA coefficient of the audio signal is in one-to-one correspondence with each group of the F groups of HOA coefficients. Based on this correspondence, an inner product is performed between the HOA coefficient of the audio signal and each group of the F groups of HOA coefficients, and a correlation between the HOA coefficient of the audio signal and each group of the F groups of HOA coefficients is obtained. It should be noted that the target virtual speaker may alternatively be determined by using another method, and this is not specifically limited in this application.
Step 702: Obtain, from a preset virtual speaker distribution table, respective position information of S virtual speakers corresponding to the target virtual speaker, where the position information includes an elevation angle index and an azimuth angle index.
Based on the foregoing presetting in this application, once the target virtual speaker (namely, a central virtual speaker) is determined, the S virtual speakers corresponding to the target virtual speaker may be obtained. The position information of the S virtual speakers may be obtained based on the earliest set virtual speaker distribution table. A same representation method is used for K virtual speakers, and the position information of the S virtual speakers is each represented by the elevation angle index and the azimuth angle index.
It can be seen that, when the target virtual speaker is determined, the target virtual speaker is a central virtual speaker having a highest correlation with the HOA coefficient of the to-be-processed audio signal. S virtual speakers corresponding to each central virtual speaker are S virtual speakers having highest correlations with HOA coefficients of the central virtual speaker. Therefore, the S virtual speakers corresponding to the target virtual speaker are also S virtual speakers having highest correlations with the HOA coefficient of the to-be-processed audio signal.
In this application, the virtual speaker distribution table is preset, so that a high average value of signal-to-noise ratios (SNRs) of HOA reconstructed signals can be obtained by deploying virtual speakers according to the distribution table, and the S virtual speakers having highest correlations with the HOA coefficient of the to-be-processed audio signal are selected based on such distribution, thereby achieving an optimal sampling effect and improving an audio signal playback effect.
In one embodiment, the determining module 801 is specifically configured to: obtain a higher order ambisonics HOA coefficient of the audio signal; obtain F groups of HOA coefficients corresponding to the F virtual speakers, where the F virtual speakers are in one-to-one correspondence with the F groups of HOA coefficients; and determine, as the target virtual speaker, a virtual speaker corresponding to a group of HOA coefficients that has a greatest correlation with the HOA coefficient of the audio signal and that is in the F groups of HOA coefficients.
In one embodiment, the S virtual speakers corresponding to the target virtual speaker meet the following conditions: the S virtual speakers include the target virtual speaker and (S−1) virtual speakers located around the target virtual speaker, where any one of (S−1) correlations between the (S−1) virtual speakers and the target virtual speaker is greater than each of (K−S) correlations between (K−S) virtual speakers, other than the S virtual speakers, of the K virtual speakers and the target virtual speaker.
In one embodiment, the K virtual speakers meet the following conditions: the K virtual speakers are distributed on a preset sphere, and the preset sphere includes L latitude regions, where L>1; and an mth latitude region of the L latitude regions includes Tm latitude circles, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on an mith latitude circle is αm, 1≤m≤L, Tm is a positive integer, and 1≤mi≤Tm, where when Tm>1, an elevation angle difference between any two adjacent latitude circles in the mth latitude region is αm.
In one embodiment, an nth latitude region of the L latitude regions includes Tn latitude circles, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on an nith latitude circle is αn, 1≤n≤L, Tn is a positive integer, and 1≤ni≤Tn, where when Tn>1, an elevation angle difference between any two adjacent latitude circles in the nth latitude region is αn, where αn=αm or αn≠αm, and n≠m.
In one embodiment, a cth latitude region of the L latitude regions includes Tc latitude circles, one of the Tc latitude circles is an equatorial latitude circle, an azimuth angle difference between adjacent virtual speakers that are in the K virtual speakers and that are distributed on a cith latitude circle is αc, 1≤c≤L, Tc is a positive integer, and 1≤ci≤Tc, where when Tc>1, an elevation angle difference between any two adjacent latitude circles in the cth latitude region is αc, where αc<αm, and c≠m.
In one embodiment, the F virtual speakers meet the following conditions: an azimuth angle difference αmi between adjacent virtual speakers that are distributed on the mith latitude circle and that are in the F virtual speakers is greater than αm.
In one embodiment, αmi=q×αm, where q is a positive integer greater than 1.
In one embodiment, a correlation Rfk between a kth virtual speaker of the K virtual speakers and the target virtual speaker satisfies the following formula:
R
fk
=B
f(θ,φ)·Bk(θ,φ), where
θ represents an azimuth angle of the target virtual speaker, φ represents an elevation angle of the target virtual speaker, Bf(θ, φ) represents the HOA coefficients of the target virtual speaker, and Bk(θ, φ) represents HOA coefficients of the kth virtual speaker of the K virtual speakers.
The apparatus in this embodiment may be used to execute the technical solution in the method embodiment shown in
In an implementation process, operations in the foregoing method embodiment can be implemented by using a hardware integrated logical circuit in the processor, or by using instructions in a form of software. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The operations of the method disclosed this application may be directly performed by a hardware encoding processor, or may be performed by a combination of hardware in an encoding processor and a software module. The software module may be located in a mature storage medium in the art, for example, a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory, and the processor reads information in the memory and completes the operations in the foregoing methods in combination with hardware of the processor.
The memory in the foregoing embodiments may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), used as an external cache. By way of example but not limitative description, many forms of RAMs may be used, for example, a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DR RAM). It should be noted that the memory of the system and method described in this specification includes but is not limited to these memories and any memory of another proper type.
A person of ordinary skill in the art may be aware that, in combination with the examples described in embodiments disclosed in this specification, units and algorithm operations may be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this application.
It may be clearly understood by a person skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the foregoing systems, apparatuses, and units, refer to a corresponding process in the foregoing method embodiment. Details are not described herein again.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and method may be implemented in other manners. For example, the described apparatus embodiments are merely examples. For example, division into the units is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some characteristics may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of embodiments.
In addition, functional units in embodiments of this application may be integrated into one processing unit, each of the units may exist alone physically, or two or more units are integrated into one unit.
When the functions are implemented in the form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to a conventional technology, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the operations of the methods described in embodiments of this application. The foregoing storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
The foregoing descriptions are merely specific implementations of this application, but are not intended to limit the protection scope of this application. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
202110247466.1 | Mar 2021 | CN | national |
This application is a continuation of International Application No. PCT/CN2022/078824, filed on Mar. 2, 2022, which claims priority to Chinese Patent Application No. 202110247466.1, filed on Mar. 5, 2021. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2022/078824 | Mar 2022 | US |
Child | 18241698 | US |