CN114548141A - Method, apparatus, electronic device and readable storage medium for generating waveform file - Google Patents
Method, apparatus, electronic device and readable storage medium for generating waveform file Download PDFInfo
- Publication number
- CN114548141A CN114548141A CN202011244525.1A CN202011244525A CN114548141A CN 114548141 A CN114548141 A CN 114548141A CN 202011244525 A CN202011244525 A CN 202011244525A CN 114548141 A CN114548141 A CN 114548141A
- Authority
- CN
- China
- Prior art keywords
- voltage amplitude
- waveform file
- data
- initial
- current
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/12—Classification; Matching
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01H—MEASUREMENT OF MECHANICAL VIBRATIONS OR ULTRASONIC, SONIC OR INFRASONIC WAVES
- G01H13/00—Measuring resonant frequency
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/34—Testing dynamo-electric machines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/02—Preprocessing
- G06F2218/04—Denoising
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/12—Classification; Matching
- G06F2218/14—Classification; Matching by matching peak patterns
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请涉及电子技术领域,具体涉及一种生成波形文件的方法、装置、电子设备和可读存储介质。The present application relates to the field of electronic technologies, and in particular, to a method, apparatus, electronic device and readable storage medium for generating a waveform file.
背景技术Background technique
线性马达作为常见的器件,广泛地应用于人们的工作和生活中,例如在使用手机的过程中,通过线性马达来实现手机的震动。As a common device, linear motors are widely used in people's work and life. For example, in the process of using mobile phones, the vibration of mobile phones is realized by linear motors.
通常随着线性马达的使用,谐振频率可能会发生偏移,为了确保马达的震动效果,所以经常需要对线性马达的谐振频率进行校准。目前,人们常常采用硬件反馈检测方式来实现线性马达的校准,即在电路中增加反馈电路来实现线性马达的谐振频率的校准。Usually with the use of a linear motor, the resonant frequency may shift. In order to ensure the vibration effect of the motor, it is often necessary to calibrate the resonant frequency of the linear motor. At present, people often use the hardware feedback detection method to realize the calibration of the linear motor, that is, adding a feedback circuit in the circuit to realize the calibration of the resonant frequency of the linear motor.
但是,传统的采用硬件反馈检测的方式来校准马达的谐振频率,由于额外增加了电路,因此成本高。However, the traditional way of calibrating the resonant frequency of the motor by means of hardware feedback detection is expensive due to the additional circuit.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种生成波形文件的方法,能够降低成本。The present application provides a method for generating a waveform file, which can reduce costs.
第一方面,提供了一种生成波形文件的方法,包括:In a first aspect, a method for generating a wave file is provided, including:
获取马达的初始谐振频率和当前谐振频率;Get the initial resonant frequency and current resonant frequency of the motor;
当所述初始谐振频率和所述当前谐振频率不同时,根据第一电压幅值和第二电压幅值确定第三电压幅值,所述第一电压幅值和所述第二电压幅值为所述初始谐振频率对应的交流驱动信号的两个相邻采样点的幅值,其中,所述第三电压幅值对应的相位大于所述第一电压幅值对应的相位且小于所述第二电压幅值对应的相位,所述第三电压幅值对应的相位与所述第一电压幅值对应的相位的差为第一相位差,所述第三电压幅值对应的相位与所述第二电压幅值对应的相位的差为第二相位差,所述第三电压幅值与第一数值和第二数值的和正相关,所述第一数值为所述第一电压幅值与第一权重系数的乘积,所述第二数值为所述第二电压幅值与第二权重系数的乘积,所述第一权重系数为所述第二相位差除以所述第一相位差和所述第二相位差的和得到的值,所述第二权重系数为所述第一相位差除以所述第一相位差和所述第二相位差的和得到的值;When the initial resonance frequency is different from the current resonance frequency, a third voltage amplitude is determined according to the first voltage amplitude and the second voltage amplitude, and the first voltage amplitude and the second voltage amplitude are The amplitudes of two adjacent sampling points of the AC drive signal corresponding to the initial resonant frequency, wherein the phase corresponding to the third voltage amplitude is greater than the phase corresponding to the first voltage amplitude and smaller than the second voltage amplitude The phase corresponding to the voltage amplitude, the difference between the phase corresponding to the third voltage amplitude and the phase corresponding to the first voltage amplitude is the first phase difference, and the phase corresponding to the third voltage amplitude is the same as the first phase difference. The difference between the phases corresponding to the two voltage amplitudes is the second phase difference, the third voltage amplitude is positively correlated with the sum of the first value and the second value, and the first value is the first voltage amplitude and the first value. The product of weighting coefficients, the second value is the product of the second voltage amplitude and the second weighting coefficient, and the first weighting coefficient is the second phase difference divided by the first phase difference and the The value obtained by the sum of the second phase differences, the second weight coefficient is the value obtained by dividing the first phase difference by the sum of the first phase difference and the second phase difference;
根据所述第三电压幅值生成当前波形文件,其中,所述当前波形文件用于生成所述当前谐振频率对应的交流驱动信号,所述第三电压幅值为所述当前谐振频率对应的交流驱动信号的一个采样点的幅值。A current waveform file is generated according to the third voltage amplitude, wherein the current waveform file is used to generate an AC drive signal corresponding to the current resonance frequency, and the third voltage amplitude is an AC drive signal corresponding to the current resonance frequency The amplitude of one sample point of the drive signal.
上述初始谐振频率为预置的初始波形文件的频率。将初始谐振频率对应的交流驱动信号的两个相邻采样点的电压数据作为第一电压幅值Nindex和第二电压幅值Nindex+1,其中第一电压幅值的采样时间在第二电压幅值之前,即第一电压幅值对应的相位小于第二电压幅值对应的相位。将当前谐振频率比初始谐振频率的比值作为第一比例系数,即Vision1=F0/F,其中,F0为当前谐振频率,F为初始谐振频率。在初始波形文件中的一个采样点处的相位,可以通过乘以第一比例系数得到当前波形文件的对应的一个采样点的相位,如果将每个采样点的间隔的相位作为一个时间单位,则当前波形文件的采样点的相位和对应的初始波形文件中的这个采样点处的相位的相位差的大小程度,则可以根据采样点的序号加一的和乘以第一比例系数的积的小数部分表征,即a=(index+1)×Vision1-ROUNDDOWN(index+1)×Vision1。由于将每个采样点处的相位作为一个时间单位,因此a为归一化的数值,将当前波形文件和初始波形文件的起始点拉齐的情况下,a可以用来表示在时间轴上第三电压幅值距离第一电压幅值的远近。当前波形文件的这个采样点的相位和对应的初始波形文件中的下一个采样点处的相位的相位差,则可以用b=1-a表征第三电压幅值距离第二电压幅值的远近。通过第一权重系数和第二权重系数,能够按照第三电压幅值距离第一电压幅值和第二电压幅值的远近程度,将第一电压幅值和第二电压幅值实现加权,得到第三电压幅值。The above-mentioned initial resonance frequency is the frequency of the preset initial waveform file. The voltage data of two adjacent sampling points of the AC drive signal corresponding to the initial resonance frequency are taken as the first voltage amplitude N index and the second voltage amplitude N index+1 , wherein the sampling time of the first voltage amplitude is at the second Before the voltage amplitude, that is, the phase corresponding to the first voltage amplitude is smaller than the phase corresponding to the second voltage amplitude. The ratio of the current resonance frequency to the initial resonance frequency is taken as the first proportional coefficient, namely Vision 1 =F 0 /F, where F 0 is the current resonance frequency and F is the initial resonance frequency. The phase at a sampling point in the initial waveform file can be multiplied by the first scale factor to obtain the phase of a corresponding sampling point in the current waveform file. If the phase of each sampling point interval is taken as a time unit, then The magnitude of the phase difference between the phase of the sampling point in the current waveform file and the phase at this sampling point in the corresponding initial waveform file can be determined by multiplying the fraction of the product of the first proportional coefficient according to the number of the sampling point plus one. Partial representation, ie a=(index+1)×Vision 1 −ROUNDDOWN(index+1)×Vision 1 . Since the phase at each sampling point is taken as a time unit, a is a normalized value. In the case of aligning the starting points of the current waveform file and the initial waveform file, a can be used to represent the first time on the time axis. The distance between the three voltage amplitudes and the first voltage amplitude. The phase difference between the phase of this sampling point in the current waveform file and the phase at the next sampling point in the corresponding initial waveform file, then b=1-a can be used to represent the distance between the third voltage amplitude and the second voltage amplitude . Through the first weighting coefficient and the second weighting coefficient, the first voltage amplitude and the second voltage amplitude can be weighted according to the distance between the third voltage amplitude and the first voltage amplitude and the second voltage amplitude, to obtain The third voltage amplitude.
本实施例中,电子设备能够按照第三电压幅值距离第一电压幅值和第二电压幅值的远近程度,将第一电压幅值和第二电压幅值实现加权,得到了合理准确的第三电压幅值。因此基于该第三电压幅值生成的当前波形文件,实现了将初始谐振频率的初始波形文件转换为当前谐振频率的当前波形文件,以此生成交流驱动信号来驱动马达,相比传统的采用反馈电路的方式进行马达校准,通过增加反馈电路的方式来对马达的频率进行调整,因此节约了成本。同时,该方法由于不增加反馈电路,因此对硬件的要求较低,应用场景更为广泛。In this embodiment, the electronic device can weight the first voltage amplitude and the second voltage amplitude according to the distance between the third voltage amplitude and the first voltage amplitude and the second voltage amplitude, and obtain a reasonable and accurate The third voltage amplitude. Therefore, based on the current waveform file generated by the third voltage amplitude, it is possible to convert the initial waveform file of the initial resonant frequency into the current waveform file of the current resonant frequency, thereby generating an AC drive signal to drive the motor. The motor is calibrated by means of a circuit, and the frequency of the motor is adjusted by adding a feedback circuit, thus saving costs. At the same time, since the method does not increase the feedback circuit, the requirements for hardware are lower, and the application scenarios are more extensive.
可选地,当所述当前谐振频率小于所述初始谐振频率时,所述根据所述第三电压幅值生成当前波形文件,包括:Optionally, when the current resonance frequency is less than the initial resonance frequency, the generating the current waveform file according to the third voltage amplitude includes:
获取第一数据数量,所述第一数据数量为初始波形文件中属于一个交流驱动信号周期的电压数据的个数,所述初始波形文件为所述初始谐振频率对应的波形文件;obtaining a first data quantity, where the first data quantity is the number of voltage data belonging to one AC drive signal cycle in an initial waveform file, and the initial waveform file is a waveform file corresponding to the initial resonant frequency;
根据所述第一数据数量和第一变换系数确定第二数据数量,所述第一变换系数为所述当前谐振频率与初始谐振频率的比值,所述初始谐振频率为所述初始波形文件对应的交流驱动信号的频率,所述第二数据数量为对所述第一数据数量和所述第一变换系数的乘积取整处理后得到的值;The second data quantity is determined according to the first data quantity and the first transformation coefficient, where the first transformation coefficient is the ratio of the current resonant frequency to the initial resonant frequency, and the initial resonant frequency is the corresponding value of the initial waveform file the frequency of the AC drive signal, and the second data quantity is a value obtained by rounding the product of the first data quantity and the first transform coefficient;
获取第一周期数量,所述第一周期数量为所述初始波形文件对应的交流驱动信号的周期的数量;obtaining a first cycle number, where the first cycle number is the number of cycles of the AC drive signal corresponding to the initial waveform file;
根据所述第一周期数量和第二变换系数确定第二周期数量,所述第二周期数量为对所述第一周期数量和所述第二变换系数的乘积取整处理后得到的值,所述第二变换系数为所述初始谐振频率与所述当前谐振频率的比值;The second cycle number is determined according to the first cycle number and the second transformation coefficient, where the second cycle number is a value obtained by rounding the product of the first cycle number and the second transformation coefficient, so The second transformation coefficient is the ratio of the initial resonance frequency to the current resonance frequency;
根据所述第二数据数量、所述第二周期数量和所述第三电压幅值生成所述当前波形文件,所述第二数据数量为所述当前波形文件中属于一个交流驱动信号周期的电压数据的个数,所述第二周期数量为所述当前波形文件包含的电压数据对应的周期数量。The current waveform file is generated according to the second data quantity, the second period quantity and the third voltage amplitude, where the second data quantity is the voltage belonging to one AC drive signal period in the current waveform file The number of data, the second number of cycles is the number of cycles corresponding to the voltage data contained in the current waveform file.
电子设备将初始波形文件中的电压数据的个数PointSUM除以初始波形文件对应的交流驱动信号的周期的数量,即除以第一周期数量T,作为初始波形文件中属于一个交流驱动信号周期的电压数据的个数。电子设备将初始谐振频率F与当前谐振频率F0的比值作为第一变换系数,将第一数据数量和第一变换系数的乘积取整作为第二数据数量,即第二数据数量T1point为对Tpoint×(F/F0)取整处理后得到的值。其中,该第二数据数量为当前波形文件中属于一个交流驱动信号周期的电压数据的个数。电子设备将当前谐振频率F0与初始谐振频率F的比值作为第二变换系数,将第二变换系数和上述第一周期数量的乘积取整处理后得到的值作为第二周期数量,即第二周期数量T1=ROUNDDOWN(T×(F0/F))。该第二周期数量为当前波形文件包含的电压数据对应的周期数量。电子设备根据第二数据数量T1point和第二周期数量T1确定出当前波形文件所需要的电压数据的个数NewPointSUM,例如NewPointSUM=T1×T1point。将第二数据数量T1point和第二周期数量T1的乘积作为当前波形文件所需要的电压数据的个数。电子设备对所生成的多个第三电压幅值按照NewPointSUM进行提取,即将多个第三电压幅值的中超过NewPointSUM数量的电压数据删除掉,来确保当前波形文件生成的交流驱动信号为整周期的信号,从而确保震感连续。The electronic device divides the number of voltage data in the initial waveform file Point SUM by the number of cycles of the AC drive signal corresponding to the initial waveform file, that is, divided by the first cycle number T, as the initial waveform file belongs to one AC drive signal cycle The number of voltage data. The electronic device uses the ratio of the initial resonant frequency F to the current resonant frequency F 0 as the first transformation coefficient, and rounds the product of the first data quantity and the first transformation coefficient as the second data quantity, that is, the second data quantity T 1point is a pair of A value obtained by rounding T point ×(F/F 0 ). Wherein, the second data quantity is the quantity of voltage data belonging to one AC drive signal cycle in the current waveform file. The electronic device takes the ratio of the current resonant frequency F 0 to the initial resonant frequency F as the second transformation coefficient, and takes the value obtained by rounding the product of the second transformation coefficient and the first cycle number as the second cycle number, that is, the second cycle number. The number of cycles T 1 =ROUNDDOWN(T×(F 0 /F)). The second number of cycles is the number of cycles corresponding to the voltage data contained in the current waveform file. The electronic device determines the number of voltage data NewPoint SUM required by the current waveform file according to the second data quantity T 1point and the second period quantity T 1 , for example, NewPoint SUM =T 1 ×T 1point . The product of the second data quantity T 1point and the second period quantity T 1 is taken as the quantity of voltage data required by the current waveform file. The electronic device extracts the generated multiple third voltage amplitudes according to NewPoint SUM , that is, deletes the voltage data that exceeds the number of NewPoint SUM among the multiple third voltage amplitudes, to ensure that the AC drive signal generated by the current waveform file is The signal of the whole cycle, so as to ensure the continuity of vibration.
本实施例中,电子设备通过表征当前谐振频率和初始谐振频率的比例关系的第一变换系数和第二变换系数,并分别基于第一变换系数和第二变换系数,依据初始波形文件的第一周期数量和第一数据数量,得到当前波形文件所需要的第二周期数量和第二数据数量,进一步根据第二周期数量和第二数据数量的乘积得到当前波形文件所需要的电压数据的个数,之后按照所需要的电压数据的个数对第三电压幅值进行提取,从而去除部分电压数据得到完整周期的波形文件数据,以确保震感的连续性,提高了用户的体验。In this embodiment, the electronic device uses the first transformation coefficient and the second transformation coefficient that represent the proportional relationship between the current resonance frequency and the initial resonance frequency, and based on the first transformation coefficient and the second transformation coefficient, respectively, according to the first transformation coefficient of the initial waveform file. The number of cycles and the number of first data, to obtain the number of second cycles and the number of data required by the current waveform file, and further obtain the number of voltage data required by the current waveform file according to the product of the number of second cycles and the number of second data , and then extract the third voltage amplitude according to the required number of voltage data, thereby removing part of the voltage data to obtain the waveform file data of a complete cycle, so as to ensure the continuity of the shock sensation and improve the user experience.
可选地,所述马达的震动模式为长震模式。Optionally, the vibration mode of the motor is a long vibration mode.
本实施例中,在,由于当前波形文件为具有完整周期的波形文件,因此电子设备能够在长震模式的情况下,即循环使用当前波形文件驱动马达的情况下,保证交流驱动信号的波形的连续,因此采用当前波形文件循环驱动马达不会发生震感不连续的情况,提高了用户的体验。In this embodiment, since the current waveform file is a waveform file with a complete cycle, the electronic device can ensure the waveform of the AC drive signal in the long vibration mode, that is, in the case of driving the motor using the current waveform file cyclically. Continuous, so using the current waveform file to drive the motor circularly will not cause discontinuous vibration, which improves the user experience.
可选地,所述方法还包括:当所述当前谐振频率大于所述初始谐振频率时,对所述当前波形文件进行补零处理,得到更新波形文件,所述更新波形文件中的电压数据的个数和初始波形文件中的电压数据的个数相同,所述初始波形文件为所述初始谐振频率对应的波形文件。Optionally, the method further includes: when the current resonant frequency is greater than the initial resonant frequency, performing zero-filling processing on the current waveform file to obtain an updated waveform file, wherein the voltage data in the updated waveform file is The number is the same as the number of voltage data in the initial waveform file, and the initial waveform file is the waveform file corresponding to the initial resonance frequency.
本实施例中,由于当前谐振频率大于所述初始谐振频率时,经过频率变换后所得到的第三电压幅值的个数比初始波形文件数据中的电压数据的个数少,因此在不改变波形文件的数据长度的情况下,对剩余的空位进行补零处理,得到与初始波形文件中的电压数据的个数相同的更新波形文件,能够避免改变波形文件的存储的数据长度,因此便于数据存储,能够减少运算量的同时,确保数据处理的准确性。In this embodiment, when the current resonant frequency is greater than the initial resonant frequency, the number of third voltage amplitudes obtained after frequency transformation is less than the number of voltage data in the initial waveform file data. In the case of the data length of the waveform file, the remaining blanks are filled with zeros to obtain an updated waveform file with the same number of voltage data in the initial waveform file, which can avoid changing the length of the stored data of the waveform file, so it is convenient for data Storage can reduce the amount of computation while ensuring the accuracy of data processing.
可选地,所述马达的震动模式为短震模式,所述初始谐振频率为所述马达的最小振动频率。Optionally, the vibration mode of the motor is a short vibration mode, and the initial resonance frequency is a minimum vibration frequency of the motor.
本实施例中,在马达的震动模式为短震模式下,例如触摸按键或者通话接通成功时马达的反馈震动时。通过预存马达的最小振动频率的初始波形文件,这样所确定的当前谐振频率对应的当前波形文件不会出现点数变多的情况,此时电子设备对当前波形文件进行最小谐振频率的初始波形文件中的电压数据的个数进行补零处理,得到与初始波形文件中的电压数据的个数相同的更新波形文件,从而避免改变初始波形文件的存储的数据长度,因此便于数据存储,能够减少运算量的同时,确保数据处理的准确性。In this embodiment, when the vibration mode of the motor is a short vibration mode, for example, when a button is touched or a call is successfully connected, the motor feedback vibration. By pre-storing the initial waveform file of the minimum vibration frequency of the motor, the current waveform file corresponding to the determined current resonant frequency will not have more points. At this time, the electronic device performs the initial waveform file of the minimum resonant frequency on the current waveform file. The number of voltage data in the original waveform file is zero-filled to obtain the updated waveform file with the same number of voltage data in the initial waveform file, so as to avoid changing the length of the data stored in the initial waveform file, so it is convenient for data storage and can reduce the amount of computation. At the same time, ensure the accuracy of data processing.
可选地,所述获取马达的初始谐振频率和当前谐振频率,包括:Optionally, the acquiring the initial resonance frequency and the current resonance frequency of the motor includes:
获取多个交流驱动信号驱动马达震动时的每个交流驱动信号对应的多个加速度数据,所述加速度数据用于表征马达在震动时的加速度的大小,所述多个交流驱动信号的频率分布在所述马达的驱动频率范围内;Acquire multiple acceleration data corresponding to each AC drive signal when multiple AC drive signals drive the motor to vibrate. The acceleration data is used to represent the magnitude of the acceleration of the motor during vibration. The frequency of the multiple AC drive signals is distributed in within the driving frequency range of the motor;
根据所述多个交流驱动信号的多个加速度数据,确定所述多个交流驱动信号中每个交流驱动信号对应的平均加速度;determining an average acceleration corresponding to each of the multiple AC drive signals according to the multiple acceleration data of the multiple AC drive signals;
根据所述多个交流驱动信号的多个平均加速度中的最大平均加速度确定所述当前谐振频率,其中,所述当前谐振频率为所述最大平均加速度对应的交流驱动信号的频率。The current resonance frequency is determined according to the maximum average acceleration among the plurality of average accelerations of the plurality of AC drive signals, wherein the current resonance frequency is the frequency of the AC drive signal corresponding to the maximum average acceleration.
本实施例中,电子设备获取多个交流驱动信号驱动马达震动时的每个交流驱动信号对应的多个加速度数据,由于上述多个交流驱动信号的频率分布在马达的驱动频率范围内,因此电子设备能够采用扫频的方式获取驱动频率范围内多个频率对应的多个加速度数据。然后电子设备根据每个交流信号对应的平均加速度中的最大平均加速度,准确便捷地确定最大平均加速度对应的当前谐振频率。该方法无需通过增加反馈电路的方式来对马达的频率进行调整,因此节约了成本。同时,该方法由于不增加反馈电路,因此对硬件的要求较低,应用场景更为广泛。In this embodiment, the electronic device acquires multiple acceleration data corresponding to each AC drive signal when the motor vibrates with multiple AC drive signals. Since the frequencies of the multiple AC drive signals are distributed within the drive frequency range of the motor, the electronic device The device can acquire multiple acceleration data corresponding to multiple frequencies within the driving frequency range by sweeping the frequency. Then the electronic device accurately and conveniently determines the current resonance frequency corresponding to the maximum average acceleration according to the maximum average acceleration among the average accelerations corresponding to each AC signal. The method does not need to adjust the frequency of the motor by adding a feedback circuit, thus saving cost. At the same time, since the method does not increase the feedback circuit, the requirements for hardware are lower, and the application scenarios are more extensive.
可选地,所述根据所述多个交流驱动信号的多个加速度数据,确定所述多个交流驱动信号中每个交流驱动信号对应的平均加速度,包括:Optionally, determining the average acceleration corresponding to each of the multiple AC drive signals according to the multiple acceleration data of the multiple AC drive signals includes:
获取所述多个交流驱动信号中每个交流驱动信号对应的加速度数据的峰峰值;acquiring the peak-to-peak value of the acceleration data corresponding to each of the plurality of AC drive signals;
根据所述峰峰值确定所述多个交流驱动信号中每个交流驱动信号对应的平均加速度。The average acceleration corresponding to each of the plurality of AC driving signals is determined according to the peak-to-peak value.
本实施例中,电子设备通过获取将上述多个交流驱动信号中每个交流驱动信号对应的加速度数据的峰峰值,在运算过程中去除了负值,然后基于每个交流驱动信号对应的峰峰值确定多个交流驱动信号中每个交流驱动信号对应的平均加速度,相比直接将负值部分的数据删除的做法,峰峰值能够将数据间的差异拉大,便于筛选和比较。In this embodiment, the electronic device obtains the peak-to-peak value of the acceleration data corresponding to each of the above-mentioned multiple AC drive signals, removes the negative value in the calculation process, and then calculates the peak-to-peak value corresponding to each AC drive signal based on the calculation process. To determine the average acceleration corresponding to each of the multiple AC drive signals, compared with the method of directly deleting the data of the negative part, the peak-to-peak value can increase the difference between the data, which is convenient for screening and comparison.
可选地,所述峰峰值为对第一峰峰值去除过冲数值所得到的数据,和/或,所述峰峰值为按照预设采样率对所述第一峰峰值进行下采样所得到的数据;所述第一峰峰值为所述多个交流驱动信号中每个交流驱动信号对应的加速度数据的原始峰峰值。Optionally, the peak-to-peak value is data obtained by removing the overshoot value from the first peak-to-peak value, and/or the peak-to-peak value is obtained by down-sampling the first peak-to-peak value according to a preset sampling rate. data; the first peak-to-peak value is the original peak-to-peak value of the acceleration data corresponding to each of the plurality of AC drive signals.
本实施例中,通过对第一峰峰值去除过冲数值能够确保数据的有效性,提高了平均加速度的准确性,进而确保了当前谐振频率的精度,通过对第一峰峰值进行下采样,能够有效减少数据量,提高了数据处理的效率,进而提高了波形文件的生成效率。In this embodiment, by removing the overshoot value from the first peak-to-peak value, the validity of the data can be ensured, the accuracy of the average acceleration is improved, and the accuracy of the current resonance frequency is further ensured. By down-sampling the first peak-to-peak value, the The data volume is effectively reduced, the data processing efficiency is improved, and the generation efficiency of the waveform file is further improved.
第二方面,提供了一种生成波形文件的装置,包括由软件和/或硬件组成的单元,该单元用于执行第一方面所述的技术方案中任意一种方法。In a second aspect, an apparatus for generating a waveform file is provided, including a unit composed of software and/or hardware, and the unit is configured to execute any one of the methods in the technical solutions described in the first aspect.
第三方面,提供了一种电子设备,包括处理器和存储器,该存储器用于存储计算机程序,该处理器用于从存储器中调用并运行该计算机程序,使得该电子设备执行第一方面所述的技术方案中任意一种方法。In a third aspect, an electronic device is provided, including a processor and a memory, the memory is used for storing a computer program, the processor is used for calling and running the computer program from the memory, so that the electronic device executes the first aspect. Any method in the technical solution.
第四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储了计算机程序,当所述计算机程序被处理器执行时,使得该处理器执行第一方面所述的技术方案中任意一种方法。In a fourth aspect, a computer-readable storage medium is provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the processor is caused to execute the technology described in the first aspect any method in the program.
第五方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码在终端设备上运行时,使得该终端设备执行第一方面所述的技术方案中任意一种方法。In a fifth aspect, a computer program product is provided, the computer program product includes: computer program code, when the computer program code is run on a terminal device, the terminal device is made to execute the technical solution described in the first aspect. any method.
附图说明Description of drawings
图1是本申请实施例提供的一例终端设备100的结构示意图;FIG. 1 is a schematic structural diagram of an example of a terminal device 100 provided by an embodiment of the present application;
图2是本申请实施例提供的终端设备100的软件结构框图;FIG. 2 is a software structural block diagram of a terminal device 100 provided by an embodiment of the present application;
图3是本申请实施例提供的一例确定马达的当前谐振频率的方法流程图;3 is a flowchart of an example of a method for determining the current resonance frequency of a motor provided by an embodiment of the present application;
图4是本申请实施例提供的一例获取的加速度数据的示意图;4 is a schematic diagram of an example of acquired acceleration data provided by an embodiment of the present application;
图5是本申请实施例提供的一例多个频率对应的多个平均加速度的曲线图;FIG. 5 is a graph of a plurality of average accelerations corresponding to a plurality of frequencies according to an example of the present application;
图6是图5中的数据进行平滑滤波后的平均加速度的曲线图;Fig. 6 is the graph of the average acceleration after the data in Fig. 5 is smoothed and filtered;
图7是本申请实施例提供的一例马达固定状态下获取的加速度数据的示意图;7 is a schematic diagram of an example of acceleration data obtained in a fixed state of a motor provided by an embodiment of the present application;
图8是本申请实施例提供的一例马达悬空状态下获取的加速度数据的示意图;FIG. 8 is a schematic diagram of an example of acceleration data obtained when a motor is in a suspended state provided by an embodiment of the present application;
图9是本申请实施例提供的一例多次获取的当前谐振频率的波形图;9 is a waveform diagram of an example of the current resonance frequency obtained multiple times provided by the embodiment of the present application;
图10是本申请实施例提供的一例获取当前谐振频率的方法流程图;10 is a flowchart of an example of a method for obtaining a current resonance frequency provided by an embodiment of the present application;
图11是本申请实施例提供的一例电压数据的示意图;11 is a schematic diagram of an example of voltage data provided by an embodiment of the present application;
图12是本申请实施例提供的一例生成波形文件的方法流程图;12 is a flowchart of an example of a method for generating a waveform file provided by an embodiment of the present application;
图13是本申请实施例提供的一例将波形文件按照采样的时间进行对应的示意图;FIG. 13 is a schematic diagram of an example of corresponding waveform files according to the sampling time provided by the embodiment of the present application;
图14是本申请实施例提供的一例电压数据的示意图;14 is a schematic diagram of an example of voltage data provided by an embodiment of the present application;
图15是本申请实施例提供的一例不同频率的波形文件中每个周期内的电压数据的点数的示意图;15 is a schematic diagram of the number of points of voltage data in each cycle in an example of waveform files with different frequencies provided by an embodiment of the present application;
图16是本申请实施例提供的一例具有完整周期的波形文件的示意图;16 is a schematic diagram of an example of a waveform file with a complete cycle provided by an embodiment of the present application;
图17是本申请实施例提供的一例波形发生变异的波形文件示意图;FIG. 17 is a schematic diagram of an example of a waveform file in which a waveform is mutated provided by an embodiment of the present application;
图18是本申请实施例提供的一例补零之后的波形文件的示意图;18 is a schematic diagram of an example of a waveform file after zero-filling provided by an embodiment of the present application;
图19是本申请实施例提供的一例生成波形文件的装置的结构示意图。FIG. 19 is a schematic structural diagram of an example of an apparatus for generating a waveform file provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Wherein, in the description of the embodiments of the present application, unless otherwise stated, “/” means or means, for example, A/B can mean A or B; “and/or” in this document is only a description of the associated object The association relationship of , indicates that there can be three kinds of relationships, for example, A and/or B, can indicate that A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括一个或者更多个该特征。Hereinafter, the terms "first", "second" and "third" are only used for descriptive purposes, and should not be understood as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature defined as "first", "second", "third" may expressly or implicitly include one or more of that feature.
本申请实施例提供的生成波形文件的方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。The method for generating a waveform file provided by the embodiments of the present application can be applied to mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR)/virtual reality (VR) devices, notebook computers, super mobile devices On terminal devices such as a personal computer (ultra-mobile personal computer, UMPC), a netbook, and a personal digital assistant (personal digital assistant, PDA), the embodiments of the present application do not impose any restrictions on the specific type of the terminal device.
示例性的,图1是本申请实施例提供的一例终端设备100的结构示意图。终端设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universalserial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Exemplarily, FIG. 1 is a schematic structural diagram of an example of a terminal device 100 provided by an embodiment of the present application. The terminal device 100 may include a
可以理解的是,本申请实施例示意的结构并不构成对终端设备100的具体限定。在本申请另一些实施例中,终端设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 100 . In other embodiments of the present application, the terminal device 100 may include more or less components than those shown in the drawings, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
其中,控制器可以是终端设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the terminal device 100 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现终端设备100的触摸功能。The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。在一些实施例中,音频模块170可以通过I2S接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。The I2S interface can be used for audio communication. In some embodiments, the
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。在一些实施例中,音频模块170也可以通过PCM接口向无线通信模块160传递音频信号,实现通过蓝牙耳机接听电话的功能。所述I2S接口和所述PCM接口都可以用于音频通信。The PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals. In some embodiments, the
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块170可以通过UART接口向无线通信模块160传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(displayserial interface,DSI)等。在一些实施例中,处理器110和摄像头193通过CSI接口通信,实现终端设备100的拍摄功能。处理器110和显示屏194通过DSI接口通信,实现终端设备100的显示功能。The MIPI interface can be used to connect the
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may be used to connect the
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端设备100充电,也可以用于终端设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端设备,例如AR设备等。The USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other terminal devices, such as AR devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备100的结构限定。在本申请另一些实施例中,终端设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the terminal device 100 . In other embodiments of the present application, the terminal device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端设备供电。The
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , the
终端设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the terminal device 100 may be implemented by the
天线1和天线2用于发射和接收电磁波信号。图1中的天线1和天线2的结构仅为一种示例。终端设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the
无线通信模块160可以提供应用在终端设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The
在一些实施例中,终端设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得终端设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the
终端设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,终端设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the terminal device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
终端设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The terminal device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,终端设备100可以包括1个或N个摄像头193,N为大于1的正整数。Camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the terminal device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当终端设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
视频编解码器用于对数字视频压缩或解压缩。终端设备100可以支持一种或多种视频编解码器。这样,终端设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record videos in various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information and can continuously learn by itself. Applications such as intelligent cognition of the terminal device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展终端设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. The
终端设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The terminal device 100 may implement audio functions through an
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。终端设备100可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当终端设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。终端设备100可以设置至少一个麦克风170C。在另一些实施例中,终端设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,终端设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。终端设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,终端设备100根据压力传感器180A检测所述触摸操作强度。终端设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be provided on the display screen 194 . There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The terminal device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
陀螺仪传感器180B可以用于确定终端设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定终端设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测终端设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消终端设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the motion attitude of the terminal device 100 . In some embodiments, the angular velocity of the end device 100 about three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyroscope sensor 180B detects the shaking angle of the terminal device 100, calculates the distance to be compensated by the lens module according to the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse motion to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenarios.
气压传感器180C用于测量气压。在一些实施例中,终端设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
磁传感器180D包括霍尔传感器。终端设备100可以利用磁传感器180D检测翻盖皮套的开合。在一些实施例中,当终端设备100是翻盖机时,终端设备100可以根据磁传感器180D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the terminal device 100 is a flip machine, the terminal device 100 can detect the opening and closing of the flip according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
加速度传感器180E可检测终端设备100在各个方向上(一般为三轴)加速度的大小。当终端设备100静止时可检测出重力的大小及方向。还可以用于识别终端设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the terminal device 100 is stationary. It can also be used to identify the posture of terminal devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器180F,用于测量距离。终端设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,终端设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F for measuring distance. The terminal device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。终端设备100通过发光二极管向外发射红外光。终端设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定终端设备100附近有物体。当检测到不充分的反射光时,终端设备100可以确定终端设备100附近没有物体。终端设备100可以利用接近光传感器180G检测用户手持终端设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The terminal device 100 emits infrared light to the outside through the light emitting diode. The terminal device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100 . When insufficient reflected light is detected, the terminal device 100 may determine that there is no object near the terminal device 100 . The terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. Proximity light sensor 180G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
环境光传感器180L用于感知环境光亮度。终端设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测终端设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket, so as to prevent accidental touch.
指纹传感器180H用于采集指纹。终端设备100可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering incoming calls with fingerprints, and the like.
温度传感器180J用于检测温度。在一些实施例中,终端设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,终端设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,终端设备100对电池142加热,以避免低温导致终端设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,终端设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 180J is used to detect the temperature. In some embodiments, the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute the temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 performs performance reduction of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the terminal device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于终端设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the terminal device 100 , which is different from the position where the display screen 194 is located.
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器180M也可以设置于耳机中,结合成骨传导耳机。音频模块170可以基于所述骨传导传感器180M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器180M获取的血压跳动信号解析心率信息,实现心率检测功能。The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 180M can also contact the pulse of the human body and receive the blood pressure beating signal. In some embodiments, the bone conduction sensor 180M can also be disposed in the earphone, combined with the bone conduction earphone. The
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。终端设备100可以接收按键输入,产生与终端设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. Touch buttons are also possible. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 191 can generate vibrating cues. The motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和终端设备100的接触和分离。终端设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。终端设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,终端设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在终端设备100中,不能和终端设备100分离。The
终端设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明终端设备100的软件结构。The software system of the terminal device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the terminal device 100 .
图2是本申请实施例的终端设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。应用程序层可以包括一系列应用程序包。FIG. 2 is a block diagram of a software structure of a terminal device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and system libraries, and a kernel layer. The application layer can include a series of application packages.
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 2, the application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and so on.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions.
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 2, the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供终端设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The telephony manager is used to provide the communication function of the terminal device 100 . For example, the management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the terminal device vibrates, and the indicator light flashes.
Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。The Android runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
为了便于理解,本申请以下实施例将以具有图1和图2所示结构的终端设备为例,结合附图和应用场景,对本申请实施例提供的生成波形文件的方法进行具体阐述。通常,线性马达是通过振子在磁场运动产生振动,不同的线性马达由于谐振频率不一样,震感也会随着随之不同。每个线性马达都有各自的谐振频率,如果按照各自的谐振频率驱动线性马达时,线性马达的震感最强,即振幅最强。通常随着线性马达(以下称为马达)的使用,谐振频率可能会发生偏移,当马达的谐振频率发生了偏移,但是如果还是采用初始波形文件产生交流驱动信号,即按照初始谐振频率对马达进行驱动的话,震感就会减弱,振动效果无法保证。本申请实施例首先通过对不同频率的交流驱动信号下马达的加速度的比较,来获取马达对应的谐振频率,然后将初始波形文件进行频率的变换,得到谐振频率对应的波形文件,来产生驱动马达的交流驱动信号,使得马达能够在其谐振频率的驱动下,达到最佳震感。For ease of understanding, the following embodiments of the present application will take the terminal device having the structure shown in FIG. 1 and FIG. 2 as an example, and combine the drawings and application scenarios to specifically describe the method for generating a waveform file provided by the embodiments of the present application. Generally, linear motors vibrate through the motion of the vibrator in the magnetic field. Different linear motors have different vibration sensations due to different resonance frequencies. Each linear motor has its own resonant frequency. If the linear motor is driven according to the respective resonant frequency, the linear motor has the strongest vibration sense, that is, the strongest amplitude. Usually with the use of a linear motor (hereinafter referred to as a motor), the resonant frequency may shift. When the resonant frequency of the motor is shifted, if the initial waveform file is still used to generate the AC drive signal, that is, according to the initial resonant frequency. If the motor is driven, the vibration will be weakened, and the vibration effect cannot be guaranteed. The embodiment of the present application first obtains the resonance frequency corresponding to the motor by comparing the acceleration of the motor under AC drive signals of different frequencies, and then performs frequency conversion on the initial waveform file to obtain the waveform file corresponding to the resonance frequency to generate the drive motor. The AC drive signal enables the motor to achieve the best vibration sensation under the drive of its resonant frequency.
本申请实施例的技术方案可以用在D类功率放大器(ClassD)驱动马达的场景下。采用ClassD驱动马达,可以直接利用电子设备本身已有的驱动信号,无需增加其他的硬件成本即可实现马达的驱动。即使电子设备增加ClassD的硬件电路来获取驱动信号,相比增加反馈电路来实现马达校准的成本也大大下降。上述电子设备可以是如图1所示的终端设备。The technical solutions of the embodiments of the present application can be used in a scenario where a Class D power amplifier (Class D) drives a motor. By adopting the ClassD drive motor, the existing drive signal of the electronic device can be directly used, and the drive of the motor can be realized without adding other hardware costs. Even if the electronic equipment adds the ClassD hardware circuit to obtain the driving signal, the cost of motor calibration is greatly reduced compared to adding the feedback circuit. The above electronic device may be a terminal device as shown in FIG. 1 .
这里首先对电子设备如何获取马达在当前状态时的当前谐振频率的详细过程进行描述。Here, the detailed process of how the electronic device obtains the current resonance frequency of the motor in the current state is first described.
图3为本申请实施例提供的一例确定马达的当前谐振频率的方法流程图。如图3所示,方法300包括:FIG. 3 is a flowchart of an example of a method for determining a current resonance frequency of a motor according to an embodiment of the present application. As shown in FIG. 3,
S310、获取多个交流驱动信号驱动马达震动时的每个交流驱动信号对应的多个加速度数据,所述加速度数据用于表征马达在震动时的加速度的大小,所述多个交流驱动信号的频率分布在所述马达的驱动频率范围内。S310: Acquire multiple acceleration data corresponding to each AC drive signal when the motor is vibrated by multiple AC drive signals, where the acceleration data is used to represent the magnitude of the acceleration of the motor during vibration, and the frequencies of the multiple AC drive signals distributed over the drive frequency range of the motor.
首先电子设备内部可以预置多个频率的波形文件,这多个波形文件各自对应的频率能够覆盖马达的驱动频率范围,其中,驱动频率范围表示马达的谐振频率发生偏移之后的谐振频率的分布范围。例如马达的初始谐振频率为235HZ时,通常马达在谐振频率发生偏移后,其谐振频率也分布在230HZ-240HZ的范围内,此时可以认为马达的驱动频率范围为230HZ-240HZ,这时,多个频率的波形文件可以包括230HZ、231HZ、232HZ...直到240HZ等11个频率的波形文件。Firstly, waveform files of multiple frequencies can be preset in the electronic device, and the corresponding frequencies of the multiple waveform files can cover the driving frequency range of the motor, wherein the driving frequency range represents the distribution of the resonant frequency after the resonant frequency of the motor is shifted. scope. For example, when the initial resonant frequency of the motor is 235HZ, usually after the resonant frequency of the motor is shifted, its resonant frequency is also distributed in the range of 230HZ-240HZ. At this time, it can be considered that the driving frequency range of the motor is 230HZ-240HZ. At this time, The waveform files of multiple frequencies can include waveform files of 11 frequencies such as 230HZ, 231HZ, 232HZ... until 240HZ.
具体的,电子设备可以采用上述多个频率的波形文件产生对应的交流驱动信号分别来驱动马达进行震动,同时通过加速度传感器采集马达震动过程中的加速度数据。例如,电子设备可以采用一个频率对应的波形文件产生的交流驱动信号驱动马达震动500毫秒,中间停止50毫秒,再采用下一个频率对应的波形文件产生的交流驱动信号驱动马达继续震动,从而获取每个交流驱动信号驱动马达震动时的多个加速度数据,以230HZ-240HZ的驱动频率范围为例,每个波形文件对应的频率间隔1HZ,采用这多个波形文件产生的交流驱动信号驱动马达震动时的加速度数据可以参见如图4所示,其中,横轴为时间,纵轴表征马达震动的加速度数据。图4中的加速度数据包括正向的加速度数据(纵轴坐标大于0)和负向的加速度数据(纵轴坐标小于0),上述加速度数据可以表征马达在震动时的加速度的大小。Specifically, the electronic device can generate corresponding AC drive signals by using the waveform files of the above-mentioned multiple frequencies to drive the motor to vibrate respectively, and at the same time collect the acceleration data during the motor vibration through the acceleration sensor. For example, the electronic device can use the AC drive signal generated by the waveform file corresponding to one frequency to drive the motor to vibrate for 500 milliseconds, stop for 50 milliseconds in the middle, and then use the AC drive signal generated by the waveform file corresponding to the next frequency to drive the motor to continue to vibrate. A plurality of acceleration data when the motor is driven by an AC drive signal. Taking the driving frequency range of 230HZ-240HZ as an example, the frequency interval corresponding to each waveform file is 1HZ. When the AC drive signal generated by these multiple waveform files is used to drive the motor to vibrate The acceleration data can be seen in Figure 4, where the horizontal axis is time, and the vertical axis represents the acceleration data of motor vibration. The acceleration data in FIG. 4 includes positive acceleration data (the vertical axis coordinate is greater than 0) and negative acceleration data (the vertical axis coordinate is less than 0). The above acceleration data can represent the magnitude of the acceleration of the motor during vibration.
S320、根据所述多个交流驱动信号的多个加速度数据,确定所述多个交流驱动信号中每个交流驱动信号对应的平均加速度。S320. Determine an average acceleration corresponding to each AC drive signal in the multiple AC drive signals according to the multiple acceleration data of the multiple AC drive signals.
具体的,电子设备可以根据上述多个交流驱动信号的多个加速度数据,进行数据处理和比较之后,确定出上述每个交流驱动信号对应的平均加速度。例如,电子设备可以将上述多个加速度数据中的负值部分删除,保留加速度数据的正数部分,然后将这些正的加速度数据中每个周期的最大幅值进行平均,作为这个频率的交流驱动信号对应的平均加速度。该平均加速度能够表征对应频率的交流驱动信号驱动马达震动时振幅的大小。Specifically, the electronic device may determine the average acceleration corresponding to each of the above-mentioned AC driving signals after data processing and comparison according to the plurality of acceleration data of the above-mentioned plurality of AC driving signals. For example, the electronic device can delete the negative part of the above-mentioned multiple acceleration data, keep the positive part of the acceleration data, and then average the maximum amplitude of each cycle in these positive acceleration data as the AC drive of this frequency The average acceleration corresponding to the signal. The average acceleration can characterize the magnitude of the amplitude when the AC drive signal of the corresponding frequency drives the motor to vibrate.
S330、根据所述多个交流驱动信号的多个平均加速度中的最大平均加速度确定所述当前谐振频率,其中,所述当前谐振频率为所述最大平均加速度对应的交流驱动信号的频率。S330. Determine the current resonance frequency according to the maximum average acceleration among the multiple average accelerations of the multiple AC drive signals, where the current resonance frequency is the frequency of the AC drive signal corresponding to the maximum average acceleration.
具体的,电子设备可以将上述多个平均加速度进行比较,得到最大平均加速度,然后将最大平均加速度对应的频率作为能够使得马达振幅最大的当前谐振频率。Specifically, the electronic device may compare the above-mentioned multiple average accelerations to obtain the maximum average acceleration, and then use the frequency corresponding to the maximum average acceleration as the current resonance frequency that can maximize the motor amplitude.
可选地,电子设备还可以是将上述多个平均加速度放在坐标系中连接,并生成曲线图,如图5所示,横轴为点数,纵轴为加速度,图5中以41个点的平均加速度为例示出。可选地,还可以对图5中的数据进行平滑滤波,从而得到如图6所示的曲线。然后将图6中的最大平均加速度对应的频率叠加预设的频率偏移量之后,作为当前谐振频率。例如,当每个交流驱动信号对应的频率间隔1HZ时,电子设备采用四个平均加速度的数据进行平滑滤波,即将附近四个频率对应的平均加速度的均值作为当前频率对应的平均加速度,然后将最大平均加速度对应的频率加2HZ作为当前谐振频率。可选地,电子设备可以把最终确定的当前谐振频率的数值写入对应的非易失性(non-volatile,NV)参数项中以便后续调用。采用平滑滤波的方式对多个平均加速度进行处理从而得到最大平均加速度,能够有效去除干扰噪声,使得当前谐振频率更精准。Optionally, the electronic device can also connect the above-mentioned multiple average accelerations in a coordinate system, and generate a graph, as shown in FIG. 5 , the horizontal axis is the number of points, and the vertical axis is the acceleration. The average acceleration is shown as an example. Optionally, smooth filtering may also be performed on the data in FIG. 5 to obtain the curve shown in FIG. 6 . Then, the frequency corresponding to the maximum average acceleration in FIG. 6 is superimposed with a preset frequency offset, and used as the current resonance frequency. For example, when the frequency interval corresponding to each AC drive signal is 1HZ, the electronic device uses the data of four average accelerations for smooth filtering, that is, the average value of the average acceleration corresponding to the four nearby frequencies is taken as the average acceleration corresponding to the current frequency, and then the maximum Add 2HZ to the frequency corresponding to the average acceleration as the current resonance frequency. Optionally, the electronic device may write the finally determined value of the current resonance frequency into a corresponding non-volatile (non-volatile, NV) parameter item for subsequent calling. The smooth filtering method is used to process multiple average accelerations to obtain the maximum average acceleration, which can effectively remove interference noise and make the current resonant frequency more accurate.
本实施例中,电子设备获取多个交流驱动信号驱动马达震动时的每个交流驱动信号对应的多个加速度数据,由于上述多个交流驱动信号的频率分布在马达的驱动频率范围内,因此电子设备能够采用扫频的方式获取驱动频率范围内多个频率对应的多个加速度数据。然后电子设备根据每个交流信号对应的平均加速度中的最大平均加速度,准确便捷地确定最大平均加速度对应的当前谐振频率。该方法无需通过增加反馈电路的方式来对马达的频率进行调整,因此节约了成本。同时,该方法由于不增加反馈电路,因此对硬件的要求较低,应用场景更为广泛。In this embodiment, the electronic device acquires multiple acceleration data corresponding to each AC drive signal when the motor vibrates with multiple AC drive signals. Since the frequencies of the multiple AC drive signals are distributed within the drive frequency range of the motor, the electronic device The device can acquire multiple acceleration data corresponding to multiple frequencies within the driving frequency range by sweeping the frequency. Then the electronic device accurately and conveniently determines the current resonance frequency corresponding to the maximum average acceleration according to the maximum average acceleration among the average accelerations corresponding to each AC signal. The method does not need to adjust the frequency of the motor by adding a feedback circuit, thus saving cost. At the same time, since the method does not increase the feedback circuit, the requirements for hardware are lower, and the application scenarios are more extensive.
可选地,在上述图3所示的实施例基础上,步骤S320的一种实现方式还可以包括:为了便于计算,电子设备将上述多个交流驱动信号中每个交流驱动信号对应的加速度数据进行去负数的处理,即对每个交流驱动信号对应的加速度数据取峰峰值,然后基于每个交流驱动信号对应的峰峰值确定多个交流驱动信号中每个交流驱动信号对应的平均加速度。采用峰峰值确定平均加速度,相比直接将负值部分的数据删除的做法,峰峰值能够将数据间的差异拉大,便于筛选和比较。Optionally, on the basis of the above-mentioned embodiment shown in FIG. 3 , an implementation manner of step S320 may further include: in order to facilitate calculation, the electronic device converts the acceleration data corresponding to each AC drive signal in the above-mentioned multiple AC drive signals. The processing of removing negative numbers is performed, that is, the peak-to-peak value of the acceleration data corresponding to each AC drive signal is obtained, and then the average acceleration corresponding to each of the multiple AC drive signals is determined based on the peak-to-peak value corresponding to each AC drive signal. The peak-to-peak value is used to determine the average acceleration. Compared with the method of directly deleting the data of the negative part, the peak-to-peak value can enlarge the difference between the data, which is convenient for screening and comparison.
可选地,上述加速度数据通常为具有周期性的数据,电子设备可以将这个周期性的加速度数据取其原始峰峰值作为第一峰峰值。通常,马达在开始震动的时候会存在过冲,因此可以删除第一峰峰值中开始震动一段时间内的过冲数值来确保数据的有效性。例如,当每个交流驱动信号的第一峰峰值有250个点的数据时,可以删除前80个点来有效去除过冲。可选地,电子设备还可以对第一峰峰值按照预设采样率进行下采样,例如每隔20个点取一个第一峰峰值,作为上述峰峰值。其中,预设采样率可以根据数据的精度要求和运算效率进行设置,如果数据的精度要求高,则可以每10个点或者更少的点取一个第一峰峰值,如果运算效率要求高,则可以每30个点或者跟他过多的点取一个第一峰峰值,对于预设采样率的大小的设置本申请实施例并不做限定。Optionally, the above acceleration data is usually data with periodicity, and the electronic device may take the original peak-to-peak value of the periodic acceleration data as the first peak-to-peak value. Usually, the motor will have overshoot when it starts to vibrate, so you can delete the overshoot value of the first peak-to-peak value that starts to vibrate for a period of time to ensure the validity of the data. For example, when the first peak-to-peak value of each AC drive signal has 250 points of data, the first 80 points can be deleted to effectively remove overshoot. Optionally, the electronic device may further downsample the first peak-to-peak value according to a preset sampling rate, for example, take a first peak-to-peak value every 20 points as the above-mentioned peak-to-peak value. Among them, the preset sampling rate can be set according to the accuracy requirements of the data and the operation efficiency. If the accuracy requirements of the data are high, a first peak-to-peak value can be taken every 10 points or less. If the operation efficiency requirements are high, then A first peak-to-peak value may be taken for every 30 points or too many points, and the setting of the preset sampling rate is not limited in this embodiment of the present application.
可选地,电子设备还可以同时去除第一峰峰值中的过冲数值并进行下采样,来确保数据的有效性以及减小运算量,提高数据处理效率。可选地,电子设备还可以是对上述加速度数据去除过冲点、和/或,对加速度数据按照预设采样率进行下采样,之后再获取处理后的加速度数据的峰峰值,同样能够确保数据的有效性以及减小运算量,提高了数据处理的效率,进而提高了波形文件的生成效率。Optionally, the electronic device may also remove the overshoot value in the first peak-to-peak value and perform down-sampling at the same time, so as to ensure the validity of the data, reduce the amount of computation, and improve the data processing efficiency. Optionally, the electronic device may also remove the overshoot point from the above acceleration data, and/or downsample the acceleration data according to a preset sampling rate, and then obtain the peak-to-peak value of the processed acceleration data, which can also ensure the data. Effectiveness and reduce the amount of computation, improve the efficiency of data processing, and thus improve the generation efficiency of wave files.
在实际采集加速度数据的过程中,可以使马达处于固定状态下进行采集,这样得到的固定状态下的加速度数据过冲会大大减少,从而使得峰峰值的过冲减小,进一步提高了所确定的当前谐振频率的准确性。如图7和图8所示,图7为马达固定状态下所采集的加速度数据,图8为马达悬空状态下所采集的加速度数据,相比之下,图8中多个频率的交流驱动信号的驱动下,马达在开始震动时存在明显过冲,表现在图8中,为多个突起的毛刺。In the process of actually collecting the acceleration data, the motor can be collected in a fixed state, so that the overshoot of the acceleration data obtained in the fixed state will be greatly reduced, so that the peak-to-peak overshoot is reduced, and the determined value is further improved. The accuracy of the current resonant frequency. As shown in Figure 7 and Figure 8, Figure 7 is the acceleration data collected when the motor is fixed, Figure 8 is the acceleration data collected when the motor is suspended, in contrast, the AC drive signals of multiple frequencies in Figure 8 Under the driving of , the motor has obvious overshoot when it starts to vibrate, which is shown in Figure 8 as multiple protruding burrs.
可选地,电子设备还可以通过多次重复上述方式,多次获取多个当前谐振频率,来观察这些当前谐振频率的一致性,以确保所得到的当前谐振频率的准确性和有效性。例如图9所示,经过五次测试,所得到的当前谐振频率分布在228HZ和229HZ,通常允许正负2HZ的误差,如果马达的驱动频率范围为230HZ-240HZ,则可以确定马达采用230HZ的谐振频率;如果马达的驱动频率范围为225HZ-235HZ,则可以确定在228HZ的交流驱动信号的驱动下,震感最强。Optionally, the electronic device may also obtain multiple current resonance frequencies by repeating the above method multiple times to observe the consistency of these current resonance frequencies, so as to ensure the accuracy and validity of the obtained current resonance frequencies. For example, as shown in Figure 9, after five tests, the obtained current resonant frequency is distributed between 228HZ and 229HZ, usually allowing a plus or minus 2HZ error. If the motor's driving frequency range is 230HZ-240HZ, it can be determined that the motor adopts 230HZ resonance Frequency; if the driving frequency range of the motor is 225HZ-235HZ, it can be determined that the vibration is the strongest under the driving of the AC driving signal of 228HZ.
为了更清楚的对如何获取当前谐振频率进行完整的描述,此处以一个具体的实施例进行说明。如图10所示,电子设备获取当前谐振频率的方法1000可以包括如下步骤:For a clearer and complete description of how to obtain the current resonance frequency, a specific embodiment is described here. As shown in FIG. 10 , the
S1010、获取230HZ-240HZ中每隔1HZ的11个频率的交流驱动信号驱动马达时的加速度数据。S1010: Acquire acceleration data when the motor is driven by an AC drive signal of 11 frequencies every 1HZ in 230HZ-240HZ.
S1020、对上述加速度数据,每隔20个点的加速度数据取其峰峰值。S1020. For the above acceleration data, take the peak-to-peak value of the acceleration data at every 20 points.
S1030、根据每个交流驱动信号对应的峰峰值获取每个频率的交流驱动信号对应的平均加速度,得到11个频率点对应的平均加速度。S1030 , obtain the average acceleration corresponding to the AC drive signal of each frequency according to the peak-to-peak value corresponding to each AC drive signal, and obtain the average acceleration corresponding to 11 frequency points.
S1040、对11个平均加速度,每四个取平均值,得到平滑滤波后的平均加速度。S1040 , taking the average of 11 average accelerations every four to obtain the average acceleration after smoothing filtering.
S1050、对平滑滤波后的平均加速度取最大值。S1050, taking the maximum value of the average acceleration after smoothing filtering.
S1060、将平滑滤波后的平均加速度中的最大值对应的交流驱动信号的频率加2HZ作为当前谐振频率。S1060 , adding 2 Hz to the frequency of the AC drive signal corresponding to the maximum value of the smoothed and filtered average acceleration as the current resonance frequency.
S1070、将当前谐振频率写入对应的NV中。S1070, write the current resonance frequency into the corresponding NV.
本实施例中获取当前谐振频率的实现细节和有益效果可以参见前述实施例钟大哥描述,此处不再赘述。For the implementation details and beneficial effects of obtaining the current resonance frequency in this embodiment, reference may be made to the description of Brother Zhong in the foregoing embodiment, which will not be repeated here.
上述实施例对电子设备如何获取马达的当前谐振频率进行了描述,下面将对如何基于当前谐振频率生成用于驱动马达的波形文件的具体过程进行说明。The above embodiments describe how the electronic device obtains the current resonant frequency of the motor. The following will describe the specific process of how to generate a waveform file for driving the motor based on the current resonant frequency.
本申请实施例可以通过对初始谐振频率的初始波形文件进行扩频来实现。首先我们定义第一比例系数,即将当前谐振频率比初始谐振频率的比值作为比例系数,以当前谐振频率为232HZ,初始谐振频率为235HZ为例,该比例系数Vision=232/235,该比例系数可以采用浮点数。可选地,如果是CPU的内核不能进行浮点数的计算,则可以统一将数值扩大10000倍进行运算。然后定义一个权重系数,该权重系数a0用于表征当前谐振频率的电压数据和对应点处的初始谐振频率的采样点的电压数据的关联程度,可以用公式a0=(index+1)×Vision-(index+1)或者该公式的变形得到,其中,index为电压数据的序号,为一个变量,通常作为电压数据N的下标。当前谐振频率对应的电压数据可以用公式The embodiment of the present application may be implemented by performing spectrum spreading on the initial waveform file of the initial resonance frequency. First, we define the first proportional coefficient, that is, the ratio of the current resonant frequency to the initial resonant frequency as the proportional coefficient. Taking the current resonant frequency as 232HZ and the initial resonant frequency as 235HZ as an example, the proportional coefficient Vision=232/235, the proportional coefficient can be Take floating point numbers. Optionally, if the core of the CPU cannot perform the calculation of floating-point numbers, the numerical value can be uniformly expanded by 10,000 times for operation. Then define a weight coefficient, the weight coefficient a 0 is used to characterize the degree of correlation between the voltage data of the current resonance frequency and the voltage data of the sampling point of the initial resonance frequency at the corresponding point, which can be expressed by the formula a 0 =(index+1)× Vision-(index+1) or a variant of this formula, where index is the serial number of the voltage data, which is a variable, and is usually used as a subscript of the voltage data N. The voltage data corresponding to the current resonant frequency can be calculated by the formula
或该公式的变形得到。其中,index从1开始逐次加1,从而得到当前谐振频率对应的多个点的电压数据,形成变换后的波形文件,该变换后的波形文件能够按照当前谐振频率驱动马达震动。or a variant of this formula. Among them, the index starts from 1 and increases by 1 successively, so as to obtain the voltage data of multiple points corresponding to the current resonant frequency, and form a transformed waveform file. The transformed waveform file can drive the motor to vibrate according to the current resonant frequency.
但是采用上述方式生成波形文件,由于index越来越大,所以每次计算得到的电压数据也会越来越大,如图11所示,所生成的波形文件对应电压数据的振幅也就越来越大,因此不合理。因此我们对上述扩频的过程进行改进,具体可以参见下述实施例。However, using the above method to generate a waveform file, because the index becomes larger and larger, the voltage data obtained by each calculation will also become larger and larger. As shown in Figure 11, the generated waveform file corresponding to the voltage data The amplitude of the data also becomes larger and larger. larger and therefore unreasonable. Therefore, we improve the above-mentioned process of spreading, and the details may refer to the following embodiments.
图12为本申请实施例提供的一例生成波形文件的方法流程图。如图12所示,该方法1200包括:FIG. 12 is a flowchart of an example of a method for generating a waveform file provided by an embodiment of the present application. As shown in Figure 12, the
S1210、获取马达的初始谐振频率和当前谐振频率。S1210: Obtain the initial resonance frequency and the current resonance frequency of the motor.
具体的,电子设备获取初始谐振频率和当前谐振频率。该当前谐振频率可以采用上述实施例中所描述的当前谐振频率的获取方式得到。初始谐振频率则可以为初始波形文件对应的频率。该初始波形文件为对应特定频率的波形文件,可以生成初始谐振频率的交流驱动信号来驱动马达震动,可以预先存储在电子设备中或者存储在云端设备以便调用。Specifically, the electronic device acquires the initial resonance frequency and the current resonance frequency. The current resonance frequency can be obtained by using the acquisition method of the current resonance frequency described in the foregoing embodiments. The initial resonance frequency can be the frequency corresponding to the initial waveform file. The initial waveform file is a waveform file corresponding to a specific frequency, which can generate an AC drive signal with an initial resonant frequency to drive the motor to vibrate, and can be pre-stored in an electronic device or stored in a cloud device for recall.
S1220、当所述初始谐振频率和所述当前谐振频率不同时,根据第一电压幅值和第二电压幅值确定第三电压幅值。S1220. When the initial resonance frequency and the current resonance frequency are different, determine a third voltage amplitude according to the first voltage amplitude and the second voltage amplitude.
通常,初始谐振频率和当前谐振频率不同时,需要对初始波形文件进行转换。如果初始谐振频率和当前谐振频率相同,则无需进行波形文件的转换。在波形文件转换过程中,主要是将初始波形文件中每个采样点的电压数据转换生成新的电压数据。Usually, when the initial resonant frequency is different from the current resonant frequency, the initial waveform file needs to be converted. If the initial resonant frequency and the current resonant frequency are the same, no conversion of the waveform file is required. In the waveform file conversion process, the voltage data of each sampling point in the initial waveform file is mainly converted to generate new voltage data.
这里将初始谐振频率对应的交流驱动信号的两个相邻采样点的电压数据,例如幅值,作为第一电压幅值和第二电压幅值,其中第一电压幅值的采样时间在第二电压幅值之前,即第一电压幅值对应的相位小于第二电压幅值对应的相位。Here, the voltage data, such as amplitudes, of two adjacent sampling points of the AC drive signal corresponding to the initial resonant frequency are taken as the first voltage amplitude and the second voltage amplitude, wherein the sampling time of the first voltage amplitude is at the second Before the voltage amplitude, that is, the phase corresponding to the first voltage amplitude is smaller than the phase corresponding to the second voltage amplitude.
首先定义第一比例系数Vision1,将当前谐振频率比初始谐振频率的比值作为第一比例系数,即Vision1=F0/F,其中,F0为当前谐振频率,F为初始谐振频率。这里根据第一比例系数获取第二权重系数a根据公式a=(index+1)×Vision1-ROUNDDOWN(index+1)×Vision1或者该公式的变形得到,其中,“ROUNDDOWN”为对绝对值取整的函数,D=ROUNDDOWN(index+1)×Vision1,第一权重系数b=1-a。则第三电压幅值可以根据公式Nindex×b+Nindex+1×a或者Nindex×(1-a)+Nindex+1×a,或者这两个公式的变形得到,其中Nindex为第一电压幅值,Nindex+1则为第二电压幅值。First define the first proportional coefficient Vision 1 , and take the ratio of the current resonance frequency to the initial resonance frequency as the first proportional coefficient, namely Vision 1 =F 0 /F, where F 0 is the current resonance frequency and F is the initial resonance frequency. Here, the second weighting coefficient a is obtained according to the first proportional coefficient according to the formula a=(index+1)×Vision 1 -ROUNDDOWN(index+1)×Vision 1 or the deformation of the formula, where “ROUNDDOWN” is the absolute value of The rounded function, D=ROUNDDOWN(index+1)×Vision 1 , the first weight coefficient b=1-a. Then the third voltage amplitude can be obtained according to the formula N index ×b+N index+1 ×a or N index ×(1-a)+N index+1 ×a, or the deformation of these two formulas, where N index is The first voltage amplitude, N index+1 is the second voltage amplitude.
可以理解,在初始波形文件中的一个采样点处的相位,可以通过乘以第一比例系数得到当前波形文件的对应的一个采样点的相位,如果将每个采样点的间隔的相位作为一个时间单位,则当前波形文件的采样点的相位和对应的初始波形文件中的这个采样点处的相位的相位差的大小程度,则可以根据采样点的序号加一的和乘以第一比例系数的积的小数部分表征,即a=(index+1)×Vision1-ROUNDDOWN(index+1)×Vision1。由于将每个采样点处的相位作为一个时间单位,因此a为归一化的数值,将当前波形文件和初始波形文件的起始点拉齐的情况下,a可以用来表示在时间轴上第三电压幅值距离第一电压幅值的远近。当前波形文件的这个采样点对应的相位和对应的初始波形文件中的下一个采样点处的相位的相位差,则可以用b=1-a表征第三电压幅值距离第二电压幅值的远近。通过第一权重系数和第二权重系数,能够按照第三电压幅值距离第一电压幅值和第二电压幅值的远近程度,将第一电压幅值和第二电压幅值实现加权,得到第三电压幅值。It can be understood that the phase at a sampling point in the initial waveform file can be multiplied by the first scale factor to obtain the phase of a corresponding sampling point in the current waveform file. If the phase of the interval of each sampling point is taken as a time unit, then the magnitude of the phase difference between the phase of the sampling point in the current waveform file and the phase at this sampling point in the corresponding initial waveform file can be multiplied by the first proportional coefficient according to the number of the sampling point plus one. The fractional representation of the product, ie a=(index+1)×Vision 1 −ROUNDDOWN(index+1)×Vision 1 . Since the phase at each sampling point is taken as a time unit, a is a normalized value. In the case of aligning the starting points of the current waveform file and the initial waveform file, a can be used to represent the first time on the time axis. The distance between the three voltage amplitudes and the first voltage amplitude. The phase difference between the phase corresponding to this sampling point in the current waveform file and the phase at the next sampling point in the corresponding initial waveform file can be represented by b=1-a to represent the distance between the third voltage amplitude and the second voltage amplitude. far and near. Through the first weighting coefficient and the second weighting coefficient, the first voltage amplitude and the second voltage amplitude can be weighted according to the distance between the third voltage amplitude and the first voltage amplitude and the second voltage amplitude to obtain The third voltage amplitude.
以当前谐振频率为232HZ,初始谐振频率为235HZ为例,参见图13所示,将数轴作为电压数据对应的相位来表征采样点的时间。在235HZ的数轴上,以第二个采样点和第三个采样点为例,其中1/235处为第二个采样点,此处的电压数据,作为第一电压幅值,2/235处为第三个采样点,此处的电压数据为第二电压幅值。则在232HZ的数轴上,1/232处的第三电压幅值可以根据公式Nindex×(1-a)+Nindex+1×a或者该公式的变形计算得到。基于图13所示,上述第三电压幅值对应的相位大于第一电压幅值对应的相位且小于第二电压幅值对应的相位,即第三电压幅值距离当前波形文件首个采样点,即当前波形文件的起始点的时差,大于第一电压幅值距离初始波形文件距离首个采样点,即初始波形文件的起始点的时差,且小于第二电压幅值距离初始波形文件距离起始点的时差。如图13中,1/232处的第三电压幅值的横坐标对应在第一电压幅值和第二电压幅值的横坐标之间。将第三电压幅值对应的相位和第一电压幅值对应的相位之差作为第一相位差,第三电压幅值和第二电压幅值对应的相位之差作为第二相位差。由图13可知,第一相位差和第二相位差之和能够表征一个时间单位,因此电子设备将第一相位差除以第一相位差和第二相位差的和得到的值作为第二权重系数a,即采用公式a=(index+1)×Vision1-ROUNDDOWN(index+1)×Vision1,获取第三电压幅值和第一电压幅值对应的相位差对应的归一化系数,作为第二权重系数a,a能够表征第三电压幅值距离第一电压幅值的远近程度;将第二相位差除以第一相位差和第二相位差的和得到的值作为第一权重系数b,也可以采用b=1-a的公式,获取第三电压幅值和第二电压幅值对应的相位差对应的归一化系数,作为第一权重系数b,b能够表征第三电压幅值距离第二电压幅值的远近程度。将上述第一电压幅值与第一权重系数的乘积作为第一数值,即第一数值为Nindex×(1-a)或Nindex×b,将第二电压幅值与第二权重系数的乘积作为第二数值,即第二数值为Nindex+1×a,其中,第三电压幅值与第一数值和第二数值的和正相关,例如将上述第一数值Nindex×(1-a)加上第二数值Nindex+1×a,作为第三电压幅值。可选地,如果第三电压幅值为当前谐振频率对应的首个采样点,则直接采用初始波形文件的第一个采样点的电压数据,即首个采样点的电压数据作为当前谐振频率对应的第一个采样点的电压数据即可。Taking the current resonant frequency as 232HZ and the initial resonant frequency as 235HZ as an example, as shown in Figure 13, the number axis is used as the phase corresponding to the voltage data to represent the time of the sampling point. On the 235HZ number axis, take the second sampling point and the third sampling point as an example, where 1/235 is the second sampling point, and the voltage data here is the first voltage amplitude, at 2/235 is the third sampling point, and the voltage data here is the second voltage amplitude. Then on the number axis of 232HZ, the third voltage amplitude at 1/232 can be calculated according to the formula N index ×(1-a)+N index+1 ×a or a deformation of the formula. As shown in Figure 13, the phase corresponding to the third voltage amplitude is greater than the phase corresponding to the first voltage amplitude and smaller than the phase corresponding to the second voltage amplitude, that is, the third voltage amplitude is away from the first sampling point of the current waveform file, That is, the time difference between the starting point of the current waveform file is greater than the time difference between the first voltage amplitude and the initial waveform file and the first sampling point, that is, the time difference between the starting point of the initial waveform file, and is smaller than the second voltage amplitude and the starting point of the initial waveform file. time difference. As shown in FIG. 13 , the abscissa of the third voltage amplitude at 1/232 corresponds to the abscissa between the first voltage amplitude and the second voltage amplitude. The difference between the phase corresponding to the third voltage amplitude and the phase corresponding to the first voltage amplitude is taken as the first phase difference, and the difference between the phase corresponding to the third voltage amplitude and the second voltage amplitude is taken as the second phase difference. It can be seen from Fig. 13 that the sum of the first phase difference and the second phase difference can represent a time unit, so the electronic device divides the first phase difference by the sum of the first phase difference and the second phase difference as the second weight. Coefficient a, that is, using the formula a=(index+1)×Vision 1 -ROUNDDOWN(index+1)×Vision 1 to obtain the normalization coefficient corresponding to the phase difference corresponding to the third voltage amplitude and the first voltage amplitude, As the second weight coefficient a, a can represent the distance between the third voltage amplitude and the first voltage amplitude; the value obtained by dividing the second phase difference by the sum of the first phase difference and the second phase difference is used as the first weight For the coefficient b, the formula of b=1-a can also be used to obtain the normalized coefficient corresponding to the phase difference corresponding to the third voltage amplitude and the second voltage amplitude. As the first weight coefficient b, b can represent the third voltage How far the amplitude is from the second voltage amplitude. The product of the above-mentioned first voltage amplitude and the first weighting coefficient is taken as the first value, that is, the first value is N index ×(1-a) or N index ×b, and the second voltage amplitude and the second weighting coefficient are calculated. The product is taken as the second value, that is, the second value is N index+1 ×a, where the third voltage amplitude is positively correlated with the sum of the first value and the second value, for example, the above first value N index ×(1-a ) plus the second value N index+1 ×a as the third voltage amplitude. Optionally, if the third voltage amplitude is the first sampling point corresponding to the current resonance frequency, the voltage data of the first sampling point of the initial waveform file is directly used, that is, the voltage data of the first sampling point is used as the corresponding current resonance frequency. The voltage data of the first sampling point can be obtained.
S1230、根据所述第三电压幅值生成当前波形文件,其中,所述当前波形文件用于生成所述当前谐振频率对应的交流驱动信号,所述第三电压幅值为所述当前谐振频率对应的交流驱动信号的一个采样点。S1230. Generate a current waveform file according to the third voltage amplitude, wherein the current waveform file is used to generate an AC drive signal corresponding to the current resonance frequency, and the third voltage amplitude is corresponding to the current resonance frequency A sampling point of the AC drive signal.
具体的,电子设备通过逐点计算当前谐振频率的多个第三电压幅值,从而得到当前谐振频率对应的交流驱动信号的多个采样点的电压数据,生成当前波形文件。需要说明的是,该当前波形文件能够生成当前谐振频率对应的交流驱动信号,用来驱动马达按照谐振频率进行震动。Specifically, the electronic device calculates multiple third voltage amplitudes of the current resonance frequency point by point, thereby obtaining voltage data of multiple sampling points of the AC drive signal corresponding to the current resonance frequency, and generating the current waveform file. It should be noted that the current waveform file can generate an AC drive signal corresponding to the current resonance frequency, which is used to drive the motor to vibrate according to the resonance frequency.
本实施例中,由于第一电压幅值和第二电压幅值为初始谐振频率对应的交流驱动信号的两个相邻采样点的幅值,第三电压幅值对应的相位大于第一电压幅值对应的相位且小于第二电压幅值对应的相位,第三电压幅值对应的相位与第一电压幅值对应的相位的差为第一相位差,第三电压幅值对应的相位与第二电压幅值对应的相位的差为第二相位差,第三电压幅值与第一数值和第二数值的和正相关,第一数值为第一电压幅值与第一权重系数的乘积,第二数值为第二电压幅值与第二权重系数的乘积,第一权重系数为第二相位差除以第一相位差和第二相位差的和得到的值,第二权重系数为第一相位差除以第一相位差和第二相位差的和得到的值。因此基于上述数据关系,电子设备根据第一电压幅值和第二电压幅值确定得到的第三电压幅值,能够利用表征第三电压幅值与第一电压幅值和第二电压幅值的远近程度的第二权重系数和第一权重系数,对第一电压幅值和第二电压幅值进行合理的加权处理,得到了合理准确的第三电压幅值。因此基于该第三电压幅值生成的当前波形文件,实现了将初始谐振频率的初始波形文件转换为当前谐振频率的当前波形文件,以此生成交流驱动信号来驱动马达,相比传统的采用反馈电路的方式进行马达校准,通过增加反馈电路的方式来对马达的频率进行调整,因此节约了成本。同时,该方法由于不增加反馈电路,因此对硬件的要求较低,应用场景更为广泛。In this embodiment, since the first voltage amplitude and the second voltage amplitude are the amplitudes of two adjacent sampling points of the AC drive signal corresponding to the initial resonance frequency, the phase corresponding to the third voltage amplitude is greater than the first voltage amplitude The phase corresponding to the value is smaller than the phase corresponding to the second voltage amplitude, the difference between the phase corresponding to the third voltage amplitude and the phase corresponding to the first voltage amplitude is the first phase difference, and the phase corresponding to the third voltage amplitude is the same as the first phase difference. The difference between the phases corresponding to the two voltage amplitudes is the second phase difference, the third voltage amplitude is positively correlated with the sum of the first value and the second value, the first value is the product of the first voltage amplitude and the first weight coefficient, and the third voltage amplitude is positively correlated with the sum of the first value and the second value. The second value is the product of the second voltage amplitude and the second weight coefficient, the first weight coefficient is the value obtained by dividing the second phase difference by the sum of the first phase difference and the second phase difference, and the second weight coefficient is the first phase difference A value obtained by dividing the difference by the sum of the first phase difference and the second phase difference. Therefore, based on the above data relationship, the electronic device determines the third voltage amplitude according to the first voltage amplitude and the second voltage amplitude, and can use the relationship between the third voltage amplitude and the first voltage amplitude and the second voltage amplitude The second weighting coefficient and the first weighting coefficient of the distance degree are reasonably weighted to the first voltage amplitude and the second voltage amplitude, and a reasonable and accurate third voltage amplitude is obtained. Therefore, based on the current waveform file generated by the third voltage amplitude, it is possible to convert the initial waveform file of the initial resonant frequency into the current waveform file of the current resonant frequency, thereby generating an AC drive signal to drive the motor. The motor is calibrated by means of a circuit, and the frequency of the motor is adjusted by adding a feedback circuit, thus saving costs. At the same time, since the method does not increase the feedback circuit, the requirements for hardware are lower, and the application scenarios are more extensive.
采用图12所示的方法所生成的波形文件对应的电压数据可以如图14所示,该方式不会导致电压数据越来越大,因此数据更为合理。The voltage data corresponding to the waveform file generated by the method shown in FIG. 12 can be as shown in FIG. 14 . This method does not cause the voltage data to become larger and larger, so the data is more reasonable.
可选地,在上述实施例的基础上,当前谐振频率小于初始谐振频率时,所得到的当前波形文件的采样点数量会变多,例如图15所示,采用235HZ的交流驱动信号时,一个周期内的电压数据的采样点的个数为409个,采用230HZ的交流驱动信号时,一个周期内的电压数据的采样点的个数为400个,采用240HZ的交流驱动信号时,一个周期内的电压数据的采样点的个数为418个。如果采样点变多后,则所生成的当前波形文件可能不是完整波形周期的文件,此时可以通过本实施例对采样点的个数进行确定,得到具有完整周期的当前波形文件,上述步骤S1230的一种可能的实现方式可以包括:Optionally, on the basis of the above embodiment, when the current resonant frequency is less than the initial resonant frequency, the number of sampling points of the obtained current waveform file will increase. For example, as shown in FIG. The number of sampling points of voltage data in a cycle is 409. When using 230HZ AC drive signal, the number of sampling points of voltage data in one cycle is 400. When using 240HZ AC drive signal, in one cycle The number of sampling points of the voltage data is 418. If the number of sampling points increases, the generated current waveform file may not be a file with a complete waveform cycle. At this time, the number of sampling points can be determined in this embodiment to obtain a current waveform file with a complete cycle. The above step S1230 One possible implementation could include:
电子设备将初始波形文件中的电压数据的个数PointSUM除以初始波形文件对应的交流驱动信号的周期的数量,即除以第一周期数量T,作为初始波形文件中属于一个交流驱动信号周期的电压数据的个数,通常个数取整数。即第一数据数量Tpoint=PointSUM/T,或者Tpoint=ROUNDDOWN(PointSUM/T)。电子设备将初始谐振频率F与当前谐振频率F0的比值作为第一变换系数,将第一数据数量和第一变换系数的乘积取整作为第二数据数量,即第二数据数量T1point为对Tpoint×(F/F0)取整处理后得到的值。通常T1point=ROUNDDOWN(Tpoint×(F/F0)),当第一数据数量和第一变换系数的乘积为整数时,T1point=Tpoint×(F/F0)。其中,该第二数据数量为当前波形文件中属于一个交流驱动信号周期的电压数据的个数。电子设备将当前谐振频率F0与初始谐振频率F的比值作为第二变换系数,将第二变换系数和上述第一周期数量的乘积取整处理后得到的值作为第二周期数量,即第二周期数量T1=ROUNDDOWN(T×(F0/F))。该第二周期数量为当前波形文件包含的电压数据对应的周期数量。之后,电子设备再根据上述第二数据数量T1point和第二周期数量T1和上述第三电压幅值生成当前波形文件。具体的,电子设备根据第二数据数量T1point和第二周期数量T1确定出当前波形文件所需要的电压数据的个数NewPointSUM,例如NewPointSUM=T1×T1point。将第二数据数量T1point和第二周期数量T1的乘积作为当前波形文件所需要的电压数据的个数。电子设备对所生成的多个第三电压幅值按照NewPointSUM进行提取,即将多个第三电压幅值的中超过NewPointSUM数量的电压数据删除掉,来确保当前波形文件生成的交流驱动信号为整周期的信号,从而确保震感连续。The electronic device divides the number of voltage data in the initial waveform file Point SUM by the number of cycles of the AC drive signal corresponding to the initial waveform file, that is, divided by the first cycle number T, as the initial waveform file belongs to one AC drive signal cycle The number of voltage data, usually an integer. That is, the first data amount T point =Point SUM /T, or T point =ROUNDDOWN(Point SUM /T). The electronic device uses the ratio of the initial resonant frequency F to the current resonant frequency F 0 as the first transformation coefficient, and rounds the product of the first data quantity and the first transformation coefficient as the second data quantity, that is, the second data quantity T 1point is a pair of A value obtained by rounding T point ×(F/F 0 ). Usually T 1point =ROUNDDOWN(T point ×(F/F 0 )), when the product of the first data amount and the first transform coefficient is an integer, T 1point =T point ×(F/F 0 ). Wherein, the second data quantity is the quantity of voltage data belonging to one AC drive signal cycle in the current waveform file. The electronic device takes the ratio of the current resonant frequency F 0 to the initial resonant frequency F as the second transformation coefficient, and takes the value obtained by rounding the product of the second transformation coefficient and the first cycle number as the second cycle number, that is, the second cycle number. The number of cycles T 1 =ROUNDDOWN(T×(F 0 /F)). The second number of cycles is the number of cycles corresponding to the voltage data contained in the current waveform file. After that, the electronic device generates a current waveform file according to the second data quantity T 1point , the second period quantity T 1 and the third voltage amplitude. Specifically, the electronic device determines the number of voltage data NewPoint SUM required by the current waveform file according to the second data quantity T 1point and the second period quantity T 1 , for example, NewPoint SUM =T 1 ×T 1point . The product of the second data quantity T 1point and the second period quantity T 1 is taken as the quantity of voltage data required by the current waveform file. The electronic device extracts the generated multiple third voltage amplitudes according to NewPoint SUM , that is, deletes the voltage data that exceeds the number of NewPoint SUM among the multiple third voltage amplitudes, to ensure that the AC drive signal generated by the current waveform file is The signal of the whole cycle, so as to ensure the continuity of vibration.
在一个实施例中,以初始谐振频率为235HZ,当前谐振频率为232HZ,当第一周期数量T为24,初始波形文件中的电压数据的个数PointSUM为9880,从而得到第以数据数量Tpoint=PointSUM/T的整数部分为411,即初始波形文件中交流驱动信号的每个周期中又408个数据。然后电子设备计算第二数据数量T1point为Tpoint×(F/F0)的整数部分可得T1point=411×(235/232)=416。然后电子设备根据公式T1=ROUNDDOWN(T×(F0/F))=ROUNDDOWN(24×(232/235))=23,得到第二周期数量T1为23,最后将当前波形文件所需要的电压数据的个数NewPointSUM=T1×T1point=23×416=9568。电子设备则在所生成的第三电压幅值中提取出前9568个电压数据生成当前波形文件,同时将其余数据丢弃。In one embodiment, the initial resonant frequency is 235HZ, the current resonant frequency is 232HZ, when the first cycle number T is 24, and the number of voltage data Point SUM in the initial waveform file is 9880, so as to obtain the first data number T point = The integer part of Point SUM /T is 411, which is another 408 data in each cycle of the AC drive signal in the initial waveform file. Then, the electronic device calculates the second data quantity T 1point as the integer part of T point ×(F/F 0 ), so that T 1point =411×(235/232)=416. Then, according to the formula T 1 =ROUNDDOWN(T×(F 0 /F))=ROUNDDOWN(24×(232/235))=23, the electronic device obtains the second cycle number T 1 as 23, and finally the current waveform file needs The number of voltage data NewPoint SUM =T 1 ×T 1point =23×416=9568. The electronic device extracts the first 9568 voltage data from the generated third voltage amplitude to generate the current waveform file, and discards the remaining data at the same time.
本实施例中,电子设备通过表征当前谐振频率和初始谐振频率的比例关系的第一变换系数和第二变换系数,并分别基于第一变换系数和第二变换系数,依据初始波形文件的第一周期数量和第一数据数量,得到当前波形文件所需要的第二周期数量和第二数据数量,进一步根据第二周期数量和第二数据数量的乘积得到当前波形文件所需要的电压数据的个数,之后按照所需要的电压数据的个数对第三电压幅值进行提取,从而去除部分电压数据得到完整周期的波形文件数据,以确保震感的连续性,提高了用户的体验。In this embodiment, the electronic device uses the first transformation coefficient and the second transformation coefficient that represent the proportional relationship between the current resonance frequency and the initial resonance frequency, and based on the first transformation coefficient and the second transformation coefficient, respectively, according to the first transformation coefficient of the initial waveform file. The number of cycles and the number of first data, to obtain the number of second cycles and the number of data required by the current waveform file, and further obtain the number of voltage data required by the current waveform file according to the product of the number of second cycles and the number of second data , and then extract the third voltage amplitude according to the required number of voltage data, thereby removing part of the voltage data to obtain the waveform file data of a complete cycle, so as to ensure the continuity of the shock sensation and improve the user experience.
可选地,当马达的震动模式为长震模式的时候,例如处于振铃状态,如来电震动或者闹钟震动,通常初始波形文件不会存储很长的波形,如果为长震模式,则需要对初始波形文件变换频率后循环驱动马达以满足震动时长。如果变换后的当前波形文件不是完整周期,则在循环的时候出现震感不连续,采用上述实施例,电子设备获取所需要的电压数据的个数,按照所需要的电压数据的个数对第三电压幅值进行提取,从而得到完整周期的当前波形文件,例如图16所示,图16中的波形为完整周期的波形,能够在循环驱动马达时保证波形连续,因此在长震模式的情况下,采用当前波形文件循环驱动马达则不会发生震感不连续的情况,因此提高了用户的体验。Optionally, when the vibration mode of the motor is in the long vibration mode, for example in a ringing state, such as the vibration of an incoming call or the vibration of an alarm clock, usually the initial waveform file will not store a very long waveform. After the initial wave file changes the frequency, the motor is driven cyclically to meet the vibration duration. If the transformed current waveform file is not a complete cycle, the shock sensation is discontinuous during the cycle. Using the above embodiment, the electronic device obtains the required number of voltage data, and compares the third The voltage amplitude is extracted to obtain the current waveform file of the complete cycle. For example, as shown in Figure 16, the waveform in Figure 16 is the waveform of the complete cycle, which can ensure the waveform continuity when driving the motor cyclically. Therefore, in the case of long vibration mode , using the current waveform file to drive the motor circularly will not cause discontinuous vibration, thus improving the user experience.
在一个实施例中,当前谐振频率大于初始谐振频率时,电子设备可以按照获取初始波形文件数据中的电压数据的个数。由于当前谐振频率大于初始谐振频率时,经过频率变换后所得到的第三电压幅值的个数比初始波形文件数据中的电压数据的个数少,因此在不改变波形文件的数据长度的情况下,对剩余的空位进行补零处理,从而得到更新波形文件,使得更新波形文件中的电压数据的个数和初始波形文件中的电压数据的个数相同。例如初始波形文件具有9880个数据,而得到的当前波形文件的电压数据的个数为9568,则对剩余的9880-9568=312个点的空位补零。电子设备通过对当前波形文件进行补零处理,得到与初始波形文件中的电压数据的个数相同的更新波形文件,能够避免改变波形文件的存储的数据长度,因此便于数据存储,能够减少运算量的同时,确保数据处理的准确性。In one embodiment, when the current resonant frequency is greater than the initial resonant frequency, the electronic device may acquire the number of voltage data in the initial waveform file data according to the number. Because when the current resonance frequency is greater than the initial resonance frequency, the number of third voltage amplitudes obtained after frequency conversion is less than the number of voltage data in the initial waveform file data, therefore, without changing the data length of the waveform file Next, perform zero-fill processing on the remaining vacancies, thereby obtaining an updated waveform file, so that the number of voltage data in the updated waveform file is the same as the number of voltage data in the initial waveform file. For example, the initial waveform file has 9880 data, and the obtained number of voltage data of the current waveform file is 9568, then the remaining 9880-9568=312 points are filled with zeros. By performing zero-fill processing on the current waveform file, the electronic device obtains an updated waveform file with the same number of voltage data as the initial waveform file, which can avoid changing the length of the stored data of the waveform file, thus facilitating data storage and reducing the amount of computation. At the same time, ensure the accuracy of data processing.
在上述实施例的基础上,当马达的震动模式为短震模式的时候,例如触摸按键或者通话接通成功时马达的反馈震动时,上述初始谐振频率可以为马达的最小振动频率。如果预先存储的波形文件的频率较高,当前谐振频率较低,对波形文件进行频率转换后,采样点的数量会变多,如果存储电压数据的存储位数不变的话,而初始波形文件对应的时长小于短震的时长,则可能发生波形丢失,例如图17所示,最后一个波形明显发生变异,此时可以预存频率低的初始波形文件来解决。这是,当前谐振频率大于上述最小振动频率,则所生成的当前波形文件中的电压数据的个数小于最小振动频率对应的初始波形文件的电压数据的个数。此时电子设备可以在不改变波形文件的数据长度的情况下,对剩余的空位进行补零处理。例如,当处于短震模式的时候,初始波形文件对应230HZ,为马达的最小谐振频率。此时电子设备对当前波形文件进行最小谐振频率的初始波形文件中的电压数据的个数进行补零处理,得到与初始波形文件中的电压数据的个数相同的更新波形文件,从而避免改变初始波形文件的存储的数据长度,因此便于数据存储,能够减少运算量的同时,确保数据处理的准确性。补零之后的波形文件可以参见图18所示,不会存在波形变异的情况。On the basis of the above embodiment, when the vibration mode of the motor is the short vibration mode, such as the feedback vibration of the motor when a key is touched or a call is successfully connected, the initial resonance frequency may be the minimum vibration frequency of the motor. If the frequency of the pre-stored waveform file is high and the current resonant frequency is low, the number of sampling points will increase after frequency conversion of the waveform file. If the duration is less than the duration of the short shock, the waveform may be lost. For example, as shown in Figure 17, the last waveform is obviously mutated. At this time, the initial waveform file with low frequency can be pre-stored to solve the problem. That is, if the current resonance frequency is greater than the above-mentioned minimum vibration frequency, the number of voltage data in the generated current waveform file is smaller than the number of voltage data in the initial waveform file corresponding to the minimum vibration frequency. At this time, the electronic device can perform zero-fill processing on the remaining empty bits without changing the data length of the waveform file. For example, when in short vibration mode, the initial waveform file corresponds to 230HZ, which is the minimum resonant frequency of the motor. At this time, the electronic device performs zero-fill processing on the number of voltage data in the initial waveform file with the minimum resonant frequency of the current waveform file, and obtains an updated waveform file with the same number of voltage data in the initial waveform file, thereby avoiding changing the initial waveform. The stored data length of the waveform file is convenient for data storage, which can reduce the amount of computation and ensure the accuracy of data processing. The waveform file after zero-filling can be seen in Figure 18, and there will be no waveform variation.
上文详细介绍了本申请提供的生成波形文件的方法的示例。可以理解的是,相应的装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Examples of the method for generating a waveform file provided by the present application are described in detail above. It can be understood that, in order to realize the above-mentioned functions, the corresponding apparatuses include corresponding hardware structures and/or software modules for performing each function. Those skilled in the art should easily realize that the present application can be implemented in hardware or a combination of hardware and computer software with the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请可以根据上述方法示例对生成波形文件的装置进行功能模块的划分,例如,可以将各个功能划分为各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The present application may divide the function modules of the device for generating waveform files according to the above method examples. For example, each function may be divided into each function module, or two or more functions may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that the division of modules in this application is schematic, and is only a logical function division, and other division methods may be used in actual implementation.
图19示出了本申请提供的一种生成波形文件的装置的结构示意图。装置1900包括获取模块1901、确定模块1902、生成模块1903。FIG. 19 shows a schematic structural diagram of an apparatus for generating a waveform file provided by the present application. The
获取模块1901,用于获取马达的初始谐振频率和当前谐振频率。The obtaining
确定模块1902,用于当所述初始谐振频率和所述当前谐振频率不同时,根据第一电压幅值和第二电压幅值确定第三电压幅值,所述第一电压幅值和所述第二电压幅值为所述初始谐振频率对应的交流驱动信号的两个相邻采样点的幅值,其中,所述第三电压幅值对应的相位大于所述第一电压幅值对应的相位且小于所述第二电压幅值对应的相位,所述第三电压幅值对应的相位与所述第一电压幅值对应的相位的差为第一相位差,所述第三电压幅值对应的相位与所述第二电压幅值对应的相位的差为第二相位差,所述第三电压幅值与第一数值和第二数值的和正相关,所述第一数值为所述第一电压幅值与第一权重系数的乘积,所述第二数值为所述第二电压幅值与第二权重系数的乘积,所述第一权重系数为所述第二相位差除以所述第一相位差和所述第二相位差的和得到的值,所述第二权重系数为所述第一相位差除以所述第一相位差和所述第二相位差的和得到的值。A
生成模块1903,用于根据所述第三电压幅值生成当前波形文件,其中,所述当前波形文件用于生成所述当前谐振频率对应的交流驱动信号,所述第三电压幅值为所述当前谐振频率对应的交流驱动信号的一个采样点的幅值。A
可选地,当所述当前谐振频率小于所述初始谐振频率时,生成模块1903具体用于:获取第一数据数量,所述第一数据数量为初始波形文件中属于一个交流驱动信号周期的电压数据的个数,所述初始波形文件为所述初始谐振频率对应的波形文件;根据所述第一数据数量和第一变换系数确定第二数据数量,所述第一变换系数为所述当前谐振频率与初始谐振频率的比值,所述初始谐振频率为所述初始波形文件对应的交流驱动信号的频率,所述第二数据数量为对所述第一数据数量和所述第一变换系数的乘积取整处理后得到的值;获取第一周期数量,所述第一周期数量为所述初始波形文件对应的交流驱动信号的周期的数量;根据所述第一周期数量和第二变换系数确定第二周期数量,所述第二周期数量为对所述第一周期数量和所述第二变换系数的乘积取整处理后得到的值,所述第二变换系数为所述初始谐振频率与所述当前谐振频率的比值;根据所述第二数据数量、所述第二周期数量和所述第三电压幅值生成所述当前波形文件,所述第二数据数量为所述当前波形文件中属于一个交流驱动信号周期的电压数据的个数,所述第二周期数量为所述当前波形文件包含的电压数据对应的周期数量。Optionally, when the current resonant frequency is less than the initial resonant frequency, the generating module 1903 is specifically configured to: obtain a first data quantity, where the first data quantity is a voltage belonging to one AC drive signal cycle in the initial waveform file The number of data, the initial waveform file is the waveform file corresponding to the initial resonance frequency; the second data amount is determined according to the first data amount and the first transformation coefficient, and the first transformation coefficient is the current resonance frequency The ratio of the frequency to the initial resonant frequency, the initial resonant frequency is the frequency of the AC drive signal corresponding to the initial waveform file, and the second data quantity is the product of the first data quantity and the first transformation coefficient The value obtained after rounding; obtaining the first cycle number, which is the number of cycles of the AC drive signal corresponding to the initial waveform file; determining the first cycle number according to the first cycle number and the second transformation coefficient; The number of two cycles, the second number of cycles is a value obtained by rounding the product of the first number of cycles and the second transformation coefficient, and the second transformation coefficient is the initial resonance frequency and the The ratio of the current resonance frequency; the current waveform file is generated according to the second data quantity, the second period quantity and the third voltage amplitude, and the second data quantity is one of the current waveform files. The number of voltage data in the AC drive signal cycle, and the second number of cycles is the number of cycles corresponding to the voltage data contained in the current waveform file.
可选地,所述马达的震动模式为长震模式。Optionally, the vibration mode of the motor is a long vibration mode.
可选地,当所述当前谐振频率大于所述初始谐振频率时,生成模块1903还用于:对所述当前波形文件进行补零处理,得到更新波形文件,所述更新波形文件中的电压数据的个数和初始波形文件中的电压数据的个数相同,所述初始波形文件为所述初始谐振频率对应的波形文件。Optionally, when the current resonant frequency is greater than the initial resonant frequency, the
可选地,所述马达的震动模式为短震模式,所述初始谐振频率为所述马达的最小振动频率。Optionally, the vibration mode of the motor is a short vibration mode, and the initial resonance frequency is a minimum vibration frequency of the motor.
可选地,获取模块1901具体用于:获取多个交流驱动信号驱动马达震动时的每个交流驱动信号对应的多个加速度数据,所述加速度数据用于表征马达在震动时的加速度的大小,所述多个交流驱动信号的频率分布在所述马达的驱动频率范围内;根据所述多个交流驱动信号的多个加速度数据,确定所述多个交流驱动信号中每个交流驱动信号对应的平均加速度;根据所述多个交流驱动信号的多个平均加速度中的最大平均加速度确定所述当前谐振频率,其中,所述当前谐振频率为所述最大平均加速度对应的交流驱动信号的频率。Optionally, the obtaining
可选地,获取模块1901具体用于:获取所述多个交流驱动信号中每个交流驱动信号对应的加速度数据的峰峰值;根据所述峰峰值确定所述多个交流驱动信号中每个交流驱动信号对应的平均加速度。Optionally, the obtaining
可选地,所述峰峰值为对第一峰峰值去除过冲数值所得到的数据,和/或,所述峰峰值为按照预设采样率对所述第一峰峰值进行下采样所得到的数据;所述第一峰峰值为所述多个交流驱动信号中每个交流驱动信号对应的加速度数据的原始峰峰值。Optionally, the peak-to-peak value is data obtained by removing the overshoot value from the first peak-to-peak value, and/or the peak-to-peak value is obtained by down-sampling the first peak-to-peak value according to a preset sampling rate. data; the first peak-to-peak value is the original peak-to-peak value of the acceleration data corresponding to each of the plurality of AC drive signals.
装置1900执行生成波形文件的方法的具体方式以及产生的有益效果可以参见方法实施例中的相关描述。For the specific manner in which the
本申请实施例还提供了一种电子设备,包括上述处理器。本实施例提供的电子设备可以是图1所示的终端设备100,用于执行上述生成波形文件的方法。在采用集成的单元的情况下,在采用集成的单元的情况下,终端设备可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对终端设备的动作进行控制管理,例如,可以用于支持终端设备执行显示单元、检测单元和处理单元执行的步骤。存储模块可以用于支持终端设备执行存储程序代码和数据等。通信模块,可以用于支持终端设备与其他设备的通信。An embodiment of the present application further provides an electronic device, including the above-mentioned processor. The electronic device provided in this embodiment may be the terminal device 100 shown in FIG. 1 , and is configured to execute the foregoing method for generating a waveform file. In the case of using an integrated unit, the terminal device may include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the actions of the terminal device, for example, may be used to support the terminal device to perform steps performed by the display unit, the detection unit, and the processing unit. The storage module can be used to support the terminal device to execute stored program codes and data. The communication module can be used to support the communication between the terminal device and other devices.
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他终端设备交互的设备。The processing module may be a processor or a controller. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processor may also be a combination that implements computing functions, such as a combination comprising one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and the like. The storage module may be a memory. The communication module may specifically be a device that interacts with other terminal devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的计算机设备可以为具有图1所示结构的终端设备。In one embodiment, when the processing module is a processor and the storage module is a memory, the computer device involved in this embodiment may be a terminal device having the structure shown in FIG. 1 .
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储了计算机程序,当所述计算机程序被处理器执行时,使得处理器执行上述任一实施例所述的生成波形文件的方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the processor is made to execute the description in any of the foregoing embodiments. method for generating wave files.
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的生成波形文件的方法。Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the above-mentioned relevant steps, so as to realize the method for generating a waveform file in the above-mentioned embodiment.
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the above-provided method. The beneficial effects in the corresponding method will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or May be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may be one physical unit or multiple physical units, that is, may be located in one place, or may be distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (which may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above content is only a specific embodiment of the present application, but the protection scope of the present application is not limited to this. Covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (18)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011244525.1A CN114548141A (en) | 2020-11-10 | 2020-11-10 | Method, apparatus, electronic device and readable storage medium for generating waveform file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011244525.1A CN114548141A (en) | 2020-11-10 | 2020-11-10 | Method, apparatus, electronic device and readable storage medium for generating waveform file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114548141A true CN114548141A (en) | 2022-05-27 |
Family
ID=81659968
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011244525.1A Pending CN114548141A (en) | 2020-11-10 | 2020-11-10 | Method, apparatus, electronic device and readable storage medium for generating waveform file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114548141A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116699388A (en) * | 2022-11-22 | 2023-09-05 | 荣耀终端有限公司 | A linear motor calibration method and electronic equipment |
CN117439487A (en) * | 2023-12-21 | 2024-01-23 | 荣耀终端有限公司 | Electronic equipment, resonance frequency detection method and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080048622A1 (en) * | 2006-02-27 | 2008-02-28 | Fee John A | Method and apparatus to determine battery resonance |
CN110536193A (en) * | 2019-07-24 | 2019-12-03 | 华为技术有限公司 | A kind of processing method and processing device of audio signal |
CN111211726A (en) * | 2020-01-16 | 2020-05-29 | 司宏伟 | System for generating motor drive signals |
CN111551848A (en) * | 2019-12-30 | 2020-08-18 | 瑞声科技(新加坡)有限公司 | Motor experience distortion index testing method, electronic equipment and storage medium |
CN111831114A (en) * | 2020-06-09 | 2020-10-27 | 瑞声科技(新加坡)有限公司 | Driving voltage generation method and device, storage medium and electronic equipment |
-
2020
- 2020-11-10 CN CN202011244525.1A patent/CN114548141A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080048622A1 (en) * | 2006-02-27 | 2008-02-28 | Fee John A | Method and apparatus to determine battery resonance |
CN110536193A (en) * | 2019-07-24 | 2019-12-03 | 华为技术有限公司 | A kind of processing method and processing device of audio signal |
CN111551848A (en) * | 2019-12-30 | 2020-08-18 | 瑞声科技(新加坡)有限公司 | Motor experience distortion index testing method, electronic equipment and storage medium |
CN111211726A (en) * | 2020-01-16 | 2020-05-29 | 司宏伟 | System for generating motor drive signals |
CN111831114A (en) * | 2020-06-09 | 2020-10-27 | 瑞声科技(新加坡)有限公司 | Driving voltage generation method and device, storage medium and electronic equipment |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116699388A (en) * | 2022-11-22 | 2023-09-05 | 荣耀终端有限公司 | A linear motor calibration method and electronic equipment |
CN116699388B (en) * | 2022-11-22 | 2024-05-24 | 荣耀终端有限公司 | Linear motor calibration method and electronic equipment |
CN117439487A (en) * | 2023-12-21 | 2024-01-23 | 荣耀终端有限公司 | Electronic equipment, resonance frequency detection method and storage medium |
CN117439487B (en) * | 2023-12-21 | 2024-05-10 | 荣耀终端有限公司 | Electronic equipment, resonance frequency detection method and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021258814A1 (en) | Video synthesis method and apparatus, electronic device, and storage medium | |
CN113722058B (en) | Resource calling method and electronic equipment | |
WO2022127787A1 (en) | Image display method and electronic device | |
CN112114912A (en) | A user interface layout method and electronic device | |
CN109976626A (en) | A kind of switching method and electronic equipment of application icon | |
CN114915721A (en) | Method for establishing connection and electronic equipment | |
CN114095599A (en) | Message display method and electronic device | |
CN116048831B (en) | Target signal processing method and electronic device | |
CN116070035B (en) | Data processing methods and electronic equipment | |
CN110058729B (en) | Method and electronic device for adjusting the sensitivity of touch detection | |
CN114548141A (en) | Method, apparatus, electronic device and readable storage medium for generating waveform file | |
CN111431968A (en) | Cross-device distribution method of service elements, terminal device and storage medium | |
WO2022135195A1 (en) | Method and apparatus for displaying virtual reality interface, device, and readable storage medium | |
WO2022078116A1 (en) | Brush effect picture generation method, image editing method and device, and storage medium | |
CN113407300B (en) | Applied manslaughter assessment methods and related equipment | |
CN118689425A (en) | Image synthesis method, device and electronic device | |
CN118072723A (en) | Cooperative awakening method, device and electronic device | |
CN111982037B (en) | Height measuring method and electronic equipment | |
CN115017227A (en) | Data synchronization method and related equipment | |
CN114828098A (en) | Data transmission method and electronic equipment | |
CN114740986A (en) | Handwriting input display method and related equipment | |
CN114338642A (en) | File transmission method and electronic equipment | |
CN114006976B (en) | Interface display method and terminal equipment | |
CN114449622B (en) | Method and electronic device for calculating Wi-Fi power consumption | |
CN117133311B (en) | Audio scene recognition method and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |