Audio data filtering method and apparatus, device, and storage medium

By converting audio data into complex vectors and performing vector calculations, the problem of low audio data filtering efficiency in the prior art is solved, a more efficient filtering process is realized, and communication quality is improved.

WO2025060473A1PCT designated stage expired Publication Date: 2025-03-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/095414
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-18
Filing Date
2024-05-27
Publication Date
2025-03-27

AI Technical Summary

Technical Problem

When filtering audio data in the prior art, reading the complex real and imaginary parts in the complex array requires multiple operations, resulting in inefficiency.

Method used

By converting audio data into complex vectors and representing filter parameters in the form of complex arrays, and reading elements from complex vectors for calculations, the real and imaginary parts of a complex can be read at the same time, which improves the reading efficiency, and processes multiple complex numbers at one time through vector operations, improving the computing efficiency.

Benefits of technology

It improves the efficiency of audio data filtering, shortens filtering time, and improves communication quality and clarity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024095414_27032025_PF_FP_ABST
    Figure CN2024095414_27032025_PF_FP_ABST
Patent Text Reader

Abstract

An audio data filtering method and apparatus, a device, and a storage medium, relating to the technical field of audio. The method comprises: acquiring audio data and a first complex number array (201); converting the audio data into a second complex number array (202); extracting a real part and an imaginary part of each complex number in the first complex number array to obtain a first complex number vector, and extracting a real part and an imaginary part of each complex number in the second complex number array to obtain a second complex number vector (203); successively reading elements in the first complex number vector to obtain a plurality of first operation vectors, and successively reading elements in the second complex number vector to obtain a plurality of second operation vectors (204); performing a vector operation on the read first operation vectors and the read second operation vectors to obtain a plurality of result vectors (205); and determining filtered audio data on the basis of the plurality of result vectors (206). The method improves reading efficiency and operation efficiency, thereby improving filtering efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Audio data filtering method, device, equipment and storage medium

[0001] This application claims priority to the Chinese patent application filed on September 18, 2023, with application number 202311201744.5 and invention name “Filtering method, device, equipment and storage medium for audio data”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of audio technology, and in particular to a method, apparatus, device, and storage medium for filtering audio data. Background Art

[0003] In game scenarios, players generally communicate with each other through voice. To ensure the sound quality, the players' audio data will be filtered.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a method, apparatus, device, and storage medium for filtering audio data, which can improve the efficiency of filtering audio data. The technical solution is as follows.

[0006] In one aspect, a method for filtering audio data is provided, which is applied to a computer device, and the method comprises:

[0007] Acquire audio data and a first complex array, where the first complex array is a filter parameter of a filter;

[0008] Converting the audio data into a second complex array;

[0009] Extracting the real part and the imaginary part of each complex number in the first complex number array to obtain a first complex vector, extracting the real part and the imaginary part of each complex number in the second complex number array to obtain a second complex vector, where one element of the complex vector is the real part or the imaginary part of a complex number;

[0010] Reading elements of the first complex vector one by one to obtain a plurality of first operation vectors, and reading elements of the second complex vector one by one to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers;

[0011] Performing vector operations on the first operation vector and the second operation vector to obtain multiple result vectors;

[0012] Filtered audio data is determined based on the plurality of result vectors.

[0013] In another aspect, a device for filtering audio data is provided, the device comprising:

[0014] An acquisition module, configured to acquire audio data and a first complex array, where the first complex array is a filter parameter of a filter;

[0015] A conversion module, configured to convert the audio data into a second complex number array;

[0016] an extraction module, configured to extract the real part and the imaginary part of each complex number in the first complex number array to obtain a first complex vector, and extract the real part and the imaginary part of each complex number in the second complex number array to obtain a second complex vector, wherein one element of the complex vector is the real part or the imaginary part of a complex number;

[0017] a reading module, configured to successively read elements in the first complex vector to obtain a plurality of first operation vectors, and successively read elements in the second complex vector to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers;

[0018] an operation module, configured to perform vector operations on the first operation vector and the second operation vector read to obtain a plurality of result vectors;

[0019] A determination module is configured to determine filtered audio data based on the multiple result vectors.

[0020] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded and executed by the processor to implement the audio data filtering method in the embodiment of the present application.

[0021] On the other hand, a computer-readable storage medium is provided, in which at least one program is stored. The at least one program is loaded and executed by a processor to implement the audio data filtering method in the embodiment of the present application.

[0022] On the other hand, a computer program product is provided, which includes at least one program segment, wherein the at least one program segment is stored in a computer-readable storage medium, and a processor of a computer device reads the at least one program segment from the computer-readable storage medium, and the processor executes the at least one program segment, so that the computer device performs the above-mentioned audio data filtering method. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0024] FIG1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0025] FIG2 is a flow chart of a method for filtering audio data provided by an embodiment of the present application;

[0026] FIG3 is a flow chart of another method for filtering audio data provided by an embodiment of the present application;

[0027] FIG4 is a schematic diagram of a parallel operation provided by an embodiment of the present application;

[0028] FIG5 is a schematic diagram of a complex array operation provided by an embodiment of the present application;

[0029] FIG6 is a flow chart of a vector operation provided by an embodiment of the present application;

[0030] FIG7 is a schematic diagram of a virtual scene provided in an embodiment of the present application;

[0031] FIG8 is a schematic diagram of another virtual scene provided in an embodiment of the present application;

[0032] FIG9 is a block diagram of an audio data filtering device provided in an embodiment of the present application;

[0033] FIG10 is a block diagram of a terminal provided in an embodiment of the present application;

[0034] FIG11 is a block diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0036] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on the quantity and execution order.

[0037] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more.

[0038] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, storage, and display, etc.), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the audio data involved in this application was obtained with full authorization.

[0039] The following is an introduction to the professional terms involved in this application.

[0040] Virtual scene: It is a virtual scene displayed (or provided) when the application is running on the terminal. The virtual scene can be a simulation environment of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiment of the present application does not limit the dimension of the virtual scene. For example, the virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. The terminal user can control the movement of virtual objects in the virtual scene.

[0041] The following is an introduction to the implementation environment involved in this application.

[0042] The audio data filtering method provided in the embodiment of the present application is executed by a computer device, which is at least one of a terminal and a server. The following is a schematic diagram of the implementation environment of the audio data filtering method provided in the embodiment of the present application.

[0043] Referring to Figure 1, Figure 1 is a schematic diagram of an implementation environment of a filtering method for audio data provided in an embodiment of the present application, and the implementation environment includes a terminal 101, a terminal 102, and a server 103. Terminal 101 and terminal 102 can be directly or indirectly connected to server 103 through wired or wireless communication, and this application does not limit this. In some embodiments, terminal 101 and terminal 102 are two terminals for making a call, and terminal 101 obtains audio data of the call object, sends the audio data to server 103, filters the audio data through server 103, and sends the filtered audio data to terminal 102 for playback. Optionally, the call can be a call in an instant messaging application or a call in a game application, which is not specifically limited here. In some embodiments, terminal 101 obtains audio data, filters the audio data by itself and outputs it, or sends the filtered audio data to terminal 102.

