CN113949955B - Noise reduction processing method, device, electronic equipment, earphone and storage medium - Google Patents
Noise reduction processing method, device, electronic equipment, earphone and storage medium Download PDFInfo
- Publication number
- CN113949955B CN113949955B CN202010688695.2A CN202010688695A CN113949955B CN 113949955 B CN113949955 B CN 113949955B CN 202010688695 A CN202010688695 A CN 202010688695A CN 113949955 B CN113949955 B CN 113949955B
- Authority
- CN
- China
- Prior art keywords
- noise reduction
- frequency bands
- noise
- frequency band
- sound
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
- H04R1/1083—Reduction of ambient noise
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2460/00—Details of hearing devices, i.e. of ear- or headphones covered by H04R1/10 or H04R5/033 but not provided for in any of their subgroups, or of hearing aids covered by H04R25/00 but not provided for in any of its subgroups
- H04R2460/01—Hearing devices using active noise cancellation
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Soundproofing, Sound Blocking, And Sound Damping (AREA)
- Circuit For Audible Band Transducer (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及降噪技术领域,更具体地,涉及一种降噪处理方法、装置、电子设备、耳机及存储介质。The present application relates to the technical field of noise reduction, and more specifically, to a noise reduction processing method, device, electronic device, earphone and storage medium.
背景技术Background technique
目前主动降噪通常采用固定滤波器参数的方法,但由于不同环境下噪声组成不同,以固定的滤波器参数来消除周围噪声,当周围环境的噪声发生显著变化时,主动降噪的降噪效果不够稳定。例如,降噪性能峰值位于80~200Hz的主动降噪耳机,主动降噪性能在400~2000Hz之间会显著下降,不能有效地消除日常环境噪声中400~2000Hz的部分噪声,即目前的主动降噪耳机的降噪效果不佳。Currently, active noise reduction usually uses a method of fixed filter parameters. However, due to the different noise compositions in different environments, when the noise in the surrounding environment changes significantly, the noise reduction effect of active noise reduction is not stable enough. For example, for active noise reduction headphones with a peak noise reduction performance of 80 to 200 Hz, the active noise reduction performance will drop significantly between 400 and 2000 Hz, and it cannot effectively eliminate part of the noise in the daily environment at 400 to 2000 Hz. That is, the current active noise reduction effect of active noise reduction headphones is not good.
发明内容Summary of the invention
本申请实施例提出了一种降噪处理方法、装置、电子设备、耳机及存储介质,能够改善主动降噪效果。The embodiments of the present application provide a noise reduction processing method, device, electronic device, earphone and storage medium, which can improve the active noise reduction effect.
第一方面,本申请实施例提供了一种降噪处理方法,该方法包括:获取音频采集装置采集的环境音,所述环境音包含噪声信号;对所述环境音进行预处理,得到待分析的噪声信号,所述待分析的噪声信号对应有多个频带;获取所述待分析的噪声信号在多个频带的声音能量值;根据所述多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数;基于所述目标降噪参数对所述环境音进行降噪处理。In a first aspect, an embodiment of the present application provides a noise reduction processing method, the method comprising: obtaining ambient sound collected by an audio collection device, the ambient sound containing a noise signal; preprocessing the ambient sound to obtain a noise signal to be analyzed, the noise signal to be analyzed corresponding to multiple frequency bands; obtaining sound energy values of the noise signal to be analyzed in multiple frequency bands; determining corresponding target noise reduction parameters based on a proportional relationship between the sound energy values of the multiple frequency bands; and performing noise reduction processing on the ambient sound based on the target noise reduction parameters.
第二方面,本申请实施例提供了一种降噪处理装置,该装置包括:音频采集模块,用于获取音频采集装置采集的环境音,所述环境音包含噪声信号;预处理模块,用于对所述环境音进行预处理,得到待分析的噪声信号,所述待分析的噪声信号对应有多个频带;能量获取模块,用于获取所述待分析的噪声信号在多个频带的声音能量值;参数确定模块,用于根据所述多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数;降噪处理模块,用于基于所述目标降噪参数对所述环境音进行降噪处理。In a second aspect, an embodiment of the present application provides a noise reduction processing device, which includes: an audio acquisition module, used to acquire ambient sound acquired by an audio acquisition device, wherein the ambient sound includes a noise signal; a preprocessing module, used to preprocess the ambient sound to obtain a noise signal to be analyzed, wherein the noise signal to be analyzed corresponds to multiple frequency bands; an energy acquisition module, used to acquire sound energy values of the noise signal to be analyzed in multiple frequency bands; a parameter determination module, used to determine corresponding target noise reduction parameters according to a proportional relationship between the sound energy values of the multiple frequency bands; and a noise reduction processing module, used to perform noise reduction processing on the ambient sound based on the target noise reduction parameters.
第三方面,本申请实施例提供了一种电子设备,包括:存储器;一个或多个处理器,与所述存储器耦接;一个或多个应用程序,其中,一个或多个应用程序被存储在存储器中并被配置为由一个或多个处理器执行,一个或多个应用程序配置用于执行上述第一方面提供的降噪处理方法。第四方面,本申请实施例提供了一种耳机,包括音频采集装置、音频输出装置以及音频信号处理电路,其中:所述音频采集装置,用于采集环境音;所述音频信号处理电路,用于获取所述音频采集装置采集的环境音;对所述环境音进行预处理,得到待分析的噪声信号,所述待分析的噪声信号对应有多个频带;获取所述待分析的噪声信号在多个频带的声音能量值;根据所述多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数;所述音频输出装置,用于基于所述目标降噪参数对所述环境音进行降噪处理。In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory; one or more processors coupled to the memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the noise reduction processing method provided in the first aspect above. In a fourth aspect, an embodiment of the present application provides a headset, comprising an audio acquisition device, an audio output device, and an audio signal processing circuit, wherein: the audio acquisition device is used to acquire ambient sound; the audio signal processing circuit is used to acquire the ambient sound acquired by the audio acquisition device; the ambient sound is preprocessed to obtain a noise signal to be analyzed, and the noise signal to be analyzed corresponds to multiple frequency bands; the sound energy values of the noise signal to be analyzed in multiple frequency bands are acquired; the corresponding target noise reduction parameters are determined according to the proportional relationship between the sound energy values of the multiple frequency bands; the audio output device is used to perform noise reduction processing on the ambient sound based on the target noise reduction parameters.
第五方面,本申请实施例提供了一种计算机可读取存储介质,计算机可读取存储介质中存储有程序代码,程序代码可被处理器调用执行上述第一方面提供的降噪处理方法。In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the noise reduction processing method provided in the first aspect above.
本申请实施例提供的一种降噪处理方法、装置、电子设备、耳机及存储介质,通过获取音频采集装置采集的环境音,其中,环境音包含噪声信号,然后对环境音进行预处理,得到对应有多个频带的待分析的噪声信号,接着获取待分析的噪声信号在多个频带的声音能量值,并根据多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数,最后基于降噪参数对环境音进行降噪处理。由此,通过识别出噪声信号在多个频带的声音能量值,根据它们之间的比例关系确定目标降噪参数,以基于目标降噪参数进行针对性降噪处理,实现对日常遇到的各种频带的噪声信号可以获得较优的主动降噪效果。The embodiments of the present application provide a noise reduction processing method, device, electronic device, headset and storage medium, which obtains ambient sound collected by an audio collection device, wherein the ambient sound includes a noise signal, and then pre-processes the ambient sound to obtain a noise signal to be analyzed corresponding to multiple frequency bands, then obtains the sound energy value of the noise signal to be analyzed in multiple frequency bands, and determines the corresponding target noise reduction parameters according to the proportional relationship between the sound energy values of the multiple frequency bands, and finally performs noise reduction processing on the ambient sound based on the noise reduction parameters. Thus, by identifying the sound energy values of the noise signal in multiple frequency bands, determining the target noise reduction parameters according to the proportional relationship between them, and performing targeted noise reduction processing based on the target noise reduction parameters, a better active noise reduction effect can be achieved for noise signals of various frequency bands encountered in daily life.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1示出了一种主动降噪原理图。FIG. 1 shows a schematic diagram of an active noise reduction principle.
图2示出了一种适用于本申请实施例的应用环境示意图。FIG. 2 shows a schematic diagram of an application environment suitable for an embodiment of the present application.
图3示出了本申请一个实施例提供的降噪处理方法的流程示意图。FIG3 is a schematic flow chart of a noise reduction method provided in an embodiment of the present application.
图4示出了本申请另一个实施例提供的降噪处理方法的流程示意图。FIG4 is a schematic flow chart of a noise reduction method provided in another embodiment of the present application.
图5示出了本申请一个示例性实施例提供的图4中步骤S260的流程示意图。FIG. 5 shows a schematic flow chart of step S260 in FIG. 4 provided by an exemplary embodiment of the present application.
图6示出了本申请一个示例性实施例提供的一类噪声信号的频谱特征图。FIG. 6 shows a frequency spectrum characteristic diagram of a type of noise signal provided by an exemplary embodiment of the present application.
图7示出了本申请一个示例性实施例提供的另一类噪声信号的频谱特征图。FIG. 7 shows a frequency spectrum characteristic diagram of another type of noise signal provided by an exemplary embodiment of the present application.
图8示出了本申请又一个实施例提供的降噪处理方法的流程示意图。FIG8 is a schematic flow chart of a noise reduction method provided in yet another embodiment of the present application.
图9示出了本申请一个示例性实施例提供的图8中步骤S370的流程示意图。FIG. 9 is a schematic flow chart of step S370 in FIG. 8 provided by an exemplary embodiment of the present application.
图10示出了本申请实施例提供的降噪处理装置的模块框图。FIG. 10 shows a module block diagram of a noise reduction processing device provided in an embodiment of the present application.
图11示出了本申请实施例提供的电子设备的结构框图。FIG. 11 shows a structural block diagram of an electronic device provided in an embodiment of the present application.
图12示出了本申请实施例提供的耳机的结构框图。FIG12 shows a structural block diagram of the earphone provided in an embodiment of the present application.
图13示出了本申请实施例提供的用于保存或者携带实现根据本申请实施例的降噪处理方法的程序代码的存储单元。FIG13 shows a storage unit provided in an embodiment of the present application for storing or carrying a program code for implementing a noise reduction processing method according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
目前主动降噪(Active Noise Cancellation,ANC)耳机大多数是通过设计固定的主动降噪参数实现基于固定的主动降噪曲线(Active Noise Cancellation Level Curve)以消除外界环境噪声,其技术原理如图1所示,麦克风采集到外界环境噪声后,通过降噪电路经固定的降噪滤波器参数进行处理,产生反相信号通过扬声器播出以抵消外界环境噪声。采用固定的降噪滤波器参数后,在降噪电路工作过程中,降噪性能曲线不随外界噪声环境变化。At present, most of the active noise cancellation (ANC) headphones are designed with fixed active noise cancellation parameters to eliminate external environmental noise based on a fixed active noise cancellation curve (Active Noise Cancellation Level Curve). The technical principle is shown in Figure 1. After the microphone collects the external environmental noise, it is processed by the noise reduction circuit with fixed noise reduction filter parameters to generate an inverted signal that is broadcast through the speaker to offset the external environmental noise. After using fixed noise reduction filter parameters, the noise reduction performance curve does not change with the external noise environment during the operation of the noise reduction circuit.
术语定义Definition of Terms
主动降噪(Active Noise Cancellation,ANC):是一种降噪方式,其原理是根据指定位置处拾取到的噪声声波,利用扬声器播放声音,并在该指定位置处产生与原始声波相位相反、振幅相同的声波。由于声波是一种机械振动,当两个声波在空间中相遇时,会进行线性叠加。由扬声器播放产生的次级声场和原始噪声场在该指定位置处相遇,发生线性叠加,两个振幅相同、相位相反的声波叠加后会相互抵消,从而削弱甚至消除该噪声,让听音者获得更安静的听音感受。Active Noise Cancellation (ANC): is a noise reduction method. Its principle is to use a speaker to play sound based on the noise sound waves picked up at a specified location, and generate a sound wave with the same amplitude and opposite phase to the original sound wave at the specified location. Since sound waves are mechanical vibrations, when two sound waves meet in space, they will be linearly superimposed. The secondary sound field generated by the speaker and the original noise field meet at the specified location and are linearly superimposed. The two sound waves with the same amplitude and opposite phase will cancel each other out after superposition, thereby weakening or even eliminating the noise, allowing the listener to have a quieter listening experience.
主动降噪曲线:主动降噪曲线是降噪装置的主动降噪量随频率变化的曲线,用于体现该装置在声音不同频率处的降噪能力强弱。具体体现为纵轴为主动降噪量、横轴为频率的曲线。降噪装置的降噪量表示可听声波在到达人的耳膜前被降低的程度。主动降噪对不同频率声波的降噪量并不相同,相较于高频信号而言,主动降噪对低频声波的降噪效果更明显。用标准化的专业仪器测量出降噪装置在各个频率点的降噪量,连接各频点降噪量值所形成的曲线就叫降噪曲线,它对不同频率点的降噪能力都有精确描述。Active noise reduction curve: The active noise reduction curve is a curve showing the change of the active noise reduction amount of the noise reduction device with frequency, which is used to reflect the noise reduction ability of the device at different sound frequencies. It is specifically reflected in a curve with the active noise reduction amount on the vertical axis and the frequency on the horizontal axis. The noise reduction amount of the noise reduction device indicates the degree to which the audible sound waves are reduced before reaching the human eardrum. The noise reduction amount of active noise reduction for sound waves of different frequencies is not the same. Compared with high-frequency signals, the noise reduction effect of active noise reduction on low-frequency sound waves is more obvious. The noise reduction amount of the noise reduction device at each frequency point is measured using standardized professional instruments. The curve formed by connecting the noise reduction values at each frequency point is called the noise reduction curve, which accurately describes the noise reduction ability at different frequency points.
目前ANC耳机基本是通过以固定的主动降噪性能、一条固定的主动降噪曲线来消除周围噪声,耳机主动降噪的有效范围一般为20~2000Hz之间,峰值一般位于80~250Hz之间。Currently, ANC headphones basically eliminate surrounding noise through a fixed active noise reduction performance and a fixed active noise reduction curve. The effective range of active noise reduction of headphones is generally between 20 and 2000Hz, and the peak is generally between 80 and 250Hz.
但是以固定的主动降噪曲线来消除周围噪声,则当周围环境的噪声发生显著变化时,ANC耳机的降噪体验不稳定。比如,一个降噪性能峰值位于80~250Hz的ANC耳机,当周围噪声以80~250Hz的低频噪声为主时,主动降噪体验较好,但当用户佩戴耳机进入周围噪声以250~400Hz的中低频噪声为主的环境中时,主动降噪体验会显著变差。最终导致用户在使用一般的ANC耳机时,在不同环境下的主动降噪体验有显著差异。However, if a fixed active noise reduction curve is used to eliminate surrounding noise, the noise reduction experience of ANC headphones will be unstable when the noise in the surrounding environment changes significantly. For example, an ANC headphone with a noise reduction performance peak at 80-250Hz will have a good active noise reduction experience when the surrounding noise is mainly low-frequency noise of 80-250Hz. However, when the user wears the headphones and enters an environment where the surrounding noise is mainly medium- and low-frequency noise of 250-400Hz, the active noise reduction experience will deteriorate significantly. Ultimately, when users use general ANC headphones, the active noise reduction experience in different environments is significantly different.
另外,有少部分ANC耳机会根据周围环境特征,减弱部分频段的噪声。例如,当这种ANC耳机结合其手机端APP使用时,可将通透模式(即将外界的环境噪声放大至耳朵处,使耳机佩戴者能够更清楚地听到外面的环境噪声,此功能近似于朝着降噪的相反方向进行处理)设置成“关于语音”的模式。在关于语音的模式下,耳机会对约300Hz以下的噪声信号有个固定的降噪量,同时将约300Hz以上的信号(语音信号的频率成分主要在300Hz以上)放大至耳机佩戴者的耳朵处。然而这种处理仍然是通过一种固定的主动降噪曲线来对所有不同的环境噪声进行相同处理,仍会存在上述问题。In addition, a small number of ANC headphones will reduce noise in certain frequency bands based on the characteristics of the surrounding environment. For example, when this type of ANC headphones is used in conjunction with its mobile phone APP, the transparency mode (that is, amplifying the external environmental noise to the ears, so that the headphone wearer can hear the external environmental noise more clearly. This function is similar to processing in the opposite direction of noise reduction) can be set to "about voice" mode. In the voice-related mode, the headphones will have a fixed amount of noise reduction for noise signals below about 300Hz, and at the same time amplify signals above about 300Hz (the frequency components of voice signals are mainly above 300Hz) to the ears of the headphone wearer. However, this processing still uses a fixed active noise reduction curve to perform the same processing on all different environmental noises, and the above-mentioned problems will still exist.
另外,部分ANC耳机根据环境噪声的整体强弱来切换不同降噪强度挡位的降噪模式,但是无论是自动还是手动实现切换,均不能灵活地对噪声中的不同频率成分进行区别处理。In addition, some ANC headphones switch between noise reduction modes with different noise reduction intensity levels according to the overall strength of the ambient noise, but whether the switching is automatic or manual, different frequency components in the noise cannot be flexibly processed differently.
基于上述问题,本申请实施例提供了一种降噪处理方法、装置、电子设备及计算机可读取存储介质,通过对获取到的环境噪声信号进行处理和分析,识别出环境噪声的频谱特点,并针对该噪声的频谱特点来调整降噪参数,从而对该噪声获得最优的降噪效果。为便于更好的理解本申请实施例,下面先对适用于本申请实施例的应用环境进行描述。Based on the above problems, the embodiments of the present application provide a noise reduction processing method, device, electronic device and computer-readable storage medium, which processes and analyzes the acquired environmental noise signal, identifies the spectrum characteristics of the environmental noise, and adjusts the noise reduction parameters according to the spectrum characteristics of the noise, so as to obtain the best noise reduction effect for the noise. In order to facilitate a better understanding of the embodiments of the present application, the application environment applicable to the embodiments of the present application is described below.
请参阅图2,图2示出了一种适用于本申请实施例的应用环境示意图。本申请实施例提供的降噪处理方法可以应用于如图2所示的降噪处理系统10中。降噪处理系统10包括终端100与耳机200。Please refer to Fig. 2, which shows a schematic diagram of an application environment applicable to the embodiment of the present application. The noise reduction processing method provided in the embodiment of the present application can be applied to the noise reduction processing system 10 shown in Fig. 2. The noise reduction processing system 10 includes a terminal 100 and a headset 200.
其中,终端100可以为但不限于为手机、平板电脑、MP3播放器(Moving PictureExperts Group Audio LayerⅢ,动态影像压缩标准音频层面3)、MP4(Moving PictureExperts Group Audio LayerⅣ,动态影像压缩标准音频层面4)播放器、笔记本电脑、电子书或可穿戴电子设备等等。本申请实施例对具体的终端100的设备类型不作限定。The terminal 100 may be, but is not limited to, a mobile phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image compression standard audio layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, dynamic image compression standard audio layer 4), a notebook computer, an e-book or a wearable electronic device, etc. The embodiment of the present application does not limit the specific device type of the terminal 100.
在一些实施例中,终端100内可以安装有能够控制耳机降噪模式的应用程序。终端100可以将需要实现的降噪模式发送给耳机200,由耳机200播放音频,音频可以包括反相声波、音乐信号、掩蔽声等。终端100内可包括音频采集装置,用于采集环境音,并可设置有处理器,可用于执行本申请实施例提供的降噪处理方法,再经由耳机200对应播放音频以实现降噪。In some embodiments, an application capable of controlling the noise reduction mode of the headset may be installed in the terminal 100. The terminal 100 may send the noise reduction mode to be implemented to the headset 200, and the headset 200 plays audio, which may include anti-phase sound waves, music signals, masking sounds, etc. The terminal 100 may include an audio acquisition device for collecting ambient sound, and may be provided with a processor for executing the noise reduction processing method provided in the embodiment of the present application, and then play the audio correspondingly through the headset 200 to achieve noise reduction.
其中,终端100与耳机200可基于有线或无线连接,可选地,若基于无线连接,则终端100与耳机200可基于蓝牙(Bluetooth)、2.4G无线通信技术、红外线传输技术或无线网络进行无线连接,以实现数据传输,例如,耳机200与终端100进行无线连接后可通过终端100获取音源数据进行播放。可选地,无线网络可以是移动通信网络或无线保真网络(WirelessFidelity,WiFi)。The terminal 100 and the headset 200 may be connected by wire or wirelessly. Optionally, if they are connected wirelessly, the terminal 100 and the headset 200 may be connected wirelessly based on Bluetooth, 2.4G wireless communication technology, infrared transmission technology or wireless network to achieve data transmission. For example, after the headset 200 is connected wirelessly to the terminal 100, the audio source data may be obtained through the terminal 100 for playback. Optionally, the wireless network may be a mobile communication network or a wireless fidelity network (WiFi).
其中,耳机200可以是有线耳机,也可以是无线耳机。可选地,耳机200还可以具体是真无线耳机。下面以完全无线缆的真无线耳机为例进行说明,但本领域技术人员应当明了的是,完全无线缆的真无线耳机仅为示例性说明,在实际使用中,本领域技术人员可以参照本申请实施例的方案,选择其他类型的耳机实施本方案,包括但不限于有线耳机和两耳机间带有线缆的无线耳机。Among them, the earphone 200 can be a wired earphone or a wireless earphone. Optionally, the earphone 200 can also be a true wireless earphone. The following is an example of a completely cable-free true wireless earphone, but those skilled in the art should understand that the completely cable-free true wireless earphone is only an exemplary description. In actual use, those skilled in the art can refer to the solution of the embodiment of the present application and select other types of earphones to implement this solution, including but not limited to wired earphones and wireless earphones with cables between the two earphones.
另外,在一些实施例中,降噪处理系统10中也可仅包括耳机200,即无需终端也可实现本申请实施例所提供的降噪处理方法,例如耳机200不播放音乐而只做降噪处理的场景下,耳机200可不与终端100连接,可单独实现本申请实施例所提供的降噪处理方法。In addition, in some embodiments, the noise reduction processing system 10 may also include only headphones 200, that is, the noise reduction processing method provided in the embodiments of the present application can be implemented without a terminal. For example, in a scenario where the headphones 200 do not play music but only perform noise reduction processing, the headphones 200 may not be connected to the terminal 100, and the noise reduction processing method provided in the embodiments of the present application can be implemented independently.
另外,图中仅示出一个耳机,在实际应用中,本领域技术人员可参照本申请实施例的方案,选择一对耳机实施本方案,需要注意的是,多个耳机的降噪处理可以相互独立,也可不相互独立,而且一对耳机中的每个耳机可分别与终端100连接,还可耳机与耳机之间互相连接,本申请实施例对此不作限定。In addition, only one earphone is shown in the figure. In actual applications, those skilled in the art may refer to the solution of the embodiment of the present application and select a pair of earphones to implement the solution. It should be noted that the noise reduction processing of multiple earphones may be independent of each other or not, and each earphone in a pair of earphones may be connected to the terminal 100 respectively, and the earphones may also be connected to each other, which is not limited in the embodiment of the present application.
在一些实施例中,每个耳机200可包括音频采集装置、音频输出装置以及音频信号处理电路,具体地可包括至少1个扬声器,至少1个可以拾取环境噪声的麦克风,至少1个可以运行算法的音频信号处理电路,另,耳机200还可包括至少1个供电电路。In some embodiments, each earphone 200 may include an audio acquisition device, an audio output device, and an audio signal processing circuit, specifically, may include at least one speaker, at least one microphone that can pick up ambient noise, at least one audio signal processing circuit that can run an algorithm, and the earphone 200 may also include at least one power supply circuit.
其中,扬声器用于播放音频和ANC反相噪声,实现耳机200的播放音乐和ANC降噪功能。当耳机200形态为单声道耳机或者真无线耳机时,每个耳机200具有至少1个扬声器。当耳机200形态为双声道耳机或者多声道耳机时,每个耳机200具有至少2个扬声器。The speaker is used to play audio and ANC anti-phase noise, so as to realize the music playing and ANC noise reduction functions of the earphone 200. When the earphone 200 is a mono earphone or a true wireless earphone, each earphone 200 has at least one speaker. When the earphone 200 is a dual-channel earphone or a multi-channel earphone, each earphone 200 has at least two speakers.
其中,麦克风位于耳机200结构上可以拾取环境音的位置,拾取的环境音用于至少以下两个用途:ANC降噪所需的原始噪声信号,用于作为降噪电路输出反相噪声所需的输入信号;噪声检测分析所需的环境噪声信号。可以通过1个麦克风同时实现以上两个用途,节省硬件成本,也可以用多个麦克风分别实现以上两个用途。The microphone is located at a position on the structure of the earphone 200 that can pick up ambient sound, and the picked up ambient sound is used for at least the following two purposes: the original noise signal required for ANC noise reduction, which is used as the input signal required for the noise reduction circuit to output the reverse noise; and the ambient noise signal required for noise detection and analysis. The above two purposes can be achieved simultaneously by one microphone, saving hardware costs, or multiple microphones can be used to achieve the above two purposes separately.
其中,音频信号处理电路可以用于以下两个用途:ANC降噪处理功能,用于确定用于降噪处理的降噪参数并发送至扬声器输出对应的反相声波,以实现降噪处理;噪声检测分析功能,用于检测和分析音频信号中的噪声信号。Among them, the audio signal processing circuit can be used for the following two purposes: ANC noise reduction processing function, used to determine the noise reduction parameters used for noise reduction processing and send them to the speaker output corresponding inverted sound waves to achieve noise reduction processing; noise detection and analysis function, used to detect and analyze noise signals in audio signals.
其中,供电电路可以为其他硬件部件供电,供电来源可以是耳机200内置的电池,可以是来自外部的电力输入,也可以是耳机200内置的发电器件。The power supply circuit can provide power for other hardware components, and the power supply source can be a battery built into the headset 200, can be power input from the outside, or can be a power generation device built into the headset 200.
下面将通过具体实施例对本申请实施例提供的降噪处理方法、装置、电子设备、耳机及存储介质进行详细说明。The noise reduction processing method, device, electronic device, headset and storage medium provided in the embodiments of the present application will be described in detail below through specific embodiments.
请参阅图3,图3示出了本申请实施例提供的一种降噪处理方法的流程示意图,可应用于电子设备,电子设备可以是上述终端或耳机。下面将针对图3所示的流程示意图进行详细的阐述。该降噪处理方法可以包括以下步骤:Please refer to FIG3, which shows a schematic flow chart of a noise reduction processing method provided in an embodiment of the present application, which can be applied to an electronic device, and the electronic device can be the above-mentioned terminal or headset. The following will be described in detail with respect to the schematic flow chart shown in FIG3. The noise reduction processing method may include the following steps:
步骤S110:获取音频采集装置采集的环境音。Step S110: Acquire the ambient sound collected by the audio collection device.
其中,环境音为音频采集装置基于当前位置采集的环境的声音信号,环境音包含噪声信号。音频采集装置可以设置于终端,也可设置于耳机,基于音频采集装置采集环境音。在一些实施方式中,音频采集装置可以是麦克风等可用于采集声音信号的装置,在此不做限定。The ambient sound is a sound signal of the environment collected by the audio collection device based on the current position, and the ambient sound includes a noise signal. The audio collection device can be set in the terminal or in the headset, and the ambient sound is collected based on the audio collection device. In some embodiments, the audio collection device can be a device such as a microphone that can be used to collect sound signals, which is not limited here.
以音频采集装置设置于耳机为例,可基于耳机的音频采集装置如麦克风采集环境音。则在设置于耳机时,可节约成本,通过复用前馈麦克风拾取的外界环境声信号,既可用于前馈降噪设计,也可用于拾取用户输入语音,而不产生额外的硬件成本。Taking the example of an audio collection device being set in a headset, the ambient sound can be collected based on the audio collection device of the headset, such as a microphone. When it is set in the headset, cost can be saved, and the external ambient sound signal picked up by the feedforward microphone can be reused, which can be used for feedforward noise reduction design and can also be used to pick up user input voice without incurring additional hardware costs.
在一些实施方式中,音频采集装置可实时采集环境音,在另一些实施方式中,音频采集装置也可基于采集指令再对环境音进行采集,即电子设备在接收到采集指令时,才根据采集指令基于音频采集装置采集环境音。例如,用户可通过终端,或对耳机的操作,触发采集指令,使得音频采集装置可接收到采集指令以采集环境音。In some embodiments, the audio collection device can collect ambient sound in real time. In other embodiments, the audio collection device can also collect ambient sound based on a collection instruction, that is, the electronic device collects ambient sound based on the audio collection device according to the collection instruction when receiving the collection instruction. For example, the user can trigger the collection instruction through the terminal or the operation of the headset, so that the audio collection device can receive the collection instruction to collect ambient sound.
在一些实施例中,电子设备获取音频采集装置采集的环境音,若环境音包含噪声信号,即可启动主动降噪功能,执行步骤S120以及之后的步骤。In some embodiments, the electronic device obtains the ambient sound collected by the audio collection device. If the ambient sound contains a noise signal, the active noise reduction function can be activated to execute step S120 and subsequent steps.
在另一些实施例中,电子设备也可在获取到音频采集装置采集的环境音后,若环境音中噪声信号的声音能量值超过预设能量值,才启动主动降噪功能,执行步骤S120以及之后的步骤,以对噪声进行降噪处理,若环境音中噪声信号的声音能量值未超过预设能量值,可不执行步骤S120以及之后的步骤,例如可继续监听环境音或结束监听,从而可在环境音中的噪声信号较弱、对用户影响不大时不作主动降噪处理,降低设备功耗,节省资源。In other embodiments, after obtaining the ambient sound collected by the audio collection device, the electronic device may also activate the active noise reduction function and execute step S120 and subsequent steps to perform noise reduction processing on the noise if the sound energy value of the noise signal in the ambient sound exceeds the preset energy value. If the sound energy value of the noise signal in the ambient sound does not exceed the preset energy value, step S120 and subsequent steps may not be executed, for example, the ambient sound may continue to be monitored or the monitoring may be ended, so that active noise reduction processing may not be performed when the noise signal in the ambient sound is weak and has little impact on the user, thereby reducing device power consumption and saving resources.
步骤S120:对采集到的环境音进行预处理,得到待分析的噪声信号。Step S120: pre-processing the collected ambient sound to obtain a noise signal to be analyzed.
在一些实施方式中,对采集到的环境音进行预处理可包括对采集到的环境音进行模数转换得到数字信号,并对该数字信号进行预加重、分帧、加窗、梅尔频率倒谱系数(Mel-Frequency Cepstral Coefficients,MFCC)提取等处理,进而得到待分析的噪声信号。在另一些实施方式中,预处理可包括比前述更多或更少的处理步骤,在此不作限定。In some embodiments, preprocessing the collected ambient sound may include performing analog-to-digital conversion on the collected ambient sound to obtain a digital signal, and performing pre-emphasis, framing, windowing, Mel-Frequency Cepstral Coefficients (MFCC) extraction and other processing on the digital signal to obtain a noise signal to be analyzed. In other embodiments, preprocessing may include more or fewer processing steps than the aforementioned, which are not limited here.
本实施例中,对采集到的环境音进行预处理,可将待分析的噪声信号按多个频带划分。具体地,频带指信号的频率范围,单位一般为赫兹(Hz),比如,频带可以是400Hz~600Hz,待分析的噪声信号可对应有100Hz~200Hz、200Hz~400Hz以及400Hz~600Hz。In this embodiment, the collected ambient sound is preprocessed, and the noise signal to be analyzed can be divided into multiple frequency bands. Specifically, the frequency band refers to the frequency range of the signal, and the unit is generally Hertz (Hz). For example, the frequency band can be 400Hz to 600Hz, and the noise signal to be analyzed can correspond to 100Hz to 200Hz, 200Hz to 400Hz, and 400Hz to 600Hz.
步骤S130:获取待分析的噪声信号在多个频带的声音能量值。Step S130: Acquire sound energy values of the noise signal to be analyzed in multiple frequency bands.
在得到待分析的噪声信号后,可获取待分析的噪声信号在多个频带的声音能量值,在一种实施方式中,得到对应有多个频带的噪声信号,可根据噪声信号在每个频带上的声音能量值,获取待分析的噪声信号在多个频带的声音能量值。After obtaining the noise signal to be analyzed, the sound energy values of the noise signal to be analyzed in multiple frequency bands can be obtained. In one embodiment, a noise signal corresponding to multiple frequency bands is obtained, and the sound energy values of the noise signal to be analyzed in multiple frequency bands can be obtained based on the sound energy value of the noise signal in each frequency band.
其中,声音能量值的单位可为dB,在一些示例中,频谱能量也可称为能量、振幅(Amplitude)、声压级,即一个声音信号在环境中是用多少dB来表示。作为一种方式,可根据待分析的噪声信号在频谱图上的分布,频谱图的横轴可为频率,纵轴可为声音能量值,则可确定噪声信号在多个频带的声音能量值。The unit of the sound energy value may be dB. In some examples, the spectrum energy may also be referred to as energy, amplitude, or sound pressure level, i.e., how many dB is used to represent a sound signal in an environment. As a method, the sound energy values of the noise signal in multiple frequency bands may be determined based on the distribution of the noise signal to be analyzed on the spectrum graph, where the horizontal axis of the spectrum graph may be the frequency and the vertical axis may be the sound energy value.
步骤140:根据多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数。Step 140: Determine corresponding target noise reduction parameters according to the proportional relationship between the sound energy values of multiple frequency bands.
在对环境音进行降噪处理时,可根据噪声信号多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数,以基于目标降噪参数对环境音中的噪声信号进行降噪处理。通过获取多个频带的声音能量值之间的比例关系,可以更准确地确定声音能量值更集中的频带,以对噪声类型进行更准确的区分,从而有利于确定更准确的降噪参数,取得更好的降噪效果。When performing noise reduction processing on ambient sound, the corresponding target noise reduction parameters can be determined according to the proportional relationship between the sound energy values of multiple frequency bands of the noise signal, so as to perform noise reduction processing on the noise signal in the ambient sound based on the target noise reduction parameters. By obtaining the proportional relationship between the sound energy values of multiple frequency bands, the frequency bands where the sound energy values are more concentrated can be more accurately determined to more accurately distinguish the noise types, which is conducive to determining more accurate noise reduction parameters and achieving better noise reduction effects.
其中,目标降噪参数可以是根据所采集到的噪声信号的声音能量值实时生成的,也可以是预先设置好的,例如在一些实施方式中,也可预先构建好针对各种噪声信号的多组预设降噪参数,并构建好每个预设降噪参数与比例关系的映射关系,从而根据多个频带的声音能量值之间的比例关系,确定对应的预设降噪参数作为目标降噪参数,从而基于该目标降噪参数对环境音进行降噪处理,从而可降低运算量,如果本实施例应用于耳机,则可降低耳机的功耗,提高其续航时间。Among them, the target noise reduction parameter can be generated in real time according to the sound energy value of the collected noise signal, or it can be pre-set. For example, in some embodiments, multiple groups of preset noise reduction parameters for various noise signals can be pre-constructed, and a mapping relationship between each preset noise reduction parameter and the proportional relationship can be constructed, so that according to the proportional relationship between the sound energy values of multiple frequency bands, the corresponding preset noise reduction parameter is determined as the target noise reduction parameter, and the ambient sound is noise-reduced based on the target noise reduction parameter, thereby reducing the amount of calculation. If this embodiment is applied to headphones, the power consumption of the headphones can be reduced and the battery life can be increased.
在一些实施例中,可基于训练好的神经网络模型,根据多个频带的能量值的比例关系,确定待分析的噪声信号的噪声类型,再将噪声类型对应的降噪参数确定为目标降噪参数,则神经网络模型可由采集到的各种频带的噪声信号作为训练样本,并标注各训练样本的噪声类型,以此训练该神经网络模型得到训练好的神经网络模型可用于实现步骤S140,具体可见后述实施例,在此不作赘述。In some embodiments, based on the trained neural network model, the noise type of the noise signal to be analyzed can be determined according to the proportional relationship of the energy values of multiple frequency bands, and then the noise reduction parameters corresponding to the noise type can be determined as the target noise reduction parameters. The neural network model can use the collected noise signals of various frequency bands as training samples, and mark the noise type of each training sample. The neural network model can be trained in this way to obtain a trained neural network model that can be used to implement step S140. The details can be seen in the embodiments described later and will not be repeated here.
在另一些实施例中,也可具体通过对多个频带的声音能量值进行比较,将其中声音能量值最高的频带所对应的降噪参数确定为目标降噪参数。在一些实施方式中,多个频带的声音能量值之间的比例关系可以是通过先确定最高声音能量值的频带,再确定该频带与其他频带的比例关系得到。具体也可见后述实施例,在此不作赘述。In other embodiments, the sound energy values of multiple frequency bands may be specifically compared, and the noise reduction parameter corresponding to the frequency band with the highest sound energy value may be determined as the target noise reduction parameter. In some implementations, the proportional relationship between the sound energy values of multiple frequency bands may be obtained by first determining the frequency band with the highest sound energy value, and then determining the proportional relationship between the frequency band and other frequency bands. The details can also be seen in the embodiments described below, and will not be repeated here.
在另一些实施方式中,多个频带的声音能量值之间的比例关系也可以是通过多个频带的声音能量值之间的比例直接确定的,具体地,若多个频带的声音能量值之间的比例与预设比例匹配,则可从多个频带中将声音能量值最高的频带确定为候选频带,并将该候选频带对应的降噪参数确定为目标降噪参数。其中,预设比例可以根据实际需要确定,例如若多个频带的数量为3,则预设比例可为1:1:2、1:1:3、1:2:4等,在此不作限定。另外,与预设比例匹配可以是精确匹配,也可以是近似匹配,例如三个频带的声音能量值之间的比例为1.1:1:2,预设比例为1:1:2,此时也可判定该三个频带的比例与预设比例匹配,由此可允许一定误差,误差允许程度也可根据实际需要确定。另外,多个频带的比例与预设比例进行匹配时可以不限定频带的顺序,也就是说只要多个频带的比例能够与预设比例匹配即可。In other embodiments, the proportional relationship between the sound energy values of multiple frequency bands can also be directly determined by the ratio between the sound energy values of multiple frequency bands. Specifically, if the ratio between the sound energy values of multiple frequency bands matches the preset ratio, the frequency band with the highest sound energy value can be determined as a candidate frequency band from the multiple frequency bands, and the noise reduction parameter corresponding to the candidate frequency band can be determined as the target noise reduction parameter. Among them, the preset ratio can be determined according to actual needs. For example, if the number of multiple frequency bands is 3, the preset ratio can be 1:1:2, 1:1:3, 1:2:4, etc., which are not limited here. In addition, matching with the preset ratio can be an exact match or an approximate match. For example, the ratio between the sound energy values of the three frequency bands is 1.1:1:2, and the preset ratio is 1:1:2. At this time, it can also be determined that the ratio of the three frequency bands matches the preset ratio, thereby allowing a certain error, and the error tolerance can also be determined according to actual needs. In addition, when the ratio of multiple frequency bands matches the preset ratio, the order of the frequency bands can be unrestricted, that is, as long as the ratio of the multiple frequency bands can match the preset ratio.
在一个具体示例中,若频带A、频带B、频带C的声音能量值之间的比例为1:2:1,预设比例为1:1:2,则可判定频带A、频带B、频带C的声音能量值之间的比例与预设比例匹配,则可将频带B对应的降噪参数确定为目标降噪参数。In a specific example, if the ratio between the sound energy values of frequency band A, frequency band B, and frequency band C is 1:2:1, and the preset ratio is 1:1:2, it can be determined that the ratio between the sound energy values of frequency band A, frequency band B, and frequency band C matches the preset ratio, and the noise reduction parameter corresponding to frequency band B can be determined as the target noise reduction parameter.
步骤150:基于目标降噪参数对环境音进行降噪处理。Step 150: Perform noise reduction processing on the ambient sound based on the target noise reduction parameter.
其中,确定的目标降噪参数可以为主动降噪曲线或与主动降噪曲线对应的降噪参数。则基于目标降噪参数可由耳机输出对应的反相声波以对环境音进行降噪处理。The determined target noise reduction parameter may be an active noise reduction curve or a noise reduction parameter corresponding to the active noise reduction curve. Based on the target noise reduction parameter, the earphone may output a corresponding anti-phase sound wave to perform noise reduction on the ambient sound.
本申请实施例提供的降噪处理方法,通过基于音频采集装置采集环境音,其中,环境音可能包含噪声信号,然后对采集到的环境音进行预处理,得到对应有多个频带的待分析的噪声信号,接着获取待分析的噪声信号在多个频带的声音能量值,并根据多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数,最后基于降噪参数对环境音进行降噪处理。由此,通过识别出噪声信号在多个频带的声音能量值,根据它们之间的比例关系确定目标降噪参数,以基于目标降噪参数进行针对性降噪处理,实现对日常遇到的各种频带的噪声信号可以获得较优的主动降噪效果。The noise reduction processing method provided in the embodiment of the present application collects ambient sound based on an audio collection device, wherein the ambient sound may contain a noise signal, and then pre-processes the collected ambient sound to obtain a noise signal to be analyzed corresponding to multiple frequency bands, then obtains the sound energy value of the noise signal to be analyzed in multiple frequency bands, and determines the corresponding target noise reduction parameters based on the proportional relationship between the sound energy values of the multiple frequency bands, and finally performs noise reduction processing on the ambient sound based on the noise reduction parameters. Thus, by identifying the sound energy values of the noise signal in multiple frequency bands, determining the target noise reduction parameters based on the proportional relationship between them, and performing targeted noise reduction processing based on the target noise reduction parameters, a better active noise reduction effect can be achieved for noise signals of various frequency bands encountered in daily life.
请参阅图4,图4示出了本申请另一个实施例提供的降噪处理方法的流程示意图,具体地,该方法可以包括:Please refer to FIG. 4 , which shows a schematic flow chart of a noise reduction processing method provided by another embodiment of the present application. Specifically, the method may include:
步骤S210:基于音频采集装置采集环境音。Step S210: Collecting ambient sound based on the audio collection device.
步骤S220:基于预设频率范围,根据倍频程将预设频率范围划分为多个待分析的频带。Step S220: Based on the preset frequency range, the preset frequency range is divided into a plurality of frequency bands to be analyzed according to octaves.
由于人耳听音系统对声音频率的分辨率并不是固定的,频率越高人耳听音系统的频率分辨率越低,且人耳听觉系统所能分辨出来的频率间隔与倍频程的中心频率近似成对数正比关系,因此得到对应有多个频带的待分析的噪声信号时,可以将待分析的噪声信号的频带宽度设定为对数频带,比如倍频程。在一些实施方式中,若想对噪声信号进行更细粒度的识别,亦可将分析频带宽度设定为1/2倍频程甚至1/3倍频程,本实施例对此不作限定。Since the resolution of the human ear hearing system for sound frequency is not fixed, the higher the frequency, the lower the frequency resolution of the human ear hearing system, and the frequency interval that the human ear hearing system can distinguish is approximately logarithmically proportional to the center frequency of the octave, when a noise signal to be analyzed corresponding to multiple frequency bands is obtained, the frequency bandwidth of the noise signal to be analyzed can be set to a logarithmic frequency band, such as an octave. In some embodiments, if you want to identify the noise signal in a more fine-grained manner, you can also set the analysis frequency bandwidth to 1/2 octave or even 1/3 octave, which is not limited in this embodiment.
在一些实施例中,预设频率范围可根据实际需要确定,例如,考虑到多数ANC耳机在1~2kHz频段内的降噪效果较弱,可仅对频率位于1kHz以下的低频噪声成分进行分析,则预设频率范围可以为1kHz以下的频率范围。当然也可对更宽或者更窄的频率范围进行处理和分析,本实施例对预设频率范围不作限定。In some embodiments, the preset frequency range can be determined according to actual needs. For example, considering that most ANC headphones have a weak noise reduction effect in the 1-2kHz frequency band, only low-frequency noise components below 1kHz can be analyzed, and the preset frequency range can be a frequency range below 1kHz. Of course, a wider or narrower frequency range can also be processed and analyzed, and this embodiment does not limit the preset frequency range.
在一些实施方式中,频带的划分也可以根据实际需要来确定。在实际应用中,为了避免ANC耳机在强低频震动场合进入非线性工作区域并进而出现异常音,ANC耳机在100Hz以下的降噪效果一般较差。鉴于此,可以将第一个待分析的频带设定为100~200Hz,同时结合人耳听觉系统的频率分辨性能,可对噪声信号进行对数频程分析,将第二个待分析的频带设定为200~400Hz。另外,作为一种实施方式,按照对数倍频程特性,第三个待分析的频带可以设定为400~800Hz。In some implementations, the division of frequency bands can also be determined according to actual needs. In practical applications, in order to prevent the ANC headset from entering the nonlinear working area and causing abnormal sounds in the presence of strong low-frequency vibrations, the noise reduction effect of the ANC headset below 100Hz is generally poor. In view of this, the first frequency band to be analyzed can be set to 100-200Hz. At the same time, combined with the frequency resolution performance of the human auditory system, the noise signal can be subjected to logarithmic frequency analysis, and the second frequency band to be analyzed can be set to 200-400Hz. In addition, as an implementation method, according to the logarithmic octave characteristics, the third frequency band to be analyzed can be set to 400-800Hz.
作为另一种实施方式,考虑到多数ANC耳机在1~2kHz频带内的降噪效果较弱,可仅对频率位于1kHz以下的低频噪声成分进行分析,则可仅考虑1kHz以下的频谱成分,将第三个待分析的频带可设定为400~1000Hz。由此,可结合主动降噪的频率特性和人耳听觉系统特性,确定待分析的不同频带的频率范围。As another implementation, considering that most ANC headphones have a weak noise reduction effect in the 1-2kHz frequency band, only low-frequency noise components below 1kHz can be analyzed, and only the spectrum components below 1kHz can be considered, and the third frequency band to be analyzed can be set to 400-1000Hz. In this way, the frequency characteristics of active noise reduction and the characteristics of the human hearing system can be combined to determine the frequency ranges of different frequency bands to be analyzed.
需要说明的是,不同ANC耳机的降噪性能不同,根据ANC耳机在不同频带的降噪性能表现,可灵活设定第三个待分析的频带,例如,将降噪性能表现开始变差的最高频率设定为第三个待分析的频带的上限频率值。在一个示例中,若ANC耳机在1.2kHz以上的频带的降噪效果才开始变差或低于设定的阈值,则第三个待分析的频带也可以设定为400~1200Hz,此时预设频率范围可为1.2kHz以下的频率范围。It should be noted that different ANC headphones have different noise reduction performances. According to the noise reduction performance of the ANC headphones in different frequency bands, the third frequency band to be analyzed can be flexibly set. For example, the highest frequency at which the noise reduction performance begins to deteriorate is set as the upper limit frequency value of the third frequency band to be analyzed. In one example, if the noise reduction effect of the ANC headphones in the frequency band above 1.2kHz begins to deteriorate or is lower than the set threshold, the third frequency band to be analyzed can also be set to 400-1200Hz, and the preset frequency range can be the frequency range below 1.2kHz.
需要说明的是,上述待分析的频带也可设定为更窄或更宽、中心频率往其他频率移动、将此频带拆分为多个更细的频带等,本实施例对此不作限定。另外,对数频程分析可以基于倍频程、1/2倍频程或1/3倍频程等,本实施例对此也不作限定。It should be noted that the frequency band to be analyzed may also be set to be narrower or wider, the center frequency may be moved to other frequencies, the frequency band may be split into multiple finer frequency bands, etc., and this embodiment does not limit this. In addition, the logarithmic frequency band analysis may be based on octaves, 1/2 octaves, or 1/3 octaves, etc., and this embodiment does not limit this either.
考虑到人耳听音系统对声音频率的分辨能力具有对数特性,即对低频部分的分辨率高,但对高频部分的分辨率反而低。因而相对于对音频采集装置拾取到的噪声信号进行傅里叶变换,然后通过分析噪声频谱差异以调用不同的降噪模式的降噪方法,本实施例通过设定好待分析的频带后,再结合该频带内的噪声频谱特性来对噪声进行识别,可更充分考虑人耳听音系统的主观听音特性,减少对过多的噪声频谱细节的考虑,使得在对噪声信号进行处理和分析时具有更优的鲁棒性。Considering that the human ear hearing system has a logarithmic characteristic in its ability to distinguish sound frequencies, that is, the resolution of the low-frequency part is high, but the resolution of the high-frequency part is low. Therefore, compared with the noise reduction method that performs Fourier transform on the noise signal picked up by the audio acquisition device and then analyzes the noise spectrum difference to call different noise reduction modes, this embodiment sets the frequency band to be analyzed and then identifies the noise in combination with the noise spectrum characteristics within the frequency band, which can more fully consider the subjective listening characteristics of the human ear hearing system, reduce the consideration of excessive noise spectrum details, and make the noise signal more robust when processing and analyzing.
步骤S230:根据每个频带的上限频率值与下限频率值,确定对应的带通滤波器。Step S230: Determine a corresponding bandpass filter according to the upper limit frequency value and the lower limit frequency value of each frequency band.
根据每个频带的上限频率值与下限频率值,即可获取每个频带的频率范围,则可生成各频率范围对应的带通滤波器。According to the upper limit frequency value and the lower limit frequency value of each frequency band, the frequency range of each frequency band can be obtained, and the bandpass filter corresponding to each frequency range can be generated.
步骤S240:在时域基于每个频带对应的带通滤波器,对每个频带的噪声信号进行带通滤波处理,得到滤波后的噪声信号作为待分析的噪声信号。Step S240: performing bandpass filtering on the noise signal of each frequency band based on the bandpass filter corresponding to each frequency band in the time domain, and obtaining a filtered noise signal as the noise signal to be analyzed.
在时域基于每个频带对应的带通滤波器,对每个频带的噪声信号进行带通滤波处理,滤出待分析的不同频带内的信号,以便于后续识别环境噪声信号的频谱特性。在此滤波处理过程中,亦滤除了不必要的低频和高频,既保证数据信息的完整性,同时降低信号处理的数据量。并且由于直接在时域上进行滤波,不需要进行傅里叶变换到频谱,只需要在时域进行滤波,所以处理更简单,更符合降噪的特性。In the time domain, based on the bandpass filter corresponding to each frequency band, the noise signal of each frequency band is bandpass filtered to filter out the signals in different frequency bands to be analyzed, so as to facilitate the subsequent identification of the spectrum characteristics of the environmental noise signal. In this filtering process, unnecessary low and high frequencies are also filtered out, which not only ensures the integrity of the data information, but also reduces the amount of data processed by the signal. And because the filtering is performed directly in the time domain, there is no need to perform Fourier transform to the spectrum, only filtering in the time domain, so the processing is simpler and more in line with the characteristics of noise reduction.
其中,通过带通滤波处理可保留信号中某一频率范围内的频率分量、同时将该频率范围外的频率分量衰减到较低水平的信号处理。在本实施例中,可利用带通滤波处理截取不同频率范围内的声音信号,再计算相应频率范围内的声信号能量,即声音能量值,进而根据声音能量值在不同频段范围内的分布差异来区分不同的噪声类型,进而确定对应的降噪参数作为目标降噪参数。Among them, the bandpass filtering process can retain the frequency components within a certain frequency range in the signal, while attenuating the frequency components outside the frequency range to a lower level. In this embodiment, the bandpass filtering process can be used to intercept the sound signals in different frequency ranges, and then the sound signal energy in the corresponding frequency range is calculated, that is, the sound energy value, and then different noise types are distinguished according to the distribution difference of the sound energy value in different frequency bands, and then the corresponding noise reduction parameters are determined as the target noise reduction parameters.
在其他一些实施例中,也可以不是带通滤波而是做低通滤波,在此不作限定。In some other embodiments, low-pass filtering may be performed instead of band-pass filtering, which is not limited here.
在一些实施例中,预处理还可包括降采样处理,比如,在前述在时域基于每个频带对应的带通滤波器,对每个频带的噪声信号进行带通滤波处理之前,可先对采集到的环境音进行降采样处理,得到降采样后的环境音;根据降采样后的环境音,得到待分析的噪声信号。具体地,在一些实施方式中,得到降采样后的环境音,可对降采样后的环境音进行预处理,得到待分析的噪声信号,其中,预处理的步骤可参考前述步骤S120,在此不再赘述。当然,在另一些实施方式中,在对降采样后的环境音进行预处理时,也可对环境音的噪声信号进行滤波处理,具体实施方式可参考前述步骤S220至步骤S240,在此不再赘述。In some embodiments, preprocessing may also include downsampling processing. For example, before the noise signal of each frequency band is band-pass filtered in the time domain based on the band-pass filter corresponding to each frequency band, the collected ambient sound may be downsampled to obtain the downsampled ambient sound; and the noise signal to be analyzed is obtained based on the downsampled ambient sound. Specifically, in some embodiments, the downsampled ambient sound is obtained, and the downsampled ambient sound may be preprocessed to obtain the noise signal to be analyzed, wherein the preprocessing step may refer to the aforementioned step S120, which will not be described in detail here. Of course, in other embodiments, when preprocessing the downsampled ambient sound, the noise signal of the ambient sound may also be filtered, and the specific implementation method may refer to the aforementioned steps S220 to S240, which will not be described in detail here.
由于主动降噪处理对系统的延时要求较高,例如,在一些场景中,系统的硬件延时需在20微秒以内。因此,在主动降噪处理通路中,对数字信号的采样率较高,基本在192kHz以上,甚至部分ANC耳机还采用768kHz的高采样率。但是,在对噪声频谱进行识别分析、分类处理时,其对系统延时的敏感度低很多,并且考虑到采样率越高则运算量越大,因此在进行噪声频谱识别分析前,可以先对高采样率的数字信号进行降采样处理。Since active noise reduction processing has high requirements for system latency, for example, in some scenarios, the system's hardware latency needs to be within 20 microseconds. Therefore, in the active noise reduction processing path, the sampling rate of the digital signal is relatively high, basically above 192kHz, and some ANC headphones even use a high sampling rate of 768kHz. However, when identifying, analyzing, and classifying the noise spectrum, its sensitivity to system latency is much lower, and considering that the higher the sampling rate, the greater the amount of calculation, the high sampling rate digital signal can be downsampled before performing noise spectrum identification and analysis.
在一些实施方式中,由于主动降噪主要对2kHz以下的频率成分有效,所以可对此频率范围内的噪声信号进行识别分析。为了覆盖到2kHz以下的频率范围,麦克风信号采样率只需要不低于4kHz即已足够。同时,频率越低越能够节省运算量,因此可采用降采样处理;如果电子设备的运算能力足够,比如音频信号处理电路的运算能力足够,也可以采用更高的采样率。作为一种方式,可采用16kHz采样率,基于16kHz的采样率对采集到的环境音进行降采样处理;作为其他方式,也可考虑采用不同的采样率,只需保证采样率不低于4kHz即仍可一定程度地降低运算量的同时保证噪声信号的精度。In some embodiments, since active noise reduction is mainly effective for frequency components below 2kHz, the noise signals within this frequency range can be identified and analyzed. In order to cover the frequency range below 2kHz, the microphone signal sampling rate only needs to be no less than 4kHz. At the same time, the lower the frequency, the more computing power can be saved, so downsampling processing can be used; if the computing power of the electronic device is sufficient, such as the computing power of the audio signal processing circuit, a higher sampling rate can also be used. As one way, a 16kHz sampling rate can be used, and the collected ambient sound can be downsampled based on the sampling rate of 16kHz; as another way, different sampling rates can also be considered. As long as the sampling rate is not less than 4kHz, the accuracy of the noise signal can still be guaranteed while reducing the amount of computing to a certain extent.
步骤S250:获取待分析的噪声信号在多个频带的声音能量值。Step S250: Acquire sound energy values of the noise signal to be analyzed in multiple frequency bands.
通过带通滤波处理,可得到噪声信号在待分析的不同频带内的噪声成分,此时可计算待分析的噪声信号在不同频带内的声音能量值。By bandpass filtering, the noise components of the noise signal in different frequency bands to be analyzed can be obtained, and at this time, the sound energy values of the noise signal to be analyzed in different frequency bands can be calculated.
在一些实施方式中,获取待分析的噪声信号在多个频带的声音能量值后,可以对待分析的噪声信号在多个频带内的声音能量值进行平滑处理。由于环境中噪声信号总是随时间变化,在实际使用时,为了使主动降噪效果不要频繁切换导致使用体验较差,通过对不同频带范围内的噪声信号的声音能量值进行平滑处理,其中,具体的平滑速度可根据实际需要进行调整,也可以是程序预设,还可以是用户自定义。通过能量平滑处理可以减缓对噪声信号变化的跟踪速度,可以消除环境的噪声信号出现的一些短暂的瞬态变化对降噪效果的影响,提升用户体验。In some embodiments, after obtaining the sound energy values of the noise signal to be analyzed in multiple frequency bands, the sound energy values of the noise signal to be analyzed in multiple frequency bands can be smoothed. Since the noise signal in the environment always changes over time, in actual use, in order to prevent the active noise reduction effect from switching frequently and resulting in a poor user experience, the sound energy values of the noise signals in different frequency bands are smoothed, wherein the specific smoothing speed can be adjusted according to actual needs, and can also be preset by the program or customized by the user. Energy smoothing can slow down the tracking speed of noise signal changes, eliminate the impact of some short-term transient changes in the environmental noise signal on the noise reduction effect, and improve the user experience.
步骤S260:根据多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数。Step S260: Determine corresponding target noise reduction parameters according to the proportional relationship between the sound energy values of multiple frequency bands.
在另一些实施例中,可基于训练好的神经网络模型实现步骤S260,则步骤S260可包括步骤S261至步骤S262,具体地,请参阅图5,图5示出了本申请一个示例性实施例提供的图4中步骤S260的流程示意图,于该实施例中,步骤S260可包括:In some other embodiments, step S260 may be implemented based on a trained neural network model, and step S260 may include steps S261 to S262. Specifically, please refer to FIG. 5, which shows a flow chart of step S260 in FIG. 4 provided by an exemplary embodiment of the present application. In this embodiment, step S260 may include:
步骤S261:基于训练好的深度学习模型,根据多个频带的声音能量值的比例关系,确定噪声类型。Step S261: Based on the trained deep learning model, determine the noise type according to the proportional relationship of the sound energy values of multiple frequency bands.
在训练深度学习模型之前,可先采集噪声数据库,例如,可基于不同的噪声环境,对不同环境下的噪声信号进行采集,得到相应的噪声信号。并为了提升深度学习模型的识别准确率,可采集尽量多的噪声信号。Before training the deep learning model, a noise database can be collected first. For example, based on different noise environments, noise signals in different environments can be collected to obtain corresponding noise signals. In order to improve the recognition accuracy of the deep learning model, as many noise signals as possible can be collected.
采集得到噪声信号后,可基于预设时间长度对采集到的噪声信号进行分段处理,得到持续时间长度为预设时间长度的多段噪声信号,其中,预设时间长度可根据实际需要确定,也可以是程序预设或用户自定义的,本实施例对此不作限定。在一个示例中,预设时间长度可设定为数秒到数十秒不等。After the noise signal is collected, the collected noise signal can be segmented based on the preset time length to obtain multiple noise signals with a duration of the preset time length, wherein the preset time length can be determined according to actual needs, or can be preset by the program or customized by the user, and this embodiment does not limit this. In an example, the preset time length can be set to range from several seconds to tens of seconds.
将采集到的噪声信号分段后,可以对每段噪声信号的在不同频带的声音能量值进行标记。在一些实施方式中,可仅标记噪声信号在每个频带的声音能量值;在另一些实施方式中,也可直接标记噪声信号在多个频带的声音能量值的比例关系;在又一些实施方式中,还可标记噪声信号的噪声类型,本实施例对此不作限定,具体可根据深度学习模型构建时的输入输出定义进行确定。After the collected noise signal is segmented, the sound energy values of each noise signal in different frequency bands can be marked. In some embodiments, only the sound energy value of the noise signal in each frequency band can be marked; in other embodiments, the proportional relationship of the sound energy values of the noise signal in multiple frequency bands can be directly marked; in still other embodiments, the noise type of the noise signal can also be marked, which is not limited in this embodiment and can be determined specifically according to the input and output definitions when the deep learning model is constructed.
其中,噪声类型可按各种维度进行划分,在一些实施方式中,可按声音能量值最高的频带来划分;在另一些实施方式中,可按噪声产生场景的不同来划分;在又一些实施方式中,可按噪声产生方式的不同来划分如鼾声、空调声、说话声等。本实施例对噪声类型的划分方式不作限定。The noise types can be divided according to various dimensions. In some embodiments, the noise types can be divided according to the frequency band with the highest sound energy value; in other embodiments, the noise types can be divided according to different noise generation scenes; in still other embodiments, the noise types can be divided according to different noise generation methods, such as snoring, air conditioning, and talking. This embodiment does not limit the method of dividing the noise types.
在一种实施方式中,由于不同噪声在不同频带上的声音能量值分布不同,那么不同噪声的声音能量值最高的频带也会有所不同,则噪声类型也可按声音能量值最高的频带进行划分,比如,噪声类型1的声音能量值最高的频带为200Hz以下,噪声类型2的声音能量值最高的频带为500Hz~600Hz,则若噪声信号的声音能量值主要集中于500Hz~600Hz,可标记其噪声类型为噪声类型2。In one embodiment, since the sound energy value distributions of different noises in different frequency bands are different, the frequency bands with the highest sound energy values of different noises will also be different. The noise types can also be divided according to the frequency bands with the highest sound energy values. For example, the frequency band with the highest sound energy value of noise type 1 is below 200Hz, and the frequency band with the highest sound energy value of noise type 2 is 500Hz~600Hz. If the sound energy value of the noise signal is mainly concentrated in 500Hz~600Hz, its noise type can be marked as noise type 2.
另外,在一些实施例中,从多个频带中确定声音能量值最高的频带时,还可确定该声音能量值最高的频带与其他频带的声音能量值的比值是否均超过预设比值,若均超过,才将该声音能量值最高的频带作为一种噪声类型对应的频带进行标注。若未均超过,则可将该声音能量值最高的频带进行拓宽,将比值未超过预设比值的其他频带与候选频带合并为一个目标频带,从而,可将合并后的目标频带作为一种噪声类型对应的频带进行标注,并针对合并后的目标频带,生成对应的降噪参数作为该噪声类型对应的降噪参数,以实现更准确的针对性降噪。其具体实施方式可见后述实施例,在此不作赘述。In addition, in some embodiments, when determining the frequency band with the highest sound energy value from multiple frequency bands, it can also be determined whether the ratios of the frequency band with the highest sound energy value to the sound energy values of other frequency bands all exceed a preset ratio. If they do, the frequency band with the highest sound energy value is marked as a frequency band corresponding to a noise type. If they do not, the frequency band with the highest sound energy value can be widened, and other frequency bands whose ratios do not exceed the preset ratio can be merged with the candidate frequency bands into a target frequency band, so that the merged target frequency band can be marked as a frequency band corresponding to a noise type, and for the merged target frequency band, corresponding noise reduction parameters can be generated as noise reduction parameters corresponding to the noise type, so as to achieve more accurate targeted noise reduction. The specific implementation method can be seen in the embodiments described later, and will not be repeated here.
在另一种实施方式中,由于不同场景的噪声的频谱特性不同,其在不同频带的声音能量值也有所差异,因而噪声类型可以按场景进行划分,比如噪声类型可包括地铁环境下的地铁噪声、办公室环境下的办公室噪声等,则可预先基于地铁环境采集地铁噪声、基于办公室环境采集办公室噪声等各种噪声类型的噪声信号,并标注对应的噪声类型,在训练深度学习模型时,可分析噪声信号的频谱特性,如噪声信号在多个频带的比例关系作为深度学习模型的输入,将该噪声信号对应的噪声类型作为期待输出,从而在一个示例中,若所采集的噪声信号的频谱特征与基于地铁环境采集到的地铁噪声的频谱特征匹配,例如,噪声信号在多个频带的声音能量值的比例关系与地铁噪声在对应频带的声音能量值的比例关系匹配,则可确定该噪声信号的噪声类型为地铁噪声,其中频谱特征是否匹配的判断可由训练好的深度学习模型实现,通过训练好的深度学习模型确定噪声类型。In another embodiment, since the spectral characteristics of noise in different scenes are different, the sound energy values in different frequency bands are also different, and thus the noise type can be divided according to the scene. For example, the noise type may include subway noise in a subway environment, office noise in an office environment, etc., then noise signals of various noise types such as subway noise based on a subway environment and office noise based on an office environment can be collected in advance, and the corresponding noise types can be marked. When training a deep learning model, the spectral characteristics of the noise signal can be analyzed, such as the proportional relationship of the noise signal in multiple frequency bands as the input of the deep learning model, and the noise type corresponding to the noise signal is used as the expected output. Thus, in one example, if the spectral characteristics of the collected noise signal match the spectral characteristics of the subway noise collected based on the subway environment, for example, the proportional relationship of the sound energy values of the noise signal in multiple frequency bands matches the proportional relationship of the sound energy values of the subway noise in the corresponding frequency bands, then it can be determined that the noise type of the noise signal is subway noise, wherein the judgment of whether the spectral characteristics match can be realized by the trained deep learning model, and the noise type is determined by the trained deep learning model.
在又一种实施方式中,由于不同方式产生的噪声的频谱特性有较大差异,例如鼾声的声音能量值主要集中于250~800Hz,而主动降噪耳机一般的降噪曲线仅是可以对处于80~200Hz的噪声信号有较好的降噪效果,所以对鼾声的降噪效果不强,则为了提升针对性降噪效果,可按噪声产生方式的不同来对噪声类型进行划分,比如鼾声、空调声、说话声等,则可预先采集鼾声、空调声、说话声等各种噪声类型的噪声信号,并标注对应的噪声类型,在训练深度学习模型时,可参考前述描述,从而在一个示例中,若所采集的噪声信号在多个频带的声音能量值的比例关系与鼾声在对应频带的声音能量值的比例关系匹配,则可确定该噪声信号的噪声类型为鼾声。In another embodiment, since the spectral characteristics of noise generated in different ways are quite different, for example, the sound energy value of snoring is mainly concentrated in 250-800Hz, and the general noise reduction curve of active noise reduction headphones can only have a good noise reduction effect on noise signals in the range of 80-200Hz, so the noise reduction effect on snoring is not strong. In order to improve the targeted noise reduction effect, the noise types can be divided according to the different noise generation methods, such as snoring, air conditioning, speaking, etc., then noise signals of various noise types such as snoring, air conditioning, speaking, etc. can be collected in advance, and the corresponding noise types can be marked. When training the deep learning model, the above description can be referred to. In an example, if the proportional relationship of the sound energy values of the collected noise signal in multiple frequency bands matches the proportional relationship of the sound energy values of snoring in the corresponding frequency bands, it can be determined that the noise type of the noise signal is snoring.
基于神经网络建立深度学习模型,并基于上述标记好的噪声信号,对深度学习模型进行训练,训练深度学习模型的参数,包括网络层数、激活函数等,从而获取训练参数的可取范围,再根据训练以及测试所得的损失函数曲线判断训练是否可停止,并再可停止时,可得到能够识别出不同噪声类型的深度学习模型。其中,神经网络可以是卷积神经网络(Convolutional Neural Networks,CNN)、深度神经网络(Deep Neural Networks,DNN)、循环神经网络(Recurrent Neural Network,RNN)等,在此不作限定。由此,可基于训练好的深度学习模型,根据多个频带的声音能量值的比例关系,确定待分析噪声信号的噪声类型。A deep learning model is established based on a neural network, and based on the above-mentioned labeled noise signal, the deep learning model is trained to train the parameters of the deep learning model, including the number of network layers, activation functions, etc., so as to obtain the desirable range of the training parameters, and then determine whether the training can be stopped based on the loss function curve obtained by training and testing, and when it can be stopped, a deep learning model that can identify different types of noise can be obtained. Among them, the neural network can be a convolutional neural network (CNN), a deep neural network (DNN), a recurrent neural network (RNN), etc., which are not limited here. Therefore, based on the trained deep learning model, the noise type of the noise signal to be analyzed can be determined according to the proportional relationship of the sound energy values of multiple frequency bands.
在一些实施方式中,可将训练好的深度学习模型移植到耳机的音频信号处理电路中,则可基于耳机运行该训练好的深度学习模型。在另一些实施方式中,也可将其部署于终端,以基于终端运行该训练好的深度学习模型,从而降低耳机的运算负担,降低耳机的功耗。尤其在耳机是真无线耳机时,可提高其续航时间。In some embodiments, the trained deep learning model can be transplanted into the audio signal processing circuit of the headset, and the trained deep learning model can be run based on the headset. In other embodiments, it can also be deployed on the terminal to run the trained deep learning model based on the terminal, thereby reducing the computing burden of the headset and reducing the power consumption of the headset. In particular, when the headset is a true wireless headset, its battery life can be improved.
步骤S262:将噪声类型对应的降噪参数确定为目标降噪参数。Step S262: Determine the noise reduction parameter corresponding to the noise type as the target noise reduction parameter.
在一些实施方式中,可预先存储有各个噪声类型与降噪参数之间的映射关系,从而可根据噪声类型确定对应的降噪参数作为目标降噪参数。在另一些实施方式中,也可根据噪声类型实时生成对应的降噪参数作为目标降噪参数,实现针对当前噪声类型的自适应降噪处理,以便取得更优的降噪效果。In some embodiments, a mapping relationship between each noise type and a noise reduction parameter may be pre-stored, so that the corresponding noise reduction parameter may be determined as a target noise reduction parameter according to the noise type. In other embodiments, the corresponding noise reduction parameter may be generated in real time according to the noise type as a target noise reduction parameter, so as to implement adaptive noise reduction processing for the current noise type, so as to achieve a better noise reduction effect.
在一些实施方式中,耳机内部可至少存储3套降噪参数,可分别对应3套主动降噪曲线,分别匹配不同噪声类型的降噪处理。In some implementations, at least three sets of noise reduction parameters may be stored inside the earphone, which may correspond to three sets of active noise reduction curves, respectively, to match noise reduction processing of different noise types.
步骤S270:基于目标降噪参数对环境音进行降噪处理。Step S270: performing noise reduction processing on the ambient sound based on the target noise reduction parameters.
确定噪声类型后可根据噪声类型对应的降噪参数确定对应的目标降噪参数。例如,当前环境的噪声信号的能量集中在200Hz以下的频带,则ANC耳机的主动降噪曲线可调整为降噪性能集中在200Hz以下频带的主动降噪曲线,从而获得最优的降噪效果;而当环境发生变化,噪声信号的频谱中能量主要集中在400~600Hz,则ANC耳机的主动降噪曲线可调整为降噪性能集中在400~600Hz频段,从而继续获得较优的降噪效果。After determining the noise type, the corresponding target noise reduction parameters can be determined according to the noise reduction parameters corresponding to the noise type. For example, if the energy of the noise signal in the current environment is concentrated in the frequency band below 200Hz, the active noise reduction curve of the ANC headset can be adjusted to an active noise reduction curve with noise reduction performance concentrated in the frequency band below 200Hz, thereby obtaining the best noise reduction effect; and when the environment changes, the energy in the spectrum of the noise signal is mainly concentrated in the range of 400 to 600Hz, then the active noise reduction curve of the ANC headset can be adjusted to a noise reduction performance concentrated in the frequency band of 400 to 600Hz, thereby continuing to obtain a better noise reduction effect.
在一个具体示例中,以图6和图7为例,图6、图7分别是两类噪声信号的频谱特征图。图6中噪声信号的能量均集中在200Hz以下的低音频带,当识别到噪声信号的频谱特征如图6所示时,可以将降噪性能主要集中在200Hz以下的降噪参数确定为目标降噪参数,并以此对环境音进行降噪处理,比如将主动降噪曲线调整为降噪性能集中在200Hz以下。图7中噪声信号的能量较多分布在500Hz~600Hz附近,当识别到噪声信号的频谱特征如图7所示时,可以将降噪性能主要集中在500Hz~600Hz之间的降噪参数确定为目标降噪参数,并以此对环境音进行降噪处理,比如将主动降噪曲线调整为降噪性能集中在500Hz~600Hz附近,耳机可基于该主动降噪曲线进行降噪处理。In a specific example, taking Figures 6 and 7 as examples, Figures 6 and 7 are spectrum feature diagrams of two types of noise signals, respectively. The energy of the noise signal in Figure 6 is concentrated in the low-frequency band below 200Hz. When the spectrum feature of the noise signal is identified as shown in Figure 6, the noise reduction parameter whose noise reduction performance is mainly concentrated below 200Hz can be determined as the target noise reduction parameter, and the ambient sound can be processed by this, such as adjusting the active noise reduction curve to concentrate the noise reduction performance below 200Hz. The energy of the noise signal in Figure 7 is mostly distributed around 500Hz to 600Hz. When the spectrum feature of the noise signal is identified as shown in Figure 7, the noise reduction parameter whose noise reduction performance is mainly concentrated between 500Hz and 600Hz can be determined as the target noise reduction parameter, and the ambient sound can be processed by this, such as adjusting the active noise reduction curve to concentrate the noise reduction performance around 500Hz to 600Hz, and the headphones can perform noise reduction based on the active noise reduction curve.
需要说明的是,本实施例中未详细描述的部分可以参考前述实施例,在此不再赘述。It should be noted that the parts not described in detail in this embodiment can be referred to the previous embodiments and will not be described again here.
本实施例提供的降噪处理方法,通过基于音频采集装置采集环境音,然后基于由倍频程划分的多个待分析的频带,生成相应的带通滤波器,并在时域上直接进行带通滤波处理得到待分析的噪声信号,使得处理更简单,更符合降噪的特性。接着,根据该待分析的噪声信号在多个频带的声音能量值之间的比例关系,识别得到噪声信号的频谱特性,然后通过该频谱特性相应地调整降噪参数,进而得到不同噪声下的更优降噪效果。另外,还可通过在带通滤波处理前先对采集到的环境音进行降采样处理,可兼顾耳机的运算量,降低其功耗。并通过采用更符合人耳听音系统的倍频程来划分多个待分析的频带,从而可在无需考虑过多噪声频谱细节的前提下,即可实现鲁棒的、更符合人耳听觉系统的主观感知特性来识别噪声类型,取得更符合人耳的主观听觉和降噪效果,提升听音者的主观体验。另外,由于基于本实施例提供的降噪处理方法,一副ANC耳机即可实现对日常遇到的各种噪声进行降噪处理,节省了用户使用和购买的ANC耳机数量。The noise reduction processing method provided in this embodiment collects ambient sound based on an audio collection device, then generates a corresponding bandpass filter based on multiple frequency bands to be analyzed divided by octaves, and directly performs bandpass filtering in the time domain to obtain the noise signal to be analyzed, so that the processing is simpler and more in line with the characteristics of noise reduction. Then, according to the proportional relationship between the sound energy values of the noise signal to be analyzed in multiple frequency bands, the spectrum characteristics of the noise signal are identified, and then the noise reduction parameters are adjusted accordingly according to the spectrum characteristics, so as to obtain a better noise reduction effect under different noises. In addition, the collected ambient sound can be downsampled before the bandpass filtering, which can take into account the amount of calculation of the headset and reduce its power consumption. And by using octaves that are more in line with the human ear hearing system to divide multiple frequency bands to be analyzed, it is possible to achieve robust and more in line with the subjective perception characteristics of the human ear hearing system to identify the noise type without considering too many noise spectrum details, and obtain a more in line with the subjective hearing and noise reduction effect of the human ear, thereby improving the subjective experience of the listener. In addition, due to the noise reduction processing method provided in this embodiment, a pair of ANC headphones can achieve noise reduction processing for various noises encountered in daily life, saving the number of ANC headphones used and purchased by users.
请参阅图8,图8示出了本申请又一个实施例提供的降噪处理方法的流程示意图,具体地,该方法可以包括:Please refer to FIG8 , which shows a schematic flow chart of a noise reduction processing method provided by another embodiment of the present application. Specifically, the method may include:
步骤S310:基于音频采集装置采集环境音。Step S310: Collecting ambient sound based on the audio collection device.
步骤S320:基于预设频率范围,根据倍频程将预设频率范围划分为多个待分析的频带。Step S320: Based on the preset frequency range, the preset frequency range is divided into a plurality of frequency bands to be analyzed according to octaves.
步骤S330:根据每个频带的上限频率值与下限频率值,确定对应的带通滤波器。Step S330: Determine a corresponding bandpass filter according to the upper limit frequency value and the lower limit frequency value of each frequency band.
步骤S340:在时域基于每个频带对应的带通滤波器,对每个频带的噪声信号进行带通滤波处理,得到滤波后的噪声信号作为待分析的噪声信号。Step S340: performing bandpass filtering on the noise signal of each frequency band based on the bandpass filter corresponding to each frequency band in the time domain, and obtaining a filtered noise signal as the noise signal to be analyzed.
步骤S350:获取待分析的噪声信号在多个频带的声音能量值。Step S350: Acquire sound energy values of the noise signal to be analyzed in multiple frequency bands.
步骤S360:从多个频带中将声音能量值最高的频带确定为候选频带。Step S360: Determine a frequency band with the highest sound energy value from among the multiple frequency bands as a candidate frequency band.
基于得到的噪声信号在不同频带内的声音能量值,可以进一步通过不同能量值之间的大小关系识别出噪声信号的频谱特性。本实施例中,可以从多个频带中将声音能量值最高的频带确定为候选频带,由于噪声信号一般集中于声音能量值最高的频带,因而可以判断该候选频带是否足以用于确定出目标降噪参数。Based on the obtained sound energy values of the noise signal in different frequency bands, the spectral characteristics of the noise signal can be further identified through the magnitude relationship between the different energy values. In this embodiment, the frequency band with the highest sound energy value can be determined as a candidate frequency band from multiple frequency bands. Since the noise signal is generally concentrated in the frequency band with the highest sound energy value, it can be determined whether the candidate frequency band is sufficient to determine the target noise reduction parameter.
在一种实施方式中,带通滤波处理后,可对噪声信号进行平滑处理。在一个示例中,若平滑处理后的噪声信号在第一个频带100Hz~200Hz范围内的噪声能量值为A、在第二个频带200Hz~400Hz范围内的噪声能量值为B,在第三个频带400Hz~1000Hz范围内的噪声能量值为C,此时若A>B>C,则可将A对应的第一个频带100Hz~200Hz确定为候选频带,A为对应的候选声音能量值。In one embodiment, after the bandpass filtering, the noise signal may be smoothed. In one example, if the noise energy value of the smoothed noise signal in the first frequency band of 100 Hz to 200 Hz is A, the noise energy value in the second frequency band of 200 Hz to 400 Hz is B, and the noise energy value in the third frequency band of 400 Hz to 1000 Hz is C, then if A>B>C, the first frequency band of 100 Hz to 200 Hz corresponding to A may be determined as a candidate frequency band, and A is the corresponding candidate sound energy value.
步骤S370:确定候选频带对应的候选声音能量值与其他频带的声音能量值的比值是否均超过预设比值。Step S370: Determine whether the ratios of the candidate sound energy value corresponding to the candidate frequency band to the sound energy values of other frequency bands exceed a preset ratio.
在一些实施例中,预设比值包括第一预设比值与第二预设比值,则步骤S370可包括步骤S371至步骤S373,具体地,请参阅图9,图9示出了本申请一个示例性实施例提供的图8中步骤S370的流程示意图,于该实施例中,步骤S370可包括:In some embodiments, the preset ratio includes a first preset ratio and a second preset ratio, and step S370 may include steps S371 to S373. Specifically, please refer to FIG. 9, which shows a flow chart of step S370 in FIG. 8 provided by an exemplary embodiment of the present application. In this embodiment, step S370 may include:
步骤S371:确定候选频带的声音能量值与第一频带的声音能量值的第一比值。Step S371: Determine a first ratio of the sound energy value of the candidate frequency band to the sound energy value of the first frequency band.
步骤S372:确定候选频带的声音能量值与第二频带的声音能量值的第二比值。Step S372: Determine a second ratio of the sound energy value of the candidate frequency band to the sound energy value of the second frequency band.
其中,其他频带可包括连续的第一频带以及第二频带,需要说明的是,连续的第一频带以及第二频带,是指第一频带、第二频带与候选频带在频率上连续,比如,候选频带为100Hz~200Hz,第一频带可以为200Hz~400Hz,第二频带可以为400Hz~1000Hz;再如,候选频带为200Hz~400Hz,第一频带可以为100Hz~200Hz,第二频带可以为400Hz~1000Hz。由此,通过比较候选频带的声音能量值与第一频带、第二频带的声音能量值,可确定候选频带的候选声音能量值与其他频带的声音能量值之间差异程度。Among them, other frequency bands may include a continuous first frequency band and a second frequency band. It should be noted that the continuous first frequency band and the second frequency band refer to that the first frequency band, the second frequency band and the candidate frequency band are continuous in frequency. For example, if the candidate frequency band is 100Hz to 200Hz, the first frequency band may be 200Hz to 400Hz, and the second frequency band may be 400Hz to 1000Hz. For another example, if the candidate frequency band is 200Hz to 400Hz, the first frequency band may be 100Hz to 200Hz, and the second frequency band may be 400Hz to 1000Hz. Therefore, by comparing the sound energy value of the candidate frequency band with the sound energy values of the first frequency band and the second frequency band, the degree of difference between the candidate sound energy value of the candidate frequency band and the sound energy values of other frequency bands can be determined.
在一些可能的实施例中,第一频带、第二频带与候选频带在频率上还可以是间隔连续的,比如候选频带为100Hz~200Hz,第一频带可以为250Hz~450Hz,第二频带可以为500Hz~1000Hz。In some possible embodiments, the first frequency band, the second frequency band and the candidate frequency band may be spaced apart and continuous in frequency, for example, the candidate frequency band is 100 Hz to 200 Hz, the first frequency band may be 250 Hz to 450 Hz, and the second frequency band may be 500 Hz to 1000 Hz.
在一些实施方式中,第一预设比值与第二预设比值可以根据实际需要确定,也可以是程序预设,还可以是用户自定义,本实施例对此不作限定。另外,第一预设比值与第二预设比值可以相同,也可不同。In some implementations, the first preset ratio and the second preset ratio can be determined according to actual needs, or can be preset by a program, or can be user-defined, which is not limited in this embodiment. In addition, the first preset ratio and the second preset ratio can be the same or different.
作为一种实施方式,第一预设比值与第二预设比值相同,则可通过确定候选频带对应的候选声音能量值与其他频带中每一个频带的声音能量值的比值是否均超过第一预设比值或第二预设比值,并在均超过时,才判定候选频带对应的候选声音能量值与其他频带的声音能量值的比值均超过预设比值。As an implementation mode, if the first preset ratio is the same as the second preset ratio, it can be determined by determining whether the ratio of the candidate sound energy value corresponding to the candidate frequency band to the sound energy value of each frequency band in other frequency bands exceeds the first preset ratio or the second preset ratio. Only when both exceed, can it be determined that the ratio of the candidate sound energy value corresponding to the candidate frequency band to the sound energy values of other frequency bands exceeds the preset ratio.
作为另一种实施方式,第一预设比值与第二预设比值可以不相同,例如,可根据第一频带、第二频带各自相距候选频带的频率差,可设置不同的第一预设比值与第二预设比值,并且,在一个示例中,频率差越大,预设比值可以越大。在另一个示例中,频率差越大,预设比值也可以越小,则只需候选频带与距离其最近的频带的声音能量值相差足够大,也可以此确定目标降噪参数。As another implementation, the first preset ratio and the second preset ratio may be different. For example, different first preset ratios and second preset ratios may be set according to the frequency difference between the first frequency band and the second frequency band and the candidate frequency band, and in one example, the larger the frequency difference, the larger the preset ratio. In another example, the larger the frequency difference, the smaller the preset ratio. In this case, the target noise reduction parameter can be determined as long as the difference between the sound energy value of the candidate frequency band and the frequency band closest to it is large enough.
其中,频率差可以为第一频带、第二频带各自与候选频带的中心频率之差,也可以是第一频带、第二频带各自与候选频带的上限频率或下限频率之差,在此不做限定。例如,若候选频带为候选频带为100Hz~200Hz,第一频带可以为200Hz~400Hz,第二频带可以为400Hz~1000Hz,则第一频带与候选频带之间的频率差为中心频率之差,即300Hz-150Hz=150Hz,第二频带与候选频带之间的频率差为中心频率之差,即700Hz-150Hz=550Hz,则第二频带对应的频率差大于第一频带对应的频率差。The frequency difference may be the difference between the center frequency of the first frequency band, the second frequency band and the candidate frequency band, or the difference between the first frequency band, the second frequency band and the upper limit frequency or the lower limit frequency of the candidate frequency band, which is not limited here. For example, if the candidate frequency band is 100Hz to 200Hz, the first frequency band may be 200Hz to 400Hz, and the second frequency band may be 400Hz to 1000Hz, then the frequency difference between the first frequency band and the candidate frequency band is the difference between the center frequencies, i.e., 300Hz-150Hz=150Hz, and the frequency difference between the second frequency band and the candidate frequency band is the difference between the center frequencies, i.e., 700Hz-150Hz=550Hz, then the frequency difference corresponding to the second frequency band is greater than the frequency difference corresponding to the first frequency band.
在一些实施方式中,可预先设置不同频率差区间与预设比值之间的映射关系,则可根据频率差确定对应的预设比值,以作为第一预设比值或第二预设比值。In some implementations, a mapping relationship between different frequency difference intervals and preset ratios may be preset, and a corresponding preset ratio may be determined according to the frequency difference to serve as the first preset ratio or the second preset ratio.
步骤S373:若第一比值超过第一预设比值且第二比值超过第二预设比值,则判定候选频带对应的候选声音能量值与其他频带的声音能量值的比值均超过预设比值。Step S373: If the first ratio exceeds the first preset ratio and the second ratio exceeds the second preset ratio, it is determined that the ratios of the candidate sound energy value corresponding to the candidate frequency band and the sound energy values of other frequency bands all exceed the preset ratios.
若第一比值超过第一预设比值且第二比值超过第二预设比值,则判定候选频带对应的候选声音能量值与其他频带的声音能量值的比值均超过预设比值,此时候选频带与其他频带之间的差异程度足够大,可将该待分析的噪声信号确定为一个噪声类型。If the first ratio exceeds the first preset ratio and the second ratio exceeds the second preset ratio, it is determined that the ratios of the candidate sound energy value corresponding to the candidate frequency band and the sound energy values of other frequency bands both exceed the preset ratios. At this time, the difference between the candidate frequency band and the other frequency bands is large enough, and the noise signal to be analyzed can be determined as a noise type.
在一些实施例中,若候选频带对应的候选声音能量值与其他频带的声音能量值的比值未均超过预设比值,则可能存在多种噪声信号的混合,则此时声音能量值最高的频带可能无法被包含于预先划分的频带,使得频带之间的声音能量值相差不够大,此时,可针对将声音能量值最高的频带进行拓宽,将比值未超过预设比值的其他频带与候选频带合并为一个目标频带,从而,可针对合并后的目标频带,生成对应的降噪参数作为目标降噪参数。由此,还可对多种高噪声信号混合的场景实现针对性降噪处理,取得更优的降噪效果。In some embodiments, if the ratio of the candidate sound energy value corresponding to the candidate frequency band to the sound energy value of other frequency bands does not exceed the preset ratio, there may be a mixture of multiple noise signals. In this case, the frequency band with the highest sound energy value may not be included in the pre-divided frequency band, so that the difference in sound energy values between the frequency bands is not large enough. At this time, the frequency band with the highest sound energy value can be widened, and other frequency bands whose ratios do not exceed the preset ratio can be merged with the candidate frequency band into a target frequency band. Thus, corresponding noise reduction parameters can be generated as target noise reduction parameters for the merged target frequency band. In this way, targeted noise reduction processing can be implemented for scenes with a mixture of multiple high noise signals to achieve better noise reduction effects.
步骤S380:若均超过,将候选频带对应的降噪参数确定为目标降噪参数。Step S380: If both are exceeded, the noise reduction parameter corresponding to the candidate frequency band is determined as the target noise reduction parameter.
例如,若待分析的噪声信号在第一个频带100Hz~200Hz范围内的声音能量值为A,在第二个频带200Hz~400Hz范围内的声音能量值为B,在第三个频带400Hz~1000Hz范围内的声音能量值为C,若A大于B的一定倍数,且A大于C的一定倍数,即A对应的第一个频带100Hz~200Hz为候选频带,可将第二个频带200Hz~400Hz记为第一频带,将第三个频带400Hz~1000Hz记为第二频带,且A与B的第一比值大于第一预设比值,A与C的第二比值大于第二预设比值,则可将该待分析的噪声信号归为一类噪声类型,此时可将降噪参数调整为针对候选频带100Hz~200Hz具有最佳降噪性能的降噪参数,从而进行更深更有针对性的降噪处理。For example, if the sound energy value of the noise signal to be analyzed in the first frequency band of 100Hz to 200Hz is A, the sound energy value in the second frequency band of 200Hz to 400Hz is B, and the sound energy value in the third frequency band of 400Hz to 1000Hz is C, if A is greater than a certain multiple of B, and A is greater than a certain multiple of C, that is, the first frequency band 100Hz to 200Hz corresponding to A is the candidate frequency band, the second frequency band 200Hz to 400Hz can be recorded as the first frequency band, and the third frequency band 400Hz to 1000Hz can be recorded as the second frequency band, and the first ratio of A to B is greater than the first preset ratio, and the second ratio of A to C is greater than the second preset ratio, then the noise signal to be analyzed can be classified as a type of noise. At this time, the noise reduction parameter can be adjusted to a noise reduction parameter with the best noise reduction performance for the candidate frequency band 100Hz to 200Hz, so as to perform deeper and more targeted noise reduction processing.
步骤S390:基于目标降噪参数对环境音进行降噪处理。Step S390: performing noise reduction processing on the ambient sound based on the target noise reduction parameters.
需要说明的是,本实施例中未详细描述的部分可以参考前述实施例,在此不再赘述。It should be noted that the parts not described in detail in this embodiment can be referred to the previous embodiments and will not be described again here.
本实施例提供的降噪处理方法,在前述实施例的基础上,通过确定候选频带对应的候选声音能量值与其他频带的声音能量值的比值是否均超过预设比值,并在均超过时,才将候选频带对应的降噪参数确定为目标降噪参数,可以确定候选声音能量值与其他频带的声音能量值之间的差异程度是否够大,从而在均超过预设比值时认为差异程度足够大,则在差异程度足够大时,才将候选频带对应的降噪参数,即降噪性能主要集中在该候选频带的降噪参数确定为目标降噪参数,从而可针对各种噪声信号实现更准确的降噪,提升降噪效果。The noise reduction processing method provided in the present embodiment is based on the above-mentioned embodiment. By determining whether the ratios of the candidate sound energy value corresponding to the candidate frequency band and the sound energy values of other frequency bands all exceed the preset ratios, and only when both exceed the ratios, the noise reduction parameters corresponding to the candidate frequency band are determined as the target noise reduction parameters. It can be determined whether the difference between the candidate sound energy value and the sound energy values of other frequency bands is large enough, so that when both exceed the preset ratios, it is considered that the difference is large enough. Then, when the difference is large enough, the noise reduction parameters corresponding to the candidate frequency band, that is, the noise reduction parameters whose noise reduction performance is mainly concentrated in the candidate frequency band, are determined as the target noise reduction parameters, thereby achieving more accurate noise reduction for various noise signals and improving the noise reduction effect.
请参阅图10,其示出了本申请实施例提供的一种降噪处理装置1000的结构框图,可应用于电子设备,电子设备可以是上述终端或耳机,具体地,该降噪处理装置1000可以包括:音频采集模块1010、预处理模块1020、能量获取模块1030、参数确定模块1040以及降噪处理模块1050,具体地:Please refer to FIG. 10, which shows a structural block diagram of a noise reduction processing device 1000 provided in an embodiment of the present application, which can be applied to an electronic device, and the electronic device can be the above-mentioned terminal or headset. Specifically, the noise reduction processing device 1000 may include: an audio acquisition module 1010, a preprocessing module 1020, an energy acquisition module 1030, a parameter determination module 1040 and a noise reduction processing module 1050, specifically:
音频采集模块1010,用于基于音频采集装置采集环境音,所述环境音包含噪声信号;An audio collection module 1010 is used to collect ambient sound based on an audio collection device, where the ambient sound includes a noise signal;
预处理模块1020,用于对采集到的所述环境音进行预处理,得到待分析的噪声信号,所述待分析的噪声信号对应有多个频带;A preprocessing module 1020 is used to preprocess the collected ambient sound to obtain a noise signal to be analyzed, where the noise signal to be analyzed corresponds to multiple frequency bands;
能量获取模块1030,用于获取所述待分析的噪声信号在多个频带的声音能量值;The energy acquisition module 1030 is used to acquire the sound energy values of the noise signal to be analyzed in multiple frequency bands;
参数确定模块1040,用于根据所述多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数;A parameter determination module 1040, configured to determine corresponding target noise reduction parameters according to a proportional relationship between the sound energy values of the multiple frequency bands;
降噪处理模块1050,用于基于所述目标降噪参数对所述环境音进行降噪处理。The noise reduction processing module 1050 is used to perform noise reduction processing on the ambient sound based on the target noise reduction parameter.
进一步地,参数确定模块1040可包括:第一候选确定子模块、第一候选比较子模块以及第一候选降噪子模块,其中:Further, the parameter determination module 1040 may include: a first candidate determination submodule, a first candidate comparison submodule and a first candidate denoising submodule, wherein:
第一候选确定子模块,用于从所述多个频带中将声音能量值最高的频带确定为候选频带;A first candidate determination submodule, configured to determine a frequency band with the highest sound energy value from the multiple frequency bands as a candidate frequency band;
第一候选比较子模块,用于确定所述候选频带对应的候选声音能量值与其他频带的声音能量值的比值是否均超过预设比值;A first candidate comparison submodule, used to determine whether the ratios of the candidate sound energy values corresponding to the candidate frequency band and the sound energy values of other frequency bands all exceed a preset ratio;
第一候选降噪子模块,用于若均超过,将所述候选频带对应的降噪参数确定为目标降噪参数。The first candidate denoising submodule is configured to determine the denoising parameter corresponding to the candidate frequency band as the target denoising parameter if both exceed the target denoising parameter.
进一步地,所述降噪处理装置1000还可包括:Furthermore, the noise reduction processing device 1000 may also include:
目标频带确定模块,用于若未均超过,将比值未超过预设比值的其他频带与所述候选频带合并作为目标频带;a target frequency band determination module, configured to combine other frequency bands whose ratios do not exceed the preset ratio with the candidate frequency band as the target frequency band if both are not exceeded;
目标降噪模块,用于将所述目标频带对应的降噪参数确定为目标降噪参数。The target noise reduction module is used to determine the noise reduction parameter corresponding to the target frequency band as the target noise reduction parameter.
进一步地,其他频带包括连续的第一频带以及第二频带,所述预设比值包括第一预设比值与第二预设比值,所述候选比较子模块包括:第一比值确定单元、第二比值确定单元以及比值比较单元,其中:Further, the other frequency bands include a continuous first frequency band and a second frequency band, the preset ratio includes a first preset ratio and a second preset ratio, and the candidate comparison submodule includes: a first ratio determination unit, a second ratio determination unit and a ratio comparison unit, wherein:
第一比值确定单元,用于确定候选频带的声音能量值与第一频带的声音能量值的第一比值;A first ratio determination unit, configured to determine a first ratio of a sound energy value of a candidate frequency band to a sound energy value of a first frequency band;
第二比值确定单元,用于确定候选频带的声音能量值与第二频带的声音能量值的第二比值;A second ratio determination unit, used to determine a second ratio of the sound energy value of the candidate frequency band to the sound energy value of the second frequency band;
比值比较单元,用于若所述第一比值超过第一预设比值且所述第二比值超过第二预设比值,则判定所述候选频带对应的候选声音能量值与其他频带的声音能量值的比值均超过预设比值。A ratio comparison unit is used to determine that the ratios of the candidate sound energy value corresponding to the candidate frequency band to the sound energy values of other frequency bands exceed the preset ratios if the first ratio exceeds the first preset ratio and the second ratio exceeds the second preset ratio.
进一步地,所述参数确定模块1040可包括:第二候选确定子模块以及第二候选降噪子模块,其中:Further, the parameter determination module 1040 may include: a second candidate determination submodule and a second candidate denoising submodule, wherein:
第二候选确定子模块,用于若所述多个频带的声音能量值之间的比例与预设比例匹配,从所述多个频带中将声音能量值最高的频带确定为候选频带;A second candidate determination submodule, configured to determine a frequency band with the highest sound energy value from among the multiple frequency bands as a candidate frequency band if a ratio between the sound energy values of the multiple frequency bands matches a preset ratio;
第二候选降噪子模块,用于将所述候选频带对应的降噪参数确定为目标降噪参数。The second candidate noise reduction submodule is used to determine the noise reduction parameters corresponding to the candidate frequency band as target noise reduction parameters.
进一步地,所述预处理模块1020可包括:频带划分子模块、滤波器确定子模块以及时域滤波子模块,其中:Furthermore, the preprocessing module 1020 may include: a frequency band division submodule, a filter determination submodule and a time domain filtering submodule, wherein:
频带划分子模块,用于基于预设频率范围,根据倍频程将所述预设频率范围划分为多个待分析的频带;A frequency band division submodule, configured to divide the preset frequency range into a plurality of frequency bands to be analyzed according to octaves based on the preset frequency range;
滤波器确定子模块,用于根据每个频带的上限频率值与下限频率值,确定对应的带通滤波器;The filter determination submodule is used to determine the corresponding bandpass filter according to the upper limit frequency value and the lower limit frequency value of each frequency band;
时域滤波子模块,用于在时域基于每个频带对应的带通滤波器,对每个频带的噪声信号进行带通滤波处理,得到滤波后的噪声信号作为待分析的噪声信号。The time domain filtering submodule is used to perform bandpass filtering on the noise signal of each frequency band in the time domain based on the bandpass filter corresponding to each frequency band, and obtain the filtered noise signal as the noise signal to be analyzed.
进一步地,所述预处理模块1020可包括:降采样子模块以及噪声获取子模块,其中:Furthermore, the preprocessing module 1020 may include: a downsampling submodule and a noise acquisition submodule, wherein:
降采样子模块,用于对采集到的所述环境音进行降采样处理,得到降采样后的环境音;A downsampling submodule, used to downsample the collected ambient sound to obtain the downsampled ambient sound;
噪声获取子模块,用于根据所述降采样后的环境音,得到待分析的噪声信号。The noise acquisition submodule is used to obtain the noise signal to be analyzed according to the downsampled ambient sound.
进一步地,所述预处理模块1020可包括:模型确定子模块以及参数确定子模块,其中:Furthermore, the preprocessing module 1020 may include: a model determination submodule and a parameter determination submodule, wherein:
模型确定子模块,用于基于训练好的深度学习模型,根据所述多个频带的声音能量值的比例关系,确定所述待分析的噪声信号的噪声类型;A model determination submodule, configured to determine the noise type of the noise signal to be analyzed based on the trained deep learning model and the proportional relationship of the sound energy values of the multiple frequency bands;
参数确定子模块,用于将所述噪声类型对应的降噪参数确定为目标降噪参数。The parameter determination submodule is used to determine the noise reduction parameter corresponding to the noise type as the target noise reduction parameter.
进一步地,降噪处理装置1000还包括:平滑处理模块,其中:Furthermore, the noise reduction processing device 1000 further includes: a smoothing processing module, wherein:
平滑处理模块,用于对所述待分析的噪声信号在多个频带内的声音能量值进行平滑处理。The smoothing processing module is used to perform smoothing processing on the sound energy values of the noise signal to be analyzed in multiple frequency bands.
进一步地,预处理模块1020可包括:降噪启动子模块,其中:Further, the pre-processing module 1020 may include: a noise reduction starter module, wherein:
降噪启动子模块,用于若环境音中噪声信号的声音能量值超过预设能量值,对所述环境音进行预处理,得到待分析的噪声信号。The noise reduction starter module is used to pre-process the ambient sound to obtain the noise signal to be analyzed if the sound energy value of the noise signal in the ambient sound exceeds a preset energy value.
本申请实施例提供的降噪处理装置用于实现前述方法实施例中相应的降噪处理方法,并具有相应的方法实施例的有益效果,在此不再赘述。The noise reduction processing device provided in the embodiment of the present application is used to implement the corresponding noise reduction processing method in the aforementioned method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
请参考图11,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备1100可以是耳机或智能手机、平板电脑、MP3播放器、MP4播放器、电子书、笔记本电脑、个人计算机、可穿戴电子设备等能够运行应用程序的终端。本申请中的电子设备1100可以包括一个或多个如下部件:处理器1110、存储器1120以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器1120中并被配置为由一个或多个处理器1110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to Figure 11, which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 1100 can be a terminal capable of running applications, such as headphones or a smart phone, a tablet computer, an MP3 player, an MP4 player, an e-book, a laptop computer, a personal computer, a wearable electronic device, etc. The electronic device 1100 in the present application may include one or more of the following components: a processor 1110, a memory 1120, and one or more applications, wherein one or more applications may be stored in the memory 1120 and configured to be executed by one or more processors 1110, and one or more programs are configured to execute the method described in the aforementioned method embodiment.
处理器1110可以包括一个或者多个处理核。处理器1110利用各种接口和线路连接整个电子设备1100内的各个部分,通过运行或执行存储在存储器1120内的指令、程序、代码集或指令集,以及调用存储在存储器1120内的数据,执行电子设备1100的各种功能和处理数据。可选地,处理器1110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1110中,单独通过一块通信芯片进行实现。The processor 1110 may include one or more processing cores. The processor 1110 uses various interfaces and lines to connect various parts of the entire electronic device 1100, and executes various functions and processes data of the electronic device 1100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1120, and calling data stored in the memory 1120. Optionally, the processor 1110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1110 can integrate one or a combination of a central processing unit (CPU), a 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 display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1110, but may be implemented separately through a communication chip.
存储器1120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器1120可用于存储指令、程序、代码、代码集或指令集。存储器1120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备1100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 1120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 1120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 1120 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 implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 1100 during use.
请参阅图12,其示出了本申请实施例提供的耳机的结构框图。耳机1200可包括音频采集装置1210、音频输出装置1220以及音频信号处理电路1230。其中:Please refer to FIG. 12 , which shows a block diagram of the structure of the earphone provided in an embodiment of the present application. The earphone 1200 may include an audio acquisition device 1210 , an audio output device 1220 , and an audio signal processing circuit 1230 . Among them:
所述音频采集装置1210,用于采集环境音。在一些实施方式中,音频采集装置1210可以是麦克风或其他可采集音频信号的器件,用于采集音频信号,并传输至音频信号处理电路1220。The audio collection device 1210 is used to collect ambient sound. In some implementations, the audio collection device 1210 may be a microphone or other device capable of collecting audio signals, and is used to collect audio signals and transmit them to the audio signal processing circuit 1220 .
所述音频信号处理电路1220,用于获取所述音频采集装置采集的环境音;对所述环境音进行预处理,得到待分析的噪声信号,所述待分析的噪声信号对应有多个频带;获取所述待分析的噪声信号在多个频带的声音能量值;根据所述多个频带的声音能量值之间的比例关系,确定对应的目标降噪参数。The audio signal processing circuit 1220 is used to obtain the ambient sound collected by the audio collection device; pre-process the ambient sound to obtain a noise signal to be analyzed, wherein the noise signal to be analyzed corresponds to multiple frequency bands; obtain the sound energy values of the noise signal to be analyzed in multiple frequency bands; and determine the corresponding target noise reduction parameters according to the proportional relationship between the sound energy values of the multiple frequency bands.
所述音频输出装置1230,用于输出音频信号,作为一种实施方式,所述音频输出装置1230可基于所述目标降噪参数对所述环境音进行降噪处理。在一些实施方式中,音频输出装置1230可以是扬声器或其他可输出音频信号的器件。The audio output device 1230 is used to output an audio signal. As an implementation, the audio output device 1230 can perform noise reduction processing on the ambient sound based on the target noise reduction parameter. In some implementations, the audio output device 1230 can be a speaker or other device that can output an audio signal.
另外,在一些实施例中,耳机1200还可包括供电电路,该供电电路可以为其他硬件部件供电,供电来源可以是耳机1200内置的电池,可以是来自外部的电力输入,也可以是耳机1200内置的发电器件。In addition, in some embodiments, the earphone 1200 may also include a power supply circuit, which can provide power to other hardware components. The power supply source may be a battery built into the earphone 1200, power input from an external source, or a power generating device built into the earphone 1200.
本申请实施例提供的耳机1200用于实现前述方法实施例中相应的降噪处理方法,并具有相应的方法实施例的有益效果,在此不再赘述。The earphone 1200 provided in the embodiment of the present application is used to implement the corresponding noise reduction processing method in the aforementioned method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
请参考图13,其示出了本申请实施例提供的一种计算机可读取存储介质的结构框图。该计算机可读取存储介质1300中存储有程序代码,所述程序代码可被处理器调用执行上述实施例中所描述的方法。Please refer to Figure 13, which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable storage medium 1300 stores program codes, which can be called by a processor to execute the method described in the above embodiment.
计算机可读取存储介质1300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读取存储介质1300包括非易失性计算机可读取存储介质(non-transitory computer-readable storage medium)。计算机可读取存储介质1300具有执行上述方法中的任何方法步骤的程序代码1310的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1310可以例如以适当形式进行压缩。The computer readable storage medium 1300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1300 has storage space for program code 1310 that performs any method step of the above method. These program codes can be read from or written to one or more computer program products. The program code 1310 can be compressed, for example, in an appropriate form.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010688695.2A CN113949955B (en) | 2020-07-16 | 2020-07-16 | Noise reduction processing method, device, electronic equipment, earphone and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010688695.2A CN113949955B (en) | 2020-07-16 | 2020-07-16 | Noise reduction processing method, device, electronic equipment, earphone and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113949955A CN113949955A (en) | 2022-01-18 |
CN113949955B true CN113949955B (en) | 2024-04-09 |
Family
ID=79326581
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010688695.2A Active CN113949955B (en) | 2020-07-16 | 2020-07-16 | Noise reduction processing method, device, electronic equipment, earphone and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113949955B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114466278B (en) * | 2022-04-11 | 2022-08-16 | 北京荣耀终端有限公司 | Method for determining parameters corresponding to earphone mode, earphone, terminal and system |
CN116095565A (en) * | 2022-09-05 | 2023-05-09 | 维沃移动通信有限公司 | Audio signal processing method, device, electronic equipment and readable storage medium |
CN116312593A (en) * | 2023-02-15 | 2023-06-23 | 阿里巴巴(中国)有限公司 | Audio signal noise processing and frequency band dividing method and device and electronic equipment |
CN116741194B (en) * | 2023-08-10 | 2024-01-12 | 同方节能工程技术有限公司 | Spatial local noise reduction method, device, equipment, system and storage medium |
CN118338184B (en) * | 2024-06-13 | 2024-08-30 | 广东省电信规划设计院有限公司 | AIGC-based intelligent noise reduction method and AIGC-based intelligent noise reduction device for earphone |
CN118737114A (en) * | 2024-08-08 | 2024-10-01 | 宁波方太厨具有限公司 | Active noise reduction system and control method thereof, abnormal sound detection method and device |
CN119049441A (en) * | 2024-08-08 | 2024-11-29 | 宁波方太厨具有限公司 | Abnormal sound detection method, active noise reduction system, control method thereof and program product |
CN118748003A (en) * | 2024-08-08 | 2024-10-08 | 宁波方太厨具有限公司 | Active noise reduction system and control method thereof, abnormal sound detection method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10043527B1 (en) * | 2015-07-17 | 2018-08-07 | Digimarc Corporation | Human auditory system modeling with masking energy adaptation |
CN108766454A (en) * | 2018-06-28 | 2018-11-06 | 浙江飞歌电子科技有限公司 | A kind of voice noise suppressing method and device |
CN109493877A (en) * | 2017-09-12 | 2019-03-19 | 清华大学 | A kind of sound enhancement method and device of auditory prosthesis |
CN110491407A (en) * | 2019-08-15 | 2019-11-22 | 广州华多网络科技有限公司 | Method, apparatus, electronic equipment and the storage medium of voice de-noising |
WO2019233358A1 (en) * | 2018-06-05 | 2019-12-12 | 安克创新科技股份有限公司 | Method and system for processing sound characteristics based on deep learning |
-
2020
- 2020-07-16 CN CN202010688695.2A patent/CN113949955B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10043527B1 (en) * | 2015-07-17 | 2018-08-07 | Digimarc Corporation | Human auditory system modeling with masking energy adaptation |
CN109493877A (en) * | 2017-09-12 | 2019-03-19 | 清华大学 | A kind of sound enhancement method and device of auditory prosthesis |
WO2019233358A1 (en) * | 2018-06-05 | 2019-12-12 | 安克创新科技股份有限公司 | Method and system for processing sound characteristics based on deep learning |
CN108766454A (en) * | 2018-06-28 | 2018-11-06 | 浙江飞歌电子科技有限公司 | A kind of voice noise suppressing method and device |
CN110491407A (en) * | 2019-08-15 | 2019-11-22 | 广州华多网络科技有限公司 | Method, apparatus, electronic equipment and the storage medium of voice de-noising |
Also Published As
Publication number | Publication date |
---|---|
CN113949955A (en) | 2022-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113949955B (en) | Noise reduction processing method, device, electronic equipment, earphone and storage medium | |
US11569789B2 (en) | Compensation for ambient sound signals to facilitate adjustment of an audio volume | |
US12164832B2 (en) | Media-compensated pass-through and mode-switching | |
CN113949956B (en) | Noise reduction processing method, device, electronic equipment, headphones and storage medium | |
US20230352038A1 (en) | Voice activation detecting method of earphones, earphones and storage medium | |
KR101606966B1 (en) | Systems, methods, apparatus, and computer-readable media for spatially selective audio augmentation | |
US20120130713A1 (en) | Systems, methods, and apparatus for voice activity detection | |
US11290802B1 (en) | Voice detection using hearable devices | |
KR20130055650A (en) | Systems, methods, apparatus, and computer-readable media for multi-microphone location-selective processing | |
CN112333602B (en) | Signal processing method, signal processing apparatus, computer-readable storage medium, and indoor playback system | |
EP4207812A1 (en) | Method for audio signal processing on a hearing system, hearing system and neural network for audio signal processing | |
CN112767908A (en) | Active noise reduction method based on key sound recognition, electronic equipment and storage medium | |
CN115314823A (en) | Hearing aid method, system and equipment based on digital sounding chip | |
CN115348507A (en) | Impulse noise suppression method, system, readable storage medium and computer equipment | |
CN113132885B (en) | Method for judging wearing state of earphone based on energy difference of double microphones | |
CN111163411B (en) | Method for reducing influence of interference sound and sound playing device | |
CN116312586A (en) | Noise reduction method, device, terminal and storage medium | |
CN116110361A (en) | Noise reduction method, device and electronic equipment | |
CN114697786B (en) | Wind noise suppression method determination method, device, terminal and storage medium | |
CN118555514A (en) | Noise reduction control method, device, system, electronic equipment and storage medium | |
CN117203979A (en) | Information processing device, information processing method, and program | |
CN119815225A (en) | Control method, electronic device and storage medium of microphone on smart glasses | |
CN116419111A (en) | Earphone control method, parameter generation method, device, storage medium and earphone | |
WO2023220918A1 (en) | Audio signal processing method and apparatus, storage medium and vehicle | |
CN120111426A (en) | Hearing aid audio optimization method and system based on intelligent scene recognition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |