WO2021102993A1 - Environment detection method, electronic device and computer-readable storage medium - Google Patents

Environment detection method, electronic device and computer-readable storage medium Download PDF

Info

Publication number
WO2021102993A1
WO2021102993A1 PCT/CN2019/122170 CN2019122170W WO2021102993A1 WO 2021102993 A1 WO2021102993 A1 WO 2021102993A1 CN 2019122170 W CN2019122170 W CN 2019122170W WO 2021102993 A1 WO2021102993 A1 WO 2021102993A1
Authority
WO
WIPO (PCT)
Prior art keywords
sound
environment
sound field
target detection
electronic device
Prior art date
Application number
PCT/CN2019/122170
Other languages
French (fr)
Chinese (zh)
Inventor
薛政
吴晟
赵文泉
边云锋
莫品西
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/122170 priority Critical patent/WO2021102993A1/en
Priority to CN201980059247.1A priority patent/CN112868061A/en
Publication of WO2021102993A1 publication Critical patent/WO2021102993A1/en

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/03Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters
    • G10L25/18Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of extracted parameters the extracted parameters being spectral information of each sub-band
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01HMEASUREMENT OF MECHANICAL VIBRATIONS OR ULTRASONIC, SONIC OR INFRASONIC WAVES
    • G01H17/00Measuring mechanical vibrations or ultrasonic, sonic or infrasonic waves, not provided for in the preceding groups
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S15/00Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems
    • G01S15/88Sonar systems specially adapted for specific applications
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/27Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique
    • G10L25/30Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the analysis technique using neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/48Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use
    • G10L25/51Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 specially adapted for particular use for comparison or discrimination

Definitions

  • the current environment in which the electronic device is located is determined according to the sound field characteristics, where the current environment includes an aquatic environment and an underwater environment.
  • this application also provides an electronic device, the electronic device including a sounder, a sound receiver, and a processor;
  • the environment detection method includes step S101 to step S103.
  • the first difference between the first mean and the second mean is calculated, and the second difference between the first standard deviation and the second standard deviation is calculated; according to the first difference and the second difference, Determine the candidate threshold coefficient that meets the preset conditions, and use the largest candidate threshold coefficient as the target threshold coefficient; calculate the first product of the first standard deviation and the target threshold coefficient, and calculate the sum of the first product and the first mean; The second product of the two standard deviations and the target threshold coefficient, and calculate the sum of the second product and the second mean; according to the sum of the first product and the first mean, and the sum of the second product and the second mean, Determine the threshold of sound field characteristics.
  • the preset condition is that the target threshold coefficient is less than the ratio of the first difference to the second difference.
  • the environment type label output by the environment discrimination model is the first preset label or the second preset label; if the environment type label output by the environment discrimination model is the first preset label, it is confirmed that the electronic device is located
  • the current environment of is an underwater environment; if the environment type label output by the environment discrimination model is the second preset label, it is determined that the current environment in which the electronic device is located is an aquatic environment.
  • the first preset label is +1
  • the second preset label is -1.
  • the processor realizes the determination of the sound field characteristics of the target detection sound according to the multi-frame frequency domain signal, it is used to realize:
  • the sound field characteristic is greater than the sound field characteristic threshold, determining that the current environment in which the electronic device is located is an underwater environment

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Measurement Of Velocity Or Position Using Acoustic Or Ultrasonic Waves (AREA)

Abstract

An environment detection method, an electronic device, and a computer-readable storage medium. The method comprises: emitting environment detection sounds, and collecting the environment detection sounds to obtain target detection sounds (S101); performing feature extraction on the target detection sounds to obtain sound field features (S102): and according to the sound field features, determining the current environment in which an electronic device is located (S103). The described method improves the accuracy of detecting the environment in which an electronic device is located.

Description