[0044] In some embodiments, the terminals 101 and 102 may be smartphones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, VR (Virtual Reality) devices, AR (Augmented Reality) devices, etc., but are not limited thereto. In some embodiments, the server 103 is an independent server, or a server cluster or distributed system consisting of multiple servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some embodiments, the server 103 primarily undertakes computing tasks, and the terminals 101 and 102 undertake secondary computing tasks; alternatively, the server 103 undertakes secondary computing services, and the terminals 101 and 102 undertake primary computing tasks; alternatively, the server 103, terminals 101, and terminals 102 employ a distributed computing architecture for collaborative computing.

[0045] Referring to Figure 2 , which is a flow chart of a method for filtering audio data provided by an embodiment of the present application, the method is executed by a computer device. Referring to Figure 2 , the method includes the following steps.

[0046] 201. A computer device obtains audio data and a first complex array, where the first complex array is a filter parameter of a filter.

[0047] In an embodiment of the present application, a filter is used to filter audio data. Filtering the audio data is used to improve the signal-to-noise ratio of high-frequency signals in the audio data to make the signal clearer, or to eliminate interfering noise in the audio data, or to remove reverberation effects in the audio data, or to eliminate echoes in the audio data, or to achieve at least two of the above. In an embodiment of the present application, the use of a filter to eliminate echoes in audio data is used as an example for illustration. Optionally, the filter is an adaptive filter.

[0048] In an embodiment of the present application, a filter filters audio data using its filter parameters. Optionally, the filter parameters include multiple weight coefficients in the filter. The filter parameters are a first complex array. The first complex array includes multiple complex numbers, which are arranged sequentially in the first complex array. The multiple complex numbers are multiple weight coefficients in the filter, and each complex number includes a real part and an imaginary part.

[0049] For example, the first complex number array is "a+bi, c+di, ...", where a+bi is a complex number, a is the real part of the complex number, and b is the imaginary part of the complex number. c+di is a complex number, c is the real part of the complex number, and d is the imaginary part of the complex number. i is the imaginary unit.

[0050] 202. The computer device converts the audio data into a second complex number array.

[0051] In an embodiment of the present application, a computer device converts audio data to obtain audio data in the form of a complex array, i.e., a second complex array, which is used to represent the audio data. The second complex array includes a plurality of complex numbers, which are sequentially arranged in the second complex array, and each complex number includes a real part and an imaginary part.

[0052] In an embodiment of the present application, the audio data is represented as a time-domain signal, i.e., the audio signal includes amplitude values ​​and phases at multiple sampling points. The real part of a complex number in the second complex array is the amplitude value of a sampling point in the time-domain signal, and the imaginary part is the phase of the sampling point. Optionally, the computer device performs a Fourier transform on the audio data to obtain the second complex array.

[0053] 203. The computer device extracts the real part and the imaginary part of each complex number in the first complex array to obtain a first complex vector, and extracts the real part and the imaginary part of each complex number in the second complex array to obtain a second complex vector, where an element of the complex vector is the real part or imaginary part of a complex number.

[0054] In the embodiment of the present application, the real parts and imaginary parts of the plurality of complex numbers are sequentially arranged in the complex vector according to the order in the complex array. The real part and imaginary part of a complex number are two adjacent elements in the complex vector.

[0055] Here, an element of the complex vector is the real part or imaginary part of a complex number means that: each element of the first complex vector belongs to a complex number in the first complex array and is the real part or imaginary part of the complex number, and each element of the second complex vector belongs to a complex number in the second complex array and is the real part or imaginary part of the complex number.

[0056] In step 203, the computer device extracts the real and imaginary parts of each complex number in the first complex array as elements, and constructs a first complex vector with the extracted elements in the order of extraction. Thus, one element of the first complex vector is the real or imaginary part of a complex number in the first complex array. The computer device extracts the real and imaginary parts of each complex number in the second complex array as elements, and constructs a second complex vector with the extracted elements in the order of extraction. Thus, one element of the second complex vector is the real or imaginary part of a complex number in the second complex array.

[0057] 204. The computer device sequentially reads elements in the first complex vector to obtain a plurality of first operation vectors, and sequentially reads elements in the second complex vector to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers.

[0058] In the embodiments of the present application, the elements in the complex vector are arranged in order, for example, the real part of the same complex number is arranged before the imaginary part of the complex number. Reading the elements in the complex vector one by one means reading each time in the order in which the elements in the complex vector are arranged, to ensure that the order of the elements in the operation vector remains unchanged. The computer device reads the first complex vector and the second complex vector multiple times to obtain multiple first operation vectors and multiple second operation vectors, respectively.

[0059] The computer device reads multiple elements of the first complex vector each time to obtain a first operation vector, and reads multiple elements of the second complex vector each time to obtain a second operation vector. Each operation vector in the first operation vector and the second operation vector includes the real and imaginary parts of multiple complex numbers, that is, the real and imaginary parts of not only one complex number but also multiple complex numbers can be read in one operation.

[0060] In an embodiment of the present application, a preset step size is used to indicate the number of multiple elements read each time. Step 204 includes: the computer device reads multiple elements in the first complex vector according to the preset step size each time to obtain a first operation vector; and reads multiple elements in the second complex vector according to the preset step size each time to obtain a second operation vector. Therefore, after reading the elements in the first complex vector multiple times, the computer device can obtain multiple first operation vectors; after reading the elements in the second complex vector multiple times, it can obtain multiple second operation vectors. Optionally, the preset step size is an even number, so that multiple complete complex numbers can be read each time. A complete complex number refers to a complex number that includes a real part and an imaginary part, avoiding the situation where the real part and imaginary part of the same complex number are separated.

[0061] It should be noted that when performing complex operations on the first and second complex arrays, the operations are performed on every two complex numbers in corresponding positions in the two complex arrays. For example, the first complex number in the first complex array is operated on the first complex number in the second complex array, and the second complex number in the first complex array is operated on the second complex number in the second complex array.

[0062] Therefore, the computer device extracts elements from the first complex vector and the second complex vector respectively according to the same preset step size, that is, the number of elements extracted from the first complex vector each time is the same as the number of elements extracted from the second complex vector, so that the number of multiple complex numbers indicated by the first operation vector and the second operation vector is the same, which facilitates one-to-one corresponding operations on the complex numbers with corresponding positions in the two operation vectors.

[0063] Among them, since the multiple first operation vectors and the multiple second operation vectors are obtained from the first complex vector and the second complex vector respectively in the same order, among the multiple first operation vectors and the multiple second operation vectors, the first operation vector and the second operation vector with the same order are the corresponding two operation vectors.

[0064] 205. The computer device performs a vector operation on the read first operation vector and the second operation vector to obtain multiple result vectors.

[0065] In an embodiment of the present application, the computer device performs a vector operation on the first operation vector and the second operation vector read once to obtain a result vector, and performs a vector operation on the first operation vector and the second operation vector read multiple times to obtain multiple result vectors.

[0066] In an embodiment of the present application, when the two complex vectors do not include unread elements, the computer device executes step 205, that is, performs vector operations on the first operation vector and the second operation vector that have been read multiple times. And grouping will be performed during the operation, and the first operation vector and the second operation vector that correspond to each other will be divided into a group, so that vector operations are performed on each group separately to obtain the result vector of each group. Alternatively, each time the computer device reads an element and obtains a first operation vector and a second operation vector, it executes step 205, that is, the vector operation is performed immediately after each first operation vector and the second operation vector are read. In the embodiment of the present application, the vector operation is performed immediately after each first operation vector and the second operation vector are read as an example for explanation.

