WO2023093333A1 - 振动信号生成方法、装置、电子设备及存储介质 - Google Patents
振动信号生成方法、装置、电子设备及存储介质 Download PDFInfo
- Publication number
- WO2023093333A1 WO2023093333A1 PCT/CN2022/124491 CN2022124491W WO2023093333A1 WO 2023093333 A1 WO2023093333 A1 WO 2023093333A1 CN 2022124491 W CN2022124491 W CN 2022124491W WO 2023093333 A1 WO2023093333 A1 WO 2023093333A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- audio
- time period
- energy
- average energy
- relative
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/16—Sound input; Sound output
Definitions
- the present application relates to the technical field of vibration driving, and specifically relates to a vibration signal generation method, device, electronic equipment, and storage medium.
- Linear Resonant Actuator is a transmission device that directly converts electrical energy into linear motion mechanical energy without any intermediate conversion mechanism. It is usually driven by alternating current, and the energized coil is subjected to ampere force in a magnetic field to drive the motor. vibration.
- linear motors have been widely used in various vibration occasions of consumer electronics, especially games and AR/VR products, due to their advantages of strong vibration, richness, crispness, and low energy consumption.
- developers In order to enhance the user experience of games and AR/VR products, developers usually convert the input audio and other signals to generate the vibration driving signal of the linear motor, and drive the linear motor to generate vibration, so as to match the input audio Vibration feedback, that is, to achieve sound-vibration synchronous output, so as to bring users a dual experience of auditory and tactile interweaving, and enhance the richness and playability of game interaction.
- the present application proposes a vibration signal generation method, device, electronic equipment and storage medium, which can detect rhythm in real time and generate vibration signals synchronously.
- the embodiment of the first aspect of the present application proposes a vibration signal generation method, including:
- the first time period is smaller than the second time period
- a preset vibration signal is generated according to a preset rule.
- the end time of the first time period and the second time period are the same.
- detecting the average energy of the first audio in the first time period before the current moment includes:
- Detecting the average energy of the second audio in the second time period before the current moment including:
- determining the relative increment of audio energy in the first time period relative to the second time period includes:
- the preset vibration signal is generated according to preset rules, including:
- Vibration signals with different amplitudes are generated according to the relative increment of the audio energy.
- the preset threshold is greater than or equal to 1.
- the duration of the first time period is two to three times the duration of the second time period.
- the embodiment of the second aspect of the present application provides a vibration signal generation device, including:
- the acquisition module is used to acquire audio data
- a detection module configured to detect the average energy of the first audio in the first time period before the current moment, and the average energy of the second audio in the second time period; the first time period is smaller than the second time period;
- a determining module configured to determine a relative increment of audio energy in the first time period relative to the second time period according to the first audio average energy and the second audio average energy;
- a generating module configured to generate a preset vibration signal according to a preset rule if the relative audio energy increment is greater than or equal to a preset threshold.
- the embodiment of the third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor runs the computer program to Implement the method as described in the first aspect. .
- the embodiment of the fourth aspect of the present application provides a computer-readable storage medium, on which a computer program is stored, and the program is executed by a processor to implement the method described in the first aspect.
- the vibration signal generation method utilizes the characteristic that the average energy of the audio frequency changes more slowly in a longer period of time than the average energy in a shorter period of time, and through the first time period of different lengths and the audio average energy detection in the second time period, two audio average energies with different amplitude change speeds can be obtained, and by calculating the relative increment of audio energy in the first time period and the second time period, detect the audio frequency in a short period of time Whether there is an approximate step change in the ratio of the average energy to the average energy in a long period of time, through the detection of this step pulse, the audio rhythm detection in the case of random input of the audio amplitude can be realized, and when the rhythm is generated Generate preset vibration waveforms, realize real-time conversion of audio signals to vibration signals, and output vibration feedback consistent with the audio rhythm. Moreover, this method does not require any preprocessing, and the audio-vibration conversion process is performed in real time, so online vibration waveform generation can be realized, which is suitable for games or work scenarios
- FIG. 1 shows a schematic flow diagram of a method for generating a vibration signal provided in an embodiment of the present application
- FIG. 2 shows a schematic diagram of a vibration signal generation method provided by an embodiment of the present application
- Fig. 3 shows a schematic flow diagram of the calculation process of audio average energy in the embodiment of the present application
- FIG. 4 shows a schematic diagram of the audio data of gunshots with large differences in the amplitude of 6 sounds in a game collected in the embodiment of the present application;
- FIG. 5 shows a schematic diagram of the audio average energy in the first time period obtained by using the vibration signal generation method provided by this embodiment
- Fig. 6 shows a schematic diagram of the audio average energy in the second time period obtained by using the vibration signal generation method provided by this embodiment
- Figure 7 shows a schematic diagram of the relative increment of audio energy relative to the audio average energy in the first time period obtained by using the vibration signal generation method provided in this embodiment relative to the audio average energy in the second time period (the upper limit of the figure is 10);
- FIG. 8 shows a schematic diagram of a vibration signal obtained by performing real-time conversion processing on the audio data in FIG. 4 by using the vibration signal generation method provided in this embodiment
- FIG. 9 shows a schematic structural diagram of a vibration signal generating device provided by an embodiment of the present application.
- FIG. 10 shows a schematic diagram of an electronic device provided by an embodiment of the present application.
- Fig. 11 shows a schematic diagram of a computer-readable storage medium provided by an embodiment of the present application.
- This embodiment studies and analyzes the existing sound-vibration conversion technology, and finds that: 1) a real-time sound-vibration conversion processing method can be realized, for example, the energy of the input audio is detected, and then the detected energy and the set If the threshold is greater than the set threshold, a preset vibration waveform will be inserted. Although this method can realize real-time sound-to-vibration conversion processing, it is difficult to detect all vibrations with a fixed threshold because the amplitude of the input audio is random. Rhythm.
- This method is an offline processing scheme, that is, the implementation process needs to input the overall audio information first, and then process it to generate a corresponding overall tactile vibration file, and then the audio file and the tactile vibration file can be played synchronously to generate a matching Sound-vibration synchronization experience.
- the audio signal is generated in real time with the player's operation, and the complete information cannot be predicted in advance and converted into a vibration file in advance. Therefore, the above offline processing method cannot be applied to games and other scenes that require real-time audio-to-vibration conversion.
- the embodiment of the present application proposes a vibration signal generation method, which can be realized by a vibration signal generation device, and can be specifically formed in an electronic device that requires real-time audio-vibration conversion (such as games such as VR/AR or On the working equipment), it can detect the audio energy in two time periods with different durations before the current time according to the audio data collected at the current time and before, and judge whether there is a rhythm according to the relative increment of the audio energy in the two time periods, And insert the preset vibration signal when the rhythm is generated, so that the real-time online conversion of audio signal to vibration signal can be realized, and the vibration signal matching the audio can be generated, and the real-time conversion sensitivity of audio-vibration can be controlled by controlling the sampling period .
- real-time audio-vibration conversion such as games such as VR/AR or On the working equipment
- the vibration signal generation method may include the following steps:
- Step S1 acquiring audio data.
- the audio data is generated in real time with the operation of the device user (such as a game player), and is closely related to the user's actual operation and the game or work scene. Usually, the overall audio data cannot be predicted in advance.
- the audio data can be collected by radio equipment, converted into audio data that can be digitally transmitted and processed through digital conversion technology, and then transmitted to the vibration signal generating device of this embodiment. That is, the audio data is usually digital information that can be calculated and processed, and the audio data can be obtained in real time during the real-time audio-to-vibration conversion process.
- the acquisition here can be actively acquired from the radio equipment, or passively received from the radio equipment.
- the audio data after the audio data is acquired, in order to improve real-time performance and minimize delay, the audio data does not need to be processed, and subsequent steps can be directly performed. However, in order to obtain more accurate real-time data and facilitate subsequent calculations, the acquired audio data can also be smoothed and filtered first. During specific implementation, those skilled in the art may perform operations according to actual conditions, which is not specifically limited in this embodiment.
- Step S2 detecting the average energy of the first audio in the first time period before the current moment, and the average energy of the second audio in the second time period.
- the first time period is less than the second time period, specifically, the duration of the second time period can be set to 2-3 times the duration of the first time period, so that the audio average energy difference in the two periods is large enough to Useful for rhythm detection.
- Values of the first time period and the second time period may be several milliseconds to tens of milliseconds, which may be set according to actual conditions, which is not specifically limited in this embodiment.
- the first time period t m and the second time period t n may be set, and the first time period t m may be set to 10 ms; the second time period t n may be set to 20 ms.
- the sampling period T s of the audio data can be set, and the audio data in the first time period t m and the second time period t n before the sampling point moment (that is, the current moment in the text) are collected every T s time interval.
- the sampling period T s can be shorter than the first time period t m , preventing the audio data with rhythm from being collected only in the second time period t n which is longer in time, and because of the time buffering of the long period, its audio is averaged The energy is not much different from the average energy of the audio in the short first time period t m , thus resulting in missed detection.
- the value of the sampling period T s can be set according to the actual situation. For example, a shorter period T s can be set to improve the sensitivity of audio-vibration conversion; a longer period T s can also be set, In order to improve the accuracy and processing speed of audio data detection.
- detecting the average energy of the first audio in the first time period before the current moment may specifically include the following processing: calculating the first quantity of the first audio data in the first time period according to the preset sampling period; Calculate the average energy of the first audio in the first time period according to the first audio data and the first quantity.
- detecting the average energy of the second audio in the second time period before the current moment may specifically include the following processing: calculating the second quantity of the second audio data in the second time period according to the preset sampling period; The audio data and the second quantity are used to calculate the average energy of the second audio in the second time period.
- the value representing the audio signal is defined as audio energy, so as to facilitate calculation.
- the audio average energy may be the average of the absolute value of the audio data, or the average of the square of the audio data, which is not specifically limited in this embodiment.
- the audio energy can also be the energy of the audio signal wave (the actual audio signal wave can be determined according to the audio data, and then the energy of the audio signal wave can be calculated), which is not specifically limited in this embodiment.
- the audio average energy P m within the time period t m can be calculated by the following formula (1) or formula (2).
- the audio average energy P n within the time period t n can be calculated by the following formula (3) or formula (4).
- the average energy of the audio is obtained by accumulating and averaging the audio data within a period of time, the detection process is simple, the calculation amount is small, the calculation time is short, and the real-time performance is stronger.
- the end time of the first time period t m and the second time period t n are the same, and both are current sampling times. That is, when recording audio data, each audio data xi in the first time period t m and each audio data x j in the second time period t n ending at the current sampling time t can be recorded separately. In this way, setting the end time of the first time period t m and the second time period t n as the sampling time can ensure that the latest audio data is collected, the rhythm can be detected as early as possible, and the vibration signal is inserted as soon as possible after the rhythm is generated. To further enhance the real-time performance of audio-vibration conversion.
- each audio data x j in t n is x, and the number of audio data in the first time period t m and the second time period t n is updated m as If the current moment t is less than the second time period t n and greater than the first time period t m , record each audio data x i in the first time period t m and each audio data x j in the 0-t time period , and the number n of audio data in the second time period t n is updated as In this way, some invalid calculations in the early stage can be reduced, the calculation speed can be further improved, and the real-time performance of audio-vibration conversion can be enhanced.
- Step S3 according to the first audio average energy and the second audio average energy, determine the relative increment of audio energy in the first time period relative to the second time period.
- the audio average energy in the first time period t m and the second time period t n with different lengths.
- the change of the audio average energy in the longer second time period tn will be slower and slower than the change of the audio average energy in the shorter first time period tm . Therefore, when the audio energy has a sudden change, the audio average energy response in the shorter first time period t m is faster, while the audio average energy response in the longer second time period t n is slower, so that There is an approximate step change in the ratio of the two, so whether the approximate step change occurs can be used as a criterion for detecting whether the rhythm is generated.
- the ratio k P m /P n of the average energy P m of the first audio frequency and the average energy P n of the second audio frequency, and determine whether the ratio k is greater than 1; if so, it indicates that the above-mentioned approximate step may exist Changes may be rhythmic, and the relative increase in audio energy in the first time period relative to the second time period can be determined as the value of the ratio k minus 1, that is, k-1; if not, it means that there is no such approximate step Basically, it can be assumed that there is no rhythm. In order to reduce the amount of calculation, the relative increment of the audio energy of the first time period relative to the second time period can be directly determined as 0.
- Step S4 if the relative increase in audio energy is greater than or equal to a preset threshold, then generate a preset vibration signal according to a preset rule.
- the variation of the above-mentioned approximate step is relative, and is only related to the sudden change ratio k of the audio average energy in the first time period tm relative to the audio frequency average energy in the second time period tn , and is related to The amplitude of the audio itself doesn't matter much. Therefore, by detecting this step pulse, the audio rhythm detection under the condition of random audio amplitude input can be realized. And it can judge whether the above-mentioned approximate step change occurs through the preset threshold of the relative increment of the average energy of the audio. In this way, the random audio amplitude caused by setting the threshold according to the absolute energy of the audio is avoided, and it is impossible to use a fixed threshold for rhythm. A matter of judgment.
- the vibration signal generation device can determine rhythmic generation when the relative increment of audio energy is greater than or equal to the preset threshold, and generate a preset vibration signal (vibration wave) according to the preset rules, so as to realize the real-time conversion of the audio signal to the vibration signal , which in turn can output vibration feedback consistent with the detected audio rhythm.
- a preset vibration signal vibration wave
- the vibration signal generating device does not perform audio-vibration conversion, and then continues to collect audio data at the next sampling moment, continues to judge the rhythm, and when there is A corresponding vibration signal is generated when the rhythm is generated. This reciprocating operation until no audio data is received (such as the end of the game) at this startup.
- the above-mentioned generation of preset vibration signals according to preset rules may include the following process: generating vibration signals of different shapes according to the relative increment of audio energy; generating vibration signals of different amplitudes according to the relative increment of audio energy vibration signal.
- This embodiment can preset the vibration signal according to the specific scene of the game or work, and can compare the relative increment of the audio energy with the historical data, and set vibration signals of different shapes and amplitudes according to the comparison result. If the relative increment of energy differs greatly from the relative increment of audio energy calculated last time, a preset waveform different from that of last time can be generated. You can also set the amplitude of the vibration signal according to the specific value of the relative increment of the audio energy, that is, if the relative increment of the audio energy is large, you can set a vibration signal with a large amplitude; if the relative increment of the audio energy is small, you can set A vibration signal with a small amplitude.
- the vibration signal generating device receives the input audio data, sets the first time period and the second time period, and the second time period is greater than the first time period, and then detects the first time period and the second time period respectively The average energy of the audio in the segment, and calculate the relative increment of the audio energy of the first time period and the second time period, and detect whether the rhythm is generated according to the relative increment of the audio energy, and generate a vibration signal when the rhythm is generated.
- the vibration signal generating device calculates the audio data in the time period according to the specific time period received, and records the audio data in the time period, and then according to the above formula ( 1)-Equation (4) calculates and obtains audio average energy.
- this embodiment selects 6 gunshots with large differences in amplitude in a certain game as audio data, and uses the vibration signal provided by this embodiment.
- Signal Generation Methods Audio-to-vibration conversion experiments were performed. Among them, as shown in FIG. 4 , it is a schematic diagram of audio data collected from 6 gunshots with large amplitude differences in a certain game. As shown in FIG. 5 , it is a schematic diagram of average audio energy in the first time period obtained by using the vibration signal generation method provided in this embodiment. As shown in FIG. 6 , it is a schematic diagram of audio average energy in the second time period obtained by using the vibration signal generation method provided in this embodiment. As shown in FIG.
- FIG. 7 it is a schematic diagram of the relative increase in audio energy of the audio average energy in the first time period relative to the audio average energy in the second time period (the upper limit of the figure is 10).
- FIG. 8 it is a schematic diagram of a vibration signal obtained by performing real-time conversion processing on the above audio data by using the vibration signal generation method provided in this embodiment.
- the vibration signal generation method utilizes the characteristic that the average energy of the audio frequency changes slowly in a longer period of time than the average energy in a shorter period of time.
- the audio average energy detection in the time period can obtain two audio average energy with different amplitude change speeds, and by calculating the relative increment of the audio energy in the first time period and the second time period, the average energy in a short time and the Whether there is an approximate step change in the ratio of the average energy in a long period of time, through the detection of this step pulse, the audio rhythm detection in the case of random input of the audio amplitude can be realized, and a preset is generated when the rhythm is generated
- the vibration waveform realizes real-time conversion of audio signal to vibration signal, and outputs vibration feedback consistent with the audio rhythm.
- this method does not require any preprocessing, and the audio-vibration conversion process is performed in real time, so online vibration waveform generation can be realized, which is suitable for games or work scenarios that require real-time audio-vibration conversion.
- this embodiment also provides a vibration signal generation device, as shown in Figure 9, the device includes:
- the acquisition module is used to acquire audio data
- a detection module configured to detect the average energy of the first audio in the first time period before the current moment, and the average energy of the second audio in the second time period; the first time period is less than the second time period;
- a determining module configured to determine the relative increment of the audio energy of the first time period relative to the second time period according to the first audio average energy and the second audio average energy;
- the generation module is used to generate a preset vibration signal according to a preset rule if the relative increase in audio energy is greater than or equal to a preset threshold.
- the vibration signal generating device provided in this embodiment is based on the same idea as the above vibration signal generating method, and at least can achieve the beneficial effects that can be achieved by the above vibration signal generating method, which will not be repeated here.
- Embodiments of the present application further provide an electronic device to execute the above method for generating a vibration signal.
- FIG. 10 shows a schematic diagram of an electronic device provided by some embodiments of the present application.
- electronic equipment 8 comprises: processor 800, memory 801, bus 802 and communication interface 803, processor 800, communication interface 803 and memory 801 are connected by bus 802;
- processor 800 runs the computer program, it executes the vibration signal generation method provided in any one of the foregoing embodiments of the present application.
- the memory 801 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
- RAM Random Access Memory
- non-volatile memory such as at least one disk memory.
- the communication connection between the device network element and at least one other network element is realized through at least one communication interface 803 (which may be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.
- the bus 802 may be an ISA bus, a PCI bus, or an EISA bus, etc.
- the bus can be divided into address bus, data bus, control bus and so on.
- the memory 801 is used to store the program, and the processor 800 executes the program after receiving the execution instruction.
- the vibration signal generation method disclosed in any implementation mode of the above-mentioned embodiments of the present application can be applied to the processor 800, or the processor 800 accomplish.
- the processor 800 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be implemented by an integrated logic circuit of hardware in the processor 800 or an instruction in the form of software.
- the above-mentioned processor 800 can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
- DSP digital signal processor
- ASIC application-specific integrated circuit
- FPGA off-the-shelf programmable gate array
- Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed.
- a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the like.
- the steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
- the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
- the storage medium is located in the memory 801, and the processor 800 reads the information in the memory 801, and completes the steps of the above method in combination with its hardware.
- the electronic device provided in the embodiment of the present application is based on the same inventive concept as the vibration signal generation method provided in the embodiment of the present application, and has the same beneficial effect as the method adopted, operated or realized.
- the electronic device can also include a power converter and a linear motor (Linear Resonant Actuator) device body.
- the power amplifier can be an amplifier that performs power matching on vibration signals, such as class A, class B, class AB, or class D Class driver, the vibration signal can be an analog signal or a customized digital signal.
- the linear motor device body is used to generate tactile vibration feedback.
- the embodiment of the present application also provides a computer-readable storage medium corresponding to the vibration signal generation method provided in the foregoing embodiment. Please refer to FIG. A program (ie, a program product), when the computer program is run by the processor, it will execute the method for generating a vibration signal provided in any of the aforementioned embodiments.
- examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access Memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media will not be repeated here.
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access Memory
- ROM read-only memory
- EEPROM electrically erasable programmable read-only memory
- flash memory or other optical and magnetic storage media will not be repeated here.
- the computer-readable storage medium provided by the above embodiments of the present application is based on the same inventive concept as the vibration signal generation method provided by the embodiments of the present application, and has the same beneficial effect as the method adopted, run or implemented by the stored application program.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Measurement Of Mechanical Vibrations Or Ultrasonic Waves (AREA)
Abstract
本申请提出一种振动信号生成方法、装置、电子设备及存储介质,该振动信号生成方法,包括:获取音频数据;检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量;第一时间段小于第二时间段;根据第一音频平均能量和第二音频平均能量,确定第一时间段相对于第二时间段的音频能量相对增量;若音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。本申请可以实时进行节奏检测,并同步生成振动信号。
Description
本申请振动驱动技术领域,具体涉及一种振动信号生成方法、装置、电子设备及存储介质。
线性马达(Linear Resonant Actuator,LRA)是一种将电能直接转换成直线运动机械能,而不需要任何中间转换机构的传动装置,通常采用交流电驱动,通电的线圈在磁场中受安培力,从而驱动马达振动。近年来,线性马达凭借其振感强烈、丰富、清脆,能耗低等优点,已经广泛应用于消费电子的各种振动场合,尤其是游戏与AR/VR产品。
为了增强游戏与AR/VR等产品的用户体验,开发者通常会对输入的音频等信号进行转化处理,以生成线性马达的振动驱动信号,并驱动线性马达产生振动,从而实现与输入音频相匹配的振感反馈,即实现音-振同步输出,从而给用户带来听觉和触觉交织的双重体验,提升游戏互动的丰富性和可玩性。
在现有的声音-振动的转化处理中,通常需要对声音的节奏信息进行检测,再结合实际的游戏场景在节奏产生时刻生成预先设置好的振动波形,实现与音频节奏同步的振动输出。若对声音的节奏检测不准确,例如,检测信号延迟,则将给用户产生声音和振动不协调的感觉,导致体验变差。
发明内容
本申请提出一种振动信号生成方法、装置、电子设备及存储介质,可以实时进行节奏检测,并同步生成振动信号。
本申请第一方面实施例提出了一种振动信号生成方法,包括:
获取音频数据;
检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量;所述第一时间段小于所述第二时间段;
根据所述第一音频平均能量和所述第二音频平均能量,确定所述第一时间段 相对于所述第二时间段的音频能量相对增量;
若所述音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。
在本申请一些实施方式中,所述第一时间段和所述第二时间段的结束时刻相同。
在本申请一些实施方式中,检测当前时刻之前第一时间段内的第一音频平均能量,包括:
根据预设的采样周期,计算所述第一时间段内第一音频数据的第一数量;
根据所述第一音频数据和所述第一数量,计算所述第一时间段内的第一音频平均能量;
检测当前时刻之前第二时间段内的第二音频平均能量,包括:
根据预设的采样周期,计算所述第二时间段内第二音频数据的第二数量;
根据所述第二音频数据和所述第二数量,计算所述第二时间段内的第二音频平均能量。
在本申请一些实施方式中,根据所述第一音频平均能量和所述第二音频平均能量,确定所述第一时间段相对于所述第二时间段的音频能量相对增量,包括:
计算所述第一音频平均能量和所述第二音频平均能量的比值,并确定所述比值是否大于1;
若是,则将所述第一时间段相对于所述第二时间段的音频能量相对增量确定为所述比值减1;
若否,则将所述第一时间段相对于所述第二时间段的音频能量相对增量确定为0。
在本申请一些实施方式中,按照预设规则生成预设的振动信号,包括:
根据所述音频能量相对增量的增幅,生成不同形状的振动信号;
根据所述音频能量相对增量的大小,生成不同幅值的振动信号。
在本申请一些实施方式中,所述预设阈值大于或等于1。
在本申请一些实施方式中,所述第一时间段的时长为所述第二时间段的时长的两到三倍。
本申请第二方面的实施例提供了一种振动信号生成装置,包括:
获取模块,用于获取音频数据;
检测模块,用于检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量;所述第一时间段小于所述第二时间段;
确定模块,用于根据所述第一音频平均能量和所述第二音频平均能量,确定所述第一时间段相对于所述第二时间段的音频能量相对增量;
生成模块,用于若所述音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。
本申请第三方面的实施例提供了一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器运行所述计算机程序以实现如第一方面所述的方法。。
本申请第四方面的实施例提供了一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行实现如第一方面所述的方法。
本申请实施例中提供的技术方案,至少具有如下技术效果或优点:
本申请实施例提供的提供的振动信号生成方法,利用音频在较长时间段内的平均能量的变化比在较短时间内的平均能量变化缓慢的特性,通过对长度不等的第一时间段和第二时间段内的音频平均能量检测,可以得到两个幅值变化速度不同的音频平均能量,并通过计算第一时间段和第二时间段的音频能量相对增量,检测短时间内的平均能量与较长时间内的平均能量的比值是否出现近似阶跃的变化,通过对这种阶跃脉冲的检测,即可实现音频幅值随机输入情况下的音频节奏检测,并在节奏产生时生成预先设置的振动波形,实现音频信号到振动信号的实时转化,并输出与音频节奏一致的振动反馈。且该方法无需进行任何预处理,音频-振动转化过程实时进行,因此可实现在线的振动波形生成,适用于需要进行音频-振动实时转化的游戏或工作场景。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了本申请实施例提供的振动信号生成方法的流程示意图;
图2示出了本申请实施例提供的振动信号生成方法的逻辑示意图;
图3示出了本申请实施例中音频平均能量的计算流程示意图;
图4示出了本申请实施例中采集的某游戏中的6声幅值差异较大的枪声音频数据示意图;
图5示出了采用本实施例提供的振动信号生成方法得到的第一时间段内的音频平均能量的示意图;
图6示出了采用本实施例提供的振动信号生成方法得到的第二时间段内的音频平均能量的示意图;
图7示出了采用本实施例提供的振动信号生成方法得到的第一时间段内的音频平均能量相对于第二时间段内的音频平均能量的音频能量相对增量的示意图(该图上限为10);
图8示出了采用本实施例提供的振动信号生成方法对图4中的音频数据进行实时转化处理得到的振动信号的示意图;
图9示出了本申请实施例提供的振动信号生成装置的结构示意图;
图10示出了本申请实施例提供的一种电子设备的示意图;
图11示出了本申请实施例提供的一种计算机可读存储介质的示意图。
下面将参照附图更详细地描述本申请的示例性实施方式。虽然附图中显示了本申请的示例性实施方式,然而应当理解,可以以各种形式实现本申请而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了能够更透彻地理解本申请,并且能够将本申请的范围完整的传达给本领域的技术人员。
需要注意的是,除非另有说明,本申请使用的技术术语或者科学术语应当为本申请所属领域技术人员所理解的通常意义。
下面结合附图来描述根据本申请实施例提出的一种振动信号生成方法、装置、电子设备及存储介质。
本实施例对现有的声音-振动的转化技术进行研究分析,发现:1)能够实现实时的音-振转化处理方法,例如,对输入音频的能量进行检测,再将检测的能量与设定的阈值进行比较,大于设定阈值则插入一个预设的振动波形,该方法虽然可 以实现实时的音-振转化处理,但由于输入音频的幅值随机,难以用一个固定的阈值检测出所有的节奏。2)很多还不能进行实现实时的音-振转化处理方法,例如,申请号为202011326608.5,名称为《振动信号生成方法、振动控制方法及其相关设备》的专利申请文件(CN112466267A),其提出了一种根据音频信号获取触觉波形的方法,首先对音频进行预处理,识别音频中的节拍,再通过节拍获取多个音符的能量,并作归一化预处理,再通过比较归一能量与设定阈值的大小关系来确定是否插入对应的触觉波形。该方法是一种离线处理方案,即实现过程需先输入整体的音频信息,再进行处理,生成与之对应的整体的触觉振动文件,然后才能将音频文件和触觉振动文件同步播放,产生相匹配的音-振同步体验。但是在游戏场景下,音频信号是伴随玩家的操作实时产生的,并不能提前预知完整信息并预先转化为振动文件,因此上述离线处理方法不能适用于游戏等需要实时进行音频-振动转化的场景。
鉴于上述问题,本申请实施例提出了一种振动信号生成方法,该方法可通过振动信号生成装置实现,具体可形成于一需要进行实时音频-振动转化的电子设备(如VR/AR等游戏或工作设备)上,其可根据当前时刻及之前采集的音频数据,检测当前时刻之前两个时长不同的时段内的音频能量,并根据该两个时段的音频能量相对增量判断是否有节奏产生,并在有节奏产生时插入预设的振动信号,从而可以实现音频信号到振动信号的实时在线转化,生成与音频相匹配的振动信号,并且可通过控制采样周期来控制音频-振动的实时转化灵敏度。
如图1所示,本申请实施例提供的振动信号生成方法可以包括以下步骤:
步骤S1,获取音频数据。
该音频数据伴随设备使用者(如游戏玩家)的操作实时产生,与用户的实际操作和游戏或工作场景息息相关,通常情况下无法提前预知整体音频数据。该音频数据可通过收音设备采集,并通过数字转换技术转换成可以进行数字传输和处理的音频数据之后,再传输至本实施例的振动信号生成装置。即,该音频数据通常是能够进行计算和处理的数字信息,在实现音频-振动的实时转化过程中,可实时获取音频数据。这里的获取可以是主动向收音设备获取,也可以是被动从收音设备接收。
需要说明的是,本实施例在获取音频数据后,为了提高实时性,尽量减小延迟,无需对音频数据进行处理,可直接进行后续步骤。但为了得到更准确的实时 数据,也更便于后续计算,也可先对获取的音频数据进行平滑滤波处理。具体实施时本领域技术人员可根据实际情况进行操作,本实施例对此不做具体限定。
步骤S2,检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量。
其中,第一时间段小于第二时间段,具体地,第二时间段的时长可设置为第一时间段时长的2-3倍,以使两个时段内的音频平均能量相差足够大,以有利于进行节奏的检测。第一时间段和第二时间段的取值可以为几毫秒到几十毫秒,具体可根据实际情况进行设定,本实施例对此不作具体限定。
在本实施例一具体实施方式中,可以设置第一时间段t
m和第二时间段t
n,第一时间段t
m可设置为10ms;第二时间段t
n可设置为20ms。可设置音频数据的采样周期T
s,则每间隔T
s时间对采样点时刻(即文中的当前时刻)之前第一时间段t
m和第二时间段t
n内的音频数据进行采集。通常采样周期T
s可以小于第一时间段t
m,防止仅在时间较长的第二时间段t
n内采集到带有节奏的音频数据,而由于长时间段的时间缓冲,使其音频平均能量与时间较短的第一时间段t
m内的音频平均能量相差不大,从而导致漏检的情况产生。具体地,采样周期T
s取值可根据实际情况具体设定,例如,可设置时间较的短周期T
s,以提高音频-振动转化的灵敏性;也可以设置时间较长的周期T
s,以提高音频数据检测的准确性和处理速度。
在一实施方式中,检测当前时刻之前第一时间段内的第一音频平均能量,具体可以包括以下处理:根据预设的采样周期,计算第一时间段内第一音频数据的第一数量;根据第一音频数据和第一数量,计算第一时间段内的第一音频平均能量。同理,检测当前时刻之前第二时间段内的第二音频平均能量,具体可以包括以下处理:根据预设的采样周期,计算第二时间段内第二音频数据的第二数量;根据第二音频数据和第二数量,计算第二时间段内的第二音频平均能量。
本实施例定义表征音频信号的数值为音频能量,以便于进行计算。则音频平均能量可以是音频数据绝对值的平均值,也可以是音频数据平方的平均值,本实施例对此不做具体限定。另外,音频能量也可以为音频信号波的能量(可根据音 频数据确定实际的音频信号波,然后再计算音频信号波的能量),本实施例对此不作具体限定。
第一时间段t
m内的音频平均能量可记为P
m,根据音频采样周期T
s,计算第一时间段t
m内的音频数据个数
然后记录当前采样时刻t之前的第一时间段t
m内的每个音频数据x
i,i=1~m。可通过下面公式(1)或公式(2)计算时间段t
m内的音频平均能量P
m。
同理,第二时间段t
n内的音频平均能量可记为P
n,根据音频采样周期T
s,计算该第二时间段t
n内的音频数据个数
然后记录当前采样时刻t之前的第二时间段t
n内的每个音频数据x
j,i=1~n。可通过下面公式(3)或公式(4)计算时间段t
n内的音频平均能量P
n。
如此,通过对一段时间内的音频数据累计求和取平均的方式获取音频的平均能量,检测过程简单,计算量小,计算时间短,实时性更强。
在另一实施方式中,第一时间段t
m和第二时间段t
n的结束时刻相同,均为当次的采样时刻。即,上述记录音频数据时,可以分别记录以当前采样时刻t为终点的第一时间段t
m的每个音频数据x
i和第二时间段t
n内的每个音频数据x
j。如此,设置第一时间段t
m和第二时间段t
n的结束时间均为采样时刻,可以保证采集到最新的音 频数据,能够尽早检测到节奏,并在节奏产生后,尽快插入振动信号,以进一步增强音频-振动转化的实时性。
另外,若当前时刻t小于时间段t
m,则只记录0-t时间段内的每个音频数据x,x
i,且第一时间段t
m的每个音频数据x
i和第二时间段t
n内的每个音频数据x
j均为x,并将第一时间段t
m和第二时间段t
n内的音频数据个数均更新m为
若当前时刻t小于第二时间段t
n且大于第一时间段t
m,则分别记录第一时间段t
m的每个音频数据x
i和0-t时间段内的每个音频数据x
j,并将第二时间段t
n内的音频数据个数n更新为
如此,可减少前期的一些无效计算,进一步提高计算速度,增强音频-振动转化的实时性。
步骤S3,根据第一音频平均能量和第二音频平均能量,确定第一时间段相对于第二时间段的音频能量相对增量。
本实施例通过对长度不等的第一时间段t
m和第二时间段t
n内的音频平均能量检测,可以得到两个幅值变化速度不同的音频平均能量,通常情况下,由于长时间的缓冲,时间较长的第二时间段t
n内的音频平均能量的变化,会比时间较短的第一时间段t
m内的音频平均能量变化更慢且更缓。所以,当音频能量发生突变时,时间较短的第一时间段t
m内的音频平均能量响应更快,而时间较长的第二时间段t
n内的音频平均能量响应较慢,从而使得两者的比值出现近似阶跃的变化,所以,是否出现该近似阶跃的变化便可作为检测节奏是否产生的标准。
具体地,可以先计算第一音频平均能量P
m和第二音频平均能量P
n的比值k=P
m/P
n,并确定该比值k是否大于1;若是,说明可能存在上述近似阶跃的变化,可能有节奏产生,可以将第一时间段相对于第二时间段的音频能量相对增量确定为该比值k减1的值,即k-1;若否,则说明没有上述近似阶跃的变化,基本可以认定没有节奏产生,为减少计算量,可以直接将第一时间段相对于第二时间段的音频能量相对增量确定为0。
步骤S4,若音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。
根据上述分析可知,上述近似阶跃的变化量是相对的,仅与第一时间段t
m内的音频平均能量相对于和第二时间段t
n内的音频平均能量的突变比例k有关,与音频本身的幅值关系不大。因此,通过对这种阶跃脉冲的检测,即可实现音频幅值随机输入情况下的音频节奏检测。并可以通过音频平均能量的相对增量的预设阈值判断上述近似阶跃的变化是否产生,如此,避免了根据音频绝对能量设置阈值所带来的音频幅值随机,无法用固定的阈值进行节奏判断的问题。
振动信号生成装置在音频能量相对增量大于或等于预设阈值时,可确定有节奏产生,并照预设规则生成预设的振动信号(即振动波),实现音频信号到振动信号的实时转化,继而可输出与检测到的音频节奏一致的振动反馈。在音频能量相对增量小于预设阈值时,则可确定没有节奏产生,振动信号生成装置则不进行音频-振动的转化,然后在下一个采样时刻继续采集音频数据,继续进行节奏判断,并在有节奏产生时生成相应的振动信号。如此往复操作,直至本次启动不再接收到音频数据(如游戏结束)为止。
具体地,上述按照预设规则生成预设的振动信号,可以包括以下过程:根据音频能量相对增量的增幅,生成不同形状的振动信号;根据音频能量相对增量的大小,生成不同幅值的振动信号。
本实施例可以根据根据游戏或工作的具体场景预设振动信号,且可以将音频能量相对增量与历史数据进行比较,并根据比较结果设置不同形状和振幅的振动信号,例如,若本次音频能量相对增量与上次计算的音频能量相对增量相差较大,则可以生成与上次不同的预设波形。还可以根据音频能量相对增量的具体数值设置振动信号的振幅大小,即若音频能量相对增量较大,则可以设置振幅较大的振动信号;若音频能量相对增量较小,则可以设置振幅较小的振动信号。
为了便于理解本申请实施例提供的方法,下面结合附图进行说明。如图2所示,振动信号生成装置接收到输入的音频数据,设置第一时间段和第二时间段,且第二时间段大于第一时间段,然后分别检测第一时间段和第二时间段内的音频平均能量,并计算第一时间段和第二时间段的音频能量相对增量,并根据该音频 能量相对增量检测节奏是否产生,并在节奏产生时生成振动信号。其中,音频平均能量的计算过程如图3所示,振动信号生成装置根据接收到的具体时间段,计算该时间段内的音频数据,并记录该时间段内的音频数据,然后按照上述公式(1)-公式(4)计算并得到音频平均能量。
为验证本实施例提供的振动信号生成方法进行音频-振动转化的实施有效性,本实施例选取某游戏中的6声幅值差异较大的枪声作为音频数据,采用本实施例提供的振动信号生成方法进行音频-振动转化试验。其中,如图4所示,为采集的某游戏中的6声幅值差异较大的枪声作为音频数据示意图。如图5所示,为采用本实施例的提供的振动信号生成方法得到的第一时间段内的音频平均能量示意图。如图6所示,为采用本实施例的提供的振动信号生成方法得到的第二时间段内的音频平均能量示意图。如图7所示,为第一时间段内的音频平均能量相对于第二时间段内的音频平均能量的音频能量相对增量示意图(该图上限为10)。如图8所示,为采用本实施例提供的振动信号生成方法对上述音频数据进行实时转化处理得到的振动信号示意图。
对比图4和图5可知,若仅依据音频平均能量的绝对幅值大小,难以找到合适的阈值来判断节奏的产生时刻,鉴于此,本实施例通过两个不同时长的时间段内的音频平均能量的音频能量相对增量,来准确检测节奏的产生时刻,从而可以及时生成相应的振动信号。
对比图4和图7可知,本实施例所采用的音频能量相对增量与音频本身的幅值关系不大,只在能量有明显变化时产生类似阶跃的脉冲波形,从而解决了输入音频幅值随机情况下的节奏检测问题。
对比图4和图8可知,生成的振动信号与音频数据的节奏相对应,说明本实施例提供的方法实现了实时、准确的音频节奏检测。
本实施例提供的振动信号生成方法,利用音频在较长时间段内的平均能量的变化比在较短时间内的平均能量变化缓慢的特性,通过对长度不等的第一时间段和第二时间段内的音频平均能量检测,可以得到两个幅值变化速度不同的音频平均能量,并通过计算第一时间段和第二时间段的音频能量相对增量,检测短时间内的平均能量与较长时间内的平均能量的比值是否出现近似阶跃的变化,通过对这种阶跃脉冲的检测,即可实现音频幅值随机输入情况下的音频节奏检测,并在 节奏产生时生成预先设置的振动波形,实现音频信号到振动信号的实时转化,并输出与音频节奏一致的振动反馈。且该方法无需进行任何预处理,音频-振动转化过程实时进行,因此可实现在线的振动波形生成,适用于需要进行音频-振动实时转化的游戏或工作场景。
基于上述振动信号生成方法相同的构思,本实施例还提供一种振动信号生成装置,如图9所示,该装置包括:
获取模块,用于获取音频数据;
检测模块,用于检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量;第一时间段小于第二时间段;
确定模块,用于根据第一音频平均能量和第二音频平均能量,确定第一时间段相对于第二时间段的音频能量相对增量;
生成模块,用于若音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。
本实施例提供的振动信号生成装置,基于上述振动信号生成方法相同的构思,至少可以实现上述振动信号生成方法能够实现的有益效果,在此不再赘述。
本申请实施方式还提供一种电子设备,以执行上述振动信号生成方法。请参考图10,其示出了本申请的一些实施方式所提供的一种电子设备的示意图。如图10所示,电子设备8包括:处理器800,存储器801,总线802和通信接口803,处理器800、通信接口803和存储器801通过总线802连接;存储器801中存储有可在处理器800上运行的计算机程序,处理器800运行计算机程序时执行本申请前述任一实施方式所提供的振动信号生成方法。
其中,存储器801可能包含高速随机存取存储器(RAM:Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口803(可以是有线或者无线)实现该装置网元与至少一个其他网元之间的通信连接,可以使用互联网、广域网、本地网、城域网等。
总线802可以是ISA总线、PCI总线或EISA总线等。总线可以分为地址总线、 数据总线、控制总线等。其中,存储器801用于存储程序,处理器800在接收到执行指令后,执行程序,前述本申请实施例任一实施方式揭示的振动信号生成方法可以应用于处理器800中,或者由处理器800实现。
处理器800可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器800中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器800可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器801,处理器800读取存储器801中的信息,结合其硬件完成上述方法的步骤。
本申请实施例提供的电子设备与本申请实施例提供的振动信号生成方法出于相同的发明构思,具有与其采用、运行或实现的方法相同的有益效果。
该电子设备还可以包括功率转化器和线性马达(Linear Resonant Actuator)器件本体,该功率放大器,可以是一个对振动信号进行功率匹配的放大器,常见的如A类,B类,AB类,或者D类驱动器,该振动信号可以是模拟信号,也可以是一定制式的数字信号。该线性马达器件本体用于产生触觉振动反馈。
本申请实施方式还提供一种与前述实施方式所提供的振动信号生成方法对应的计算机可读存储介质,请参考图11,其示出的计算机可读存储介质为光盘30,其上存储有计算机程序(即程序产品),计算机程序在被处理器运行时,会执行前述任意实施方式所提供的振动信号生成方法。
需要说明的是,计算机可读存储介质的例子还可以包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类 型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他光学、磁性存储介质,在此不再一一赘述。
本申请的上述实施例提供的计算机可读存储介质与本申请实施例提供的振动信号生成方法出于相同的发明构思,具有与其存储的应用程序所采用、运行或实现的方法相同的有益效果。
应该注意的是上述实施例对本申请进行说明而不是对本申请进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本申请可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
以上,仅为本申请较佳的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
Claims (10)
- 一种振动信号生成方法,其特征在于,包括:获取音频数据;检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量;所述第一时间段小于所述第二时间段;根据所述第一音频平均能量和所述第二音频平均能量,确定所述第一时间段相对于所述第二时间段的音频能量相对增量;若所述音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。
- 根据权利要求1所述的方法,其特征在于,所述第一时间段和所述第二时间段的结束时刻相同。
- 根据权利要求1或2所述的方法,其特征在于,检测当前时刻之前第一时间段内的第一音频平均能量,包括:根据预设的采样周期,计算所述第一时间段内第一音频数据的第一数量;根据所述第一音频数据和所述第一数量,计算所述第一时间段内的第一音频平均能量;检测当前时刻之前第二时间段内的第二音频平均能量,包括:根据预设的采样周期,计算所述第二时间段内第二音频数据的第二数量;根据所述第二音频数据和所述第二数量,计算所述第二时间段内的第二音频平均能量。
- 根据权利要求3所述的方法,其特征在于,根据所述第一音频平均能量和所述第二音频平均能量,确定所述第一时间段相对于所述第二时间段的音频能量相对增量,包括:计算所述第一音频平均能量和所述第二音频平均能量的比值,并确定所述比值是否大于1;若是,则将所述第一时间段相对于所述第二时间段的音频能量相对增量确定为所述比值减1;若否,则将所述第一时间段相对于所述第二时间段的音频能量相对增量确定为0。
- 根据权利要求1或2所述的方法,其特征在于,按照预设规则生成预设的 振动信号,包括:根据所述音频能量相对增量的增幅,生成不同形状的振动信号;根据所述音频能量相对增量的大小,生成不同幅值的振动信号。
- 根据权利要求1或2所述的方法,其特征在于,所述预设阈值大于或等于1。
- 根据权利要求1或2所述的方法,其特征在于,所述第一时间段的时长为所述第二时间段的时长的两到三倍。
- 一种振动信号生成装置,其特征在于,包括:获取模块,用于获取音频数据;检测模块,用于检测当前时刻之前第一时间段内的第一音频平均能量,以及第二时间段内的第二音频平均能量;所述第一时间段小于所述第二时间段;确定模块,用于根据所述第一音频平均能量和所述第二音频平均能量,确定所述第一时间段相对于所述第二时间段的音频能量相对增量;生成模块,用于若所述音频能量相对增量大于或等于预设阈值,则按照预设规则生成预设的振动信号。
- 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器运行所述计算机程序以实现如权利要求1-7任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行实现如权利要求1-7中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111417788.2A CN114327040A (zh) | 2021-11-25 | 2021-11-25 | 振动信号生成方法、装置、电子设备及存储介质 |
| CN202111417788.2 | 2021-11-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2023093333A1 true WO2023093333A1 (zh) | 2023-06-01 |
Family
ID=81047279
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/124491 Ceased WO2023093333A1 (zh) | 2021-11-25 | 2022-10-11 | 振动信号生成方法、装置、电子设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114327040A (zh) |
| WO (1) | WO2023093333A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119757526A (zh) * | 2025-03-06 | 2025-04-04 | 舟山市特种设备检测研究院 | 一种基于脉冲反射超声的螺栓检测方法、装置和设备 |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114327040A (zh) * | 2021-11-25 | 2022-04-12 | 歌尔股份有限公司 | 振动信号生成方法、装置、电子设备及存储介质 |
| CN116185171B (zh) * | 2022-12-07 | 2025-10-24 | 瑞声开泰声学科技(上海)有限公司 | 一种振动反馈信号的生成方法、电子设备及存储介质 |
| CN116364112B (zh) * | 2023-03-24 | 2026-03-20 | 武汉市聚芯微电子有限责任公司 | 一种波形匹配方法、装置、设备以及计算机存储介质 |
| CN116994603A (zh) * | 2023-06-27 | 2023-11-03 | 北京花房科技有限公司 | 一种音频信号的检测方法、装置及计算设备 |
| CN116827205B (zh) * | 2023-08-31 | 2023-12-15 | 荣耀终端有限公司 | 马达振动的控制方法、电子设备及可读存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170245070A1 (en) * | 2014-08-22 | 2017-08-24 | Pioneer Corporation | Vibration signal generation apparatus and vibration signal generation method |
| CN107103917A (zh) * | 2017-03-17 | 2017-08-29 | 福建星网视易信息系统有限公司 | 音乐节奏检测方法及其系统 |
| CN111081271A (zh) * | 2019-11-29 | 2020-04-28 | 福建星网视易信息系统有限公司 | 基于频域和时域的音乐节奏检测方法及存储介质 |
| CN112466267A (zh) * | 2020-11-24 | 2021-03-09 | 瑞声新能源发展(常州)有限公司科教城分公司 | 振动生成方法、振动控制方法及其相关设备 |
| CN114327040A (zh) * | 2021-11-25 | 2022-04-12 | 歌尔股份有限公司 | 振动信号生成方法、装置、电子设备及存储介质 |
Family Cites Families (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA2090531A1 (en) * | 1993-02-26 | 1994-08-27 | Stephen W. Armstrong | Dual time constant audio compression system |
| BR0305746A (pt) * | 2002-08-07 | 2004-12-07 | Dolby Lab Licensing Corp | Tradução espacial de canal de áudio |
| CN103247175B (zh) * | 2013-04-27 | 2015-01-21 | 西安交通大学 | 基于汽车怠速声音频谱的道路拥堵监测方法 |
| US9749733B1 (en) * | 2016-04-07 | 2017-08-29 | Harman Intenational Industries, Incorporated | Approach for detecting alert signals in changing environments |
| CN109817241B (zh) * | 2019-02-18 | 2021-06-01 | 腾讯音乐娱乐科技(深圳)有限公司 | 音频处理方法、装置及存储介质 |
| CN110350935B (zh) * | 2019-05-27 | 2022-01-25 | 努比亚技术有限公司 | 音频信号输出控制方法、可穿戴设备及可读存储介质 |
| CN111477243B (zh) * | 2020-04-16 | 2023-05-23 | 维沃移动通信有限公司 | 音频信号处理方法及电子设备 |
| CN113438364B (zh) * | 2021-06-01 | 2022-07-05 | 荣耀终端有限公司 | 振动调节方法、电子设备、存储介质 |
-
2021
- 2021-11-25 CN CN202111417788.2A patent/CN114327040A/zh active Pending
-
2022
- 2022-10-11 WO PCT/CN2022/124491 patent/WO2023093333A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170245070A1 (en) * | 2014-08-22 | 2017-08-24 | Pioneer Corporation | Vibration signal generation apparatus and vibration signal generation method |
| CN107103917A (zh) * | 2017-03-17 | 2017-08-29 | 福建星网视易信息系统有限公司 | 音乐节奏检测方法及其系统 |
| CN111081271A (zh) * | 2019-11-29 | 2020-04-28 | 福建星网视易信息系统有限公司 | 基于频域和时域的音乐节奏检测方法及存储介质 |
| CN112466267A (zh) * | 2020-11-24 | 2021-03-09 | 瑞声新能源发展(常州)有限公司科教城分公司 | 振动生成方法、振动控制方法及其相关设备 |
| CN114327040A (zh) * | 2021-11-25 | 2022-04-12 | 歌尔股份有限公司 | 振动信号生成方法、装置、电子设备及存储介质 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119757526A (zh) * | 2025-03-06 | 2025-04-04 | 舟山市特种设备检测研究院 | 一种基于脉冲反射超声的螺栓检测方法、装置和设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114327040A (zh) | 2022-04-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2023093333A1 (zh) | 振动信号生成方法、装置、电子设备及存储介质 | |
| CN114299991B (zh) | 基于音频信号的振动生成方法、装置、设备及存储介质 | |
| US11039815B2 (en) | Signal processing apparatus, control method, signal processing system, and signal processing method for reduction of power consumption of a wireless medical device | |
| CN112509549B (zh) | 用于环境噪声的主动降噪方法 | |
| TWI711035B (zh) | 方位角估計的方法、設備、語音交互系統及儲存介質 | |
| CN113192152B (zh) | 基于音频的图像生成方法、电子设备及存储介质 | |
| CN111220263A (zh) | 一种检测马达谐振频率的方法和系统 | |
| KR20140081695A (ko) | 동작 분석 장치 | |
| WO2017185451A1 (zh) | 播放控制方法、装置以及系统 | |
| KR101868789B1 (ko) | 초음파 트랜스듀서를 이용한 센서 및 센서의 떨림 시간 감소 방법 | |
| CN113674723B (zh) | 一种音频处理方法、计算机设备及可读存储介质 | |
| KR20150105847A (ko) | 음성구간 검출 방법 및 장치 | |
| CN113436641B (zh) | 一种音乐转场时间点检测方法、设备及介质 | |
| JP2012194417A (ja) | 音声処理装置および方法、並びにプログラム | |
| CN108924344A (zh) | 终端振动方法、装置、存储介质及电子设备 | |
| CN103472452B (zh) | 一种多通道超声波传感器系统快速检测方法及系统 | |
| CN111175810A (zh) | 微震信号到时拾取方法、装置、设备及存储介质 | |
| CN106373590B (zh) | 一种基于语音实时时长调整的声音变速控制系统和方法 | |
| US12190902B1 (en) | Adaptive multi-stage output gain | |
| JP2009216617A (ja) | サンプリングクロック生成回路および交流信号測定装置 | |
| US6338036B1 (en) | Confirmation notification by apparatus using audio recognition as to the acceptability of an input sound | |
| JP5724361B2 (ja) | 音声認識装置、音声認識方法および音声認識プログラム | |
| CN115166280B (zh) | 风机转速信号处理方法、装置、电子设备及存储介质 | |
| JP2008112056A (ja) | 音声信号処理装置 | |
| JP2007206154A (ja) | 実環境騒音下の音声区間の検出 |
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: 22897418 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.10.2024) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22897418 Country of ref document: EP Kind code of ref document: A1 |