环境检测方法、电子设备及计算机可读存储介质Environmental detection method, electronic equipment and computer readable storage medium 技术领域Technical field
本申请涉及电子设备技术领域,尤其涉及一种环境检测方法、电子设备及计算机可读存储介质。This application relates to the technical field of electronic equipment, and in particular to an environment detection method, electronic equipment, and computer-readable storage media.
背景技术Background technique
随着电子设备的广泛应用,用户对电子设备的性能要求也越来越高,尤其对恶劣场景下的性能也提出了苛刻的要求,其中水下场景便是一个典型案例。在水下场景,用户一般有安全和性能这两方面的需求,用户一方面希望电子设备能够检测到电子设备在水中并做出安全性提醒和保护,另一方面希望设备在水下能够自动切换设备相关配置,能够在水下也正常工作,比如拍照或录像等。With the widespread application of electronic devices, users have higher and higher performance requirements for electronic devices, especially for performance in harsh scenes. Among them, underwater scenes are a typical case. In underwater scenes, users generally have both safety and performance requirements. On the one hand, users want electronic equipment to detect that the electronic equipment is in the water and make safety reminders and protections, and on the other hand, they hope that the equipment can automatically switch underwater. The equipment-related configuration can work normally even underwater, such as taking photos or videos.
目前,主要通过已有器件利用水下场景的物理规律进行水下场景检测,比如检测蓝牙或其他信号能否正常传输进行水下场景检测,或者利用电子设备的扬声器发出声音,由麦克风接收声音,可以得到声程差和时间差,并基于声程差和时间差进行水下场景检测,但蓝牙等信号在浅水区仍能正常传输,检测结果会存在偏差,而扬声器到麦克风的传播路径不仅仅是壳外的气导或水导路径,扬声器的声波往往也可以通过设备内部传达至麦克风,会影响声程差和时间差的分析,干扰水下场景检测,导致检测结果出现偏差。因此,如何提高水电子设备所处环境的检测准确度是目前亟待解决的问题。At present, underwater scene detection is mainly carried out by using the physical laws of underwater scenes through existing devices, such as detecting whether Bluetooth or other signals can be transmitted normally for underwater scene detection, or using the speaker of electronic equipment to emit sound, and the sound is received by the microphone. The sound path difference and time difference can be obtained, and the underwater scene detection is based on the sound path difference and time difference. However, signals such as Bluetooth can still be transmitted normally in shallow water, and the detection results will be biased, and the propagation path from the speaker to the microphone is not only the shell Outside air conduction or water conduction path, the sound wave of the speaker can often be transmitted to the microphone through the inside of the device, which will affect the analysis of the sound path difference and time difference, interfere with the underwater scene detection, and cause the detection result to be biased. Therefore, how to improve the detection accuracy of the environment in which the hydroelectronic equipment is located is a problem to be solved urgently.
发明内容Summary of the invention
基于此,本申请提供了一种环境检测方法、电子设备及计算机可读存储介质,旨在提高电子设备所处环境的检测准确度,提升用户体验。Based on this, the present application provides an environment detection method, an electronic device, and a computer-readable storage medium, which aim to improve the detection accuracy of the environment in which the electronic device is located and improve user experience.
第一方面,本申请提供了一种环境检测方法,包括:In the first aspect, this application provides an environmental detection method, including:
通过电子设备的发声器发出环境检测音,并通过所述电子设备的声音接收器采集所述环境检测音以获取采集到的目标检测音;Emit the environment detection sound through the sound generator of the electronic device, and collect the environment detection sound through the sound receiver of the electronic device to obtain the collected target detection sound;
对所述目标检测音进行特征提取以获取所述目标检测音的声场特征;Performing feature extraction on the target detection sound to obtain sound field characteristics of the target detection sound;
根据所述声场特征确定所述电子设备所处的当前环境,其中,所述当前环境包括水上环境和水下环境。The current environment in which the electronic device is located is determined according to the sound field characteristics, where the current environment includes an aquatic environment and an underwater environment.
第二方面,本申请还提供了一种电子设备,所述电子设备包括发声器、声 音接收器和处理器;In the second aspect, this application also provides an electronic device, the electronic device including a sounder, a sound receiver, and a processor;
所述发声器用于发出环境检测音;The sound generator is used to emit environmental detection sounds;
所述声音接收器用于采集所述环境检测音以获取采集到的目标检测音;The sound receiver is used to collect the environment detection sound to obtain the collected target detection sound;
所述处理器用于实现如下步骤:The processor is used to implement the following steps:
获取所述声音接收器采集到的所述目标检测音;Acquiring the target detection sound collected by the sound receiver;
对所述目标检测音进行特征提取以获取所述目标检测音的声场特征;Performing feature extraction on the target detection sound to obtain sound field characteristics of the target detection sound;
根据所述声场特征确定所述电子设备所处的当前环境,其中,所述当前环境包括水上环境和水下环境。The current environment in which the electronic device is located is determined according to the sound field characteristics, where the current environment includes an aquatic environment and an underwater environment.
第三方面,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如上所述的环境检测方法的步骤。In the third aspect, the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes the environment detection as described above. Method steps.
本申请实施例提供了一种环境检测方法、电子设备及计算机可读存储介质,通过对环境检测音进行采集,得到目标检测音,并对目标检测音进行特征提取,得到目标检测音的声场特征,且基于该声场特征确定电子设备所处的当前环境,由于整个检测过程不涉及蓝牙或其他信号的传输,也不涉及声音的声程差和时间差,即可检测出电子设备所处的当前环境,有效的提高了电子设备所处环境的检测准确度,极大的提高了用户体验。The embodiments of the application provide an environment detection method, electronic equipment, and computer-readable storage medium. By collecting environment detection sounds, target detection sounds are obtained, and feature extraction of the target detection sounds is performed to obtain the sound field characteristics of the target detection sounds. , And based on the sound field characteristics to determine the current environment in which the electronic device is located. Since the entire detection process does not involve the transmission of Bluetooth or other signals, nor does it involve the sound path difference and time difference of the sound, the current environment in which the electronic device is located can be detected , Which effectively improves the detection accuracy of the environment in which the electronic device is located, and greatly improves the user experience.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the application.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1是本申请一实施例提供的一种环境检测方法的步骤示意流程图;FIG. 1 is a schematic flowchart of steps of an environment detection method provided by an embodiment of the present application;
图2是本申请实施例中发声器与声音接收器之间的声学传播路径的示意图;2 is a schematic diagram of the acoustic propagation path between the sound generator and the sound receiver in an embodiment of the present application;
图3是图1中的环境检测方法的子步骤示意流程图;3 is a schematic flowchart of sub-steps of the environment detection method in FIG. 1;
图4是本申请一实施例提供的另一种环境检测方法的步骤示意流程图;4 is a schematic flowchart of steps of another environment detection method provided by an embodiment of the present application;
图5是本申请一实施例提供的一种电子设备的结构示意性框图。FIG. 5 is a schematic block diagram of the structure of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions 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. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowchart shown in the drawings is only an example, and does not necessarily include all contents and operations/steps, nor does it have to be executed in the described order. For example, some operations/steps can also be decomposed, combined or partially combined, so the actual execution order may be changed according to actual conditions.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present application will be described in detail with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
请参阅图1,图1是本申请一实施例提供的一种环境检测方法的步骤示意流程图。该环境检测方法可以应用在电子设备,用于检测电子设备所处的环境。其中电子设备包括相机、手机、平板电脑和手持云台等。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of steps of an environment detection method provided by an embodiment of the present application. The environment detection method can be applied to electronic equipment to detect the environment in which the electronic equipment is located. Among them, electronic devices include cameras, mobile phones, tablet computers, and handheld PTZs.
具体地,如图1所示,该环境检测方法包括步骤S101至步骤S103。Specifically, as shown in FIG. 1, the environment detection method includes step S101 to step S103.
S101、通过电子设备的发声器发出环境检测音,并通过所述电子设备的声音接收器采集所述环境检测音以获取采集到的目标检测音。S101: Emit an environment detection sound through a sounder of an electronic device, and collect the environment detection sound through a sound receiver of the electronic device to obtain the collected target detection sound.
其中,电子设备的发声器包括但不限于扬声器和蜂鸣器,声音接收器包括但不限于单麦克风和双麦克风,环境检测音包括但不限于电机激振声、蜂鸣声、提示音、语音和音乐,该电机激振声是电机运行时发出的声音,该蜂鸣声为蜂鸣器运行时发出的声音。发声器发出的环境检测音同时通过内部传播路径和外部传播路径被声音接收器,并且在内部传播路径占主要部分。请参照图2,图2为本申请实施例中发声器与声音接收器之间的声学传播路径的示意图,如图2所示,发声器10通过内部传播路径1传播发出的环境检测音至声音接收器20,同时通过外部传播路径2传播发出的环境检测音至声音接收器20。Among them, the sound generator of the electronic device includes but not limited to the speaker and buzzer, the sound receiver includes but not limited to the single microphone and the dual microphone, and the environmental detection sound includes but not limited to the motor excitation sound, buzzer sound, prompt sound, voice And music, the motor excitation sound is the sound made when the motor is running, and the buzzer is the sound made by the buzzer when it is running. The environmental detection sound emitted by the sounder is simultaneously received by the sound receiver through the internal propagation path and the external propagation path, and the internal propagation path occupies the main part. Please refer to FIG. 2. FIG. 2 is a schematic diagram of the acoustic propagation path between the sound generator and the sound receiver in an embodiment of the application. As shown in FIG. 2, the sound generator 10 propagates the emitted environmental detection sound to the sound through the internal propagation path 1 The receiver 20 propagates the emitted environmental detection sound to the sound receiver 20 through the external propagation path 2 at the same time.
电子设备开启环境检测功能后,电子设备以间隔预设时间或者实时通过发声器发出环境检测音,并通过电子设备的声音接收器采集该环境检测音,得到目标检测音。需要说明的是,上述预设时间可基于实际情况进行设置,本申请对此不作具体限定。After the electronic device turns on the environmental detection function, the electronic device emits environmental detection sounds through the sounder at predetermined intervals or in real time, and collects the environmental detection sounds through the sound receiver of the electronic device to obtain target detection sounds. It should be noted that the aforementioned preset time can be set based on actual conditions, which is not specifically limited in this application.
在一实施例中,电子设备的发声器发出环境检测音的同时,开启电子设备的声音接收器,从而控制声音接收器采集发声器发出的环境检测音,得到目标检测音,且发声器停止发出环境检测音的同时,关闭声音接收器,保证得到的目标检测音在时间上与发出的环境检测音严格同步,便于后续从目标检测音中准确的提取出声学特征。In one embodiment, when the sounder of the electronic device emits the environment detection sound, the sound receiver of the electronic device is turned on, thereby controlling the sound receiver to collect the environment detection sound emitted by the sounder to obtain the target detection sound, and the sounder stops emitting At the same time as the environmental detection sound, the sound receiver is turned off to ensure that the obtained target detection sound is strictly synchronized in time with the emitted environmental detection sound, so as to facilitate the subsequent accurate extraction of acoustic features from the target detection sound.
在一实施例中,当声音接收器一直处于工作状态(如录音或者不间断侦听)的情况下,发声器发出环境检测音时,记录环境检测音的发出时刻,并在发声器停止发出环境检测音时,记录环境检测音的停止时刻,然后根据发出时刻和停止时刻从声音接收器接收的声音数据中提取对应的声音片段,并对该声音片段进行过滤,从而得到目标检测音,可以保证得到的目标检测音在时间上与发出的环境检测音严格同步,便于后续从目标检测音中准确的提取出声学特征。In one embodiment, when the sound receiver is always working (such as recording or uninterrupted listening), when the sounder emits the environment detection sound, the time when the environment detection sound is emitted is recorded, and the sounder stops emitting the environment When detecting the sound, record the stop time of the environmental detection sound, and then extract the corresponding sound segment from the sound data received by the sound receiver according to the emitting time and the stop time, and filter the sound segment to obtain the target detection sound, which can guarantee The obtained target detection sound is strictly synchronized in time with the emitted environmental detection sound, which facilitates the subsequent accurate extraction of acoustic features from the target detection sound.
S102、对所述目标检测音进行特征提取以获取所述目标检测音的声场特征。S102: Perform feature extraction on the target detection sound to obtain a sound field feature of the target detection sound.
在得到目标检测音之后,对该目标检测音进行特征提取,得到目标检测音的声场特征。其中,在水下刚性壁环境,声源发出的声波在壁面不断反射叠加,会使得整个声场增强;而水上非刚性壁环境,声源发出的声波在非刚性壁上得到衰减甚至漏声,且衰减与频率相关,水上非刚性壁环境的声场弱于水下刚性壁环境,声场特征包括时域幅值和频域幅值中的至少一种。After the target detection sound is obtained, feature extraction is performed on the target detection sound to obtain the sound field characteristics of the target detection sound. Among them, in the underwater rigid wall environment, the sound waves emitted by the sound source are continuously reflected and superimposed on the wall surface, which will increase the entire sound field; while in the water non-rigid wall environment, the sound waves emitted by the sound source are attenuated or even leaked on the non-rigid wall, and Attenuation is related to frequency. The sound field of a non-rigid wall environment above water is weaker than that of an underwater rigid wall environment, and the sound field characteristics include at least one of a time domain amplitude and a frequency domain amplitude.
在一实施例中,对所述目标检测音进行校正处理,以使得经过校正处理后的目标检测音与所述环境检测音时间同步;对经过校正处理后的目标检测音进行特征提取,得到所述目标检测音的声场特征。通过保证目标检测音在时间上与发出的环境检测音严格同步,便于后续从目标检测音中准确的提取出声学特征,从而可以提高电子设备所处环境的检测准确性。由于采集目标检测音时,发声器与声音接收器的开启时间与关闭时间严格同步,也可以不对目标检测音进行校正处理,当然也可以对目标检测音进行校正处理,本申请对此不作具体限定。In one embodiment, correction processing is performed on the target detection sound, so that the target detection sound after the correction processing is time-synchronized with the environment detection sound; the feature extraction is performed on the target detection sound after the correction processing to obtain the target detection sound. The sound field characteristics of the target detection sound. By ensuring that the target detection sound is strictly synchronized in time with the emitted environmental detection sound, it is convenient to accurately extract the acoustic characteristics from the target detection sound in the subsequent, thereby improving the detection accuracy of the environment in which the electronic device is located. Since the turn-on time and turn-off time of the sound generator and the sound receiver are strictly synchronized when collecting the target detection sound, the target detection sound may not be corrected, of course, the target detection sound may also be corrected, which is not specifically limited in this application. .
在一实施例中,如图3所示,步骤S102包括步骤S1021至步骤S1023。In an embodiment, as shown in FIG. 3, step S102 includes step S1021 to step S1023.
S1021、对所述目标检测音进行采样以获取目标检测音的多帧时域信号。S1021, sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound.
在采集得到目标检测音之后,对目标检测音进行采样,得到目标检测音的多帧时域信号。其中,每帧时域信号可以表示为:After the target detection sound is collected, the target detection sound is sampled to obtain multi-frame time-domain signals of the target detection sound. Among them, the time domain signal of each frame can be expressed as:
x l(n)=[x(Ml-N+1),...,x(Ml-1),x(Ml)],l=0,1,...,L,,其中,N为帧长,M为帧移,l为帧序号,L是目标检测音的总帧数,N的取值范围为0.001f s<N<f s,M的取值范围为0.01N<M<100N,f s为采样频率,目标检测音的采用频率f s可基于实际情况进行设置,本申请对此不作具体限定。 x l (n)=[x(Ml-N+1),...,x(Ml-1),x(Ml)],l=0,1,...,L, where N is Frame length, M is the frame shift, l is the frame number, L is the total number of frames of the target detection sound, the value range of N is 0.001f s <N<f s , and the value range of M is 0.01N<M<100N , F s is the sampling frequency, and the frequency f s of the target detection tone can be set based on actual conditions, which is not specifically limited in this application.
S1022、对所述多帧时域信号进行频域变换以获取多帧频域信号。S1022: Perform frequency domain transformation on the multi-frame time-domain signal to obtain a multi-frame frequency-domain signal.
对多帧时域信号中的每一帧时域信号进行频域变换,可以得到每一帧时域信号的频域信号,从而得到多帧频域信号。其中,频域变换包括但不限于对时域信号进行傅里叶变换和对时域信号进行小波变换。The frequency domain transform is performed on each frame of the time domain signal in the multi-frame time domain signal, and the frequency domain signal of each frame of the time domain signal can be obtained, thereby obtaining the multi-frame frequency domain signal. Among them, the frequency domain transform includes, but is not limited to, performing Fourier transform on time domain signals and performing wavelet transform on time domain signals.
在一实施例中,根据预设的窗函数对多帧时域信号进行加窗处理;对经过加窗处理之后的多帧时域信号进行频域变换以获取多帧频域信号。其中,预设的窗函数包括如下至少一种:矩形窗、正弦窗、汉宁窗、海明窗和高斯窗。通过对时域信号进行加窗处理,可以减少频谱能量泄漏。In an embodiment, the multi-frame time-domain signal is windowed according to a preset window function; the multi-frame time-domain signal after the windowing process is subjected to frequency domain transformation to obtain the multi-frame frequency domain signal. Wherein, the preset window function includes at least one of the following: rectangular window, sinusoidal window, Hanning window, Hamming window and Gaussian window. By windowing the time-domain signal, spectral energy leakage can be reduced.
示例性的,经过加窗后的一帧时域信号可以表示为:x′ l(n)=x l(n)w,其中,w为N点的窗函数,通过对x′ l(n)进行频域变换,可以得到对应的频域信号为
Figure PCTCN2019122170-appb-000001
Exemplarily, a frame of time-domain signal after windowing can be expressed as: x′ l (n)=x l (n)w, where w is the window function of N points, and by comparing x′ l (n) Carrying out frequency domain transformation, the corresponding frequency domain signal can be obtained as
Figure PCTCN2019122170-appb-000001
S1023、根据所述多帧频域信号确定所述目标检测音的声场特征。S1023. Determine a sound field characteristic of the target detection sound according to the multi-frame frequency domain signal.
具体地,根据多帧频域信号中每一帧频域信号确定每一帧频域信号对应的多个特征频域幅值;对多帧频域信号中每一帧频域信号对应的多个特征频域幅值进行融合以获取多个融合特征频域幅值;将多个融合特征频域幅值确定为目标检测音的声场特征。其中,通过对频域信号进行分析,可以得到频域信号对应的多个特征频域幅值。Specifically, a plurality of characteristic frequency domain amplitudes corresponding to each frame of the frequency domain signal are determined according to each frame of the frequency domain signal in the multi-frame frequency domain signal; The characteristic frequency domain amplitudes are fused to obtain multiple fused characteristic frequency domain amplitudes; the multiple fused characteristic frequency domain amplitudes are determined as the sound field characteristics of the target detection tone. Among them, by analyzing the frequency domain signal, multiple characteristic frequency domain amplitudes corresponding to the frequency domain signal can be obtained.
其中,频域信号的多个特征频域幅值的确定方式具体为:计算频域信号
Figure PCTCN2019122170-appb-000002
中对应频率f 1,f 2…,f m的共m个线谱的能量P 1,l(n),P 2,l(n)…P m,l(n),其中,
Figure PCTCN2019122170-appb-000003
0≤f 1<f 2<…<f m<f s/2,1≤m<N/2,a j是加权系数,Hm’和Lm’满足f Lm’≥max{0,(f m’+f m’-1)/2)},f Hm’≤min{f s/2,(f m’+f m’+1)/2)},从而得到,频域信号的m个特征频域幅值为S l(n)=[P 1,l(n),P 2,l(n)…P m,l(n)]。
Among them, the method for determining the multiple characteristic frequency domain amplitudes of the frequency domain signal is specifically: calculating the frequency domain signal
Figure PCTCN2019122170-appb-000002
The energies P 1,l (n), P 2,l (n)...P m,l (n) of m line spectra corresponding to frequencies f 1 , f 2 …, f m in
Figure PCTCN2019122170-appb-000003
0≤f 1 <f 2 <…<f m <f s /2, 1≤m<N/2, a j is a weighting coefficient, Hm' and Lm' satisfy f Lm' ≥max{0,(f m' +f m'-1 )/2)},f Hm' ≤min{f s /2,(f m' +f m'+1 )/2)}, so that the m characteristic frequencies of the frequency domain signal The domain amplitude is S l (n)=[P 1,l (n), P 2,l (n)...P m,l (n)].
在一实施例中,根据每一帧频域信号对应的多个特征频域幅值,对每一帧频域信号对应的多个特征频域幅值进行融合,得到每一帧频域信号对应的融合特征频域幅值,从而得到多个融合特征频域幅值。其中,多个特征频域幅值的融合方式具体为:根据每一帧频域信号对应的多个特征频域幅值,计算每一帧频域信号的特征频域幅值的算术平均值、几何均值或中值,并将每一帧频域信号的特征频域幅值的算术平均值、几何均值或中值确定为每一帧频域信号对应的融合特征频域幅值。示例性的,将每一帧频域信号X l(n)对应的多个特征频域幅值S l(n)进行融合,可以得到多个融合特征频域幅值S a(n)=[P 1(n),P 2(n)…P m(n)]。 In one embodiment, according to the multiple characteristic frequency domain amplitudes corresponding to each frame of frequency domain signal, the multiple characteristic frequency domain amplitudes corresponding to each frame of frequency domain signal are fused to obtain the frequency domain signal corresponding to each frame. The frequency domain amplitude of the fusion feature is obtained, and multiple fusion feature frequency domain amplitudes are obtained. Among them, the method of fusion of multiple characteristic frequency domain amplitudes is specifically: according to the multiple characteristic frequency domain amplitudes corresponding to each frame of frequency domain signal, calculating the arithmetic mean of the characteristic frequency domain amplitude of each frame of frequency domain signal, The geometric mean or median is determined, and the arithmetic mean, geometric mean, or median of the characteristic frequency domain amplitude of each frame of frequency domain signal is determined as the fused characteristic frequency domain amplitude corresponding to each frame of frequency domain signal. Exemplary, each of the frame frequency-domain signal X l (n) corresponding to the plurality of frequency domain amplitude characteristic S l (n) are fused, a plurality of fused features can be obtained in the frequency domain amplitude S a (n) = [ P 1 (n), P 2 (n)...P m (n)].
在一实施例中,对目标检测音进行采样以获取目标检测音的多帧时域信号;根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征。其中,每帧时域信号可以表示为:In an embodiment, the target detection sound is sampled to obtain a multi-frame time domain signal of the target detection sound; the sound field characteristics of the target detection sound are determined according to the time domain amplitude of the multi-frame time domain signal. Among them, the time domain signal of each frame can be expressed as:
x l(n)=[x(Ml-N+1),...,x(Ml-1),x(Ml)],l=0,1,...,L, x l (n)=[x(Ml-N+1),...,x(Ml-1),x(Ml)],l=0,1,...,L,
其中,N为帧长,M为帧移,l为帧序号,L是目标检测音的总帧数,N的取值范围为0.001f s<N<f s,M的取值范围为0.01N<M<100N,f s为采样频率。需要说明的是,上述采样频率可基于实际情况进行设置,本申请对此不作具体限定。 Among them, N is the frame length, M is the frame shift, l is the frame number, L is the total number of frames of the target detection sound, the value range of N is 0.001f s <N<f s , and the value range of M is 0.01N <M<100N, f s is the sampling frequency. It should be noted that the above-mentioned sampling frequency can be set based on actual conditions, which is not specifically limited in this application.
具体地,获取多帧时域信号中每一帧时域信号的时域幅值的平均值;对所述多帧时域信号的平均值进行融合,将融合之后的结果确定为目标检测音的声场特征。其中,多帧时域信号的平均值的融合方式为具体为:获取每一帧时域信号的加权融合系数,并根据每一帧时域信号的加权融合系数和每一帧时域信号的时域幅值的平均值,对多帧时域信号的平均值进行融合,得到目标检测音的声场特征。通过提取时域信号的时域幅值,确定目标检测音的声场特征,对电子设备的计算性能要求较低,不需要很多的运算资源即可提取到目标检测音的声场特征。Specifically, the average value of the time domain amplitude of each frame of the time domain signal in the multi-frame time domain signal is obtained; the average value of the multi-frame time domain signal is fused, and the result after the fusion is determined as the target detection sound Sound field characteristics. Among them, the fusion method of the average value of the multi-frame time domain signal is specifically: obtaining the weighted fusion coefficient of each frame of time domain signal, and according to the weighted fusion coefficient of each frame of time domain signal and the time of each frame of time domain signal. The average value of the domain amplitude is fused to the average value of the multi-frame time domain signal to obtain the sound field characteristics of the target detection sound. By extracting the time domain amplitude of the time domain signal, the sound field characteristics of the target detection sound are determined, which requires low calculation performance of the electronic device, and the sound field characteristics of the target detection sound can be extracted without much computing resources.
示例性的,计算一帧时域信号的时域幅值的平均值,即计算x l(n)的时域幅值的平均值,可以表示为:Q l(n)=mean(abs(x l(n))),其中abs代表求绝对值操作,mean代表求均值操作;在得到每一帧时域信号的时域幅值的平均值Q l(n),l=1,2,…,L之后,对每一帧时域信号的时域幅值的平均值进行融合,从而得到目标检测音的声场特征Q a(n)。 Exemplarily, calculating the average value of the time domain amplitude of a frame of time domain signal, that is, calculating the average value of the time domain amplitude of x l (n), can be expressed as: Q l (n)=mean(abs(x l (n))), where abs represents the absolute value operation, mean represents the averaging operation; in obtaining the average value of the time domain amplitude of each frame of time domain signal Q l (n), l=1, 2,... After L, the average value of the time domain amplitude of each frame of time domain signal is fused to obtain the sound field characteristic Q a (n) of the target detection sound.
S103、根据所述声场特征确定所述电子设备所处的当前环境。S103: Determine the current environment in which the electronic device is located according to the sound field characteristics.
在确定目标检测音的声场特征之后,基于该声场特征确定电子设备所处的当前环境。其中,所述当前环境包括水上环境和水下环境。After the sound field characteristics of the target detection sound are determined, the current environment in which the electronic device is located is determined based on the sound field characteristics. Wherein, the current environment includes an aquatic environment and an underwater environment.
在一实施例中,获取声场特征阈值,并根据声场特征阈值和声场特征确定电子设备所处的当前环境,若所述声场特征大于所述声场特征阈值,则确定所述电子设备所处的当前环境为水下环境;若所述声场特征小于或等于所述声场特征阈值,则确定所述电子设备所处的当前环境为水上环境。其中,所述声场特征阈值是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合中的至少一个确定的,第一声场特征集合包括水下环境的目标检测音的多个声场特征,第二声场特征集合包括水上环境的目标检测音的多个声场特征。In an embodiment, the sound field characteristic threshold is acquired, and the current environment in which the electronic device is located is determined according to the sound field characteristic threshold and the sound field characteristics. If the sound field characteristic is greater than the sound field characteristic threshold, the current environment where the electronic device is located is determined The environment is an underwater environment; if the sound field characteristic is less than or equal to the sound field characteristic threshold, it is determined that the current environment in which the electronic device is located is an aquatic environment. Wherein, the sound field feature threshold is determined according to at least one of a first sound field feature set of the underwater environment and a second sound field feature set of the water environment, and the first sound field feature set includes the target detection sound of the underwater environment Multiple sound field features, and the second sound field feature set includes multiple sound field features of target detection sounds in the water environment.
示例性的,水下环境的第一声场特征集合为A={S water,1,S water,2…S water,l1}, 水上环境的第二声场特征集合为B={S air,1,S air,2…S air,l2},其中,l1和l2可基于实际情况进行设置,对此不作具体限定,可选地,l1和l2大于或等于10。通过A={S water,1,S water,2…S water,l1}和/或B={S air,1,S air,2…S air,l2}可以确定声场特征阈值。 Exemplarily, the first sound field feature set of the underwater environment is A={S water,1 ,S water,2 …S water,l1 }, and the second sound field feature set of the water environment is B={S air,1 ,S air,2 …S air,l2 }, where l1 and l2 can be set based on the actual situation, which is not specifically limited. Optionally, l1 and l2 are greater than or equal to 10. The sound field characteristic threshold can be determined by A={S water,1 ,S water,2 ...S water,l1 } and/or B={S air,1 ,S air,2 ...S air,l2}.
在一实施例中,获取基准声场特征,并计算目标检测音的声场特征与该基准声场特征的差值,且根据该目标检测音的声场特征与该基准声场特征的差值,确定电子设备所处的当前环境。其中,该基准声场特征根据水下环境的第一声场特征集合或者根据水下环境的第二声场特征集合确定。In one embodiment, a reference sound field characteristic is acquired, and the difference between the sound field characteristic of the target detection sound and the reference sound field characteristic is calculated, and the difference between the sound field characteristic of the target detection sound and the reference sound field characteristic is determined to determine the location of the electronic device. The current environment of the place. Wherein, the reference sound field characteristic is determined according to the first sound field characteristic set of the underwater environment or the second sound field characteristic set of the underwater environment.
具体地,若该基准声场特征是根据水下环境的第一声场特征集合确定的,则如果该目标检测音的声场特征与该基准声场特征的差值小于预设差值阈值,则可以确定电子设备所处的当前环境为水下环境,而如果该目标检测音的声场特征与该基准声场特征的差值大于或等于预设差值阈值,则可以确定电子设备所处的当前环境为水上环境。Specifically, if the reference sound field feature is determined according to the first sound field feature set of the underwater environment, then if the difference between the sound field feature of the target detection sound and the reference sound field feature is less than the preset difference threshold, it can be determined The current environment in which the electronic device is located is an underwater environment, and if the difference between the sound field characteristics of the target detection sound and the reference sound field characteristics is greater than or equal to the preset difference threshold, it can be determined that the current environment in which the electronic device is located is water surroundings.
具体地,若该基准声场特征是根据水上环境的第二声场特征集合确定的,则如果该目标检测音的声场特征与该基准声场特征的差值小于预设差值阈值,则可以确定电子设备所处的当前环境为水上环境,而如果该目标检测音的声场特征与该基准声场特征的差值大于或等于预设差值阈值,则可以确定电子设备所处的当前环境为水下环境。Specifically, if the reference sound field feature is determined according to the second sound field feature set of the aquatic environment, if the difference between the sound field feature of the target detection sound and the reference sound field feature is less than the preset difference threshold, the electronic device can be determined The current environment in which the electronic device is located is an underwater environment, and if the difference between the sound field characteristics of the target detection sound and the reference sound field characteristics is greater than or equal to the preset difference threshold, it can be determined that the current environment in which the electronic device is located is an underwater environment.
具体地,获取水下环境的第一声场特征集合和水上环境的第二声场特征集合;计算所述第一声场特征集合的第一均值和第一标准差,并计算第二声场特征集合的第二均值和第二标准差;根据所述第一均值、第一标准差、第二均值和第二标准差,确定声场特征阈值。Specifically, the first sound field feature set of the underwater environment and the second sound field feature set of the water environment are acquired; the first mean value and the first standard deviation of the first sound field feature set are calculated, and the second sound field feature set is calculated The second mean value and the second standard deviation of the; according to the first mean value, the first standard deviation, the second mean value and the second standard deviation, the sound field characteristic threshold is determined.
示例性的,计算第一均值与第二均值之间的第一差值,并计算第一标准差与第二标准差之间的第二差值;根据第一差值和第二差值,确定符合预设条件的候选阈值系数,并将最大的候选阈值系数作为目标阈值系数;计算第一标准差与目标阈值系数的第一乘积,并计算第一乘积与第一均值之和;计算第二标准差与目标阈值系数的第二乘积,并计算第二乘积与所述第二均值之和;根据第一乘积与第一均值之和,以及第二乘积与所述第二均值之和,确定声场特征阈值。其中所述预设条件为所述目标阈值系数小于所述第一差值与第二差值的比值。Exemplarily, the first difference between the first mean and the second mean is calculated, and the second difference between the first standard deviation and the second standard deviation is calculated; according to the first difference and the second difference, Determine the candidate threshold coefficient that meets the preset conditions, and use the largest candidate threshold coefficient as the target threshold coefficient; calculate the first product of the first standard deviation and the target threshold coefficient, and calculate the sum of the first product and the first mean; The second product of the two standard deviations and the target threshold coefficient, and calculate the sum of the second product and the second mean; according to the sum of the first product and the first mean, and the sum of the second product and the second mean, Determine the threshold of sound field characteristics. The preset condition is that the target threshold coefficient is less than the ratio of the first difference to the second difference.
例如,水下环境的多帧频域幅度为:For example, the multi-frame frequency domain amplitude of the underwater environment is:
Figure PCTCN2019122170-appb-000004
则通过融合之后得到水下环境的声场特征为[94 58 104],而水上环境的多帧频域幅度为:
Figure PCTCN2019122170-appb-000004
After fusion, the sound field characteristics of the underwater environment are obtained as [94 58 104], and the multi-frame frequency domain amplitude of the aquatic environment is:
Figure PCTCN2019122170-appb-000005
则通过融合之后得到水上环境的声场特征为[16 7 11],通过多次采集可以得到水下环境的第一声场特征集合和水上环境的第二声场特征集合,然后通过第一声场特征集合和/或水上环境的第二声场特征集合可以确定声场特征阈值。
Figure PCTCN2019122170-appb-000005
After fusion, the sound field characteristics of the water environment are obtained as [16 7 11], the first sound field characteristic set of the underwater environment and the second sound field characteristic set of the water environment can be obtained through multiple collections, and then the first sound field characteristics The set and/or the second sound field feature set of the water environment may determine the sound field feature threshold.
上述实施例提供的环境检测方法,通过对环境检测音进行采集,得到目标检测音,并对目标检测音进行特征提取,得到目标检测音的声场特征,且基于该声场特征确定电子设备所处的当前环境,由于整个检测过程不涉及蓝牙或其他信号的传输,也不涉及声音的声程差和时间差,即可检测出电子设备所处的当前环境,有效的提高了电子设备所处环境的检测准确度,极大的提高了用户体验。In the environment detection method provided by the foregoing embodiment, the target detection sound is obtained by collecting the environment detection sound, and the feature extraction of the target detection sound is performed to obtain the sound field characteristics of the target detection sound, and based on the sound field characteristics, the location of the electronic device is determined In the current environment, since the entire detection process does not involve the transmission of Bluetooth or other signals, nor does it involve the sound path difference and time difference, the current environment in which the electronic device is located can be detected, which effectively improves the detection of the environment in which the electronic device is located. The accuracy greatly improves the user experience.
请参阅图4,图4是本申请一实施例提供的另一种环境检测方法的步骤示意流程图。Please refer to FIG. 4, which is a schematic flowchart of the steps of another environment detection method provided by an embodiment of the present application.
具体地,如图4所示,该环境检测方法包括步骤S201至S204。Specifically, as shown in FIG. 4, the environment detection method includes steps S201 to S204.
S201、通过电子设备的发声器发出环境检测音,并通过所述电子设备的声音接收器采集所述环境检测音以获取采集到的目标检测音。S201: Emit an environment detection sound through a sounder of an electronic device, and collect the environment detection sound through a sound receiver of the electronic device to obtain the collected target detection sound.
电子设备开启环境检测功能后,电子设备以间隔预设时间或者实时通过发声器发出环境检测音,并通过电子设备的声音接收器采集该环境检测音,得到目标检测音。需要说明的是,上述预设时间可基于实际情况进行设置,本申请对此不作具体限定。After the electronic device turns on the environmental detection function, the electronic device emits environmental detection sounds through the sounder at predetermined intervals or in real time, and collects the environmental detection sounds through the sound receiver of the electronic device to obtain target detection sounds. It should be noted that the aforementioned preset time can be set based on actual conditions, which is not specifically limited in this application.
S202、对所述目标检测音进行特征提取以获取所述目标检测音的声场特征。S202: Perform feature extraction on the target detection sound to obtain a sound field feature of the target detection sound.
在得到目标检测音之后,对该目标检测音进行特征提取,得到目标检测音的声场特征。其中,在水下刚性壁环境,声源发出的声波在壁面不断反射叠加,会使得整个声场增强;而水上非刚性壁环境,声源发出的声波在非刚性壁上得到衰减甚至漏声,且衰减与频率相关,水上非刚性壁环境的声场弱于水下刚性壁环境,声场特征包括时域幅值和频域幅值中的至少一种。After the target detection sound is obtained, feature extraction is performed on the target detection sound to obtain the sound field characteristics of the target detection sound. Among them, in the underwater rigid wall environment, the sound waves emitted by the sound source are continuously reflected and superimposed on the wall surface, which will increase the entire sound field; while in the water non-rigid wall environment, the sound waves emitted by the sound source are attenuated or even leaked on the non-rigid wall, and Attenuation is related to frequency. The sound field of a non-rigid wall environment above water is weaker than that of an underwater rigid wall environment, and the sound field characteristics include at least one of a time domain amplitude and a frequency domain amplitude.
S203、将所述声场特征输入至预设的环境判别模型以获取预设的环境判别 模型输出的环境类型标签。S203. Input the sound field characteristics into a preset environment discrimination model to obtain an environment type label output by the preset environment discrimination model.
其中,所述预设的环境判别模型是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合优化得到的,所述环境判别模型为二分类模型,也可以为神经网络模型,通过水下环境的第一声场特征集合和水上环境的第二声场特征集合对二分类模型或者神经网络模型进行参数优化,即可得到环境判别模型。所述神经网络模型包括但不限于卷积神经网络、循环神经网络和循环卷积神经网络。Wherein, the preset environment discrimination model is optimized based on the first sound field feature set of the underwater environment and the second sound field feature set of the water environment, and the environment discrimination model is a binary classification model or a neural network Model, through the first sound field feature set of the underwater environment and the second sound field feature set of the water environment to optimize the parameters of the two-class model or the neural network model to obtain the environment discrimination model. The neural network model includes, but is not limited to, a convolutional neural network, a recurrent neural network, and a recurrent convolutional neural network.
在得到目标检测音之后,将将该声场特征输入至预设的环境判别模型以获取预设的环境判别模型输出的环境类型标签。其中,该环境类型标签包括水下环境对应的第一预设标签和水上环境对应的第二预设标签。以下以二分类模型对环境判别模型的构建过程进行解释说明。After the target detection sound is obtained, the sound field characteristics are input to the preset environment discrimination model to obtain the environment type label output by the preset environment discrimination model. Wherein, the environment type label includes a first preset label corresponding to an underwater environment and a second preset label corresponding to an aquatic environment. The following uses a two-class model to explain the construction process of the environmental discriminant model.
预先多次计算水上环境和水下环境的目标检测音的声场特征,分别得到水下环境的第一声场特征集合A={S water,1,S water,2…S water,l1}和水下环境的第二声场特征集合B={S air,1,S air,2…S air,l2},集合A的标签为y i=+1,集合B的标签为y j=-1,l1,l2均大于10,将所有数据随机混合得到样本数据T={(x 1,y 1),(x 2,y 2),…,(x N,y N)},N=l1+l2。 The sound field characteristics of the target detection sound in the water environment and the underwater environment are calculated many times in advance, and the first sound field feature set A={S water,1 ,S water,2 …S water,l1 } and the water are obtained respectively. The second sound field feature set of the lower environment B={S air,1 ,S air,2 …S air,l2 }, the label of set A is y i =+1, the label of set B is y j =-1,l1 , l2 is greater than 10, randomly mix all data to obtain sample data T={(x 1 ,y 1 ),(x 2 ,y 2 ),...,(x N ,y N )}, N=l1+l2.
选取核函数K(x,z)和参数C,核函数可基于实际情况进行选取,本说明书以高斯核函数为例进行说明,通过高斯核函数和参数C,可以得到:Select the kernel function K(x, z) and the parameter C. The kernel function can be selected based on the actual situation. This manual takes the Gaussian kernel function as an example for explanation. Through the Gaussian kernel function and the parameter C, you can get:
Figure PCTCN2019122170-appb-000006
然后通过样本数据T={(x 1,y 1),(x 2,y 2),…,(x N,y N)}求得最优解
Figure PCTCN2019122170-appb-000007
选择α *的一个正分量0<α j<c,计算
Figure PCTCN2019122170-appb-000008
最后构造决策函数:
Figure PCTCN2019122170-appb-000009
构造得到的决策函数即为环境判别模型,可以理解的是,将目标检测音的声场特征输入该决策函数,输出的结果为+1时,可以确定电子设备的当前环境为水下环境,输出的结果为-1时,可以确定电子设备的当前环境为水上环境。
Figure PCTCN2019122170-appb-000006
Then through the sample data T = {(x 1 ,y 1 ),(x 2 ,y 2 ),...,(x N ,y N )} to find the optimal solution
Figure PCTCN2019122170-appb-000007
Choose a positive component of α * 0<α j <c, calculate
Figure PCTCN2019122170-appb-000008
Finally, the decision function is constructed:
Figure PCTCN2019122170-appb-000009
The constructed decision function is the environment discrimination model. It can be understood that the sound field characteristics of the target detection sound are input to the decision function, and when the output result is +1, it can be determined that the current environment of the electronic device is an underwater environment, and the output When the result is -1, it can be determined that the current environment of the electronic device is a water environment.
S204、根据所述环境类型标签确定所述电子设备所处的当前环境。S204: Determine the current environment in which the electronic device is located according to the environment type label.
具体地,确定该环境判别模型输出的环境类型标签是第一预设标签,还是 第二预设标签;若该环境判别模型输出的环境类型标签是第一预设标签,则确电子设备所处的当前环境为水下环境;若该环境判别模型输出的环境类型标签为第二预设标签,则确定电子设备所处的当前环境为水上环境。可选地,第一预设标签为+1,第二预设标签为-1。Specifically, it is determined whether the environment type label output by the environment discrimination model is the first preset label or the second preset label; if the environment type label output by the environment discrimination model is the first preset label, it is confirmed that the electronic device is located The current environment of is an underwater environment; if the environment type label output by the environment discrimination model is the second preset label, it is determined that the current environment in which the electronic device is located is an aquatic environment. Optionally, the first preset label is +1, and the second preset label is -1.
在一实施例中,当确定电子设备的拍摄装置处于水下环境时,调节该拍摄装置的成像参数。其中,该成像参数包括如下至少一种:曝光时长、光圈值、感光度值和曝光增益。当拍摄装置处于水下环境时,对拍摄装置的成像参数进行调节,可以提高拍摄装置拍摄的图像质量,极大的提高用户体验。In an embodiment, when it is determined that the photographing device of the electronic device is in an underwater environment, the imaging parameters of the photographing device are adjusted. Wherein, the imaging parameter includes at least one of the following: exposure duration, aperture value, sensitivity value, and exposure gain. When the shooting device is in an underwater environment, adjusting the imaging parameters of the shooting device can improve the image quality of the shooting device and greatly improve the user experience.
上述实施例提供的环境检测方法,通过对环境检测音进行采集,得到目标检测音,并对目标检测音进行特征提取,得到目标检测音的声场特征,且基于该声场特征和环境判别模型,即可快速且准确的确定电子设备所处的当前环境,极大的提高了用户体验。In the environment detection method provided by the above-mentioned embodiments, the target detection sound is obtained by collecting the environment detection sound, and the feature extraction of the target detection sound is performed to obtain the sound field characteristics of the target detection sound, and the sound field characteristics of the target detection sound are obtained based on the sound field characteristics and the environment discrimination model, namely The current environment where the electronic device is located can be quickly and accurately determined, which greatly improves the user experience.
请参阅图5,图5是本申请一实施例提供的电子设备的示意性框图。在一种实施方式中,该电子设备包括但不限于相机、手机、平板电脑和手持云台等。进一步地,该电子设备300包括处理器301、发声器302和声音接收器303,处理器301、发声器302和声音接收器303通过总线304连接,该总线304比如为I2C(Inter-integrated Circuit)总线。Please refer to FIG. 5, which is a schematic block diagram of an electronic device according to an embodiment of the present application. In an embodiment, the electronic device includes, but is not limited to, a camera, a mobile phone, a tablet computer, and a handheld pan/tilt. Further, the electronic device 300 includes a processor 301, a sounder 302, and a sound receiver 303. The processor 301, the sounder 302, and the sound receiver 303 are connected by a bus 304, such as I2C (Inter-integrated Circuit). bus.
具体地,处理器301可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal Processor,DSP)等。Specifically, the processor 301 may be a micro-controller unit (MCU), a central processing unit (CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
具体地,发声器302包括但不限于扬声器和蜂鸣器,声音接收器303包括但不限于单麦克风和双麦克风。Specifically, the sound generator 302 includes but is not limited to a speaker and a buzzer, and the sound receiver 303 includes but is not limited to a single microphone and a dual microphone.
其中,所述发声器302用于发出环境检测音;Wherein, the sound generator 302 is used to emit environmental detection sounds;
所述声音接收器303用于采集所述环境检测音以获取采集到的目标检测音;The sound receiver 303 is configured to collect the environmental detection sound to obtain the collected target detection sound;
所述处理器301用于实现如下步骤:The processor 301 is configured to implement the following steps:
获取所述声音接收器采集到的所述目标检测音;Acquiring the target detection sound collected by the sound receiver;
对所述目标检测音进行特征提取以获取所述目标检测音的声场特征;Performing feature extraction on the target detection sound to obtain sound field characteristics of the target detection sound;
根据所述声场特征确定所述电子设备所处的当前环境,其中,所述当前环境包括水上环境和水下环境。The current environment in which the electronic device is located is determined according to the sound field characteristics, where the current environment includes an aquatic environment and an underwater environment.
可选地,所述处理器实现对所述目标检测音进行特征提取以获取所述目标检测音的声场特征时,用于实现:Optionally, when the processor implements feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound, it is used to achieve:
对所述目标检测音进行校正处理,以使得经过校正处理后的目标检测音与 所述环境检测音时间同步;Performing correction processing on the target detection sound, so that the target detection sound after the correction processing is synchronized with the environment detection sound;
对所述校正处理后的目标检测音进行特征提取,得到所述目标检测音的声场特征。Perform feature extraction on the target detection sound after the correction process to obtain the sound field characteristics of the target detection sound.
可选地,所述处理器实现对所述目标检测音进行特征提取以获取所述目标检测音的声场特征时,用于实现:Optionally, when the processor implements feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound, it is used to achieve:
对所述目标检测音进行采样以获取目标检测音的多帧时域信号;Sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound;
对所述多帧时域信号进行频域变换以获取多帧频域信号;Performing frequency domain transformation on the multi-frame time domain signal to obtain a multi-frame frequency domain signal;
根据所述多帧频域信号确定所述目标检测音的声场特征。The sound field characteristic of the target detection sound is determined according to the multi-frame frequency domain signal.
可选地,所述处理器实现对所述多帧时域信号进行频域变换以获取多帧频域信号时,用于实现:Optionally, when the processor implements frequency domain transformation on the multi-frame time-domain signal to obtain a multi-frame frequency-domain signal, it is used to implement:
根据预设的窗函数对所述多帧时域信号进行加窗处理;Performing windowing processing on the multi-frame time domain signal according to a preset window function;
对所述加窗处理之后的多帧时域信号进行频域变换以获取多帧频域信号。Perform frequency domain transformation on the multi-frame time-domain signal after the windowing process to obtain the multi-frame frequency-domain signal.
可选地,所述处理器实现根据所述多帧频域信号确定所述目标检测音的声场特征时,用于实现:Optionally, when the processor realizes the determination of the sound field characteristics of the target detection sound according to the multi-frame frequency domain signal, it is used to realize:
根据所述多帧频域信号中每一帧频域信号确定每一帧频域信号对应的多个特征频域幅值;Determining multiple characteristic frequency domain amplitudes corresponding to each frame of frequency domain signal according to each frame of frequency domain signal in the multi-frame frequency domain signal;
对所述多帧频域信号中每一帧频域信号对应的多个特征频域幅值进行融合以获取多个融合特征频域幅值;Fusing multiple characteristic frequency domain amplitude values corresponding to each frame of the frequency domain signal in the multi-frame frequency domain signal to obtain multiple fused characteristic frequency domain amplitude values;
将所述多个融合特征频域幅值确定为所述目标检测音的声场特征。The frequency domain amplitudes of the multiple fusion features are determined as the sound field features of the target detection sound.
可选地,所述处理器实现对所述目标检测音进行特征提取以获取所述目标检测音的声场特征时,用于实现:Optionally, when the processor implements feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound, it is used to achieve:
对所述目标检测音进行采样以获取目标检测音的多帧时域信号;Sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound;
根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征。The sound field characteristic of the target detection sound is determined according to the time domain amplitude of the multi-frame time domain signal.
可选地,所述处理器实现根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征时,用于实现:Optionally, when the processor realizes the determination of the sound field characteristics of the target detection sound according to the time domain amplitude of the multi-frame time domain signal, it is used to realize:
获取多帧时域信号中每一帧时域信号的时域幅值的平均值;Obtain the average value of the time domain amplitude of each frame of the time domain signal in the multi-frame time domain signal;
对所述多帧时域信号的平均值进行融合,将融合之后的结果确定为所述目标检测音的声场特征。The average value of the multi-frame time domain signals is fused, and the result after the fusion is determined as the sound field feature of the target detection sound.
可选地,所述处理器实现根据所述声场特征确定所述电子设备所处的当前环境时,用于实现:Optionally, when the processor implements the determination of the current environment in which the electronic device is located according to the sound field characteristics, it is used to implement:
获取声场特征阈值,其中,所述声场特征阈值是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合中的至少一个确定的;Acquiring a sound field characteristic threshold, where the sound field characteristic threshold is determined according to at least one of the first sound field characteristic set of the underwater environment and the second sound field characteristic set of the water environment;
根据所述声场特征阈值和所述声场特征确定所述电子设备所处的当前环境。The current environment where the electronic device is located is determined according to the sound field characteristic threshold value and the sound field characteristic.
可选地,所述处理器实现获取声场特征阈值时,用于实现:Optionally, when the processor implements the acquisition of the sound field characteristic threshold, it is used to implement:
获取水下环境的第一声场特征集合和水上环境的第二声场特征集合;Acquiring the first sound field feature set of the underwater environment and the second sound field feature set of the water environment;
计算所述第一声场特征集合的第一均值和第一标准差,并计算第二声场特征集合的第二均值和第二标准差;Calculating the first mean value and the first standard deviation of the first sound field feature set, and calculating the second mean value and the second standard deviation of the second sound field feature set;
根据所述第一均值、第一标准差、第二均值和第二标准差,确定声场特征阈值。According to the first mean value, the first standard deviation, the second mean value, and the second standard deviation, the sound field characteristic threshold is determined.
可选地,所述处理器实现根据所述声场特征阈值和所述声场特征确定所述电子设备所处的当前环境时,用于实现:Optionally, when the processor realizes the determination of the current environment in which the electronic device is located according to the sound field characteristic threshold and the sound field characteristic, the processor is configured to realize:
若所述声场特征大于所述声场特征阈值,则确定所述电子设备所处的当前环境为水下环境;If the sound field characteristic is greater than the sound field characteristic threshold, determining that the current environment in which the electronic device is located is an underwater environment;
若所述声场特征小于或等于所述声场特征阈值,则确定所述电子设备所处的当前环境为水上环境。If the sound field characteristic is less than or equal to the sound field characteristic threshold, it is determined that the current environment in which the electronic device is located is a water environment.
可选地,所述处理器实现根据所述声场特征确定所述电子设备所处的当前环境时,用于实现:Optionally, when the processor implements the determination of the current environment in which the electronic device is located according to the sound field characteristics, it is used to implement:
将所述声场特征输入至预设的环境判别模型以获取预设的环境判别模型输出的环境类型标签;Input the sound field characteristics into a preset environment discrimination model to obtain an environment type label output by the preset environment discrimination model;
根据所述环境类型标签确定所述电子设备所处的当前环境。The current environment in which the electronic device is located is determined according to the environment type label.
可选地,所述预设的环境判别模型是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合优化得到的。Optionally, the preset environment discrimination model is optimized based on the first sound field feature set of the underwater environment and the second sound field feature set of the water environment.
可选地,所述电子设备包括拍摄装置;所述处理器实现还用于实现:Optionally, the electronic equipment includes a photographing device; the processor implementation is also used to implement:
当确定所述拍摄装置处于水下环境时,调节所述拍摄装置的成像参数。When it is determined that the photographing device is in an underwater environment, the imaging parameters of the photographing device are adjusted.
可选地,所述发声器包括扬声器、蜂鸣器或电机,所述声音接收器包括麦克风。Optionally, the sound generator includes a speaker, a buzzer or a motor, and the sound receiver includes a microphone.
可选地,所述声场特征包括时域幅值和频域幅值中的至少一种。Optionally, the sound field characteristics include at least one of a time domain amplitude and a frequency domain amplitude.
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的电子设备的具体工作过程,可以参考前述环境检测方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the electronic device described above can refer to the corresponding process in the foregoing environmental detection method embodiment, which will not be repeated here. Go into details.
本申请的实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现上述实施例提供的环境检测方法的步骤。The embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the processor executes the program instructions to implement the foregoing implementation The steps of the environmental detection method provided in the example.
其中,所述计算机可读存储介质可以是前述任一实施例所述的电子设备的 内部存储单元,例如所述电子设备的硬盘或内存。所述计算机可读存储介质也可以是所述电子设备的外部存储设备,例如所述电子设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。Wherein, the computer-readable storage medium may be the internal storage unit of the electronic device described in any of the foregoing embodiments, such as the hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital, SD) ) Card, Flash Card, etc.
应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification of this application and the appended claims, unless the context clearly indicates other circumstances, the singular forms "a", "an" and "the" are intended to include plural forms.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification of this application and the appended claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (31)

  1. 一种环境检测方法,其特征在于,包括:An environment detection method, characterized in that it comprises:
    通过电子设备的发声器发出环境检测音,并通过所述电子设备的声音接收器采集所述环境检测音以获取采集到的目标检测音;Emit the environment detection sound through the sound generator of the electronic device, and collect the environment detection sound through the sound receiver of the electronic device to obtain the collected target detection sound;
    对所述目标检测音进行特征提取以获取所述目标检测音的声场特征;Performing feature extraction on the target detection sound to obtain sound field characteristics of the target detection sound;
    根据所述声场特征确定所述电子设备所处的当前环境,其中,所述当前环境包括水上环境和水下环境。The current environment in which the electronic device is located is determined according to the sound field characteristics, where the current environment includes an aquatic environment and an underwater environment.
  2. 根据权利要求1所述的环境检测方法,其特征在于,所述对所述目标检测音进行特征提取以获取所述目标检测音的声场特征,包括:The environment detection method according to claim 1, wherein the feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound comprises:
    对所述目标检测音进行校正处理,以使得经过校正处理后的目标检测音与所述环境检测音时间同步;Performing correction processing on the target detection sound, so that the target detection sound after the correction processing is synchronized with the environment detection sound;
    对所述校正处理后的目标检测音进行特征提取,得到所述目标检测音的声场特征。Perform feature extraction on the target detection sound after the correction process to obtain the sound field characteristics of the target detection sound.
  3. 根据权利要求1或2所述的环境检测方法,其特征在于,所述对所述目标检测音进行特征提取以获取所述目标检测音的声场特征,包括:The environment detection method according to claim 1 or 2, wherein the feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound comprises:
    对所述目标检测音进行采样以获取目标检测音的多帧时域信号;Sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound;
    对所述多帧时域信号进行频域变换以获取多帧频域信号;Performing frequency domain transformation on the multi-frame time domain signal to obtain a multi-frame frequency domain signal;
    根据所述多帧频域信号确定所述目标检测音的声场特征。The sound field characteristic of the target detection sound is determined according to the multi-frame frequency domain signal.
  4. 根据权利要求3所述的环境检测方法,其特征在于,所述对所述多帧时域信号进行频域变换以获取多帧频域信号,包括:The environment detection method according to claim 3, wherein the performing frequency domain transformation on the multi-frame time domain signal to obtain the multi-frame frequency domain signal comprises:
    根据预设的窗函数对所述多帧时域信号进行加窗处理;Performing windowing processing on the multi-frame time domain signal according to a preset window function;
    对所述加窗处理之后的多帧时域信号进行频域变换以获取多帧频域信号。Perform frequency domain transformation on the multi-frame time-domain signal after the windowing process to obtain the multi-frame frequency-domain signal.
  5. 根据权利要求3或4所述的环境检测方法,其特征在于,所述根据所述多帧频域信号确定所述目标检测音的声场特征,包括:The environment detection method according to claim 3 or 4, wherein the determining the sound field characteristics of the target detection sound according to the multi-frame frequency domain signal comprises:
    根据所述多帧频域信号中每一帧频域信号确定每一帧频域信号对应的多个特征频域幅值;Determining multiple characteristic frequency domain amplitudes corresponding to each frame of frequency domain signal according to each frame of frequency domain signal in the multi-frame frequency domain signal;
    对所述多帧频域信号中每一帧频域信号对应的多个特征频域幅值进行融合以获取多个融合特征频域幅值;Fusing multiple characteristic frequency domain amplitude values corresponding to each frame of the frequency domain signal in the multi-frame frequency domain signal to obtain multiple fused characteristic frequency domain amplitude values;
    将所述多个融合特征频域幅值确定为所述目标检测音的声场特征。The frequency domain amplitudes of the multiple fusion features are determined as the sound field features of the target detection sound.
  6. 根据权利要求1至5中任一项所述的环境检测方法,其特征在于,所述 对所述目标检测音进行特征提取以获取所述目标检测音的声场特征,包括:The environment detection method according to any one of claims 1 to 5, wherein the feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound comprises:
    对所述目标检测音进行采样以获取目标检测音的多帧时域信号;Sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound;
    根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征。The sound field characteristic of the target detection sound is determined according to the time domain amplitude of the multi-frame time domain signal.
  7. 根据权利要求6所述的环境检测方法,其特征在于,所述根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征,包括:The environment detection method according to claim 6, wherein the determining the sound field characteristics of the target detection sound according to the time domain amplitude of the multi-frame time domain signal comprises:
    获取多帧时域信号中每一帧时域信号的时域幅值的平均值;Obtain the average value of the time domain amplitude of each frame of the time domain signal in the multi-frame time domain signal;
    对所述多帧时域信号的平均值进行融合,将融合之后的结果确定为所述目标检测音的声场特征。The average value of the multi-frame time domain signals is fused, and the result after the fusion is determined as the sound field feature of the target detection sound.
  8. 根据权利要求1至7中任一项所述的环境检测方法,其特征在于,所述根据所述声场特征确定所述电子设备所处的当前环境,包括:The environment detection method according to any one of claims 1 to 7, wherein the determining the current environment in which the electronic device is located according to the characteristics of the sound field comprises:
    获取声场特征阈值,其中,所述声场特征阈值是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合中的至少一个确定的;Acquiring a sound field characteristic threshold, where the sound field characteristic threshold is determined according to at least one of the first sound field characteristic set of the underwater environment and the second sound field characteristic set of the water environment;
    根据所述声场特征阈值和所述声场特征确定所述电子设备所处的当前环境。The current environment where the electronic device is located is determined according to the sound field characteristic threshold value and the sound field characteristic.
  9. 根据权利要求8所述的环境检测方法,其特征在于,所述获取声场特征阈值,包括:The environment detection method according to claim 8, wherein said acquiring a threshold value of a sound field feature comprises:
    获取水下环境的第一声场特征集合和水上环境的第二声场特征集合;Acquiring the first sound field feature set of the underwater environment and the second sound field feature set of the water environment;
    计算所述第一声场特征集合的第一均值和第一标准差,并计算第二声场特征集合的第二均值和第二标准差;Calculating the first mean value and the first standard deviation of the first sound field feature set, and calculating the second mean value and the second standard deviation of the second sound field feature set;
    根据所述第一均值、第一标准差、第二均值和第二标准差,确定声场特征阈值。According to the first mean value, the first standard deviation, the second mean value, and the second standard deviation, the sound field characteristic threshold is determined.
  10. 根据权利要求8或9所述的环境检测方法,其特征在于,所述根据所述声场特征阈值和所述声场特征确定所述电子设备所处的当前环境,包括:The environment detection method according to claim 8 or 9, wherein the determining the current environment in which the electronic device is located according to the sound field characteristic threshold and the sound field characteristic comprises:
    若所述声场特征大于所述声场特征阈值,则确定所述电子设备所处的当前环境为水下环境;If the sound field characteristic is greater than the sound field characteristic threshold, determining that the current environment in which the electronic device is located is an underwater environment;
    若所述声场特征小于或等于所述声场特征阈值,则确定所述电子设备所处的当前环境为水上环境。If the sound field characteristic is less than or equal to the sound field characteristic threshold, it is determined that the current environment in which the electronic device is located is a water environment.
  11. 根据权利要求1至10中任一项所述的环境检测方法,其特征在于,所述根据所述声场特征确定所述电子设备所处的当前环境,包括:The environment detection method according to any one of claims 1 to 10, wherein the determining the current environment in which the electronic device is located according to the characteristics of the sound field comprises:
    将所述声场特征输入至预设的环境判别模型以获取预设的环境判别模型输出的环境类型标签;Input the sound field characteristics into a preset environment discrimination model to obtain an environment type label output by the preset environment discrimination model;
    根据所述环境类型标签确定所述电子设备所处的当前环境。The current environment in which the electronic device is located is determined according to the environment type label.
  12. 根据权利要求11所述的环境检测方法,其特征在于,所述预设的环境 判别模型是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合优化得到的。The environment detection method according to claim 11, wherein the preset environment discrimination model is optimized based on the first sound field feature set of the underwater environment and the second sound field feature set of the water environment.
  13. 根据权利要求1至12中任一项所述的环境检测方法,其特征在于,所述电子设备包括拍摄装置;所述方法还包括:The environment detection method according to any one of claims 1 to 12, wherein the electronic equipment comprises a photographing device; the method further comprises:
    当确定所述拍摄装置处于水下环境时,调节所述拍摄装置的成像参数。When it is determined that the photographing device is in an underwater environment, the imaging parameters of the photographing device are adjusted.
  14. 根据权利要求1或13所述的环境检测方法,其特征在于,所述发声器包括扬声器、蜂鸣器或电机,所述声音接收器包括麦克风。The environment detection method according to claim 1 or 13, wherein the sound generator comprises a speaker, a buzzer or a motor, and the sound receiver comprises a microphone.
  15. 根据权利要求1或13所述的环境检测方法,其特征在于,所述声场特征包括时域幅值和频域幅值中的至少一种。The environment detection method according to claim 1 or 13, wherein the sound field characteristics include at least one of a time domain amplitude and a frequency domain amplitude.
  16. 一种电子设备,其特征在于,所述电子设备包括发声器、声音接收器和处理器;An electronic device, characterized in that the electronic device includes a sound generator, a sound receiver, and a processor;
    所述发声器,用于发出环境检测音;The sound generator is used to emit environmental detection sounds;
    所述声音接收器,用于采集所述环境检测音以获取采集到的目标检测音;The sound receiver is configured to collect the environmental detection sound to obtain the collected target detection sound;
    所述处理器用于实现如下步骤:The processor is used to implement the following steps:
    对所述目标检测音进行特征提取以获取所述目标检测音的声场特征;Performing feature extraction on the target detection sound to obtain sound field characteristics of the target detection sound;
    根据所述声场特征确定所述电子设备所处的当前环境,其中,所述当前环境包括水上环境和水下环境。The current environment in which the electronic device is located is determined according to the sound field characteristics, where the current environment includes an aquatic environment and an underwater environment.
  17. 根据权利要求16所述的电子设备,其特征在于,所述处理器实现对所述目标检测音进行特征提取以获取所述目标检测音的声场特征时,用于实现:The electronic device according to claim 16, wherein when the processor implements feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound, it is used to achieve:
    对所述目标检测音进行校正处理,以使得经过校正处理后的目标检测音与所述环境检测音时间同步;Performing correction processing on the target detection sound, so that the target detection sound after the correction processing is synchronized with the environment detection sound;
    对所述校正处理后的目标检测音进行特征提取,得到所述目标检测音的声场特征。Perform feature extraction on the target detection sound after the correction process to obtain the sound field characteristics of the target detection sound.
  18. 根据权利要求16或17所述的电子设备,其特征在于,所述处理器实现对所述目标检测音进行特征提取以获取所述目标检测音的声场特征时,用于实现:The electronic device according to claim 16 or 17, wherein when the processor implements feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound, it is used to achieve:
    对所述目标检测音进行采样以获取目标检测音的多帧时域信号;Sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound;
    对所述多帧时域信号进行频域变换以获取多帧频域信号;Performing frequency domain transformation on the multi-frame time domain signal to obtain a multi-frame frequency domain signal;
    根据所述多帧频域信号确定所述目标检测音的声场特征。The sound field characteristic of the target detection sound is determined according to the multi-frame frequency domain signal.
  19. 根据权利要求18所述的电子设备,其特征在于,所述处理器实现对所述多帧时域信号进行频域变换以获取多帧频域信号时,用于实现:The electronic device according to claim 18, wherein when the processor implements frequency domain transformation on the multi-frame time-domain signal to obtain a multi-frame frequency-domain signal, it is used to implement:
    根据预设的窗函数对所述多帧时域信号进行加窗处理;Performing windowing processing on the multi-frame time domain signal according to a preset window function;
    对所述加窗处理之后的多帧时域信号进行频域变换以获取多帧频域信号。Perform frequency domain transformation on the multi-frame time-domain signal after the windowing process to obtain the multi-frame frequency-domain signal.
  20. 根据权利要求18或19所述的电子设备,其特征在于,所述处理器实现根据所述多帧频域信号确定所述目标检测音的声场特征时,用于实现:The electronic device according to claim 18 or 19, wherein when the processor realizes the determination of the sound field characteristics of the target detection sound according to the multi-frame frequency domain signal, it is used to realize:
    根据所述多帧频域信号中每一帧频域信号确定每一帧频域信号对应的多个特征频域幅值;Determining multiple characteristic frequency domain amplitudes corresponding to each frame of frequency domain signal according to each frame of frequency domain signal in the multi-frame frequency domain signal;
    对所述多帧频域信号中每一帧频域信号对应的多个特征频域幅值进行融合以获取多个融合特征频域幅值;Fusing multiple characteristic frequency domain amplitude values corresponding to each frame of the frequency domain signal in the multi-frame frequency domain signal to obtain multiple fused characteristic frequency domain amplitude values;
    将所述多个融合特征频域幅值确定为所述目标检测音的声场特征。The frequency domain amplitudes of the multiple fusion features are determined as the sound field features of the target detection sound.
  21. 根据权利要求16至20中任一项所述的电子设备,其特征在于,所述处理器实现对所述目标检测音进行特征提取以获取所述目标检测音的声场特征时,用于实现:The electronic device according to any one of claims 16 to 20, wherein when the processor implements feature extraction of the target detection sound to obtain the sound field characteristics of the target detection sound, it is used to achieve:
    对所述目标检测音进行采样以获取目标检测音的多帧时域信号;Sampling the target detection sound to obtain a multi-frame time domain signal of the target detection sound;
    根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征。The sound field characteristic of the target detection sound is determined according to the time domain amplitude of the multi-frame time domain signal.
  22. 根据权利要求21所述的电子设备,其特征在于,所述处理器实现根据所述多帧时域信号的时域幅值确定所述目标检测音的声场特征时,用于实现:22. The electronic device according to claim 21, wherein when the processor realizes the determination of the sound field characteristic of the target detection sound according to the time domain amplitude of the multi-frame time domain signal, it is used to realize:
    获取多帧时域信号中每一帧时域信号的时域幅值的平均值;Obtain the average value of the time domain amplitude of each frame of the time domain signal in the multi-frame time domain signal;
    对所述多帧时域信号的平均值进行融合,将融合之后的结果确定为所述目标检测音的声场特征。The average value of the multi-frame time domain signals is fused, and the result after the fusion is determined as the sound field feature of the target detection sound.
  23. 根据权利要求16至22中任一项所述的电子设备,其特征在于,所述处理器实现根据所述声场特征确定所述电子设备所处的当前环境时,用于实现:The electronic device according to any one of claims 16 to 22, wherein, when the processor realizes the determination of the current environment in which the electronic device is located according to the characteristics of the sound field, it is configured to realize:
    获取声场特征阈值,其中,所述声场特征阈值是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合中的至少一个确定的;Acquiring a sound field characteristic threshold, where the sound field characteristic threshold is determined according to at least one of the first sound field characteristic set of the underwater environment and the second sound field characteristic set of the water environment;
    根据所述声场特征阈值和所述声场特征确定所述电子设备所处的当前环境。The current environment where the electronic device is located is determined according to the sound field characteristic threshold value and the sound field characteristic.
  24. 根据权利要求23所述的电子设备,其特征在于,所述处理器实现获取声场特征阈值时,用于实现:The electronic device according to claim 23, wherein when the processor implements the acquisition of the sound field characteristic threshold, it is used to implement:
    获取水下环境的第一声场特征集合和水上环境的第二声场特征集合;Acquiring the first sound field feature set of the underwater environment and the second sound field feature set of the water environment;
    计算所述第一声场特征集合的第一均值和第一标准差,并计算第二声场特征集合的第二均值和第二标准差;Calculating the first mean value and the first standard deviation of the first sound field feature set, and calculating the second mean value and the second standard deviation of the second sound field feature set;
    根据所述第一均值、第一标准差、第二均值和第二标准差,确定声场特征阈值。According to the first mean value, the first standard deviation, the second mean value, and the second standard deviation, the sound field characteristic threshold is determined.
  25. 根据权利要求23或24所述的电子设备,其特征在于,所述处理器实现根据所述声场特征阈值和所述声场特征确定所述电子设备所处的当前环境时, 用于实现:The electronic device according to claim 23 or 24, wherein when the processor realizes the determination of the current environment in which the electronic device is located according to the sound field characteristic threshold and the sound field characteristic, the processor is configured to realize:
    若所述声场特征大于所述声场特征阈值,则确定所述电子设备所处的当前环境为水下环境;If the sound field characteristic is greater than the sound field characteristic threshold, determining that the current environment in which the electronic device is located is an underwater environment;
    若所述声场特征小于或等于所述声场特征阈值,则确定所述电子设备所处的当前环境为水上环境。If the sound field characteristic is less than or equal to the sound field characteristic threshold, it is determined that the current environment in which the electronic device is located is a water environment.
  26. 根据权利要求16至25任一项所述的电子设备,其特征在于,所述处理器实现根据所述声场特征确定所述电子设备所处的当前环境时,用于实现:The electronic device according to any one of claims 16 to 25, wherein when the processor realizes the determination of the current environment in which the electronic device is located according to the characteristics of the sound field, it is configured to realize:
    将所述声场特征输入至预设的环境判别模型以获取预设的环境判别模型输出的环境类型标签;Input the sound field characteristics into a preset environment discrimination model to obtain an environment type label output by the preset environment discrimination model;
    根据所述环境类型标签确定所述电子设备所处的当前环境。The current environment in which the electronic device is located is determined according to the environment type label.
  27. 根据权利要求26所述的电子设备,其特征在于,所述预设的环境判别模型是根据水下环境的第一声场特征集合和水上环境的第二声场特征集合优化得到的。The electronic device according to claim 26, wherein the preset environment discrimination model is optimized based on the first sound field feature set of the underwater environment and the second sound field feature set of the water environment.
  28. 根据权利要求16至27中任一项所述的电子设备,其特征在于,所述电子设备包括拍摄装置;所述处理器实现还用于实现:The electronic device according to any one of claims 16 to 27, wherein the electronic device comprises a photographing device; and the processor implementation is also used to implement:
    当确定所述拍摄装置处于水下环境时,调节所述拍摄装置的成像参数。When it is determined that the photographing device is in an underwater environment, the imaging parameters of the photographing device are adjusted.
  29. 根据权利要求16或28所述的电子设备,其特征在于,所述发声器包括扬声器、蜂鸣器或电机,所述声音接收器包括麦克风。The electronic device according to claim 16 or 28, wherein the sound generator comprises a speaker, a buzzer or a motor, and the sound receiver comprises a microphone.
  30. 根据权利要求16或28所述的电子设备,其特征在于,所述声场特征包括时域幅值和频域幅值中的至少一种。The electronic device according to claim 16 or 28, wherein the sound field characteristic comprises at least one of a time domain amplitude and a frequency domain amplitude.
  31. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如权利要求1至15中任一项所述的环境检测方法。A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes as described in any one of claims 1 to 15 The environmental detection method described.