[0067] In this embodiment of the present application, since the first operational vector is obtained by extracting elements from a first complex vector, which is derived from filter parameters, multiple elements in the first operational vector represent portions of filtered data. Since the second operational vector is obtained by extracting elements from a second complex vector, which is derived from a second complex array representing audio data, multiple elements in the second operational vector represent portions of audio data. Therefore, operating on the first operational vector and the second operational vector represents filtering the audio data based on the filter data. Accordingly, the multiple result vectors obtained represent the filtered audio data.

[0068] It should be noted that when the computer device performs a vector operation on the first operation vector and the second operation vector, the operation type used may include at least one of addition, subtraction, multiplication, and division. The operation type may be determined by the computer device based on a filtering algorithm and is not limited in this embodiment of the present application.

[0069] 206. The computer device determines filtered audio data based on the multiple result vectors.

[0070] In an embodiment of the present application, a result complex array can be determined based on the multiple result vectors, and the result complex array is used to represent the filtered audio data. The computer device performs a reverse conversion on the result complex array to obtain the filtered audio data.

[0071] Optionally, the computer device implements the above steps through a filter, that is, the computer device inputs the audio data into the filter, the filter filters the audio data through filtering parameters, and then outputs the filtered audio data.

[0072] In related art, the process of filtering audio data primarily involves operations on a complex array, which includes multiple complex numbers. During the operations on the complex array, the complex numbers in the array are read. When reading any complex number, the real part of the complex number is read first, followed by the imaginary part, and the operations are performed based on the real and imaginary parts of the complex number. Reading the real and imaginary parts of the complex number one by one requires multiple read operations, which reduces the filtering efficiency of the audio data.

[0073] An embodiment of the present application provides a method for filtering audio data, which converts audio data into a complex vector and represents filtering parameters in the form of a complex array. In this way, when reading elements from the complex vector for calculation, the real part and imaginary part of a complex number can be read simultaneously, without having to read the real part and imaginary part of a complex number twice, thereby improving reading efficiency; and multiple complex numbers can be read at one time, further improving reading efficiency; and vector operations are performed based on the first operation vector and the second operation vector corresponding to the multiple complex numbers, so that multiple complex numbers can be calculated at one time, thereby improving calculation efficiency. This method improves reading efficiency and calculation efficiency by converting the complex array into a vector for processing, thereby improving the filtering efficiency of audio data.

[0074] The above briefly introduces the audio data filtering method using the embodiment of Figure 2. The following further introduces the audio data filtering method using the embodiment of Figure 3. Referring to Figure 3, Figure 3 shows an audio data filtering method provided in an embodiment of the present application. The method is executed by a computer device and includes the following steps.

[0075] 301. A computer device obtains audio data and a first complex array, where the first complex array is a filter parameter of a filter.

[0076] In the embodiment of the present application, step 301 is the same as step 201 and will not be described again here.

[0077] 302. The computer device converts the audio data into a second complex number array.

[0078] In the embodiment of the present application, two complex numbers in corresponding positions in the first complex number array and the second complex number array are used to perform a complex operation. For example, a complex operation is performed on the first complex number in the first complex number array and the first complex number in the second complex number array, that is, a one-to-one correspondence operation is performed on the multiple complex numbers in the two complex number arrays.

[0079] 303. The computer device extracts the real part and the imaginary part of each complex number in the first complex array to obtain a first complex vector, and extracts the real part and the imaginary part of each complex number in the second complex array to obtain a second complex vector, where an element of the complex vector is the real part or the imaginary part of a complex number.

[0080] In the embodiment of the present application, the order of the real and imaginary parts of the multiple complex numbers in the complex vector matches the order in the complex array. In the complex vector, the real part of a complex number is sorted before the imaginary part of the complex number, and the real and imaginary parts of a complex number are two adjacent elements.

[0081] It should be noted that complex arrays store complex numbers using the C++ (a computer programming language) complex class structure. This class, provided in the C++ standard library, represents complex numbers, provides real and imaginary data storage, and common complex number operations. For example, a complex array is stored in the form "a+bi, c+di, ...". Another example is a complex array stored in the form "r:a, i:b, r:a, i:b, ...", where r identifies the real part of the complex number and i identifies the imaginary part.

[0082] In the embodiment of the present application, the conversion of complex numbers into vectors for operation is implemented through assembly language. Assembly language is a low-level computer programming language used to directly control computer hardware to implement vector operations.

[0083] In the filtering algorithm implemented in a C++ class structure, the present embodiment utilizes assembly language to simulate C++ complex number bit-by-bit operations from the perspective of memory model and mathematical operations, upgrading linear operations to vector parallel operations, significantly improving operational efficiency during the filtering process. A memory model is an abstract model of program access to memory, describing how programs access memory to read data. Memory is used to store various data types, such as complex vectors and operation vectors.

[0084] 304. The computer device sequentially reads elements in the first complex vector to obtain a plurality of first operation vectors, and sequentially reads elements in the second complex vector to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers.

[0085] Optionally, the preset step size is used to indicate the number of multiple elements read each time, and the computer device reads the multiple elements according to the preset step size, that is, each time obtains a preset number of multiple elements from the complex vector, where the preset number is equal to the preset step size, and then combines the multiple elements read each time into an operation vector. The order of the multiple elements in the operation vector is the same as their order in the complex vector.

[0086] In the embodiment of the present application, when the computer device reads the elements one by one, it reads the elements from the front to the back in the order of the multiple elements in the complex vector.

[0087] For example, during the i-th read process, multiple elements of the first complex vector are read to obtain the first operation vector required for the i-th operation. During the i+1-th read process, multiple elements are read from the remaining elements of the first complex vector to obtain the first operation vector required for the i+1-th operation. The multiple elements in the i-th first operation vector are arranged before the multiple elements in the i+1-th first operation vector in the first complex vector. The process for obtaining the second operation vector is similar and will not be further described here. i is an integer greater than or equal to 1.

[0088] Optionally, after any element in the complex vector is read, it no longer exists in the complex vector. In this way, each time an element is read, the first few elements in the complex vector corresponding to the preset step size only need to be read, thereby improving reading efficiency.

[0089] 305. The computer device adjusts the first operation vector and the second operation vector read at any time according to a first adjustment method to obtain a third operation vector, and adjusts the second operation vector according to a second adjustment method to obtain a fourth operation vector, wherein the first adjustment method and the second adjustment method match the preset step size and the operation type between the first complex number array and the second complex number array, so that the operation result obtained based on the multiple operation vectors is the same as the operation result obtained based on the operation type between the first complex number array and the second complex number array.

[0090] In an embodiment of the present application, two operation vectors (i.e., the first operation vector and the second operation vector) are adjusted based on the first adjustment method and the second adjustment method that match the preset step size and the operation type. In this way, vector operations are performed based on the adjusted operation vectors, and synchronous operations on multiple complex numbers can be achieved through vector operations, thereby improving the operation efficiency, and making the obtained operation results the same as the operation results obtained by the first complex number array and the second complex number array based on the operation type, thereby ensuring the accuracy of the operation, and thus ensuring the accuracy of the filtering while improving the filtering efficiency.

