Noise detection method, storage medium, electronic equipment and chip
By performing frame processing and filtering on the audio data in the time domain, it is directly determined whether the audio data includes piano sounds, which solves the problems of large data volume and high power consumption in the existing technology, and achieves rapid processing in low-performance devices. Detect and suppress piano sounds to avoid speaker distortion.
Patent Information
- Application Number
- CN202410775636.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-08
AI Technical Summary
When detecting and suppressing piano sounds, the existing technology needs to convert the audio file from a time domain signal to a frequency domain signal, and perform multiple collection and analysis, resulting in a large amount of data and high power consumption, and is not suitable for low performance and low power. Consumable electronic equipment.
By dividing the audio data to be processed into frames, filtering the audio sub-data based on the target frequency, and directly determining whether the audio sub-data includes piano sounds in the time domain, reducing data processing steps and data collection volume, and using energy proportion for suppression. deal with.
It achieves rapid detection of piano sounds in the time domain, reduces data processing steps and data collection volume, is suitable for low-performance, low-power electronic devices, and avoids speaker distortion.
Smart Images

Figure CN118748767A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio processing technology, and in particular to a noise detection method, a storage medium, an electronic device and a chip. Background Art
[0002] When playing an audio file containing piano sounds through a speaker, the piano sounds have uneven energy distribution in the spectrum. For example, the spectrum energy of the piano sounds is mainly concentrated in the low-frequency part, and the spectrum energy of the low-frequency part is higher. As a result, when a piano sound appears during the playback process, it may cause speaker distortion and a "rustling" noise. In this way, it is necessary to detect the piano sound part in the audio file to suppress the piano sound part to prevent speaker distortion.
[0003] However, the existing detection of piano sounds usually requires converting the audio file from a time domain signal to a frequency domain signal first. After collecting audio features multiple times on the frequency domain signal, the multiple collected audio features must be analyzed before the piano sound part in the audio file can be detected. The amount of collected data is large and the power consumption is high. Summary of the invention
[0004] Embodiments of the present application provide a noise detection method, a storage medium, an electronic device, and a chip.
[0005] In a first aspect, the present application provides a noise detection method for application to an electronic device, the method comprising: performing frame processing on the audio data to be processed to obtain multiple frames of audio sub-data; filtering the audio sub-data based on a target frequency to obtain audio data to be tested, wherein the target frequency is the attenuation frequency of the target type of audio; determining a first total energy of the audio sub-data and a second total energy of the audio data to be tested; determining whether the audio sub-data includes the target type of audio based on a ratio of the first total energy to the second total energy; and suppressing the audio sub-data when the audio sub-data includes the target type of audio.
[0006] In an embodiment of the present application, the electronic device directly filters the audio sub-data in the time domain. The audio data to be tested obtained by the filtering process represents the non-piano sound features in the audio sub-data, and determines whether the audio sub-data includes piano sounds through the energy ratio of the audio data to be tested and the audio sub-data. There is no need to perform Fourier transform to process the audio sub-data in the frequency domain, which reduces the data processing steps and the amount of data collected is small, which is suitable for low-performance, low-power electronic devices.
[0007] In a possible implementation of the first aspect above, the target type audio is piano sound.
[0008] In a possible implementation of the first aspect above, filtering the audio sub-data based on the target frequency to obtain the audio data to be tested includes: filtering the audio sub-data based on the target frequency to filter out frequency components in the audio sub-data that are less than or equal to the target frequency to obtain the audio data to be tested.
[0009] In a possible implementation of the first aspect above, determining whether the audio sub-data includes target type audio is based on the ratio of the first total energy to the second total energy, including: determining the energy ratio of the second total energy to the first total energy; if the energy ratio is less than a preset conditional threshold, the audio sub-data includes the target type audio.
[0010] In a possible implementation of the first aspect above, determining the energy ratio of the second total energy to the first total energy includes: determining the energy ratio of the second total energy to the first total energy, normalizing the energy ratio, and obtaining the energy ratio.
[0011] In a possible implementation of the first aspect above, the suppression processing includes: determining first spectrum energy of the audio sub-data; and adjusting the first spectrum energy to second spectrum energy, wherein the second spectrum energy is less than or equal to a limiting amplitude of the speaker.
[0012] In a possible implementation of the first aspect above, the method also includes: multiple frames of audio sub-data respectively include multiple sampling periods, and the multiple sampling periods include in sampling order: a first period, a second period, a third period and a fourth period, wherein non-piano sound detection is performed on the audio sub-data in the first period, piano sound detection is performed on the audio sub-data in the second period, the compression ratio of the audio sub-data is determined in the third period, and suppression processing is performed on the audio sub-data based on the compression ratio in the fourth period.
[0013] In a possible implementation of the first aspect above, the method also includes: multiple frames of audio sub-data include 8 sampling periods respectively; performing human voice detection on the audio sub-data in the 4th sampling period, performing drum and / or whistle detection on the audio sub-data in the 5th sampling period, performing piano sound detection on the audio sub-data in the 6th sampling period, determining the compression ratio of the audio sub-data in the 7th sampling period, and suppressing the audio sub-data based on the compression ratio in the 8th sampling period.
[0014] In a possible implementation of the first aspect above, the method also includes: the i-th frame audio sub-data includes N first sampling periods, and the (i+1)-th frame audio sub-data includes N second sampling periods, wherein the N second sampling periods include part of the N first sampling periods.
[0015] In a second aspect, an embodiment of the present application provides a readable storage medium having instructions stored thereon, which, when executed on an electronic device, enables the electronic device to implement any one of the noise detection methods provided by the first aspect and various possible implementations of the first aspect.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, which is one of the processors of the electronic device, for executing the instructions stored in the memory to implement any one of the noise detection methods provided in the first aspect and various possible implementations of the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a chip, which includes a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface, and is used to execute instructions stored in the memory to implement any one of the noise detection methods provided by the first aspect and various possible implementations of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 According to some embodiments of the present application, a schematic diagram of clipping is shown;
[0019] Figure 2 According to some embodiments of the present application, a schematic diagram of a noise detection method is shown;
[0020] Figure 3 According to some embodiments of the present application, a schematic flow chart of a noise detection method is shown;
[0021] Figure 4 According to some embodiments of the present application, a timing diagram of characteristic data is shown;
[0022] Figure 5 According to some embodiments of the present application, a schematic structural diagram of an electronic device is shown. DETAILED DESCRIPTION
[0023] The illustrative embodiments of the present application include, but are not limited to, a noise detection method, a storage medium, an electronic device, and a chip.
[0024] The technical solution of the present application is introduced below in conjunction with the accompanying drawings.
[0025] The spectral energy of piano sound is mainly concentrated in the low-frequency part. For example, in the low-frequency part less than 4 kilo hertz (kHz), the spectral energy of piano sound will be attenuated at 4kHz. In this way, the spectral energy of piano sound in the frequency band less than 4kHz is higher, and the spectral energy of piano sound in the frequency band greater than 4kHz is lower, resulting in the phenomenon of uneven energy distribution of piano sound in the spectrum.
[0026] Since the spectrum energy of piano sound in the low frequency part is relatively high, when playing an audio file containing piano sound through a speaker, when a piano sound appears during the playback, the spectrum energy of the audio may exceed the speaker's limited amplitude (referred to as limiter), resulting in a "rustling" noise and causing speaker distortion. Figure 1 As shown, the horizontal axis is used to represent the timeline, the vertical axis is used to represent the amplitude, M is used to represent the audio data including the piano sound, and a / -a is used to represent the amplitude limit of the speaker. When a piano sound appears during the playback process, the spectrum energy of the piano sound in the low-frequency part is relatively high, resulting in a higher amplitude of the audio data M when the piano sound part is played, causing the amplitude of the audio data M from point A to point B and from point C to point D to exceed the amplitude limit of the speaker, causing the waveform of the audio data M to be clipped, resulting in the audio data M generating noise, that is, speaker distortion. In this way, it is necessary to detect the piano sound part in the audio file to suppress the piano sound part and avoid clipping to prevent speaker distortion.
[0027] In some embodiments, the detection of piano sound usually requires that after the audio file is input into the electronic device, the electronic device first needs to convert the audio file from a time domain signal to a frequency domain signal, for example, by using a fast Fourier transform (FFT) algorithm to convert the audio file from a time domain signal to a frequency domain signal. Then the electronic device collects audio features on the frequency domain signal multiple times and analyzes the multiple collected audio features, so that the electronic device can detect the piano sound part in the audio file. The amount of collected data is large, the power consumption is large, and it is not suitable for low-performance, low-power electronic devices.
[0028] To this end, the present application proposes a noise detection method, which is applied to electronic devices. The method includes: the electronic device first performs frame processing on the audio data to be processed to obtain multiple frames of audio sub-data; then the electronic device performs filtering processing on the audio sub-data based on the target frequency to obtain the audio data to be tested, wherein the target frequency is the attenuation frequency of the target type of audio; then the electronic device determines the first total energy of the audio sub-data and the second total energy of the audio data to be tested, and determines whether the audio sub-data includes the target type of audio based on the ratio of the first total energy to the second total energy. When the audio sub-data includes the target type of audio, the electronic device suppresses the audio sub-data.
[0029] It can be understood that when the target type of audio is piano sound, the target frequency is the frequency at which the spectrum energy of the piano sound attenuates, such as 4kHz. The electronic device first filters the audio sub-data in the time domain through a filter with a cutoff frequency that is the target frequency at which the spectrum energy of the piano audio appears to attenuate, so as to obtain the audio data to be tested, so that the non-piano sound features in the audio sub-data can be represented by the audio data to be tested, and then the proportion of the non-piano sound features in the corresponding audio sub-data can be determined by the energy ratio of the second total energy of the audio data to be tested to the first total energy of the audio sub-data, thereby determining whether there is a piano sound in the audio sub-data. The noise detection method of the present application directly filters the audio sub-data in the time domain, and there is no need to perform Fourier transform to process the audio sub-data in the frequency domain, which reduces the data processing steps and the amount of data collection is small, and is suitable for low-performance, low-power electronic devices.
[0030] In some embodiments, Figure 2 As shown, the process of the noise detection method includes: inputting the audio data to be processed into an electronic device to sample and save the audio sub-data, for example, the number of sampling points of each frame of audio sub-data is one-eighth or one-twelfth of the number of sampling points based on the FFT algorithm, so that the recognition is accurate, saving the calculation cost and memory cost; then the total energy value of the audio sub-data is calculated to obtain the first total energy, and then the frequency components less than or equal to the target frequency in the audio sub-data are filtered out through a high-pass filter with a cutoff frequency of the target frequency of piano sound attenuation (such as 4kHz) to obtain the audio data to be tested, and the high-frequency energy value of the audio data to be tested is calculated to obtain the second total energy, that is, the high-frequency energy value greater than 4kHz in the audio sub-data (non-piano sound feature); finally, the high-frequency energy ratio is calculated by the energy ratio of the second total energy and the first total energy, so as to determine whether the audio sub-data includes piano sound through the high-frequency energy ratio, for example, when the high-frequency energy ratio is less than the preset condition threshold, it means that the non-piano sound feature in the audio sub-data accounts for a small proportion, and then it can be determined that the audio sub-data includes piano sound; finally, the high-frequency energy ratio is normalized to obtain the piano feature value.
[0031] In other embodiments, a low-pass filter having a cutoff frequency equal to the target frequency for piano sound attenuation (e.g., 4kHz) may be used to filter out frequency components in the audio sub-data that are greater than or equal to the target frequency, so as to obtain test audio data representing piano sound characteristics in the audio sub-data, and then determine whether the audio sub-data includes piano sounds by comparing the low-frequency energy ratio of the test audio data representing piano sound characteristics and the audio sub-data; for example, when the low-frequency energy ratio is greater than a preset condition threshold, it indicates that the piano sound characteristics account for a large proportion in the audio sub-data, and then determine that the audio sub-data includes piano sounds.
[0032] In some embodiments, before filtering the audio sub-data through a high-pass filter or a low-pass filter to obtain the audio data to be tested, the audio sub-data may also be first filtered through a low-pass filter to filter out irrelevant high-frequency bands in the audio sub-data, thereby achieving noise reduction processing on the audio sub-data.
[0033] The following is an example of the audio data to be tested representing non-piano features in the audio sub-data to explain the embodiment of the present application.
[0034] Figure 3 According to some embodiments of the present application, a flow chart of a noise detection method is shown. In some embodiments, Figure 3 Each step of the process shown is performed by an electronic device. To simplify the description, Figure 3 The execution entities of each step will not be described repeatedly in the steps of the process shown. Figure 3 As shown, the following steps are included:
[0035] S301: Perform frame processing on the audio data to be processed to obtain multiple frames of audio sub-data.
[0036] In some embodiments, after the audio file is input into the electronic device to obtain the audio data to be processed, the electronic device performs frame processing on the audio data to be processed multiple times to obtain multiple frames of audio sub-data. For example, the electronic device can use the time length of 10ms, 20ms and 30ms as the frame interval to divide the audio data to be processed into multiple frames of audio sub-data, and this application does not limit this.
[0037] S302: Filter the audio sub-data based on a target frequency to obtain audio data to be tested, wherein the target frequency is an attenuation frequency of a target type of audio.
[0038] In some embodiments, the electronic device filters out the frequency components less than or equal to the target frequency in the audio sub-data through a high-pass filter with a cutoff frequency equal to the target frequency of piano sound attenuation (e.g., 4kHz) to obtain the audio data to be tested. It can be understood that the spectrum energy of piano sound is mainly concentrated in the low-frequency part, and the spectrum energy of piano sound will be attenuated at 4kHz, that is, the audio data to be tested obtained by filtering out the frequency components less than or equal to the target frequency in the audio sub-data can represent the non-piano sound characteristics in the audio sub-data.
[0039] S303: Determine a first total energy of the audio sub-data and a second total energy of the audio data to be tested.
[0040] In some embodiments, the spectrum energy in the frequency domain, ie, the first total energy and the second total energy, may be calculated in the time domain using Parseval's Theorem.
[0041] S304: Determine whether the audio sub-data includes target type audio based on the ratio of the first total energy to the second total energy.
[0042] In some embodiments, whether the audio sub-data includes piano sound is determined by the ratio of the second total energy to the first total energy. For example, whether the audio sub-data includes piano sound is determined by the ratio of the spectrum energy of the 4kHz to 10kHz frequency band to the spectrum energy of the 0kHz to 10kHz frequency band.
[0043] S305: When the audio sub-data includes target type audio, suppress the audio sub-data.
[0044] In some embodiments, the energy ratio of the second total energy to the first total energy is first determined, and after the energy ratio of the audio sub-data is determined, the energy ratio is normalized to obtain an energy ratio, and whether the audio sub-data includes piano sound is determined by the energy ratio. For example, when the energy ratio is less than a preset conditional threshold, it means that the proportion of non-piano sound features in the audio sub-data is small, that is, the possibility that the audio sub-data includes piano sound is high, and the audio sub-data is suppressed to avoid speaker distortion.
[0045] It can be understood that the present application directly filters the audio sub-data in the time domain, and there is no need to perform Fourier transform to process the audio sub-data in the frequency domain, that is, feature extraction is performed through the frequency characteristics of the audio sub-data to accurately identify the piano sound; and in the calculation of the frequency energy ratio, no FFT calculation is performed to convert it to the frequency domain, but the energy ratio is directly calculated in the time domain to obtain the piano eigenvalue, which effectively improves the calculation efficiency and significantly reduces the amount of calculation and memory overhead.
[0046] In some embodiments, the audio sub-data may be suppressed by reducing the spectral energy of the audio sub-data so that the spectral energy of the audio sub-data is less than or equal to the amplitude limit of the speaker, thereby avoiding the wave clipping phenomenon and preventing the speaker distortion phenomenon. For example, after determining that the audio sub-data includes piano sound, the original spectral energy (first spectral energy) of the audio sub-data is first determined, and the original spectral energy is adjusted to be less than or equal to the second spectral energy of the amplitude limit of the speaker.
[0047] In some embodiments, multiple frames of audio sub-data include multiple sampling periods respectively. For example, each frame of audio sub-data is obtained by sampling the audio data to be processed 8 times, that is, 1 frame of audio sub-data includes 8 sampling periods. Furthermore, in the process of piano sound detection of the audio sub-data, non-piano sounds such as human voice, drum sound, whistle sound, etc. in the audio sub-data can also be detected, and the compression ratio of the audio sub-data is determined based on the detection results of the piano sound and the non-piano sound, and the audio sub-data is suppressed based on the obtained compression ratio. It can be understood that the audio sub-data can also include more or fewer sampling periods, and there is no specific limitation.
[0048] In some embodiments, in order to improve computational efficiency, the detection calculation in the audio sub-data can be evenly divided into multiple sampling periods in the audio sub-data. For example, the 8 sampling periods in one frame of audio sub-data can be divided into the first period, the second period, the third period and the fourth period according to the sampling order, and then the audio sub-data is subjected to non-piano sound detection in the first period, the audio sub-data is subjected to piano sound detection in the second period, the compression ratio of the audio sub-data is determined in the third period, and the audio sub-data is subjected to suppression processing based on the compression ratio in the fourth period. In this way, by evenly dividing the computational amount, the time overhead of the maximum computational amount cycle in each frame is shortened, the dynamic performance is improved, the performance requirements of general chips are met, and the low-computing-power chips achieve the expected results, effectively reducing costs and power consumption.
[0049] For example, Figure 4 As shown, each frame of audio sub-data includes feature data of 8 sampling periods, and each frame of audio sub-data is subjected to data input, data collection, and feature value calculation in sequence according to the sampling timing. In some embodiments, in order to improve the calculation efficiency, in the 4th sampling period, the audio sub-data is firstly detected for human voice through the feature data of the first 4 sampling periods; in the 5th sampling period, the audio sub-data is then detected for special audio such as drums and whistles through the feature data of the first 5 sampling periods; in the 6th sampling period, the audio sub-data is detected for piano sound through the feature data of the first 6 sampling periods; in the 7th sampling period, the compression logic judgment is performed on the feature data of the first 7 sampling periods to determine the compression ratio of the audio sub-data; in the 8th sampling period, the audio sub-data is filtered, smoothed, interpolated, etc. based on the compression ratio to suppress the audio sub-data. In this way, non-piano sound detection, piano sound detection, compression ratio calculation, etc. are evenly distributed to each sampling period in the audio sub-data, shortening the time overhead of the maximum calculation period of each frame of audio sub-data, improving the dynamic performance, and meeting the requirements of low computing power chips. It can be understood that in Figure 4In the example, the 1st to 5th sampling periods are taken as examples of the first period, the 1st to 6th sampling periods are taken as examples of the second period, the 1st to 7th sampling periods are taken as examples of the third period, and the 1st to 8th sampling periods are taken as examples of the fourth period.
[0050] In some embodiments, when the i-th frame audio sub-data is detected and calculated using the feature data of multiple sampling periods (corresponding to instances of the first sampling period) of the i-th frame audio sub-data, the feature data of a part of the sampling periods (corresponding to instances of the second sampling period) of the i-1-th frame audio sub-data may be obtained as a supplement to the feature data of the i-th frame audio sub-data. Figure 4 As shown, the first feature data in the data input is the feature data of the 8th sampling period of the i-1th frame audio sub-data, and the 2nd to 9th feature data are the feature data of the 8th sampling period of the i-th frame audio sub-data; thus, during data acquisition, the i-th frame audio sub-data is detected and calculated using the feature data of the 8th sampling period in the i-1th frame audio sub-data and the feature data of the 2nd to 8th sampling period in the i-th frame audio sub-data, a total of 8 feature data, and the detection calculation is evenly distributed to each sampling period to improve the calculation efficiency. Thus, under the condition that the array required for calculation meets the requirements and the compression effect meets the expectations, the problem that the sampling does not fill the calculation array and the first few calculation periods of each frame cannot be efficiently utilized is solved; at the same time, the calculation process is split so that the calculation time is evenly distributed to each sampling calculation period, so that the calculation time overhead of each calculation period meets the requirements of ordinary audio processing chips.
[0051] Figure 5 According to some embodiments of the present application, a schematic diagram of the structure of an electronic device 100 is shown. Figure 5As shown, the electronic device 100 includes: a processor 101, a communication interface 103 and a memory 102. Among them, the processor 101, the communication interface 103 and the memory 102 can be connected to each other through an internal bus 104, and can also communicate through other means such as wireless transmission. In the embodiment of the present application, the connection through the bus 104 is taken as an example. The bus 104 can be a peripheral component interconnect express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a computer express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 104 can be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 104 can also include a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are marked as bus 104 in the figure.
[0052] The processor 101 may be composed of at least one general-purpose processor, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 101 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 102, which enables the electronic device 100 to provide a variety of services.
[0053] The memory 102 is used to store program codes, and is controlled to be executed by the processor 101 to perform the processing steps of the noise detection method in the above embodiment.
[0054] It should be noted that this embodiment can be implemented by a general physical server, for example, an ARM server or an X86 server, or it can be implemented by a virtual machine based on a general physical server combined with NFV technology. A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. This application does not make any specific limitations.
[0055] The memory 102 may include a volatile memory, such as a random access memory (RAM); the memory 102 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 102 may also include a combination of the above types. The memory 102 may store program code, specifically executing Figure 3 Steps S301 to S305 in the embodiment are not described in detail here.
[0056] The communication interface 103 can be a wired interface (such as an Ethernet interface), an internal interface (such as a PCIe bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless LAN interface) for communicating with other devices or modules.
[0057] Need to explain, Figure 5 This is only one possible implementation of the embodiment of the present application. In actual applications, the electronic device 100 may also include more or fewer components, which will not be elaborated here.
[0058] In some embodiments, the present application further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is executed on the processor 102, Figure 3 The method flow shown is realized.
[0059] In some embodiments, the present application further provides a computer program product, which, when executed on the processor 102, Figure 3 The method flow shown is realized.
[0060] In some embodiments, the present application further proposes a chip, which is formed with a processor and a data interface. The processor reads the instructions stored in the above-mentioned memory 101 through the data interface, and when the instructions are executed on the processor, Figure 3 The method flow shown is realized.
[0061] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0062] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0063] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0064] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.
Claims
1. A noise detection method, applied to electronic equipment, characterized in that: include: Perform frame processing on the audio data to be processed to obtain multiple frames of audio sub-data; Performing filtering processing on the audio sub-data based on a target frequency to obtain audio data to be tested, wherein the target frequency is an attenuation frequency of a target type of audio; Determining a first total energy of the audio sub-data and a second total energy of the audio data to be tested; determining, based on a ratio of the first total energy to the second total energy, whether the audio sub-data includes the target type audio; When the audio sub-data includes the target type of audio, suppression processing is performed on the audio sub-data.
2. The method according to claim 1, characterized in that The target type audio is piano sound.
3. The method according to claim 1, characterized in that The filtering the audio sub-data based on the target frequency to obtain the audio data to be tested includes: The audio sub-data is filtered based on the target frequency to filter out frequency components in the audio sub-data that are less than or equal to the target frequency, thereby obtaining the audio data to be tested.
4. The method according to claim 1, characterized in that: The determining, based on the ratio of the first total energy to the second total energy, whether the audio sub-data includes the target type audio comprises: determining an energy ratio of the second total energy to the first total energy; If the energy ratio is less than a preset conditional threshold, the audio sub-data includes the target type audio.
5. The method according to claim 4, characterized in that Determining the energy ratio of the second total energy to the first total energy includes: An energy ratio of the second total energy to the first total energy is determined, and the energy ratio is normalized to obtain the energy ratio.
6. The method according to claim 1, characterized in that The suppression process comprises: Determining a first spectrum energy of the audio sub-data; The first spectrum energy is adjusted to a second spectrum energy, wherein the second spectrum energy is less than or equal to a limiting amplitude of a speaker.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The multiple frames of audio sub-data respectively include multiple sampling periods, and the multiple sampling periods include: a first period, a second period, a third period and a fourth period in sampling order, wherein: In the first cycle, non-piano sound detection is performed on the audio sub-data, and in the second cycle, piano sound detection is performed on the audio sub-data. In the third cycle, the compression ratio of the audio sub-data is determined, and in the fourth cycle, suppression processing is performed on the audio sub-data based on the compression ratio.
8. The method according to claim 7, characterized in that The method further comprises: The multiple frames of audio sub-data each include 8 sampling periods; In the 4th sampling period, human voice detection is performed on the audio sub-data, in the 5th sampling period, drum sound and / or whistle detection is performed on the audio sub-data, in the 6th sampling period, piano sound detection is performed on the audio sub-data, in the 7th sampling period, the compression ratio of the audio sub-data is determined, and in the 8th sampling period, suppression processing is performed on the audio sub-data based on the compression ratio.
9. The method according to claim 7, characterized in that: The method further comprises: The audio sub-data of the i-th frame includes N first sampling periods, and the audio sub-data of the (i+1)-th frame includes N second sampling periods, wherein the N second sampling periods include some sampling periods of the N first sampling periods.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on an electronic device, enable the electronic device to implement the method according to any one of claims 1 to 9.
11. An electronic device, characterized in that: include: a memory for storing instructions to be executed by one or more processors of the electronic device; And a processor, which is one of the processors of the electronic device, configured to execute instructions stored in the memory to implement the method according to any one of claims 1 to 9.
12. A chip, characterized in that: The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the method as claimed in any one of claims 1 to 9.
Citation Information
Cited By
Piano noise risk detection method and device, electronic equipment and readable storage medium
CN122825047A