PCT/CN2019/122170 2019-11-29 2019-11-29 Environment detection method, electronic device and computer-readable storage medium WO2021102993A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/122170 WO2021102993A1 (en) 2019-11-29 2019-11-29 Environment detection method, electronic device and computer-readable storage medium
CN201980059247.1A CN112868061A (en) 2019-11-29 2019-11-29 Environment detection method, electronic device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/122170 WO2021102993A1 (en) 2019-11-29 2019-11-29 Environment detection method, electronic device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2021102993A1 true WO2021102993A1 (en) 2021-06-03

Family

ID=75995574

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/122170 WO2021102993A1 (en) 2019-11-29 2019-11-29 Environment detection method, electronic device and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN112868061A (en)
WO (1) WO2021102993A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135619A (en) * 2010-12-06 2011-07-27 王茂森 Biosonar sounding device and method
CN104808209A (en) * 2015-05-13 2015-07-29 集怡嘉数码科技(深圳)有限公司 Method and device for detecting obstacle
CN105738908A (en) * 2016-01-29 2016-07-06 宇龙计算机通信科技(深圳)有限公司 Anti-collision early warning method, anti-collision early warning device, and earphone
CN108919277A (en) * 2018-07-02 2018-11-30 深圳米唐科技有限公司 Indoor and outdoor surroundings recognition methods, system and storage medium based on sub- ultrasonic wave

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103065631B (en) * 2013-01-24 2015-07-29 华为终端有限公司 A kind of method of speech recognition, device
CN107820037B (en) * 2016-09-14 2021-03-26 中兴通讯股份有限公司 Audio signal, image processing method, device and system
CN107144341A (en) * 2017-04-28 2017-09-08 珠海格力电器股份有限公司 Environment control method, device and the air-conditioning with the device
CN109655835A (en) * 2018-10-15 2019-04-19 浙江天地人科技有限公司 A kind of detection method and device of channel environment variation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135619A (en) * 2010-12-06 2011-07-27 王茂森 Biosonar sounding device and method
CN104808209A (en) * 2015-05-13 2015-07-29 集怡嘉数码科技(深圳)有限公司 Method and device for detecting obstacle
CN105738908A (en) * 2016-01-29 2016-07-06 宇龙计算机通信科技(深圳)有限公司 Anti-collision early warning method, anti-collision early warning device, and earphone
CN108919277A (en) * 2018-07-02 2018-11-30 深圳米唐科技有限公司 Indoor and outdoor surroundings recognition methods, system and storage medium based on sub- ultrasonic wave

