CN115240700B - Acoustic device and sound processing method thereof - Google Patents
Acoustic device and sound processing method thereof Download PDFInfo
- Publication number
- CN115240700B CN115240700B CN202210950503.XA CN202210950503A CN115240700B CN 115240700 B CN115240700 B CN 115240700B CN 202210950503 A CN202210950503 A CN 202210950503A CN 115240700 B CN115240700 B CN 115240700B
- Authority
- CN
- China
- Prior art keywords
- frame
- processed
- amplitude
- frequency point
- suppression
- 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
- 238000003672 processing method Methods 0.000 title claims abstract description 29
- 230000001629 suppression Effects 0.000 claims abstract description 178
- 230000005236 sound signal Effects 0.000 claims abstract description 62
- 238000006243 chemical reaction Methods 0.000 claims abstract description 14
- 230000006870 function Effects 0.000 claims description 4
- 230000003595 spectral effect Effects 0.000 claims description 4
- 238000010606 normalization Methods 0.000 claims description 2
- 230000007613 environmental effect Effects 0.000 claims 1
- 230000002401 inhibitory effect Effects 0.000 abstract 1
- 230000001105 regulatory effect Effects 0.000 abstract 1
- 230000007774 longterm Effects 0.000 description 16
- 230000002238 attenuated effect Effects 0.000 description 4
- 238000000034 method Methods 0.000 description 3
- 230000002787 reinforcement Effects 0.000 description 3
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L21/00—Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
- G10L21/02—Speech enhancement, e.g. noise reduction or echo cancellation
- G10L21/0208—Noise filtering
- G10L21/0216—Noise filtering characterised by the method used for estimating noise
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L21/00—Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
- G10L21/02—Speech enhancement, e.g. noise reduction or echo cancellation
- G10L21/0208—Noise filtering
- G10L21/0216—Noise filtering characterised by the method used for estimating noise
- G10L21/0224—Processing in the time domain
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L21/00—Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
- G10L21/02—Speech enhancement, e.g. noise reduction or echo cancellation
- G10L21/0208—Noise filtering
- G10L21/0216—Noise filtering characterised by the method used for estimating noise
- G10L21/0232—Processing in the frequency domain
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L21/00—Speech or voice signal processing techniques to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
- G10L21/02—Speech enhancement, e.g. noise reduction or echo cancellation
- G10L21/0316—Speech enhancement, e.g. noise reduction or echo cancellation by changing the amplitude
Landscapes
- Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Quality & Reliability (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Multimedia (AREA)
- Soundproofing, Sound Blocking, And Sound Damping (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及声学设备,特别是涉及一种声学设备及其声音处理方法。The invention relates to acoustic equipment, and in particular to an acoustic equipment and a sound processing method thereof.
背景技术Background Art
现今,麦克风-放大器-扬声器构成的实时扩音系统广泛应用于生活场景中。例如,助听器就是其中一种常见的扩音系统。在实时扩音系统中,对于突然发生的冲击性噪音,比如拍手、关门等声音通常具有比言语声更高的声压级。若同时对冲击性噪音进行放大,则会很大程度上影响用户的舒适度。Nowadays, real-time sound reinforcement systems consisting of microphones, amplifiers, and speakers are widely used in daily life. For example, hearing aids are a common type of sound reinforcement system. In real-time sound reinforcement systems, sudden impact noises, such as clapping and door slamming, usually have higher sound pressure levels than speech. If the impact noise is amplified at the same time, it will greatly affect the user's comfort.
发明内容Summary of the invention
本发明的一个目的是要提供一种能够解决上述任一问题的声学设备及其声音处理方法。An object of the present invention is to provide an acoustic device and a sound processing method thereof that can solve any of the above problems.
本发明一个进一步的目的是要使得经过处理的声音信号更加平滑。A further object of the present invention is to make the processed sound signal smoother.
本发明另一个进一步的目的是要保证对长时冲击噪的抑制效果。Another further object of the present invention is to ensure the suppression effect on long-term impact noise.
特别地,本发明提供了一种声学设备的声音处理方法,包括:In particular, the present invention provides a sound processing method for an acoustic device, comprising:
获取设定帧长的声音信号;Get the sound signal of set frame length;
对所述声音信号进行时频转换,得到待处理帧的各频点幅度;Performing time-frequency conversion on the sound signal to obtain the amplitude of each frequency point of the frame to be processed;
计算所述待处理帧的冲击噪概率;Calculating the impulse noise probability of the frame to be processed;
得到所述待处理帧的各频点的抑制幅度;Obtaining the suppression amplitude of each frequency point of the frame to be processed;
根据所述抑制幅度对所述声音信号进行抑制。The sound signal is suppressed according to the suppression amplitude.
可选地,对所述声音信号进行时频转换的步骤包括:Optionally, the step of performing time-frequency conversion on the sound signal includes:
按照公式:对所述声音信号进行短时傅里叶变换;According to the formula: Performing short-time Fourier transform on the sound signal;
按照公式:Amp(n,ω)=20·lg(|X(n,ω)|)计算各频点幅度;Calculate the amplitude of each frequency point according to the formula: Amp(n, ω) = 20·lg(|X(n, ω)|);
计算所述待处理帧的冲击噪概率的步骤包括:The step of calculating the impulse noise probability of the frame to be processed comprises:
根据公式:计算所述待处理帧的冲击噪概率;According to the formula: Calculating the impulse noise probability of the frame to be processed;
其中,X(n,ω)是对应频谱分量;k是对应帧长;x(m)是输入信号;w(m)是窗函数;n是帧的次序数;Amp(n,ω)是各频点幅度;Alow为预设的幅值范围的最小值;Ahigh为预设的幅值范围的最大值;P(n)为范围归一化0至1的概率。Among them, X(n, ω) is the corresponding spectral component; k is the corresponding frame length; x(m) is the input signal; w(m) is the window function; n is the ordinal number of the frame; Amp(n, ω) is the amplitude of each frequency point; A low is the minimum value of the preset amplitude range; A high is the maximum value of the preset amplitude range; P(n) is the probability of range normalization from 0 to 1.
可选地,得到所述待处理帧的各频点的抑制幅度的步骤包括:Optionally, the step of obtaining the suppression amplitude of each frequency point of the frame to be processed includes:
根据公式计算得到所述待处理帧的各频点的抑制幅度;The suppression amplitude of each frequency point of the frame to be processed is calculated according to the formula;
其中,公式为:The formula is:
G(n,w)=min[max(Amp(n,ω)-Amp(n-1,ω)-Debounce,0),Limit_G]·P(n);G(n,w)=min[max(Amp(n,ω)-Amp(n-1,ω)-Debounce,0),Limit_G]·P(n);
其中,G(n,ω)为抑制幅度;Debounce为预设去幅度变化抖动;Limit_G为限制抑制频点幅度最大值。Wherein, G(n, ω) is the suppression amplitude; Debounce is the preset amplitude change removal jitter; Limit_G is the maximum value of the frequency point amplitude that is limited to be suppressed.
可选地,得到所述待处理帧的各频点的抑制幅度的步骤还包括:Optionally, the step of obtaining the suppression amplitude of each frequency point of the frame to be processed further includes:
判断所述待处理帧是否需要进行平滑抑制:Determine whether the frame to be processed needs to be smoothed and suppressed:
若是,取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度;If yes, taking the attenuation value of the suppression amplitude of each frequency point of the frame before the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed;
若否,执行根据公式计算得到所述待处理帧的各频点的抑制幅度的步骤。If not, the step of calculating the suppression amplitude of each frequency point of the frame to be processed according to the formula is executed.
可选地,判断所述待处理帧是否需要进行平滑抑制的步骤包括:Optionally, the step of determining whether the frame to be processed needs to be smoothly suppressed includes:
判断所述待处理帧的冲击噪概率是否为0:Determine whether the impulse noise probability of the frame to be processed is 0:
若是,判断所述待处理帧的前一帧是否存在抑制幅度,若是,执行取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度的步骤,若否,执行根据公式计算得到所述待处理帧的各频点的抑制幅度的步骤;If yes, determine whether there is a suppression amplitude in the previous frame of the frame to be processed. If yes, perform the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed. If no, perform the step of calculating the suppression amplitude of each frequency point of the frame to be processed according to the formula;
若否,判断所述待处理帧的前一帧的冲击噪概率是否为0,若是,执行根据公式计算得到所述待处理帧的各频点的抑制幅度的步骤,若否,执行取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度的步骤。If not, determine whether the impulse noise probability of the previous frame of the frame to be processed is 0. If so, execute the step of calculating the suppression amplitude of each frequency point of the frame to be processed according to the formula. If not, execute the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed.
可选地,若所述待处理帧的冲击噪概率大于0并且所述待处理帧的前一帧的冲击噪概率大于0,执行取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度的步骤之前还包括:Optionally, if the impulse noise probability of the frame to be processed is greater than 0 and the impulse noise probability of the previous frame of the frame to be processed is greater than 0, before executing the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed, the step further includes:
判断所述待处理帧的帧能量是否大于预设阈值,若否,执行取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度的步骤;若是,判断所述待处理帧是否属于长时冲击噪,若是,取所述待处理帧前一帧各频点的抑制幅度作为所述待处理帧各频点的抑制幅度,若否,取所述待处理帧前一帧各频点的抑制幅度的衰减值与根据计算得到的所述待处理帧的抑制幅度的最大值作为抑制幅度。Determine whether the frame energy of the frame to be processed is greater than a preset threshold value. If not, execute the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed; if so, determine whether the frame to be processed belongs to long-term impulse noise. If so, take the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed; if not, take the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed and the maximum value of the suppression amplitude of the frame to be processed obtained according to the calculation as the suppression amplitude.
可选地,判断所述待处理帧是否属于长时冲击噪的步骤包括:Optionally, the step of determining whether the frame to be processed belongs to long-term impulse noise includes:
判断帧能量大于预设阈值的连续帧数是否大于预设值,若是,执行取所述待处理帧前一帧各频点的抑制幅度作为所述待处理帧各频点的抑制幅度的步骤,若否,执行取所述待处理帧前一帧各频点的抑制幅度的衰减值与根据计算得到的抑制幅度的最大值作为抑制幅度的步骤。Determine whether the number of consecutive frames whose frame energy is greater than a preset threshold is greater than a preset value. If so, execute the step of taking the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed. If not, execute the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed and the maximum value of the suppression amplitude obtained according to the calculation as the suppression amplitude.
可选地,根据所述抑制幅度对所述声音信号进行抑制的步骤包括:Optionally, the step of suppressing the sound signal according to the suppression amplitude includes:
使各频点幅度经过抑制后的保留信号幅度大于稳态环境音幅度。Make the retained signal amplitude of each frequency point after suppression greater than the steady-state ambient sound amplitude.
可选地,计算所述待处理帧的冲击噪概率的步骤之前包括:Optionally, before the step of calculating the impulse noise probability of the frame to be processed, the step includes:
判断所述待处理帧是否为第一帧,若是,直接将所述待处理帧的声音信号进行输出。It is determined whether the frame to be processed is the first frame. If so, the sound signal of the frame to be processed is directly output.
特别地,本发明提供了一种声学设备,包括:In particular, the present invention provides an acoustic device comprising:
麦克风,配置成将获取的声音转换为实时音频数据;a microphone configured to convert acquired sound into real-time audio data;
放大器,配置成实时放大所述实时音频数据;an amplifier configured to amplify the real-time audio data in real time;
扬声器,配置成将放大后的实时音频数据转换为输出声音;a speaker configured to convert the amplified real-time audio data into output sound;
信号处理器,包括存储器、处理器及存储在所述存储器上并在所述处理器上运行的机器可执行程序,并且所述处理器执行所述机器可执行程序时实现上述任一项中的声学设备的声音处理方法。A signal processor comprises a memory, a processor and a machine executable program stored in the memory and running on the processor, and the processor implements the sound processing method of the acoustic device in any of the above items when executing the machine executable program.
本发明的声学设备及其声音处理方法,获取设定帧长的声音信号作为待处理帧,对声音信号进行时频转换,得到待处理帧的各频点幅度;计算待处理帧的冲击噪概率;根据冲击噪概率得到待处理帧的各频点的抑制幅度;根据抑制幅度对声音信号进行抑制。也就是说,能够对待处理帧声音信号的各频点幅度做调节,从而对突然发生的冲击性噪音进行抑制,使得声音信号整体上趋于稳定,保证声音的舒适度,同时保证言语声的清晰度。并且,因为只对频点的幅度进行调节,所以能够较好地保证音质的保真度。The acoustic device and sound processing method of the present invention obtain a sound signal of a set frame length as a frame to be processed, perform time-frequency conversion on the sound signal, and obtain the amplitude of each frequency point of the frame to be processed; calculate the probability of impact noise of the frame to be processed; obtain the suppression amplitude of each frequency point of the frame to be processed according to the probability of impact noise; and suppress the sound signal according to the suppression amplitude. In other words, the amplitude of each frequency point of the sound signal of the frame to be processed can be adjusted, thereby suppressing the sudden impact noise, making the sound signal tend to be stable as a whole, ensuring the comfort of the sound, and at the same time ensuring the clarity of the speech sound. In addition, because only the amplitude of the frequency point is adjusted, the fidelity of the sound quality can be better guaranteed.
进一步地,本发明的声学设备及其声音处理方法,通过判断待处理帧是否需要进行平滑抑制,当待处理帧需要进行平滑抑制时取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度。因此,在能够对冲击噪进行抑制的基础上,能够避免经过抑制的多帧声音信号之间变化过于剧烈,进而有助于保证声音信号的舒适性。Furthermore, the acoustic device and the sound processing method of the present invention determine whether the frame to be processed needs to be smoothly suppressed. When the frame to be processed needs to be smoothly suppressed, the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed is taken as the suppression amplitude of each frequency point of the frame to be processed. Therefore, on the basis of being able to suppress the impact noise, it is possible to avoid excessive changes between the suppressed multi-frame sound signals, thereby helping to ensure the comfort of the sound signal.
更进一步地,通过在待处理帧处于长时冲击噪时取所述待处理帧前一帧各频点的抑制幅度作为所述待处理帧各频点的抑制幅度,从而能够保证对长时冲击噪的抑制效果。Furthermore, when the frame to be processed is in the condition of long-term impulse noise, the suppression amplitude of each frequency point of the previous frame of the frame to be processed is taken as the suppression amplitude of each frequency point of the frame to be processed, thereby ensuring the suppression effect of long-term impulse noise.
根据下文结合附图对本发明具体实施例的详细描述,本领域技术人员将会更加明了本发明的上述以及其他目的、优点和特征。Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
后文将参照附图以示例性而非限制性的方式详细描述本发明的一些具体实施例。附图中相同的附图标记标示了相同或类似的部件或部分。本领域技术人员应该理解,这些附图未必是按比例绘制的。附图中:Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:
图1是根据本发明一个实施例的声学设备的示意性框图;FIG1 is a schematic block diagram of an acoustic device according to an embodiment of the present invention;
图2是根据本发明一个实施例的声学设备的声音处理方法的示意性流程图;FIG2 is a schematic flow chart of a sound processing method of an acoustic device according to an embodiment of the present invention;
图3是根据本发明另一个实施例的声学设备的声音处理方法的示意性流程图;3 is a schematic flow chart of a sound processing method of an acoustic device according to another embodiment of the present invention;
图4是根据本发明又一个实施例的声学设备的声音处理方法的示意性流程图;FIG4 is a schematic flow chart of a sound processing method of an acoustic device according to yet another embodiment of the present invention;
图5是根据本发明又一个实施例的声学设备的声音处理方法的示意性流程图;5 is a schematic flow chart of a sound processing method of an acoustic device according to yet another embodiment of the present invention;
图6是根据本发明一个实施例的声学设备的声音处理方法中判断是否需要平滑抑制的示意性流程图;6 is a schematic flow chart of determining whether smoothing suppression is required in a sound processing method of an acoustic device according to an embodiment of the present invention;
图7是根据本发明又一个实施例的声学设备的声音处理方法的示意性流程图。FIG. 7 is a schematic flowchart of a sound processing method of an acoustic device according to yet another embodiment of the present invention.
具体实施方式DETAILED DESCRIPTION
本领域技术人员应当理解的是,下文所描述的实施例仅仅是本发明的一部分实施例,而不是本发明的全部实施例,该一部分实施例旨在用于解释本发明的技术原理,并非用于限制本发明的保护范围。基于本发明提供的实施例,本领域普通技术人员在没有付出创造性劳动的情况下所获得的其它所有实施例,仍应落入到本发明的保护范围之内。It should be understood by those skilled in the art that the embodiments described below are only some embodiments of the present invention, rather than all embodiments of the present invention, and these embodiments are intended to explain the technical principles of the present invention, rather than to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should still fall within the protection scope of the present invention.
需要说明的是,在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。It should be noted that the logic and/or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.
如图1所示,在一个实施例中,声学设备10包括麦克风110、放大器120、扬声器130和信号处理器140。麦克风110配置成将获取的声音转换为实时音频数据。放大器120配置成实时放大所述实时音频数据。扬声器130配置成将放大后的实时音频数据转换为输出声音。信号处理器140包括存储器、处理器及存储在所述存储器上并在所述处理器上运行的机器可执行程序,并且所述处理器执行所述机器可执行程序时实现下述实施例中的声音处理方法。As shown in FIG1 , in one embodiment, the acoustic device 10 includes a microphone 110, an amplifier 120, a speaker 130, and a signal processor 140. The microphone 110 is configured to convert the acquired sound into real-time audio data. The amplifier 120 is configured to amplify the real-time audio data in real time. The speaker 130 is configured to convert the amplified real-time audio data into output sound. The signal processor 140 includes a memory, a processor, and a machine executable program stored in the memory and running on the processor, and the processor implements the sound processing method in the following embodiment when executing the machine executable program.
如图2所示,在一个实施例中,声音处理方法包括:As shown in FIG. 2 , in one embodiment, the sound processing method includes:
步骤S202,获取设定帧长的声音信号。其中,帧长可以预先设定。Step S202, obtaining a sound signal with a set frame length, wherein the frame length can be preset.
步骤S204,对声音信号进行时频转换,得到待处理帧的各频点幅度。Step S204: performing time-frequency conversion on the sound signal to obtain the amplitude of each frequency point of the frame to be processed.
其中,具体方式为:先按照公式(1)对声音信号进行短时傅里叶变换:The specific method is as follows: firstly, the sound signal is subjected to short-time Fourier transform according to formula (1):
在公式(1)中,X(n,ω)是对应频谱分量;k是对应帧长;x(m)是输入信号;w(m)是窗函数;n是帧的次序数。In formula (1), X(n,ω) is the corresponding spectral component; k is the corresponding frame length; x(m) is the input signal; w(m) is the window function; and n is the ordinal number of the frame.
按照公式(2)对得到的频谱分量进行处理,得到各频点幅度:The obtained spectral components are processed according to formula (2) to obtain the amplitude of each frequency point:
Amp(n,ω)=20·lg(|X(n,ω)|) (2)Amp(n,ω)=20·lg(|X(n,ω)|) (2)
在公式(2)中,Amp(n,ω)是各频点幅度。In formula (2), Amp(n,ω) is the amplitude of each frequency point.
步骤S206,计算待处理帧的冲击噪概率。Step S206, calculating the impulse noise probability of the frame to be processed.
其中,具体计算公式为:The specific calculation formula is:
在公式(3)中,Alow为预设的幅值范围的最小值;Ahigh为预设的幅值范围的最大值;P(n)为范围归一化0至1的概率。In formula (3), A low is the minimum value of the preset amplitude range; A high is the maximum value of the preset amplitude range; and P(n) is the probability of the range normalized from 0 to 1.
步骤S208,得到待处理帧的各频点的抑制幅度。Step S208, obtaining the suppression amplitude of each frequency point of the frame to be processed.
步骤S210,根据抑制幅度对声音信号进行抑制。具体来说,即根据计算得到的各频点的抑制幅度对各频点由公式(2)得到的各频点的幅度进行抑制。然后将抑制后的各频点幅度作为待处理帧的最终幅度进行输出。Step S210, suppress the sound signal according to the suppression amplitude. Specifically, suppress the amplitude of each frequency point obtained by formula (2) according to the calculated suppression amplitude of each frequency point. Then output the suppressed amplitude of each frequency point as the final amplitude of the frame to be processed.
在本实施例的方案中,通过计算待处理帧的冲击噪概率,再根据冲击噪概率得到待处理帧的各频点的抑制幅度,然后根据抑制幅度对声音信号进行抑制。也就是说,能够对待处理帧声音信号的各频点幅度做调节,从而对突然发生的冲击性噪音进行抑制,使得声音信号整体上趋于稳定,保证声音的舒适度,同时保证言语声的清晰度。并且,因为只对频点的幅度进行调节,所以能够较好地保证音质的保真度。In the scheme of this embodiment, the probability of the impact noise of the frame to be processed is calculated, and then the suppression amplitude of each frequency point of the frame to be processed is obtained according to the probability of the impact noise, and then the sound signal is suppressed according to the suppression amplitude. In other words, the amplitude of each frequency point of the sound signal of the frame to be processed can be adjusted, so as to suppress the sudden impact noise, so that the sound signal tends to be stable as a whole, ensuring the comfort of the sound and the clarity of the speech sound. In addition, because only the amplitude of the frequency point is adjusted, the fidelity of the sound quality can be better guaranteed.
如图3所示,在一个实施例中,声音处理方法包括:As shown in FIG3 , in one embodiment, the sound processing method includes:
步骤S302,获取设定帧长的声音信号。Step S302, obtaining a sound signal with a set frame length.
步骤S304,对声音信号进行时频转换,得到待处理帧的各频点幅度。Step S304: performing time-frequency conversion on the sound signal to obtain the amplitude of each frequency point of the frame to be processed.
步骤S306,判断待处理帧是否为第一帧,若是,直接将待处理帧的声音信号进行输出。若否,执行步骤S308。Step S306, determining whether the frame to be processed is the first frame, if so, directly outputting the sound signal of the frame to be processed. If not, executing step S308.
步骤S308,计算待处理帧的冲击噪概率。Step S308, calculating the impulse noise probability of the frame to be processed.
步骤S310,得到待处理帧的各频点的抑制幅度。Step S310, obtaining the suppression amplitude of each frequency point of the frame to be processed.
步骤S312,根据抑制幅度对声音信号进行抑制。Step S312: suppress the sound signal according to the suppression amplitude.
具体来说,如果待处理帧为第一帧声音信号,直接将计算得到的各频点幅度作为输出幅度,对待处理帧的声音信号进行输出。如果待处理帧为第一帧之后的帧,得到各频点的抑制幅度后,利用抑制幅度对各频点的初始幅度进行抑制。然后将抑制后的各频点幅度作为待处理帧的输出幅度进行输出。Specifically, if the frame to be processed is the first frame of sound signal, the amplitude of each frequency point calculated is directly used as the output amplitude to output the sound signal of the frame to be processed. If the frame to be processed is a frame after the first frame, after obtaining the suppression amplitude of each frequency point, the initial amplitude of each frequency point is suppressed by using the suppression amplitude. Then, the suppressed amplitude of each frequency point is output as the output amplitude of the frame to be processed.
如图4所示,在一个实施例中,声音处理方法包括:As shown in FIG4 , in one embodiment, the sound processing method includes:
步骤S402,获取设定帧长的声音信号。Step S402, obtaining a sound signal with a set frame length.
步骤S404,对声音信号进行时频转换,得到待处理帧的各频点幅度。Step S404: performing time-frequency conversion on the sound signal to obtain the amplitude of each frequency point of the frame to be processed.
步骤S406,判断待处理帧是否为第一帧,若是,直接将待处理帧的声音信号进行输出。若否,执行步骤S408。Step S406, determining whether the frame to be processed is the first frame, if so, directly outputting the sound signal of the frame to be processed. If not, executing step S408.
步骤S408,计算待处理帧的冲击噪概率。Step S408: Calculate the impulse noise probability of the frame to be processed.
步骤S410,根据公式计算得到待处理帧的各频点的抑制幅度。Step S410, obtaining the suppression amplitude of each frequency point of the frame to be processed according to the formula.
具体来说,计算公式为:Specifically, the calculation formula is:
G(n,w)=min[max(Amp(n,ω)-Amp(n-1,ω)-Debounce,0),Limit_G]·P(n) (4)G(n,w)=min[max(Amp(n,ω)-Amp(n-1,ω)-Debounce,0),Limit_G]·P(n) (4)
在公式(4)中,G(n,ω)为抑制幅度;Debounce为预设去幅度变化抖动;Limit_G为限制抑制频点幅度最大值。其中,Limit_G的值可以根据需要设定。对于不想将声音抑制太多的人或场景下(例如,对于某些人或某些场景下,鼓掌声大一些也没关系),使用者可以通过设定Limit_G的值来保证抑制幅度不会太大。而对于没有上述需求的使用者可以设定取消Limit_G值的影响(将Limit_G设定到最大值)。换句话说,根据公式计算得到所述待处理帧的各频点的抑制幅度的公式也可以为公式(5),从而满足不同使用者的使用需求。In formula (4), G(n, ω) is the suppression amplitude; Debounce is the preset amplitude change jitter removal; Limit_G is the maximum value of the frequency point amplitude that is limited to be suppressed. The value of Limit_G can be set as needed. For people or scenes who do not want to suppress the sound too much (for example, for some people or in some scenes, it doesn't matter if the applause is louder), the user can set the value of Limit_G to ensure that the suppression amplitude is not too large. For users who do not have the above requirements, they can set the cancellation of the influence of the Limit_G value (set Limit_G to the maximum value). In other words, the formula for calculating the suppression amplitude of each frequency point of the frame to be processed according to the formula can also be formula (5), so as to meet the usage needs of different users.
G(n,ω)=max(Amp(n,ω)-Amp(n-1,ω)-Debounce,0)·P(n) (5)G(n,ω)=max(Amp(n,ω)-Amp(n-1,ω)-Debounce,0)·P(n) (5)
步骤S412,根据抑制幅度对声音信号进行抑制。Step S412: suppress the sound signal according to the suppression amplitude.
具体来说,声学设备接收到预设帧长的声音信号,开始对这一帧的声音信号进行处理,这一帧就是待处理帧。经过时频转换后,可以得到待处理帧多个频点对应的幅度值。当待处理帧为接收的第一帧信号,不对各频点的幅度值进行处理。Specifically, the acoustic device receives a sound signal of a preset frame length and starts processing the sound signal of this frame. This frame is the frame to be processed. After time-frequency conversion, the amplitude values corresponding to multiple frequency points of the frame to be processed can be obtained. When the frame to be processed is the first frame signal received, the amplitude values of each frequency point are not processed.
从第二帧开始,每一个待处理帧开始计算冲击噪概率和各频点的抑制幅度。具体地,根据公式(3)得到的冲击噪概率为范围归一化0至1的概率,所以,待处理帧的冲击噪概率为0或大于0。如果待处理帧冲击噪概率为0,由公式(4)可以得知,那么待处理帧的抑制幅度为0,也就是不对声音信号的各频点的幅度值进行抑制,直接输出。如果待处理帧冲击噪概率不为0,也就是大于0,就可以获得各频点的抑制幅度(即G(n,ω)),利用抑制幅度对待处理帧各频点的原幅度值进行抑制,然后将抑制后的各频点幅度作为待处理帧的输出幅度进行输出。Starting from the second frame, each frame to be processed begins to calculate the probability of impulse noise and the suppression amplitude of each frequency point. Specifically, the probability of impulse noise obtained according to formula (3) is a probability normalized from 0 to 1, so the probability of impulse noise of the frame to be processed is 0 or greater than 0. If the probability of impulse noise of the frame to be processed is 0, it can be known from formula (4) that the suppression amplitude of the frame to be processed is 0, that is, the amplitude value of each frequency point of the sound signal is not suppressed and is directly output. If the probability of impulse noise of the frame to be processed is not 0, that is, it is greater than 0, the suppression amplitude of each frequency point (i.e. G(n, ω)) can be obtained, and the original amplitude value of each frequency point of the frame to be processed is suppressed by the suppression amplitude, and then the suppressed amplitude of each frequency point is output as the output amplitude of the frame to be processed.
如图5所示,在一个实施例中,得到待处理帧的各频点的抑制幅度的步骤包括:判断待处理帧是否需要进行平滑抑制:若是,取待处理帧前一帧各频点的抑制幅度的衰减值作为待处理帧各频点的抑制幅度;若否,执行根据公式计算得到待处理帧的各频点的抑制幅度的步骤。具体来说,本实施例的声音处理方法包括:As shown in FIG5 , in one embodiment, the step of obtaining the suppression amplitude of each frequency point of the frame to be processed includes: determining whether the frame to be processed needs to be smoothly suppressed: if so, taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed; if not, executing the step of calculating the suppression amplitude of each frequency point of the frame to be processed according to the formula. Specifically, the sound processing method of this embodiment includes:
步骤S502,获取设定帧长的声音信号。Step S502, obtaining a sound signal with a set frame length.
步骤S504,对声音信号进行时频转换,得到待处理帧的各频点幅度。Step S504: perform time-frequency conversion on the sound signal to obtain the amplitude of each frequency point of the frame to be processed.
步骤S506,判断待处理帧是否为第一帧,若是,直接将待处理帧的声音信号进行输出。若否,执行步骤S508。Step S506, determining whether the frame to be processed is the first frame, if so, directly outputting the sound signal of the frame to be processed. If not, executing step S508.
步骤S508,计算待处理帧的冲击噪概率。Step S508: Calculate the impulse noise probability of the frame to be processed.
步骤S510,判断待处理帧是否需要进行平滑抑制。若是,执行步骤S512,若否,执行步骤S514。Step S510, determining whether the frame to be processed needs to be smoothed and suppressed. If yes, executing step S512, if not, executing step S514.
步骤S512,取待处理帧前一帧各频点的抑制幅度的衰减值作为待处理帧各频点的抑制幅度。Step S512, taking the attenuation value of the suppression amplitude of each frequency point in the frame before the frame to be processed as the suppression amplitude of each frequency point in the frame to be processed.
步骤S514,根据公式计算得到待处理帧的各频点的抑制幅度。Step S514, obtaining the suppression amplitude of each frequency point of the frame to be processed according to the formula.
步骤S516,根据抑制幅度对声音信号进行抑制。Step S516: suppress the sound signal according to the suppression amplitude.
参照图6所示,具体地,步骤S510,判断待处理帧是否需要进行平滑抑制包括:Referring to FIG. 6 , specifically, step S510, determining whether the frame to be processed needs to be smoothed and suppressed includes:
步骤S602,判断待处理帧的冲击噪概率是否为0。若是,执行步骤S604。若否,执行步骤S606。Step S602, determining whether the impulse noise probability of the frame to be processed is 0. If yes, executing step S604. If not, executing step S606.
步骤S604,判断待处理帧的前一帧是否存在抑制幅度,若是,执行步骤S608,若否,执行步骤S610。Step S604, determining whether there is a suppression amplitude in the previous frame of the frame to be processed, if so, executing step S608, if not, executing step S610.
步骤S606,判断待处理帧的前一帧的冲击噪概率是否为0,若是,执行步骤S610,若否,执行步骤S608。Step S606 , determining whether the impulse noise probability of the frame before the frame to be processed is 0, if so, executing step S610 , if not, executing step S608 .
步骤S608,取待处理帧前一帧各频点的抑制幅度的衰减值作为待处理帧各频点的抑制幅度。Step S608, taking the attenuation value of the suppression amplitude of each frequency point of the frame before the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed.
步骤S610,根据公式计算得到待处理帧的各频点的抑制幅度。Step S610, obtaining the suppression amplitude of each frequency point of the frame to be processed according to the formula.
具体来说,声学设备接收到预设帧长的声音信号,开始对这一帧的声音信号进行处理,这一帧就是待处理帧。经过时频转换后,可以得到待处理帧多个频点对应的幅度值。当待处理帧为接收的第一帧信号,不对各频点的幅度值进行处理。因此,将第一帧的冲击噪概率取为0且不存在抑制幅度。Specifically, the acoustic device receives a sound signal of a preset frame length and starts processing the sound signal of this frame. This frame is the frame to be processed. After time-frequency conversion, the amplitude values corresponding to multiple frequency points of the frame to be processed can be obtained. When the frame to be processed is the first frame signal received, the amplitude values of each frequency point are not processed. Therefore, the probability of impulse noise of the first frame is taken as 0 and there is no suppression amplitude.
从第二帧开始,每一个待处理帧开始计算冲击噪概率和各频点的抑制幅度。例如,第二帧冲击噪概率为0,因为第一帧不存在抑制幅度,那么第二帧根据公式计算各频点的抑制幅度,因为冲击噪概率为0,那么第二帧各频点的抑制幅度也是0,即不存在抑制幅度。Starting from the second frame, each frame to be processed begins to calculate the probability of impulse noise and the suppression amplitude of each frequency point. For example, the probability of impulse noise in the second frame is 0, because there is no suppression amplitude in the first frame, then the suppression amplitude of each frequency point in the second frame is calculated according to the formula, because the probability of impulse noise is 0, then the suppression amplitude of each frequency point in the second frame is also 0, that is, there is no suppression amplitude.
接着来说,第三帧冲击噪概率为0,因为第二帧不存在抑制幅度,那么第三帧根据公式计算各频点的抑制幅度,因为冲击噪概率为0,那么第三帧各频点的抑制幅度也是0。Next, the probability of impulse noise in the third frame is 0. Since there is no suppression amplitude in the second frame, the suppression amplitude of each frequency point in the third frame is calculated according to the formula. Since the probability of impulse noise is 0, the suppression amplitude of each frequency point in the third frame is also 0.
而后每一帧的冲击噪概率均为0,直至第n帧,其冲击噪概率不为0,也就是大于0。因为其前一帧(第n-1帧)的冲击噪概率为0,所以第n帧根据公式计算各频点的抑制幅度。第n+1帧的冲击噪概率仍大于0,并且第n帧的冲击噪概率也大于0,所以,第n+1帧采用第n帧各频点的抑制幅度衰减后的数值作为本帧的抑制幅度。Then the impulse noise probability of each frame is 0 until the nth frame, whose impulse noise probability is not 0, that is, greater than 0. Because the impulse noise probability of the previous frame (n-1th frame) is 0, the suppression amplitude of each frequency point is calculated according to the formula for the nth frame. The impulse noise probability of the n+1th frame is still greater than 0, and the impulse noise probability of the nth frame is also greater than 0, so the n+1th frame uses the attenuated value of the suppression amplitude of each frequency point of the nth frame as the suppression amplitude of this frame.
然后,直至第n+10帧,待处理帧的冲击噪概率为0,因为第n+9帧存在抑制幅度。那么第n+10帧采用第n+9帧各频点的抑制幅度衰减后的数值作为本帧的抑制幅度。接着,第n+11帧的冲击噪概率为0,因为第n+10帧存在抑制幅度,那么第n+11帧采用第n+10帧各频点的抑制幅度衰减后的数值作为本帧的抑制幅度。Then, until the n+10th frame, the probability of impulse noise of the frame to be processed is 0, because the n+9th frame has a suppression amplitude. Then the n+10th frame uses the attenuated value of the suppression amplitude of each frequency point in the n+9th frame as the suppression amplitude of this frame. Then, the probability of impulse noise of the n+11th frame is 0, because the n+10th frame has a suppression amplitude, so the n+11th frame uses the attenuated value of the suppression amplitude of each frequency point in the n+10th frame as the suppression amplitude of this frame.
在本实施的方案中,通过判断待处理帧是否需要进行平滑抑制,当待处理帧需要进行平滑抑制时取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度,因此,在能够对冲击噪进行抑制的基础上,能够避免经过抑制的多帧声音信号之间变化过于剧烈,进而有助于保证声音信号的舒适性。In the scheme of the present implementation, by judging whether the frame to be processed needs to be smoothly suppressed, when the frame to be processed needs to be smoothly suppressed, the attenuation value of the suppression amplitude of each frequency point of the frame previous to the frame to be processed is taken as the suppression amplitude of each frequency point of the frame to be processed. Therefore, on the basis of being able to suppress the impact noise, it is possible to avoid excessively drastic changes between the suppressed multi-frame sound signals, which helps to ensure the comfort of the sound signal.
需要说明的是,取前一帧各频点的抑制幅度的衰减值的方式可以是将前一帧各频点的抑制幅度减去固定值作为衰减值。例如,取固定值为2dB,假设第n帧需要进行平滑抑制,第n-1帧某一频点的抑制幅度为10dB,那么第n帧对应频点的抑制幅度为8dB。此种衰减方式下,可以是直至衰减值小于等于0,也可以是在衰减值小于预设值时直接取待处理帧抑制幅度为0。It should be noted that the attenuation value of the suppression amplitude of each frequency point in the previous frame can be obtained by subtracting a fixed value from the suppression amplitude of each frequency point in the previous frame as the attenuation value. For example, the fixed value is 2dB. Assuming that the nth frame needs to be smoothly suppressed, and the suppression amplitude of a certain frequency point in the n-1th frame is 10dB, then the suppression amplitude of the corresponding frequency point in the nth frame is 8dB. In this attenuation method, it can be until the attenuation value is less than or equal to 0, or it can be directly taken as 0 when the attenuation value is less than the preset value.
或者,取前一帧各频点的抑制幅度的衰减值的方式可以是取前一帧各频点的抑制幅度的百分比值作为衰减值。例如,去百分比为90%,设第n帧需要进行平滑抑制,第n-1帧某一频点的抑制幅度为10dB,那么第n帧对应频点的抑制幅度为9dB。此种衰减方式下,直至衰减值小于等于预设值时直接取待处理帧抑制幅度为0。Alternatively, the attenuation value of the suppression amplitude of each frequency point of the previous frame can be taken as the percentage value of the suppression amplitude of each frequency point of the previous frame as the attenuation value. For example, if the percentage is 90%, and the nth frame needs to be smoothly suppressed, and the suppression amplitude of a certain frequency point of the n-1th frame is 10dB, then the suppression amplitude of the corresponding frequency point of the nth frame is 9dB. In this attenuation mode, the suppression amplitude of the frame to be processed is directly taken as 0 until the attenuation value is less than or equal to the preset value.
如图7所示,在一个实施例中,若待处理帧的前一帧的冲击噪概率大于0并且待处理帧的前一帧的冲击噪概率大于0,执行取待处理帧前一帧各频点的抑制幅度的衰减值作为待处理帧各频点的抑制幅度的步骤之前还包括:As shown in FIG. 7 , in one embodiment, if the impulse noise probability of the previous frame of the frame to be processed is greater than 0 and the impulse noise probability of the previous frame of the frame to be processed is greater than 0, before executing the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed, the step further includes:
判断所述待处理帧的帧能量是否大于预设阈值,若否,执行取所述待处理帧前一帧各频点的抑制幅度的衰减值作为所述待处理帧各频点的抑制幅度的步骤;若是,判断所述待处理帧是否属于长时冲击噪,若是,取所述待处理帧前一帧各频点的抑制幅度作为所述待处理帧各频点的抑制幅度,若否,取所述待处理帧前一帧各频点的抑制幅度的衰减值与根据计算得到的抑制幅度的最大值作为抑制幅度。Determine whether the frame energy of the frame to be processed is greater than a preset threshold value. If not, execute the step of taking the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed; if so, determine whether the frame to be processed belongs to long-term impulse noise. If so, take the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed; if not, take the attenuation value of the suppression amplitude of each frequency point of the previous frame of the frame to be processed and the maximum value of the suppression amplitude obtained according to the calculation as the suppression amplitude.
具体步骤如下:The specific steps are as follows:
步骤S702,获取设定帧长的声音信号。Step S702, obtaining a sound signal with a set frame length.
步骤S704,对声音信号进行时频转换,得到待处理帧的各频点幅度。Step S704: perform time-frequency conversion on the sound signal to obtain the amplitude of each frequency point of the frame to be processed.
步骤S706,判断待处理帧是否为第一帧,若是,直接将待处理帧的声音信号进行输出。若否,执行步骤S708。Step S706, determining whether the frame to be processed is the first frame, if so, directly outputting the sound signal of the frame to be processed. If not, executing step S708.
步骤S708,计算待处理帧的冲击噪概率。Step S708, calculating the impulse noise probability of the frame to be processed.
步骤S710,判断待处理帧的冲击噪概率是否为0。若是,执行步骤S712。若否,执行步骤S714。Step S710, determining whether the impulse noise probability of the frame to be processed is 0. If yes, executing step S712. If not, executing step S714.
步骤S712,判断待处理帧的前一帧是否存在抑制幅度。若是,执行步骤S720,若否,执行步骤S722。Step S712, determine whether the previous frame of the frame to be processed has a suppression amplitude. If so, execute step S720, if not, execute step S722.
步骤S714,判断待处理帧的前一帧的冲击噪概率是否为0。若是,执行步骤S722,若否,执行步骤S716。Step S714, determining whether the impulse noise probability of the frame before the frame to be processed is 0. If so, executing step S722, if not, executing step S716.
步骤S716,判断待处理帧的帧能量是否大于预设阈值。若是,执行步骤S718,若否,执行步骤S720。Step S716, determining whether the frame energy of the frame to be processed is greater than a preset threshold. If so, executing step S718, if not, executing step S720.
步骤S718,判断待处理帧是否属于长时冲击噪。若是,执行步骤S724,若否,执行步骤S726。Step S718, determine whether the frame to be processed is a long-term impulse noise. If yes, execute step S724, if no, execute step S726.
具体地,判断待处理帧是否属于长时冲击噪的步骤包括:Specifically, the step of determining whether the frame to be processed belongs to long-term impulse noise includes:
判断帧能量大于预设阈值的连续帧数是否大于预设值。若是,则判定待处理帧属于长时冲击噪,那么执行步骤S724。若否,则判定待处理帧不属于长时冲击噪,那么执行步骤S726。It is determined whether the number of consecutive frames whose frame energy is greater than the preset threshold is greater than the preset value. If so, it is determined that the frame to be processed belongs to long-term impulse noise, and step S724 is executed. If not, it is determined that the frame to be processed does not belong to long-term impulse noise, and step S726 is executed.
步骤S720,取待处理帧前一帧各频点的抑制幅度的衰减值作为待处理帧各频点的抑制幅度。Step S720, taking the attenuation value of the suppression amplitude of each frequency point of the frame before the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed.
步骤S722,根据公式计算得到待处理帧的各频点的抑制幅度。Step S722, calculating the suppression amplitude of each frequency point of the frame to be processed according to the formula.
步骤S724,取待处理帧前一帧各频点的抑制幅度作为待处理帧各频点的抑制幅度。具体来说,就是将前一帧各频点的抑制幅度直接作为待处理帧各频点的抑制幅度。Step S724, taking the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed. Specifically, the suppression amplitude of each frequency point of the previous frame is directly taken as the suppression amplitude of each frequency point of the frame to be processed.
步骤S726,取待处理帧前一帧各频点的抑制幅度的衰减值与根据计算得到的待处理帧的抑制幅度的最大值作为抑制幅度。Step S726, taking the maximum value of the attenuation value of the suppression amplitude of each frequency point of the frame before the frame to be processed and the suppression amplitude of the frame to be processed obtained according to calculation as the suppression amplitude.
步骤S728,根据抑制幅度对声音信号进行抑制。Step S728, suppressing the sound signal according to the suppression amplitude.
其中,计算信号能量值的方法本身为现有技术,此处不再赘述。The method for calculating the signal energy value is a prior art and will not be described in detail here.
具体来说,声学设备接收到预设帧长的声音信号,开始对这一帧的声音信号进行处理,这一帧就是待处理帧。经过时频转换后,可以得到待处理帧多个频点对应的幅度值。当待处理帧为接收的第一帧信号,不对各频点的幅度值进行处理。因此,将第一帧的冲击噪概率取为0且不存在抑制幅度。Specifically, the acoustic device receives a sound signal of a preset frame length and starts processing the sound signal of this frame. This frame is the frame to be processed. After time-frequency conversion, the amplitude values corresponding to multiple frequency points of the frame to be processed can be obtained. When the frame to be processed is the first frame signal received, the amplitude values of each frequency point are not processed. Therefore, the probability of impulse noise of the first frame is taken as 0 and there is no suppression amplitude.
从第二帧开始,每一个待处理帧开始计算冲击噪概率和各频点的抑制幅度。例如,第二帧冲击噪概率为0,因为第一帧不存在抑制幅度,那么第二帧根据公式计算各频点的抑制幅度,因为冲击噪概率为0,那么第二帧各频点的抑制幅度也是0,即不存在抑制幅度。Starting from the second frame, each frame to be processed begins to calculate the probability of impulse noise and the suppression amplitude of each frequency point. For example, the probability of impulse noise in the second frame is 0, because there is no suppression amplitude in the first frame, then the suppression amplitude of each frequency point in the second frame is calculated according to the formula, because the probability of impulse noise is 0, then the suppression amplitude of each frequency point in the second frame is also 0, that is, there is no suppression amplitude.
接着来说,第三帧冲击噪概率为0,因为第二帧不存在抑制幅度,那么第三帧根据公式计算各频点的抑制幅度,因为冲击噪概率为0,那么第三帧各频点的抑制幅度也是0。Next, the probability of impulse noise in the third frame is 0. Since there is no suppression amplitude in the second frame, the suppression amplitude of each frequency point in the third frame is calculated according to the formula. Since the probability of impulse noise is 0, the suppression amplitude of each frequency point in the third frame is also 0.
而后每一帧的冲击噪概率均为0,直至第n帧,其冲击噪概率不为0,也就是大于0。因为其前一帧(第n-1帧)的冲击噪概率为0,所以第n帧根据公式计算各频点的抑制幅度。第n+1帧的冲击噪概率仍大于0,并且第n帧的冲击噪概率也大于0,此时,需要判断第n+1帧的帧能量是否大于预设阈值。Then the impulse noise probability of each frame is 0 until the nth frame, whose impulse noise probability is not 0, that is, greater than 0. Because the impulse noise probability of the previous frame (n-1th frame) is 0, the suppression amplitude of each frequency point is calculated according to the formula for the nth frame. The impulse noise probability of the n+1th frame is still greater than 0, and the impulse noise probability of the nth frame is also greater than 0. At this time, it is necessary to determine whether the frame energy of the n+1th frame is greater than the preset threshold.
若第n+1帧的帧能量小于预设阈值,则第n+1帧采用第n帧各频点的抑制幅度衰减后的数值作为本帧的抑制幅度。若第n+1帧的帧能量大于预设阈值,判断第n+1帧是否属于长时冲击噪。例如取预设值为10。因为到第n+1帧,帧能量大于预设阈值的帧数为2,所以判定第n+1帧不属于长时冲击噪,取第n帧各频点的抑制幅度的衰减值与根据计算得到第n+1帧的抑制幅度的最大值作为第n+1帧的抑制幅度。If the frame energy of the n+1th frame is less than the preset threshold, the n+1th frame uses the attenuated value of the suppression amplitude of each frequency point of the nth frame as the suppression amplitude of this frame. If the frame energy of the n+1th frame is greater than the preset threshold, it is determined whether the n+1th frame belongs to long-term impulse noise. For example, the preset value is 10. Because the number of frames whose frame energy is greater than the preset threshold by the n+1th frame is 2, it is determined that the n+1th frame does not belong to long-term impulse noise, and the attenuation value of the suppression amplitude of each frequency point of the nth frame and the maximum value of the suppression amplitude of the n+1th frame obtained by calculation are taken as the suppression amplitude of the n+1th frame.
然后,直至第n+11帧,每一帧的冲击噪概率都不为0且均大于预设阈值。此时,帧能量大于预设阈值的连续帧数为11帧,则判定第n+11帧待属于长时冲击噪。那么第n+11帧采用第n+10帧各频点的抑制幅度作为本帧的抑制幅度。Then, until the n+11th frame, the probability of impulse noise in each frame is not 0 and is greater than the preset threshold. At this time, the number of consecutive frames whose frame energy is greater than the preset threshold is 11 frames, and the n+11th frame is determined to be a long-term impulse noise. Then the n+11th frame uses the suppression amplitude of each frequency point of the n+10th frame as the suppression amplitude of this frame.
在本实施的方案中,通过判断待处理帧的帧能量是否大于阈值以及判断是否属于长时冲击噪,一方面,冲击噪重叠时,能够避免对后出现的冲击噪抑制不足的情况发生。另一方面,通过在待处理帧处于长时冲击噪时取所述待处理帧前一帧各频点的抑制幅度作为所述待处理帧各频点的抑制幅度,从而能够保证对长时冲击噪的抑制效果。In the scheme of this implementation, by judging whether the frame energy of the frame to be processed is greater than the threshold and judging whether it is a long-term impulse noise, on the one hand, when the impulse noise overlaps, insufficient suppression of the subsequent impulse noise can be avoided. On the other hand, by taking the suppression amplitude of each frequency point of the previous frame of the frame to be processed as the suppression amplitude of each frequency point of the frame to be processed when the frame to be processed is in the long-term impulse noise, the suppression effect of the long-term impulse noise can be guaranteed.
优选地,在一个实施例中,根据抑制幅度对声音信号进行抑制的步骤包括:使各频点幅度经过抑制后的保留信号幅度大于稳态环境音幅度,从而保证听感。Preferably, in one embodiment, the step of suppressing the sound signal according to the suppression amplitude includes: making the amplitude of the retained signal after the amplitude of each frequency point is suppressed greater than the amplitude of the steady-state ambient sound, thereby ensuring the hearing experience.
至此,本领域技术人员应认识到,虽然本文已详尽示出和描述了本发明的多个示例性实施例,但是,在不脱离本发明精神和范围的情况下,仍可根据本发明公开的内容直接确定或推导出符合本发明原理的许多其他变型或修改。因此,本发明的范围应被理解和认定为覆盖了所有这些其他变型或修改。At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and identified as covering all such other variations or modifications.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210950503.XA CN115240700B (en) | 2022-08-09 | 2022-08-09 | Acoustic device and sound processing method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210950503.XA CN115240700B (en) | 2022-08-09 | 2022-08-09 | Acoustic device and sound processing method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115240700A CN115240700A (en) | 2022-10-25 |
CN115240700B true CN115240700B (en) | 2024-08-23 |
Family
ID=83679109
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210950503.XA Active CN115240700B (en) | 2022-08-09 | 2022-08-09 | Acoustic device and sound processing method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115240700B (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000172283A (en) * | 1998-12-01 | 2000-06-23 | Nec Corp | System and method for detecting sound |
CN101627428A (en) * | 2007-03-06 | 2010-01-13 | 日本电气株式会社 | Noise suppression method, device, and program |
CN103456310B (en) * | 2013-08-28 | 2017-02-22 | 大连理工大学 | Transient noise suppression method based on spectrum estimation |
JP6960766B2 (en) * | 2017-05-15 | 2021-11-05 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America | Noise suppression device, noise suppression method and program |
CN113470674B (en) * | 2020-03-31 | 2023-06-16 | 珠海格力电器股份有限公司 | Voice noise reduction method and device, storage medium and computer equipment |
CN111755023B (en) * | 2020-04-15 | 2023-10-13 | 欧仕达听力科技(厦门)有限公司 | Frequency shift real-time loudness compensation method based on equal loudness curve |
CN111641799B (en) * | 2020-04-20 | 2021-06-29 | 合肥优尔电子科技有限公司 | Video conference system and audio quality diagnosis method thereof |
-
2022
- 2022-08-09 CN CN202210950503.XA patent/CN115240700B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN115240700A (en) | 2022-10-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8903721B1 (en) | Smart auto mute | |
CN109346098B (en) | Echo cancellation method and terminal | |
CN114697782B (en) | Headphone wind noise recognition method, device and headphone | |
US8718562B2 (en) | Processing audio signals | |
CN103997561B (en) | Communication device and voice processing method thereof | |
CN112272848B (en) | Background noise estimation using gap confidence | |
KR101253708B1 (en) | Hearing aid for screening envirronmental noise and method for screening envirronmental noise of hearing aid | |
JP2017500780A (en) | Adaptive residual feedback suppression | |
CN111356058A (en) | An echo cancellation method, device and smart speaker | |
KR101369687B1 (en) | Method for control of adaptation of feedback suppression in a hearing aid, and a hearing aid | |
JP6019098B2 (en) | Feedback suppression | |
CN114697783B (en) | Headphone wind noise recognition method and device | |
CN112437957B (en) | Forced gap insertion for comprehensive listening | |
CN115348507A (en) | Impulse noise suppression method, system, readable storage medium and computer equipment | |
JP4460256B2 (en) | Noise reduction processing method, apparatus for implementing the method, program, and recording medium | |
CN106297816B (en) | Echo cancellation nonlinear processing method and device and electronic equipment | |
CN115240700B (en) | Acoustic device and sound processing method thereof | |
GB2490092A (en) | Reducing howling by applying a noise attenuation factor to a frequency which has above average gain | |
JPH1098346A (en) | Automatic gain adjustment device | |
JP6942282B2 (en) | Transmission control of audio devices using auxiliary signals | |
AU2017355584A1 (en) | Intelligent hearing aid | |
CN115410593B (en) | Audio channel selection method, device, equipment and storage medium | |
CN114866899B (en) | Headset noise reduction method, headset device and computer readable storage medium | |
CN117912485A (en) | Speech band extension method, noise reduction audio device, and storage medium | |
TW201618088A (en) | Method for reducing noise and computer program thereof and electronic device |
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 | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: An acoustic device and its sound processing method Granted publication date: 20240823 Pledgee: Industrial and Commercial Bank of China Limited Xiamen Haicang Branch Pledgor: AUSTAR HEARING SCIENCE & TECHNOLOGY (XIAMEN) CO.,LTD. Registration number: Y2024980051206 |