Reverberation time determination method and device, storage medium and electronic equipment
The room reverberation time is calculated through the filter weight coefficient of the frequency domain block adaptive filter, which solves the problem of high computational resource consumption in traditional technology and achieves efficient reverberation time determination.
Patent Information
- Application Number
- CN202310334850.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
When estimating room reverberation time, traditional echo cancellation technology needs to convert the frequency domain signal into the time domain through inverse Fourier transform, which consumes a lot of computing resources.
Calculate the weight coefficient energy of each frequency domain block through the filter weight coefficient of the frequency domain block adaptive filter, fit the energy attenuation curve, and directly determine the reverberation time of the room, avoiding the step of inverse Fourier transform.
The computing resources required to determine the room reverberation time are reduced and the calculation efficiency is improved.
Smart Images

Figure CN118737174A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a method, device, storage medium and electronic device for determining reverberation time. Background Art
[0002] Traditional acoustic echo cancellation (AEC) generally uses adaptive filters and nonlinear filter suppression to perform echo cancellation. When performing nonlinear filter suppression, if the room reverberation time is known, the nonlinear echo part can be better estimated, thereby better controlling the nonlinear echo.
[0003] In a related technical solution, a test signal is played by a loudspeaker in the current room, and then a reflected signal of the test signal is received by a microphone to obtain a received signal. An impulse response of an adaptive filter is solved through the received signal and the test signal played by the loudspeaker, and the reverberation time of the current room is estimated based on the impulse response.
[0004] However, in this technical solution, the frequency domain signal needs to be converted to the time domain through inverse Fourier transform to obtain the impulse response in the time domain. The reverberation time of the current room is calculated through the impulse response coefficient in the time domain, which consumes a lot of computing resources. Summary of the invention
[0005] The embodiments of the present application provide a method, device, storage medium and electronic device for determining reverberation time, which can reduce the computing resources required for calculating the reverberation time of the current room, thereby efficiently determining the reverberation time of the current room. The technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a method for determining reverberation time, the method comprising:
[0007] Selecting a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of a frequency domain block adaptive filter corresponding to the current room, wherein the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room;
[0008] Determine a filter weight coefficient of the frequency domain block adaptive filter corresponding to each frequency domain block in the predetermined number of frequency domain blocks;
[0009] Determine the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient;
[0010] Fitting the energy attenuation curve corresponding to the current room based on the weight coefficient energy corresponding to each of the frequency domain blocks;
[0011] The reverberation time of the current room is determined based on the energy decay curve.
[0012] In some example embodiments, based on the above scheme, the filter weight coefficient is a one-dimensional vector with a length of N, where N is a positive integer, and determining the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient includes:
[0013] Performing a square operation on each element in the one-dimensional vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block;
[0014] The N square values corresponding to the filter weight coefficients of each frequency domain block are summed to obtain the weight coefficient energy corresponding to each frequency domain block.
[0015] In some example embodiments, based on the above solution, after determining the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient, the method further includes:
[0016] Performing a logarithmic operation on the weight coefficient energy corresponding to each of the frequency domain blocks to determine the logarithmic value of the weight coefficient energy corresponding to each of the frequency domain blocks;
[0017] The energy fitting of the sound field energy attenuation curve corresponding to the current room based on the weight coefficient energy corresponding to each of the frequency domain blocks includes:
[0018] A linear fit is performed on the logarithmic values of the weight coefficient energies corresponding to each of the frequency domain blocks to obtain an energy attenuation curve corresponding to the current room.
[0019] In some example embodiments, based on the above solution, determining the reverberation time of the current room based on the energy decay curve includes:
[0020] Determine a horizontal axis position on the energy decay curve corresponding to the energy decay amount of the reverberation time;
[0021] Determine the number of the frequency domain blocks corresponding to the reverberation time based on the horizontal axis position;
[0022] The reverberation time of the current room is determined based on the number of the frequency domain blocks and the data duration of the frequency domain blocks.
[0023] In some example embodiments, based on the above solution, the method further includes:
[0024] Obtaining a reverberation time correction coefficient corresponding to the current room, wherein the reverberation time correction coefficient is a pre-calibrated correction coefficient;
[0025] The reverberation time of the current room is corrected based on the reverberation time correction coefficient.
[0026] In some example embodiments, based on the above solution, before selecting a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room, the method further includes:
[0027] The frequency domain block adaptive filter is trained in the current room to determine a filter weight coefficient of the frequency domain block adaptive filter.
[0028] In some example embodiments, based on the above solution, training the frequency domain block adaptive filter in the current room to determine the filter weight coefficient of the frequency domain block adaptive filter includes:
[0029] Dividing the input signal of the frequency domain block adaptive filter into a plurality of data blocks;
[0030] Updating filter weight coefficients of the frequency domain block adaptive filter block by block;
[0031] Based on the update result, the filter weight coefficient corresponding to each frequency domain block of the frequency domain block adaptive filter is determined.
[0032] In a second aspect, an embodiment of the present application provides a device for determining a reverberation time, the device comprising:
[0033] A block selection module, used to select a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of a frequency domain block adaptive filter corresponding to the current room, wherein the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room;
[0034] A filter weight coefficient determination module is used to determine the filter weight coefficient of each frequency domain block in a plurality of frequency domain blocks corresponding to the frequency domain block adaptive filter;
[0035] A weight coefficient energy determination module, which determines the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient;
[0036] A curve fitting module, which fits the energy attenuation curve corresponding to the current room based on the weight coefficient energy of each frequency domain block;
[0037] A reverberation time determination module determines the reverberation time of the current room based on the energy decay curve.
[0038] In some example embodiments, based on the above scheme, the filter weight coefficient is a one-dimensional vector with a length of N, where N is a positive integer, and the weight coefficient energy determination module includes:
[0039] A square operation unit, used for performing a square operation on each element in the one-dimensional vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block;
[0040] The weight coefficient energy determination unit is used to sum the N square values corresponding to the filter weight coefficients of each frequency domain block to obtain the weight coefficient energy corresponding to each frequency domain block.
[0041] In some example embodiments, based on the above solution, the apparatus further includes:
[0042] A logarithmic value determination module, used for performing a logarithmic operation on the weight coefficient energy corresponding to each frequency domain block after determining the weight coefficient energy corresponding to each frequency domain block based on the filter weight coefficient, to determine the logarithmic value of the weight coefficient energy corresponding to each frequency domain block;
[0043] The curve fitting module comprises:
[0044] The linear fitting unit is used to perform linear fitting on the logarithmic values of the weight coefficient energies corresponding to each of the frequency domain blocks to obtain an energy attenuation curve corresponding to the current room.
[0045] In some example embodiments, based on the above solution, the reverberation time determination module includes:
[0046] A position determination unit, used to determine a horizontal axis position on the energy decay curve corresponding to the energy decay amount of the reverberation time;
[0047] A quantity determination unit, configured to determine the quantity of the frequency domain blocks corresponding to the reverberation time based on the horizontal axis position;
[0048] The time determination unit is used to determine the reverberation time of the current room based on the number of the frequency domain blocks and the data duration of the frequency domain blocks.
[0049] In some example embodiments, based on the above solution, the apparatus further includes:
[0050] A correction coefficient acquisition unit, used to acquire a reverberation time correction coefficient corresponding to the current room, wherein the reverberation time correction coefficient is a pre-calibrated correction coefficient;
[0051] A correction unit is used to correct the reverberation time of the current room based on the reverberation time correction coefficient.
[0052] In some example embodiments, based on the above solution, the apparatus further includes:
[0053] A training module is used to train the frequency domain block adaptive filter in the current room before selecting a predetermined number of frequency domain blocks from multiple frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room to determine the filter weight coefficient of the frequency domain block adaptive filter.
[0054] In some example embodiments, based on the above solution, the training module includes:
[0055] A block division unit is used to divide the input signal of the frequency domain block adaptive filter into multiple data blocks
[0056] A weight updating unit, used for updating the filter weight coefficient of the frequency domain block adaptive filter block by block;
[0057] The weight determination unit is used to determine the filter weight coefficient corresponding to each frequency domain block of the frequency domain block adaptive filter based on the update result.
[0058] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned method.
[0059] In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.
[0060] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0061] In one or more embodiments of the present application, the weight coefficient energy corresponding to each frequency domain block is determined based on the filter weight coefficient of the frequency domain block adaptive filter; the energy attenuation curve corresponding to the current room is fitted based on the weight coefficient energy of each frequency domain block; the reverberation time of the current room is determined based on the energy attenuation curve. The filter coefficient of the frequency domain block adaptive filter can be used to determine the reverberation time, and there is no need to convert the frequency domain signal into the time domain through an inverse Fourier transform, thereby reducing the computing resources required to determine the room reverberation time. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0063] Figure 1 A schematic diagram showing an application scenario of a method for determining reverberation time provided in some embodiments of the present application;
[0064] Figure 2 A schematic diagram showing a flow chart of a method for determining reverberation time according to some embodiments of the present application is shown;
[0065] Figure 3 A schematic diagram of a process of fitting an energy decay curve provided according to some embodiments of the present application is shown;
[0066] Figure 4 A schematic diagram of determining the reverberation time through an energy decay curve according to some other embodiments of the present application is shown;
[0067] Figure 5 A schematic diagram of the structure of a reverberation time determination device provided in an embodiment of the present application is shown;
[0068] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0070] Below, the relevant terms involved in the embodiments of the present application are first explained.
[0071] Adaptive filter: A digital filter that can automatically adjust its parameters according to the input signal.
[0072] Frequency domain block adaptive filter: The input data of the digital filter is processed in blocks, the linear convolution is converted into circular convolution, and then the circular convolution theorem of discrete Fourier transform is used to convert the time domain circular convolution into the frequency domain product. After that, a certain algorithm is used to automatically correct the filter weight coefficient in the frequency domain, so as to achieve the purpose of adaptive filtering.
[0073] Reverberation time: usually expressed as RT60, which indicates the time required for the signal to reflect and attenuate by 60dB in the room. The larger the RT60, the longer the sound will echo in the room.
[0074] In the related art, in order to measure the reverberation time of a room, a test signal is played through a loudspeaker, and then a microphone is used to receive the reflected signal of the test signal. An impulse response can be solved by the received signal and the signal played by the loudspeaker. According to the impulse response, the RT60 of the room can be estimated. The impulse response solution process can be implemented in the form of an adaptive filter. When performing echo cancellation, adaptive filtering is required. The impulse response can be determined according to the coefficients of the adaptive filter, that is, the RT60 can be estimated by the coefficients of the adaptive filter. Since the frequency domain block adaptive filtering method obtains a block frequency domain signal, it cannot be directly used to calculate the RT60 of the room. It is necessary to convert the block frequency domain signal to the time domain to obtain the impulse response in the time domain. According to the impulse response in the time domain, the RT60 is calculated. This process requires the use of an inverse Fourier transform, which consumes more computing resources.
[0075] Furthermore, because the impulse response is usually a process in which the energy decreases monotonically, estimating the RT60 of the room does not require a very precise impulse response. Only a curve envelope that approximates the impulse response can be used to estimate the RT60. In the case of impulse response block division, the energy of each frequency domain block can also characterize the trend of monotonically decreasing energy. After block division, curve fitting of the energy of the frequency domain block can approximate the trend of monotonically decreasing energy. Since the energy of each frequency domain block can be directly calculated in the frequency domain through the filter weight coefficient, there is no need to transform the existing frequency domain filter coefficients into the time domain, thereby greatly saving the amount of calculation for determining the room RT60.
[0076] In view of this, the embodiments of the present application provide a method and device for determining reverberation time. By using the filter coefficients of the adaptive filter in the frequency domain corresponding to the frequency domain block to approximate the RT60 of the room, there is no need to convert the frequency domain signal into the time domain through inverse Fourier transform, thereby reducing the computing resources of the processor required to determine the RT60 of the room.
[0077] The reverberation time determination method can be implemented by a computer program and can be run on the reverberation time determination based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0078] The reverberation time determination device in the embodiment of the present application may be a terminal device, including but not limited to: an interactive smart tablet, a personal computer, a tablet computer, a handheld device, a wearable device, a computing device or other processing device connected to a wireless modem, etc. The terminal device may be called by different names in different networks, for example: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, terminal device in 5G network or future evolution network, etc.
[0079] Below, the technical solution of the method for determining the reverberation time according to the embodiment of the present application will be described in detail with reference to the accompanying drawings.
[0080] Figure 1 A schematic diagram showing an application scenario of the method for determining reverberation time provided in an embodiment of the present application.
[0081] like Figure 1 As shown, the system architecture of the application scenario may include one or more of the terminal devices 110, 120, 130, a network 140 and a server 150. The network 140 is used to provide a medium for a communication link between the terminal devices 110, 120, 130 and the server 150. The network 140 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. For example, the network 140 may be a public switched telephone network (PSTN) or the Internet. The terminal devices 110, 120, 130 may be various electronic devices with computing capabilities, including but not limited to interactive smart tablets, desktop computers, portable computers, smart phones, and tablet computers.
[0082] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 150 may be a server cluster composed of multiple servers.
[0083] The reverberation time determination method provided in the embodiments of this specification may be executed by the terminal devices 110, 120, and 130, and accordingly, the reverberation time determination device may be a terminal device, or a processor in the terminal device, or other modules in the terminal device for implementing the reverberation time determination function. However, it is easy for those skilled in the art to understand that some steps of the reverberation time determination method provided in the embodiments of this specification may also be executed by the server 150, and accordingly, the reverberation time determination device may also be set in the server 150, which is not particularly limited in this exemplary embodiment.
[0084] It should be noted that the steps in the reverberation time determination method in the example embodiment of this specification may be partially executed by the terminal device, partially executed by the server, or entirely executed by the terminal device, and this specification does not specifically limit this.
[0085] based on Figure 1 The system architecture shown below will be combined Figure 2-Figure 4 , the reverberation time determination method provided by the embodiment of this specification is introduced in detail. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principle of this specification, and the embodiments of this specification are not limited in this respect. On the contrary, the embodiments of this specification can be applied to any applicable scenario.
[0086] Figure 2 A flow chart of a method for determining reverberation time according to some embodiments of the present application is shown. The execution subject of the method for determining reverberation time may be a terminal device with an audio and video playback function. The method for determining reverberation time includes steps S210 to S250. The method for determining reverberation time in an example embodiment is described in detail below in conjunction with the accompanying drawings.
[0087] Reference Figure 2 As shown, in step S210, a predetermined number of frequency domain blocks are selected from multiple frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room, and the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room.
[0088] In an exemplary embodiment, M is set as the length of the frequency domain block adaptive filter, and P is the length of the frequency domain block. If the frequency domain block adaptive filter includes L frequency domain blocks, then M is equal to P*L, where L is a positive integer greater than or equal to 2. A predetermined number of frequency domain blocks are selected from multiple frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room. The predetermined number of frequency domain blocks may be 3 frequency domain blocks, for example, the first 3 frequency domain blocks of the L frequency domain blocks.
[0089] It should be noted that although three frequency domain blocks are used as an example, those skilled in the art should understand that other appropriate numbers of frequency domain blocks, such as 4, can be used to fit the energy attenuation curve, which is also within the scope of the embodiments of the present application.
[0090] Furthermore, the frequency domain block adaptive filter is a FLMS (Fast Least Mean Square) adaptive filter, which is pre-trained for the current room to obtain the trained frequency domain block adaptive filter for the current room and the filter weight coefficients corresponding to each frequency domain block.
[0091] It should be noted that although the FLMS adaptive filter is used as an example for explanation, those skilled in the art should understand that the frequency domain block adaptive filter can also be other appropriate filters such as a block frequency domain Kalman filter or a frequency domain block adaptive filter, which is also within the scope of the embodiments of the present application.
[0092] In step S220, a filter weight coefficient of a frequency domain block adaptive filter corresponding to each frequency domain block in a predetermined number of frequency domain blocks is determined.
[0093] In an example embodiment, the predetermined number of frequency domain blocks may be three frequency domain blocks, and the frequency domain blocks at the beginning of the impulse response have relatively large energy and relatively high accuracy when fitting the energy decay curve. Therefore, the filter weight coefficients corresponding to the first three frequency domain blocks among the multiple frequency domain blocks may be taken to fit the energy decay curve. The filter weight coefficients corresponding to the first three frequency domain blocks are obtained from the filter weight coefficients corresponding to each frequency domain block of the pre-trained frequency domain block adaptive filter.
[0094] In step S230, the weight coefficient energy corresponding to each frequency domain block is determined based on the filter weight coefficient.
[0095] In an example embodiment, the filter weight coefficient is squared to obtain the square value of the filter weight coefficient of each frequency domain block, and the weight coefficient energy corresponding to each frequency domain block is determined based on the square value of the filter weight coefficient of each frequency domain block.
[0096] For example, obtain the filter weight coefficients W0, W1, and W2 of the first three frequency domain blocks of the FLMS adaptive filter; determine the square values of W0, W1, and W2, and use the square values of W0, W1, and W2 as the weight coefficient energy corresponding to each frequency domain block.
[0097] Further, in some example embodiments, the filter weight coefficient is a one-dimensional vector with a length of N, where N is a positive integer, and a square operation is performed on each element in the one-dimensional vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block; the N square values corresponding to the filter weight coefficient of each frequency domain block are summed to obtain the weight coefficient energy corresponding to each frequency domain block.
[0098] In step S240, an energy attenuation curve corresponding to the current room is fitted based on the weight coefficient energy of each frequency domain block.
[0099] In an example embodiment, the horizontal axis of the energy attenuation curve may be time, and the vertical axis may be weight coefficient energy. Curve fitting is performed on the time and weight coefficient energy corresponding to each frequency domain block to obtain the energy attenuation curve corresponding to the current room.
[0100] For example, the time corresponding to each frequency domain block is used as the horizontal axis coordinate and the weight coefficient energy corresponding to each frequency domain block is used as the vertical axis coordinate to obtain the coordinate points corresponding to each frequency domain block, and curve fitting is performed on the coordinate points corresponding to each frequency domain block to obtain the energy attenuation curve corresponding to the current room.
[0101] In step S250, the reverberation time of the current room is determined based on the energy decay curve.
[0102] In an example embodiment, based on the energy attenuation corresponding to the reverberation time, for example 60db, the horizontal axis position corresponding to the energy attenuation on the energy attenuation curve is determined, and based on the horizontal axis position corresponding to the energy attenuation, the reverberation time of the current room is determined.
[0103] For example, determine the horizontal axis position on the energy decay curve corresponding to the energy decay of the reverberation time; determine the number of frequency domain blocks corresponding to the reverberation time based on the horizontal axis position; determine the reverberation time of the current room based on the number of frequency domain blocks and the data duration of the frequency domain blocks. For example, let the data duration corresponding to the frequency domain block be t, if the number of frequency domain blocks corresponding to the horizontal axis position corresponding to the energy decay of the weight coefficient 60dB on the energy decay curve is 3, then the reverberation time of the current room is 3t.
[0104] according to Figure 2 According to the technical solution in the example embodiment, the weight coefficient energy corresponding to each frequency domain block is determined based on the filter weight coefficient of the frequency domain block adaptive filter; the energy attenuation curve corresponding to the current room is fitted based on the weight coefficient energy of each frequency domain block; the reverberation time of the current room is determined based on the energy attenuation curve, and the filter coefficient of the frequency domain block adaptive filter can be used to determine the reverberation time, and there is no need to convert the frequency domain signal into the time domain through inverse Fourier transform, thereby reducing the computing resources required to determine the room reverberation time.
[0105] In addition, in an example embodiment, before selecting a predetermined number of frequency domain blocks from multiple frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room, the reverberation time determination method also includes: training the frequency domain block adaptive filter in the current room to determine the filter weight coefficient of the frequency domain block adaptive filter.
[0106] For example, the input signal of the frequency domain block adaptive filter is divided into multiple data blocks; the filter weight coefficient of the frequency domain block adaptive filter is updated block by block; based on the update result, the filter weight coefficient corresponding to each frequency domain block of the frequency domain block adaptive filter is determined. The filter weight coefficient of the adaptive filter is updated block by block in units of frequency domain blocks. That is to say, when processing each sampling point in the frequency domain block, the filter weight coefficient is fixed. After each sampling point in the frequency domain block is processed, the filter weight coefficient is updated to obtain the filter weight coefficient of the frequency domain block adaptive filter corresponding to each updated frequency domain block.
[0107] For example, the input signal is divided into L frequency domain blocks for processing, L is a positive integer greater than or equal to 2, each frequency domain block may include K sampling points, K is a positive integer greater than or equal to 2. For example, the input signal sequence is divided into a number of frequency domain blocks of length K through a serial-to-parallel converter, and these frequency domain blocks are sent one at a time to a frequency domain block adaptive filter of length M, and the filter weight coefficient of the frequency domain block adaptive filter is updated block by block; based on the update result, the filter weight coefficient corresponding to each frequency domain block of the frequency domain block adaptive filter is determined.
[0108] According to the technical solution in the above embodiment, in the training stage of the frequency domain block adaptive filter in the current room, the filter weight coefficient itself is continuously corrected according to the characteristics of the signal processed by the frequency domain block adaptive filter to minimize the mean square error (Least Mean Square, LMS), that is, the mean square error has reached the minimum value, so that the weight coefficient of the filter is optimized.
[0109] Figure 3 A schematic diagram of a process for fitting an energy decay curve provided according to some embodiments of the present application is shown.
[0110] Reference Figure 3 As shown, in step S310, the filter weight coefficient of the frequency domain block adaptive filter corresponding to each frequency domain block in the predetermined number of frequency domain blocks is determined.
[0111] In an example embodiment, the predetermined number of frequency domain blocks may be three frequency domain blocks. Since the frequency domain blocks at the beginning of the impulse response have relatively large energy and relatively high accuracy when fitting the energy attenuation curve, the filter weight coefficients corresponding to the first three frequency domain blocks among the multiple frequency domain blocks may be taken to fit the energy attenuation curve.
[0112] For example, filter weight coefficients W0, W1, and W2 of the first three frequency domain blocks of the FLMS adaptive filter are obtained, where W0-W2 are one-dimensional complex vectors with a length of N.
[0113] In step S320, a square operation is performed on each element in the one-dimensional vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block.
[0114] In some example embodiments, the filter weight coefficient is a one-dimensional complex vector of length N, where N is a positive integer, and a square operation is performed on each element in the one-dimensional complex vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block.
[0115] In step S330, N square values corresponding to the filter weight coefficients of each frequency domain block are summed to obtain the weight coefficient energy corresponding to each frequency domain block.
[0116] In an example embodiment, the N square values corresponding to the filter weight coefficients of each frequency domain block are summed to obtain the weight coefficient energy corresponding to each frequency domain block. For example, each value in the filter weight coefficients W0~W2 of the frequency domain blocks is squared, and the N square values of each frequency domain block are summed to obtain the weight coefficient energies s0, s1, and s2 corresponding to each frequency domain block.
[0117] In step S340, a logarithmic operation is performed on the weight coefficient energy corresponding to each frequency domain block to determine the logarithmic value of the weight coefficient energy corresponding to each frequency domain block.
[0118] In the example embodiment, since the energy decay curve is exponentially decaying, a logarithmic operation is performed on the weight coefficient energy corresponding to each frequency domain block to convert the energy decay curve into a linear decay curve. For example, the logarithm of the weight coefficient energy s0-s2 corresponding to each frequency domain block is taken with the base 10 and multiplied by 10 to obtain the logarithmic values g0, g1, g2 of the weight coefficient energy corresponding to each frequency domain block;
[0119] In step S350, a linear fit is performed on the logarithmic values of the weight coefficient energies corresponding to each frequency domain block to obtain an energy attenuation curve corresponding to the current room.
[0120] In the example embodiment, a straight line fitting is performed on the logarithmic value of the weight coefficient energy corresponding to each frequency domain block, so as to obtain an energy attenuation curve that approximates the room impulse response. For example, the coordinate points (0, g0), (1, g1), and (2, g2) corresponding to three frequency domain blocks are obtained with the number of blocks as the horizontal coordinate and the logarithmic value of the weight coefficient energy as the vertical coordinate, and these three coordinate points are fitted with a straight line y=ax+b to obtain coefficients a and b.
[0121] according to Figure 3According to the technical solution in the example embodiment, on the one hand, by performing logarithmic operation on the energy of the weight coefficients corresponding to each frequency domain block, the energy decay curve of exponential decay can be converted into a linear curve of linear decay; on the other hand, the energy decay curve of the room is fitted by using the filter coefficients of the adaptive filter in the frequency domain corresponding to the frequency domain block, so that the reverberation time RT60 of the room can be approximately estimated, without converting the frequency domain signal to the time domain through inverse Fourier transform, thereby reducing the computing resources of the processor required to determine the room RT60.
[0122] Further, in the example embodiment, based on the energy attenuation corresponding to the reverberation time, for example 60db, the horizontal axis position corresponding to the energy attenuation on the energy attenuation curve is determined, and based on the horizontal axis position corresponding to the energy attenuation, the reverberation time of the current room is determined.
[0123] For example, refer to Figure 4 As shown, according to the value of the first frequency domain block, extend it backward to -60dB, and then according to the time length of each frequency domain block, the approximate value of the room's reverberation time RT60 can be estimated. For example, if y = -60, we can solve x = (-60-b) / a, so RT60 = x*t, where t is the data length corresponding to a frequency domain block of FLMS, and x is the number of frequency domain blocks. Figure 4 In the example, x is 4.5, t is 0.3, and RT60 is 1.35.
[0124] According to the technical solution in the above-mentioned example embodiment, based on the energy attenuation corresponding to the reverberation time, for example 60db, the horizontal axis position corresponding to the energy attenuation on the energy attenuation curve is determined, and based on the horizontal axis position corresponding to the energy attenuation, the reverberation time of the current room is determined, so that the reverberation time RT60 of the room can be approximately estimated according to the number of frequency domain blocks corresponding to the sound energy attenuation and the time of the frequency domain blocks, without the need to convert the frequency domain signal into the time domain through inverse Fourier transform, thereby reducing the computing resources of the processor required to determine the room RT60.
[0125] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0126] See also Figure 5 , which shows a schematic diagram of the structure of a reverberation time determination device provided by an exemplary embodiment of the present application. The reverberation time determination device can be implemented as all or part of the device through software, hardware or a combination of both. The reverberation time determination device 500 includes: a block selection module 510, a filter weight coefficient determination module 520, a weight coefficient energy determination module 530, a curve fitting module 540 and a reverberation time determination module 550. Among them,
[0127] A block selection module 510 is used to select a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of a frequency domain block adaptive filter corresponding to the current room, wherein the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room;
[0128] A filter weight coefficient determination module 520, used to determine a filter weight coefficient of each frequency domain block in a plurality of frequency domain blocks corresponding to the frequency domain block adaptive filter;
[0129] A weight coefficient energy determination module 530, configured to determine the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient;
[0130] A curve fitting module 540, configured to fit an energy attenuation curve corresponding to the current room based on the weight coefficient energy of each frequency domain block;
[0131] The reverberation time determination module 550 is configured to determine the reverberation time of the current room based on the energy decay curve.
[0132] In some example embodiments, based on the above scheme, the filter weight coefficient is a one-dimensional vector with a length of N, where N is a positive integer, and the weight coefficient energy determination module 530 includes:
[0133] A square operation unit, used for performing a square operation on each element in the one-dimensional vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block;
[0134] The weight coefficient energy determination unit is used to sum the N square values corresponding to the filter weight coefficients of each frequency domain block to obtain the weight coefficient energy corresponding to each frequency domain block.
[0135] In some example embodiments, based on the above solution, the apparatus 500 further includes:
[0136] A logarithmic value determination module, used for performing a logarithmic operation on the weight coefficient energy corresponding to each frequency domain block after determining the weight coefficient energy corresponding to each frequency domain block based on the filter weight coefficient, to determine the logarithmic value of the weight coefficient energy corresponding to each frequency domain block;
[0137] The curve fitting module 540 includes:
[0138] The linear fitting unit is used to perform linear fitting on the logarithmic values of the weight coefficient energies corresponding to each of the frequency domain blocks to obtain an energy attenuation curve corresponding to the current room.
[0139] In some example embodiments, based on the above solution, the reverberation time determination module 550 includes:
[0140] A position determination unit, used to determine a horizontal axis position on the energy decay curve corresponding to the energy decay amount of the reverberation time;
[0141] A quantity determination unit, configured to determine the quantity of the frequency domain blocks corresponding to the reverberation time based on the horizontal axis position;
[0142] The time determination unit is used to determine the reverberation time of the current room based on the number of the frequency domain blocks and the data duration of the frequency domain blocks.
[0143] In some example embodiments, based on the above solution, the apparatus 500 further includes:
[0144] A correction coefficient acquisition unit, used to acquire a reverberation time correction coefficient corresponding to the current room, wherein the reverberation time correction coefficient is a pre-calibrated correction coefficient;
[0145] A correction unit is used to correct the reverberation time of the current room based on the reverberation time correction coefficient.
[0146] In some example embodiments, based on the above solution, the apparatus 500 further includes:
[0147] A training module is used to train the frequency domain block adaptive filter in the current room before selecting a predetermined number of frequency domain blocks from multiple frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room to determine the filter weight coefficient of the frequency domain block adaptive filter.
[0148] In some example embodiments, based on the above solution, the training module includes:
[0149] A block division unit is used to divide the input signal of the frequency domain block adaptive filter into multiple data blocks
[0150] A weight updating unit, used for updating the filter weight coefficient of the frequency domain block adaptive filter block by block;
[0151] The weight determination unit is used to determine the filter weight coefficient corresponding to each frequency domain block of the frequency domain block adaptive filter based on the update result.
[0152] according to Figure 5According to the technical solution in the example embodiment, the weight coefficient energy corresponding to each frequency domain block is determined based on the filter weight coefficient of the frequency domain block adaptive filter; the energy attenuation curve corresponding to the current room is fitted based on the weight coefficient energy of each frequency domain block; the reverberation time of the current room is determined based on the energy attenuation curve, and the filter coefficient of the frequency domain block adaptive filter can be used to determine the reverberation time, and there is no need to convert the frequency domain signal into the time domain through inverse Fourier transform, thereby reducing the computing resources required to determine the room reverberation time.
[0153] It should be noted that, when the reverberation time determination device provided in the above embodiment executes the reverberation time determination method, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the reverberation time determination device provided in the above embodiment and the reverberation time determination method embodiment belong to the same concept, and the embodiment and implementation process thereof are detailed in the method embodiment, which will not be repeated here.
[0154] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0155] The embodiment of the present application further provides a computer storage medium, which can store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the reverberation time determination method as described in the above embodiment. The specific execution process can refer to the specific description of the above embodiment, which will not be repeated here.
[0156] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded by the processor and executes the reverberation time determination method as described in the above embodiment. The specific execution process can be found in the specific description of the above embodiment, which will not be repeated here.
[0157] See also Figure 6 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 600 may include: at least one processor 601 , at least one network interface 604 , an input / output interface 603 , a memory 605 , and at least one communication bus 602 .
[0158] The communication bus 602 is used to realize the connection and communication between these components.
[0159] The input / output interface 603 may include a display screen (Display), a camera (Camera), and the optional input / output interface 603 may also include a standard wired interface, a wireless interface, a microphone, and a speaker.
[0160] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0161] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect various parts within the entire electronic device 600, and executes various functions and processes data of the electronic device 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 601 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented separately through a chip.
[0162] Among them, the memory 605 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 605 may optionally be at least one storage device located away from the aforementioned processor 601. As Figure 6As shown, the memory 605 as a computer storage medium may include an operating system, a network communication module, an input and output interface module, and a reverberation time determination application program.
[0163] exist Figure 6 In the electronic device 600 shown, the input-output interface 603 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 601 can be used to call the reverberation time determination application stored in the memory 605, and specifically perform the following operations:
[0164] Selecting a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of a frequency domain block adaptive filter corresponding to the current room, wherein the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room;
[0165] Determine a filter weight coefficient of the frequency domain block adaptive filter corresponding to each frequency domain block in the predetermined number of frequency domain blocks;
[0166] Determine the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient;
[0167] Fitting the energy attenuation curve corresponding to the current room based on the weight coefficient energy corresponding to each of the frequency domain blocks;
[0168] The reverberation time of the current room is determined based on the energy decay curve.
[0169] The above is a schematic scheme of an electronic device in an embodiment of this specification. It should be noted that the technical scheme of the electronic device and the technical scheme of the above-mentioned reverberation time determination processing method belong to the same concept, and the details not described in detail in the technical scheme of the electronic device can be referred to the description of the technical scheme of the above-mentioned reverberation time determination processing method.
[0170] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0171] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0172] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for determining reverberation time, characterized in that: The method comprises: Selecting a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of a frequency domain block adaptive filter corresponding to the current room, wherein the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room; Determine a filter weight coefficient of the frequency domain block adaptive filter corresponding to each frequency domain block in the predetermined number of frequency domain blocks; Determine the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient; Fitting the energy attenuation curve corresponding to the current room based on the weight coefficient energy corresponding to each of the frequency domain blocks; The reverberation time of the current room is determined based on the energy decay curve.
2. The method according to claim 1, characterized in that The filter weight coefficient is a one-dimensional vector with a length of N, where N is a positive integer, and determining the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient includes: Performing a square operation on each element in the one-dimensional vector of the filter weight coefficient of each frequency domain block to obtain N square values corresponding to the filter weight coefficient of each frequency domain block; The N square values corresponding to the filter weight coefficients of each frequency domain block are summed to obtain the weight coefficient energy corresponding to each frequency domain block.
3. The method according to claim 2, characterized in that After determining the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient, the method further includes: Performing a logarithmic operation on the weight coefficient energy corresponding to each of the frequency domain blocks to determine the logarithmic value of the weight coefficient energy corresponding to each of the frequency domain blocks; The energy fitting of the sound field energy attenuation curve corresponding to the current room based on the weight coefficient energy corresponding to each of the frequency domain blocks includes: A linear fit is performed on the logarithmic values of the weight coefficient energies corresponding to each of the frequency domain blocks to obtain an energy attenuation curve corresponding to the current room.
4. The method according to claim 1, characterized in that: The determining the reverberation time of the current room based on the energy decay curve comprises: Determine a horizontal axis position on the energy decay curve corresponding to the energy decay amount of the reverberation time; Determine the number of the frequency domain blocks corresponding to the reverberation time based on the horizontal axis position; The reverberation time of the current room is determined based on the number of the frequency domain blocks and the data duration of the frequency domain blocks.
5. The method according to claim 4, characterized in that The method further comprises: Obtaining a reverberation time correction coefficient corresponding to the current room, wherein the reverberation time correction coefficient is a pre-calibrated correction coefficient; The reverberation time of the current room is corrected based on the reverberation time correction coefficient.
6. The method according to any one of claims 1 to 5, characterized in that Before selecting a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of the frequency domain block adaptive filter corresponding to the current room, the method further includes: The frequency domain block adaptive filter is trained in the current room to determine a filter weight coefficient of the frequency domain block adaptive filter.
7. The method according to claim 6, characterized in that The step of training the frequency domain block adaptive filter in the current room to determine a filter weight coefficient of the frequency domain block adaptive filter includes: Dividing the input signal of the frequency domain block adaptive filter into a plurality of data blocks; Updating filter weight coefficients of the frequency domain block adaptive filter block by block; Based on the update result, the filter weight coefficient corresponding to each frequency domain block of the frequency domain block adaptive filter is determined.
8. A reverberation time determination device, characterized in that: The device comprises: A block selection module, used to select a predetermined number of frequency domain blocks from a plurality of frequency domain blocks of a frequency domain block adaptive filter corresponding to the current room, wherein the frequency domain block adaptive filter is an adaptive filter pre-trained for the current room; A filter weight coefficient determination module, used to determine the filter weight coefficient of each frequency domain block in a plurality of frequency domain blocks corresponding to the frequency domain block adaptive filter; A weight coefficient energy determination module, used to determine the weight coefficient energy corresponding to each of the frequency domain blocks based on the filter weight coefficient; A curve fitting module, used for fitting the energy attenuation curve corresponding to the current room based on the weight coefficient energy of each frequency domain block; A reverberation time determination module is used to determine the reverberation time of the current room based on the energy decay curve.
9. A computer storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 7.
10. An electronic device, comprising: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method according to any one of claims 1 to 7.