Also Published As

Publication number Publication date
CN112868061A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
WO2020108614A1 (en) Audio recognition method, and target audio positioning method, apparatus and device
US10602267B2 (en) Sound signal processing apparatus and method for enhancing a sound signal
CN110970057B (en) Sound processing method, device and equipment
WO2018077109A1 (en) Sound processing method and device
US11941968B2 (en) Systems and methods for identifying an acoustic source based on observed sound
WO2021017950A1 (en) Ultrasonic processing method and apparatus, electronic device and computer-readable medium
WO2018228060A1 (en) Sound processing method and device
WO2014161309A1 (en) Method and apparatus for mobile terminal to implement voice source tracking
US10602270B1 (en) Similarity measure assisted adaptation control
KR102387025B1 (en) Audio signal processing method, device, terminal and storage medium
CN113192527A (en) Method, apparatus, electronic device and storage medium for cancelling echo
CN112309417B (en) Method, device, system and readable medium for processing audio signal with wind noise suppression
US20140341386A1 (en) Noise reduction
CN104683696A (en) Method for realizing fast and accurate self-snapshooting of camera based on ultrasonic measurement
CN112233689B (en) Audio noise reduction method, device, equipment and medium
WO2020020375A1 (en) Voice processing method and apparatus, electronic device, and readable storage medium
WO2022121182A1 (en) Voice activity detection method and apparatus, and device and computer-readable storage medium
US8924206B2 (en) Electrical apparatus and voice signals receiving method thereof
US11430460B2 (en) Method and device for processing audio signal, and storage medium
WO2024051521A1 (en) Audio signal processing method and apparatus, electronic device and readable storage medium
WO2024041512A1 (en) Audio noise reduction method and apparatus, and electronic device and readable storage medium
WO2021102993A1 (en) Environment detection method, electronic device and computer-readable storage medium
CN112201267A (en) Audio processing method and device, electronic equipment and storage medium
CN105208283A (en) Soundsnap method and device
CN116405774A (en) Video processing method and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19954547

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19954547

Country of ref document: EP

Kind code of ref document: A1