[0091] It should be noted that the computer does not need to actually execute the step of "operating the first complex number array and the second complex number array based on the operation type to obtain a calculation result". It only needs to determine the correct first adjustment method and second adjustment method to ensure that the obtained calculation result is the same as the "calculation result obtained by operating the first complex number array and the second complex number array based on the operation type".

[0092] The operation type includes at least one of addition, subtraction, multiplication and division.

[0093] In some embodiments, the computer device can adjust the first operation vector according to a variety of adjustment methods to obtain multiple third operation vectors, and can adjust the second operation vector according to a variety of adjustment methods to obtain multiple fourth operation vectors. It can also further adjust the third operation vector and the fourth operation vector to improve the diversity and flexibility of the adjustment, thereby facilitating vector operations.

[0094] In an embodiment of the present application, the adjustment method includes at least one of swapping the elements indicating the real part and the imaginary part in the operation vector, modifying the numerical value of the elements in the operation vector, and modifying the positive or negative nature of the elements in the operation vector.

[0095] The swapping of the elements indicating the real and imaginary parts may be done by swapping the real and imaginary parts of the same complex number or the real and imaginary parts of different complex numbers. The modification of the values ​​of the elements in the operation vector may be done based on the values ​​of the elements in the operation vector or based on values ​​outside the operation vector.

[0096] In an embodiment of the present application, by adjusting the operation vectors through the above-mentioned multiple adjustment methods, multiple operation vectors can be adjusted to a form that can uniformly perform operations on multiple pairs of complex numbers, and then based on the adjusted operation vectors, multiple pairs of complex numbers can be uniformly operated, thereby improving the efficiency of the operation.

[0097] In some embodiments, a computer device establishes a corresponding relationship in advance so that the computer device determines an adjustment method based on a preset step size and an operation type. The process of the computer device establishing the corresponding relationship includes the following steps: the computer device determines multiple groups of adjustment method pairs based on multiple groups of condition pairs, each group of condition pairs includes a preset step size and an operation type, and each group of adjustment method pairs includes two adjustment methods, and the two adjustment methods are respectively used to adjust two operation vectors. Based on the multiple groups of condition pairs and the multiple groups of adjustment method pairs, a corresponding relationship is established, the corresponding relationship includes the multiple groups of condition pairs and the adjustment method pairs corresponding to the multiple groups of condition pairs, and the corresponding relationship is used to determine the adjustment method.

[0098] In an embodiment of the present application, the preset step size in the conditional pair can be four, six, eight, etc., and the operation type can be addition, subtraction, multiplication, and division, etc. The adjustment method includes at least one of swapping the elements indicating the real part and the imaginary part in the operation vector, modifying the numerical value of the elements in the operation vector, and modifying the positive and negative values ​​of the elements in the operation vector. For example, when the preset step size included in the conditional pair is four and the operation type is multiplication, the adjustment method determined based on the corresponding relationship includes an adjustment method of swapping the elements indicating the real part and the imaginary part in the operation vector, and an adjustment method of modifying the positive and negative values ​​of the elements indicating the real part in the operation vector.

[0099] In the embodiment of the present application, since the corresponding relationship is established in advance, the adjustment method can be quickly determined when adjusting the operation vector, and the adjustment method is used to perform vector operations, thereby improving the efficiency of vector operations.

[0100] In some embodiments, for any pair of conditions, the computer device determines the result of the operation between each two complex numbers based on the number of complex numbers indicated by a preset step size and the operation type, determines an intermediate result used to obtain the real and imaginary parts of the operation result, and then determines an intermediate vector used to obtain the intermediate result. The operation vector is converted into the intermediate vector as an adjustment method. Each adjustment method may include multiple sub-adjustment methods, so that the same operation vector is adjusted based on the multiple sub-adjustment methods to obtain multiple adjusted operation vectors.

[0101] In some embodiments, after the computer device reads the elements to obtain the first and second operation vectors, it adjusts the first and second operation vectors to obtain the third and fourth operation vectors. In other embodiments, the computer device performs this adjustment while reading the elements. Accordingly, the computer device adjusts the elements based on the adjustment methods corresponding to the third and fourth operation vectors during the reading process, i.e., the reading and adjustment steps are performed simultaneously to improve the efficiency of obtaining the adjusted operation vectors.

[0102] In some embodiments, the computer device uses the vector parallel computing technology of the chip's multi-function computing unit (MFCU, Multi Function Control Unit) to improve the computing speed. The multi-function computing unit is a common computing unit in a chip, which has a variety of different computing functions. The multi-function computing unit is usually composed of multiple computing units and can perform a variety of different operations at the same time, including addition, subtraction, multiplication, division, logical operations, vector operations, etc. Vector parallel computing technology is a parallel computing technology that uses hardware devices such as vector processors or GPUs (Graphics Processing Units) to perform operations on multiple vectors at the same time to improve computing efficiency and performance.

[0103] 306. The computer device performs vector operations on the first operation vector, the second operation vector, the third operation vector, and the fourth operation vector to obtain a result vector of any operation.

[0104] In some embodiments, the above-mentioned computer device performs vector operations on the first operation vector, the second operation vector, the third operation vector and the fourth operation vector, and the process of obtaining any result vector includes the following steps: the computer device performs multiple vector operations based on the first operation vector, the second operation vector, the third operation vector and the fourth operation vector to obtain multiple intermediate result vectors, each element in the intermediate result vector is used to determine the real part or imaginary part of a complex number, and each vector operation corresponds to at least two operation vectors of the first operation vector, the second operation vector, the third operation vector and the fourth operation vector; the computer device combines multiple intermediate result vectors to obtain any result vector, and the real part or imaginary part indicated by the result vector is obtained by combining multiple elements with the same position in the multiple intermediate result vectors.

[0105] Multiple vector operations are at least two vector operations. For example, a computer device performs a vector operation on a first operation vector and a third operation vector to obtain an intermediate result vector; and a computer device performs a vector operation on a second operation vector and a fourth operation vector to obtain an intermediate result vector. For another example, a computer device performs a vector operation on a first operation vector, a second operation vector, and a third operation vector to obtain an intermediate result vector; and a computer device performs a vector operation on a first operation vector and a fourth operation vector to obtain an intermediate result vector.

[0106] In an embodiment of the present application, multiple elements in a result vector are real and imaginary parts of multiple complex numbers, and one element is the real or imaginary part of a complex number. Combining multiple intermediate result vectors is performed by performing one of addition, subtraction, multiplication, and division on the multiple intermediate result vectors to obtain a result vector. For example, if combining multiple intermediate result vectors is performed by accumulating multiple intermediate results, then any element in the result vector is the sum of multiple elements in the multiple intermediate result vectors that have the same position as the element.

[0107] In an embodiment of the present application, by performing unified operations on multiple operation vectors and performing synchronous operations on multiple elements in the operation vectors, intermediate results of the real and imaginary parts of multiple complex numbers can be obtained at one time, and then synchronous operations are performed on multiple elements in the intermediate vectors to obtain the real and imaginary parts of multiple complex numbers at one time. In this way, by utilizing the principle of synchronous calculation of multiple elements of a vector, multiple complex numbers can be processed synchronously, thereby improving the efficiency of complex number operations.

[0108] In the embodiment of the present application, steps 305-306 are used to perform vector operations on the read first and second operation vectors to obtain multiple result vectors. In this embodiment, by adjusting the operation vectors, the multiple operation vectors can be adjusted to a form that can uniformly operate on multiple pairs of complex numbers. Based on the adjusted operation vectors, the multiple pairs of complex numbers can then be uniformly operated, thereby improving the efficiency of the operation. Furthermore, due to the improved operation efficiency, the filtering time is shortened. Accordingly, the filtering speed is accelerated, thereby improving the filtering efficiency.

[0109] It should be noted that the above steps 305-306 are merely one optional implementation method for performing vector operations on the read first operation vector and second operation vector to obtain multiple result vectors. The computer device can also implement this process through other optional implementation methods. For example, the computer device can directly perform vector operations on the first operation vector and the second operation vector to obtain a result vector without adjusting the first operation vector and the second operation vector. If the operation type is addition or subtraction, then the first operation vector and the second operation vector can be directly added or subtracted to obtain a result vector.

[0110] In some embodiments, the element reading process can be performed in parallel with the vector operation process. Accordingly, the i-th and (i+1)-th operations are still used as examples for description. During the vector operation on the first and second operation vectors read for the i-th time, multiple elements are read from the remaining elements of the first complex vector to obtain the (i+1)-th first operation vector, and multiple elements are read from the remaining elements of the second complex vector to obtain the (i+1)-th second operation vector.

[0111] For example, when performing vector multiplication, the operation vector for the next operation process is read from the complex vector in advance. After reading (fetching) the element to obtain the current operation vector, the decoding (decode) and operation (execution) process will be entered immediately. In the current vector operation process, the CPU (Central Processing Unit) reads the next two operation vectors in the two complex vectors in parallel. In this way, by concurrently executing the current operation step and the next reading step, the reading time loss of the next operation will be reduced, the purpose of operation acceleration will be achieved, and efficiency will be improved. Among them, decoding refers to the process of reading data from the memory and dividing the read data into a first operation vector and a second operation vector. That is, after the computer device reads a series of data from the memory, it needs to be decoded to divide it into multiple elements and determine which elements are divided into which operation vector.

[0112] Optionally, the computer device implements parallel execution of multiple steps through the CPU's instruction parallel optimization (ILP optimization) technology. The processor fully utilizes the hardware resources of the computer device by executing multiple instructions simultaneously, thereby accelerating the execution speed of the program and improving the execution efficiency and performance of the program.

[0113] For example, referring to Figure 4, Figure 4 is a schematic diagram of a parallel operation provided by an embodiment of the present application. First, wait for instructions, then execute instructions to filter, and finally complete the instructions. Wherein, the linear communication model (pipeline) divides the filtering process into 4 steps, namely the steps of reading, decoding, computing and returning results (write-back), and the blocks of different patterns in the figure represent different steps. Optionally, in the process of executing the current computing instruction, execute the next read instruction. Further, in the process of executing the current decoding instruction, execute the next read instruction. Accordingly, in multiple clock cycles, the current decoding step and the next read step are executed in parallel.

[0114] 307. The computer device fills each two adjacent elements in the result vector with a complex number in the result complex number array to obtain multiple complex numbers in the result complex number array, where each two adjacent elements are the real part and the imaginary part of a complex number respectively.

[0115] In some embodiments, each time the computer device obtains a result vector, it pads every two adjacent elements in the result vector with a complex number in the result complex number array to obtain multiple complex numbers in the result complex number array. In other embodiments, after the computer device obtains at least two result vectors, it pads every two adjacent elements in the at least two result vectors with a complex number in the result complex number array to obtain multiple complex numbers in the result complex number array.

[0116] In some embodiments, two adjacent elements in the result vector are the real part and imaginary part of a complex number, with the real part in front and the imaginary part in the back, that is, the number of elements in the result vector is an even number, the elements in odd positions are the real part of the complex number, and the elements in even positions are the imaginary part of the complex number.

[0117] It should be noted that the result vectors are populated in the result complex array in the order in which they were read. The elements in each result vector are populated in the result complex array in the order in which they appear in the multiple elements. The result complex array is used to represent the filtered audio data.

[0118] In the related art, since both the audio data and the filter parameters are in the form of complex arrays, when performing operations based on the complex arrays, the real part and the imaginary part of each complex number in the complex arrays are read one by one. In this way, one complex number is read from two complex arrays respectively to perform operations on the two complex numbers, which requires four reading operations. After the results are obtained, the real part and the imaginary part of the results are also stored one by one in the result complex array, that is, the real part or the imaginary part of a complex number is stored in the complex array at a time, thereby reducing the operational efficiency of the complex array.

[0119] In the embodiment of the present application, the multiplication operation of complex arrays in the high frequency of echo cancellation is used as an example for explanation. The operation process of the complex array involves the multiplication and addition operations of two complex arrays. The operation process is that the two complex arrays participating in the operation read out their own complex numbers one by one, and use the real and imaginary parts of the complex numbers to participate in the operation. For example, see Figure 5, which is a schematic diagram of the operation of a complex array provided by the embodiment of the present application. Therein, the values ​​of the real and imaginary parts of the two complex arrays are read out bit by bit, and then the complex multiplication operations are performed one by one, and finally stored in the result complex array. The reading efficiency of this process is low. The two complex numbers require four read operations before the complex multiplication operation is performed. In addition, four independent multiplication operations must be performed first, and then two independent addition and subtraction operations must be performed. There are many operation steps, and the obtained operation results are also stored in the result complex array twice, which is overall inefficient. In the figure, r represents the real part of the complex number, and i represents the imaginary part of the complex number.

[0120] In the embodiment of the present application, the preset step size is four, the first operation vector and the second operation vector respectively include the real part and the imaginary part of two complex numbers, and the operation type is multiplication. The process of performing vector operations on the first operation vector and the second operation vector read by the computer device to obtain multiple result vectors includes the following steps:

[0121] The computer device replaces the second element of the first operation vector with the first element and the fourth element with the third element for any first operation vector and the second operation vector read at any time, to obtain a third operation vector; replaces the first element of the second operation vector with the negative number of the second element and the third element with the negative number of the fourth element to obtain a fourth operation vector; swaps the first element and the second element and the third element and the fourth element in the second operation vector to obtain a fifth operation vector; multiplies every two elements of corresponding positions in the third operation vector and the second operation vector to obtain a first intermediate vector; multiplies every two elements of corresponding positions in the fourth operation vector and the fifth operation vector to obtain a second intermediate vector; determines the sum of the first intermediate vector and the second intermediate vector to obtain a result vector at any time.

[0122] The multiple elements in the multiple intermediate result vectors correspond one to one, that is, the multiple intermediate result vectors respectively include the same number of elements.

[0123] In this embodiment, two complex numbers can be multiplied at the same time, and by converting the complex numbers into vectors, the real and imaginary parts of multiple complex numbers can be synchronously calculated at the same time. The real and imaginary parts are no longer calculated independently, that is, the synchronous calculation of multiple real parts and multiple imaginary parts is realized. In this way, the calculation efficiency is further improved on the basis of the synchronous calculation of multiple complex numbers.

[0124] For example, see Figure 6, which is a flowchart of a vector operation provided by an embodiment of the present application. Here, a preset step size of four is used, and the first and second operation vectors each include the real and imaginary parts of two complex numbers, and the operation type is multiplication. The squares in the figure represent element positions, and the letters represent the values ​​of an element. Verv32_s16 represents an instruction for swapping two elements in a vector. vtrn_s16 represents an instruction for modifying the values ​​of elements based on the values ​​of elements in an operation vector. vmul_s16 represents an instruction for modifying the positive or negative value of elements in an operation vector. vmull_s16 represents an instruction for multiplying every two elements in corresponding positions in two vectors. vmlsl_s16 represents an instruction for multiplying every two elements in corresponding positions in two vectors and adding the elements in corresponding positions in another vector. vcombine_s16 + vshrn_s16 are instructions for filling the result complex array with elements from multiple result vectors. As shown in Figure 6, the bitwise multiplication of a complex array is converted into the multiplication and subtraction of the vectors [a, b, e, f] and [c, d, g, h]. This allows two complex numbers to be read at once, and the product of the two complex numbers is obtained through one multiplication and one multiplication-subtraction operation. This significantly improves data reading, storage, and computational efficiency.

[0125] 308. The computer device determines filtered audio data based on the multiple complex numbers in the result complex number array.

[0126] In an embodiment of the present application, the computer device performs an inverse transform on multiple complex numbers in the resulting complex array to obtain filtered audio data. For example, if the computer device performs a Fourier transform on the audio data to obtain a complex array, the computer device performs an inverse Fourier transform on the resulting complex array to obtain filtered audio data.

[0127] In the embodiment of the present application, the process of obtaining filtered audio data based on multiple result vectors is implemented through the above steps 307-308. In this embodiment, since the multiple result vectors are obtained from multiple operation vectors, and the multiple operation vectors are obtained from two complex arrays, the multiple result vectors are then converted into result complex arrays, resulting in the operation results of the two complex arrays. The two complex array operations are used to filter the audio data, and the filtered audio data can be obtained based on the result complex arrays, thus ensuring the integrity of the operation.

[0128] In this embodiment, multiple elements in each result vector are simultaneously added to the result complex number array, thereby obtaining multiple complex numbers at once. Compared to performing operations on only one set of complex numbers at a time and thus adding only one complex number at a time to the result complex number array, this improves processing efficiency and, in turn, improves the filtering efficiency of the audio data.

[0129] It should be noted that the above steps 307-308 are only an optional implementation method for realizing the process of determining the filtered audio data based on multiple result vectors. The computer device can also realize the process through other optional implementation methods, which will not be described in detail here.

[0130] In the embodiment of the present application, the multiplication operation between complex arrays is used as an example for explanation. In the filtering process, not only the multiplication operation between complex arrays is involved, but also the updating process of the filtering parameters is involved. The updating process includes operations such as addition, subtraction, and division. The computer device can also convert the corresponding data into a complex array to perform operations based on the vector corresponding to the complex array. For example, referring to the following formula (1), the computer device obtains the filtered audio data through the multiplication operation in the following formula (1). (n) =w (n) ×x (n) (1);

[0131] Among them, y (n) represents the actual output signal of the filter, that is, the filtered audio data, w (n) Represents the filter parameters of the filter, x (n)Represents the audio signal input to the filter. If the filtered audio data is obtained based on the complex array, then y in the above formula (n) 、w (n) 、x (n) All are complex arrays.

[0132] For another example, the update process of the filter parameters is implemented by formula (1) and the following formulas (2) and (3). Formula (3) is a formula for updating the filter parameters of the filter using the LMS (Least Mean Square) algorithm. (n) =d (n) -y (n) (2); w (n+1) =w (n) +μ×e (n) ×x (n) (3);

[0133] Among them, e (n) represents the error signal, d (n) represents the expected output signal of the filter, y (n) represents the actual output signal of the filter, μ represents the step size parameter, which is used to control the speed of updating the filter parameters. (n+1) Represents the updated filter parameters, w (n) Represents the filter parameters of the filter, x (n) Represents the audio signal input to the filter. If the filter parameters are updated based on a complex array, then y in the above formula (n) 、w (n) 、x (n) 、e (n) Each factor is a complex array. Further, the computer device converts the complex array in the above formula into a vector operation, which can improve the operation efficiency and thus improve the efficiency of updating the filter parameters.

[0134] The method provided in the embodiment of the present application can be applied in the virtual scene of the game, for example, to perform echo cancellation on the voices of two players talking in the game. Furthermore, the method provided in the embodiment of the present application is applied in the GVoice SDK (a game voice plug-in), that is, it runs in the game. The voice of the player's speech will pass through the filtering algorithm of GVoice to improve the execution speed of echo cancellation. And on the product side, the CPU occupied by the SDK will be reduced. Echo cancellation is the main operation content of the GVoice SDK. Improving its operation efficiency is crucial to improving the performance of the entire GVoice SDK. By using the method provided in the embodiment of the present application to eliminate echoes in audio data, the overall performance of the algorithm is improved by 17%, thereby improving the communication quality and clarity. For example, see Figures 7 and 8, Figures 7 and 8 are schematic diagrams of a virtual scene provided in the embodiment of the present application.

[0135] An embodiment of the present application provides a method for filtering audio data, which converts audio data into a complex vector and represents filtering parameters in the form of a complex array. In this way, when reading elements from the complex vector for calculation, the real part and imaginary part of a complex number can be read simultaneously, without having to read the real part and imaginary part of a complex number twice, thereby improving reading efficiency; and multiple complex numbers can be read at one time, further improving reading efficiency; and vector operations are performed based on the first operation vector and the second operation vector corresponding to the multiple complex numbers, so that multiple complex numbers can be calculated at one time, thereby improving calculation efficiency. This method improves reading efficiency and calculation efficiency by converting the complex array into a vector for processing, thereby improving the filtering efficiency of audio data.

[0136] FIG9 is a block diagram of an audio data filtering device provided according to an embodiment of the present application. The device is used to perform the steps of the above-mentioned audio data filtering method. Referring to FIG9 , the device includes:

[0137] An acquisition module 901 is configured to acquire audio data and a first complex array, where the first complex array is a filter parameter of a filter;

[0138] A conversion module 902, configured to convert the audio data into a second complex number array;

[0139] An extraction module 903 is configured to extract the real part and the imaginary part of each complex number in the first complex array to obtain a first complex vector, and extract the real part and the imaginary part of each complex number in the second complex array to obtain a second complex vector, where an element of the complex vector is the real part or the imaginary part of a complex number;

[0140] a reading module 904 configured to sequentially read elements of a first complex vector to obtain a plurality of first operation vectors, and sequentially read elements of a second complex vector to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers;

[0141] An operation module 905 is configured to perform vector operations on the first operation vector and the second operation vector to obtain a plurality of result vectors;

[0142] The determination module 906 is configured to determine filtered audio data based on the multiple result vectors.

[0143] In some embodiments, the reading module 904 is configured to:

[0144] Reading multiple elements of the first complex vector at a preset step size each time to obtain a first operation vector;

[0145] Reading multiple elements in the second complex vector at a preset step size each time to obtain a second operation vector;

[0146] The preset step size is used to indicate the number of elements read each time.

[0147] In some embodiments, the operation module 905 is configured to:

[0148] For any first operation vector and second operation vector read at any time, adjusting the first operation vector according to a first adjustment method to obtain a third operation vector, and adjusting the second operation vector according to a second adjustment method to obtain a fourth operation vector, the first adjustment method and the second adjustment method matching a preset step size and an operation type between the first complex array and the second complex array, so that an operation result obtained based on the multiple operation vectors is the same as an operation result obtained based on the operation type between the first complex array and the second complex array;

[0149] Vector operations are performed on the first operation vector, the second operation vector, the third operation vector, and the fourth operation vector to obtain result vectors of any operation.

[0150] In some embodiments, the multiple elements in the result vector are real parts and imaginary parts of multiple complex numbers, and the operation module 905 is used to:

[0151] Perform multiple vector operations based on the first operation vector, the second operation vector, the third operation vector, and the fourth operation vector to obtain multiple intermediate result vectors, each element of the intermediate result vectors is used to determine the real part or the imaginary part of a complex number, and each vector operation corresponds to at least two operation vectors;

[0152] The multiple intermediate result vectors are combined to obtain a result vector, and the real part or imaginary part indicated by the result vector is obtained by combining multiple elements in the same position in the multiple intermediate result vectors.

[0153] In some embodiments, the adjustment method includes at least one of swapping elements indicating real parts and imaginary parts in the operation vector, modifying the values ​​of elements in the operation vector, and modifying the positive and negative properties of elements in the operation vector.

[0154] In some embodiments, the first operation vector and the second operation vector respectively include the real part and the imaginary part of two complex numbers; the operation module 905 is configured to:

[0155] For any of the first and second operation vectors read at any time, the second element of the first operation vector is replaced by the first element, and the fourth element is replaced by the third element, to obtain a third operation vector; the first element of the second operation vector is replaced by the negative number of the second element, and the third element is replaced by the negative number of the fourth element, to obtain a fourth operation vector;

[0156] Swapping the first element and the second element in the second operation vector, and swapping the third element and the fourth element in the second operation vector, to obtain a fifth operation vector;

[0157] Multiplying every two elements of the third operation vector and the second operation vector at corresponding positions to obtain a first intermediate vector; multiplying every two elements of the fourth operation vector and the fifth operation vector at corresponding positions to obtain a second intermediate vector;

[0158] The sum of the first intermediate vector and the second intermediate vector is determined to obtain a result vector at any time.

[0159] In some embodiments, the determination module 906 is further configured to:

[0160] Determining multiple adjustment mode pairs based on the multiple condition pairs, each condition pair including a preset step size and an operation type, each adjustment mode pair including two adjustment modes, and the two adjustment modes are respectively used to adjust the two operation vectors;

[0161] The device also includes an establishment module for establishing a corresponding relationship based on multiple sets of condition pairs and multiple sets of adjustment method pairs. The corresponding relationship includes multiple sets of condition pairs and the adjustment method pairs corresponding to the multiple sets of condition pairs respectively. The corresponding relationship is used to determine the adjustment method.

[0162] In some embodiments, the reading module 904 is further configured to:

[0163] In the process of performing vector operations on the first operation vector and the second operation vector read for the i-th time, multiple elements are read from the remaining elements of the first complex vector to obtain the i+1-th first operation vector, and multiple elements are read from the remaining elements of the second complex vector to obtain the i+1-th second operation vector, where i is an integer greater than 0.

[0164] In some embodiments, the determination module 906 is configured to:

[0165] Fill each two adjacent elements in the multiple result vectors with a complex number in the result complex array to obtain multiple complex numbers in the result complex array, where each two adjacent elements are the real part and the imaginary part of a complex number respectively;

[0166] Filtered audio data is determined based on the plurality of complex numbers in the result complex array.

[0167] An embodiment of the present application provides a filtering device for audio data, which converts audio data into a complex vector and represents filtering parameters in the form of a complex array. In this way, when reading elements from the complex vector for calculation, the real part and imaginary part of a complex number can be read simultaneously, without having to read the real part and imaginary part of a complex number twice, thereby improving reading efficiency; multiple complex numbers can be read at one time, further improving reading efficiency; and vector operations are performed based on the first operation vector and the second operation vector of the multiple complex numbers read, so that multiple complex numbers can be calculated at one time, thereby improving calculation efficiency. The device improves reading efficiency and calculation efficiency by converting the complex array into a vector for processing, thereby improving the filtering efficiency of audio data.

[0168] In the embodiments of the present application, the computer device may be a terminal or a server. When the computer device is a terminal, the terminal serves as the execution subject to implement the technical solution provided in the embodiments of the present application; when the computer device is a server, the server serves as the execution subject to implement the technical solution provided in the embodiments of the present application; or, the technical solution provided in the present application may be implemented through interaction between the terminal and the server, which is not limited in the embodiments of the present application.

[0169] FIG10 illustrates a block diagram of a terminal 1000 according to an exemplary embodiment of the present application. Terminal 1000 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1000 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other similar names.

[0170] Typically, the terminal 1000 includes a processor 1001 and a memory 1002 .

[0171] Processor 1001 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 1001 may be implemented in at least one of the following hardware forms: a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), or a PLA (Programmable Logic Array). In some embodiments, processor 1001 may also include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.

[0172] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1002 is used to store at least one program code, which is executed by the processor 1001 to implement the audio data filtering method provided in the method embodiment of the present application.

[0173] In some embodiments, terminal 1000 may optionally include a peripheral device interface 1003 and at least one peripheral device. Processor 1001, memory 1002, and peripheral device interface 1003 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1003 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1004, a display screen 1005, a camera assembly 1006, an audio circuit 1007, and a power supply 1008.

[0174] In some embodiments, the terminal 1000 further includes one or more sensors 1009 . The one or more sensors 1009 include, but are not limited to, an acceleration sensor 1010 , a gyroscope sensor 1011 , a pressure sensor 1012 , an optical sensor 1013 , and a proximity sensor 1014 .

[0175] Those skilled in the art will understand that the structure shown in FIG10 does not constitute a limitation on the terminal 1000 , and the terminal 1000 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0176] FIG11 is a block diagram of a server provided according to an embodiment of the present application. The server 1100 may vary greatly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1101 and one or more memories 1102, wherein the memories 1102 are used to store executable program codes, and the processors 1101 are configured to execute the above-mentioned executable program codes to implement the audio data filtering methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.

[0177] An embodiment of the present application also provides a computer-readable storage medium, in which at least one program is stored. The at least one program is loaded and executed by a processor to implement the audio data filtering method of any of the above implementation methods.

[0178] An embodiment of the present application also provides a computer program product, which includes at least one program segment, and the at least one program segment is stored in a computer-readable storage medium. The processor of the computer device reads the at least one program segment from the computer-readable storage medium, and the processor executes the at least one program segment, so that the computer device performs the audio data filtering method of any of the above-mentioned implementation methods.

[0179] In some embodiments, the computer program product involved in the embodiments of the present application can be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected through a communication network. Multiple computer devices distributed at multiple locations and interconnected through a communication network can constitute a blockchain system.

[0180] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for filtering audio data, applied to a computer device, the method comprising: Acquire audio data and a first complex array, where the first complex array is a filter parameter of a filter; Converting the audio data into a second complex array; Extracting the real part and the imaginary part of each complex number in the first complex number array to obtain a first complex number vector, extracting the real part and the imaginary part of each complex number in the second complex number array to obtain a second complex number vector, wherein one element of the complex number vector is the real part or the imaginary part of a complex number; Reading elements in the first complex vector one by one to obtain a plurality of first operation vectors, and reading elements in the second complex vector one by one to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers; Performing vector operations on the first operation vector and the second operation vector read to obtain multiple result vectors; Filtered audio data is determined based on the plurality of result vectors.

2. The method according to claim 1, characterized in that The step of successively reading the elements in the first complex vector to obtain a plurality of first operation vectors, and successively reading the elements in the second complex vector to obtain a plurality of second operation vectors comprises: Reading a plurality of elements in the first complex vector at a preset step length each time to obtain a first operation vector; Reading a plurality of elements in the second complex vector according to the preset step length each time to obtain a second operation vector; The preset step size is used to indicate the number of multiple elements read each time.

3. The method according to claim 1, wherein: The performing vector operation on the read first operation vector and the second operation vector to obtain a plurality of result vectors includes: For the first operation vector and the second operation vector read at any time, the first operation vector is adjusted according to a first adjustment method to obtain a third operation vector, and the second operation vector is adjusted according to a second adjustment method to obtain a fourth operation vector, wherein the first adjustment method and the second adjustment method match the preset step size and the operation type between the first complex number array and the second complex number array, so that the operation result obtained based on the multiple operation vectors is the same as the operation result obtained based on the operation type between the first complex number array and the second complex number array; Vector operations are performed on the first operation vector, the second operation vector, the third operation vector, and the fourth operation vector to obtain the result vector of any one of the operations.

4. The method according to claim 3, wherein: The multiple elements in the result vector are real parts and imaginary parts of multiple complex numbers, and the vector operation is performed on the first operation vector, the second operation vector, the third operation vector, and the fourth operation vector to obtain the result vector of any one time, including: Based on the first operation vector, the second operation vector, the third operation vector and the fourth operation vector, multiple vector operations are performed to obtain multiple intermediate result vectors, each element of the intermediate result vector is used to determine the real part or the imaginary part of a complex number, and each vector operation corresponds to at least two operation vectors; The multiple intermediate result vectors are combined to obtain the result vector, the real part or The imaginary part is obtained by combining multiple elements in the same position in the multiple intermediate result vectors.

5. The method according to claim 3, wherein: The adjustment method includes at least one of swapping elements indicating real parts and imaginary parts in the operation vector, modifying the values ​​of elements in the operation vector, and modifying the positive and negative properties of elements in the operation vector.

6. The method according to any one of claims 1 to 3, wherein: The first operation vector and the second operation vector respectively include the real part and the imaginary part of two complex numbers; the vector operation is performed on the read first operation vector and the second operation vector to obtain multiple result vectors, including: For any of the first operation vector and the second operation vector read at one time, the second element in the first operation vector is replaced by the first element, and the fourth element is replaced by the third element, to obtain a third operation vector; the first element in the second operation vector is replaced by the negative number of the second element, and the third element is replaced by the negative number of the fourth element, to obtain a fourth operation vector; Swapping the first element and the second element in the second operation vector, and swapping the third element and the fourth element, to obtain a fifth operation vector; Multiplying every two elements of the third operation vector and the second operation vector at corresponding positions to obtain a first intermediate vector; multiplying every two elements of the fourth operation vector and the fifth operation vector at corresponding positions to obtain a second intermediate vector; The sum of the first intermediate vector and the second intermediate vector is determined to obtain the result vector of any one time.

7. The method according to claim 3, wherein: The method further comprises: Based on the multiple sets of condition pairs, determining multiple sets of adjustment mode pairs, each set of condition pairs including a preset step size and an operation type, each set of adjustment mode pairs including two adjustment modes, and the two adjustment modes are respectively used to adjust the two operation vectors; Based on the multiple sets of condition pairs and the multiple sets of adjustment mode pairs, a corresponding relationship is established, the corresponding relationship includes the multiple sets of condition pairs and the adjustment mode pairs respectively corresponding to the multiple sets of condition pairs, and the corresponding relationship is used to determine the adjustment mode.

8. The method according to claim 1, wherein: The method further comprises: In the process of performing vector operations on the first operation vector and the second operation vector read for the i-th time, multiple elements are read from the remaining elements of the first complex vector to obtain the i+1-th first operation vector, and multiple elements are read from the remaining elements of the second complex vector to obtain the i+1-th second operation vector, where i is an integer greater than 0.

9. The method according to claim 1, wherein: The step of determining the filtered audio data based on the plurality of result vectors comprises: Filling each two adjacent elements in the multiple result vectors with a complex number in the result complex number array to obtain multiple complex numbers in the result complex number array, wherein each two adjacent elements are the real part and the imaginary part of a complex number respectively; The filtered audio data is determined based on a plurality of complex numbers in the result complex array.

10. A filtering device for audio data, the device comprising: An acquisition module, used for acquiring audio data and a first complex array, where the first complex array is a filter parameter of a filter; A conversion module, used for converting the audio data into a second complex number array; an extraction module, configured to extract the real part and the imaginary part of each complex number in the first complex number array to obtain a first complex number vector, and extract the real part and the imaginary part of each complex number in the second complex number array to obtain a second complex number vector, wherein one element of the complex number vector is a real part or an imaginary part of a complex number; a reading module, configured to read the elements in the first complex vector one by one to obtain a plurality of first operation vectors, and read the elements in the second complex vector one by one to obtain a plurality of second operation vectors, wherein the first operation vector and the second operation vector respectively include real parts and imaginary parts of a plurality of complex numbers, and the first operation vector and the second operation vector indicate the same number of complex numbers; An operation module, configured to perform vector operation on the first operation vector and the second operation vector read to obtain a plurality of result vectors; A determination module is used to determine the filtered audio data based on the multiple result vectors.

11. A computer device, comprising a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded by the processor and executes the audio data filtering method according to any one of claims 1 to 9.

12. A computer-readable storage medium, wherein the computer-readable storage medium is used to store at least one program, wherein the at least one program is used to execute the audio data filtering method according to any one of claims 1 to 9.

13. A computer program product, comprising at least one program segment, wherein the at least one program segment is stored in a computer-readable storage medium, a processor of a computer device reads the at least one program segment from the computer-readable storage medium, and the processor executes the at least one program segment, so that the computer device executes the audio data filtering method described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Sound source orientation method and system

    CN110876100A

  • Speech recognition method, system and equipment

    CN114333811A

  • Audio data filtering method and device, equipment and storage medium

    CN116935824A

  • Complex evolution recurrent neural networks

    US20190156819A1