A vibration control method, a vibration device, and a storage medium
Through waveform adaptation and sampling period adjustment, the driving signal is generated to improve the vibration effect, solving the problem of vibration waveform distortion, and achieving the effect of reducing the storage amount while improving the vibration effect.
Patent Information
- Application Number
- CN202111219936.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-10-20
AI Technical Summary
When the existing technology reduces the frequency of the vibration waveform signal and uses a low-frequency PWM drive signal, the vibration waveform is distorted, which in turn affects the vibration effect of the motor. It cannot vibrate completely according to the desired vibration waveform, resulting in poor vibration effect.
By obtaining the preset and expected frequency and sampling rate of the waveform data, perform waveform adaptation, re-determine the expected pulse width or waveform data, adjust the sampling period according to the expected carrier sampling rate, and generate a driving signal to drive the motor to vibrate, retaining more vibration. The details of the waveform improve the vibration effect.
While reducing the storage amount, the vibration effect is improved to ensure that the motor can vibrate according to the desired vibration waveform without increasing the amount of stored waveform data.
Smart Images

Figure CN114021079B
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic applications, and in particular to a vibration control method, a vibration device, and a storage medium. Background Art
[0002] Electronic devices can use vibration to indicate that the user has received a message or a call, etc. In order to achieve different vibration effects, the designer of the vibration waveform will pre-store some vibration waveforms in the memory of the electronic device, and the electronic device can select different vibration waveforms from them according to different vibration scenarios to control the motor to vibrate. However, as users' requirements for vibration sensations become more and more abundant, a large amount of waveform data needs to be stored. In order to reduce the storage amount of waveform data, the vibration waveform signal frequency will be reduced, and a lower frequency pulse width modulation (PWM) drive signal will be used to drive the motor to vibrate. However, reducing the vibration waveform signal frequency and using a low-frequency PWM drive signal will cause the vibration waveform to be distorted, which in turn causes the motor to be unable to vibrate completely according to the expected vibration waveform, resulting in poor vibration effect. Summary of the invention
[0003] The embodiments of the present application provide a vibration control method, a vibration device, and a storage medium, which can improve the vibration effect while reducing the storage amount of vibration data.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a vibration control method, the method comprising:
[0006] Acquiring a preset waveform signal frequency and an expected waveform signal frequency, and / or a preset carrier sampling rate and an expected carrier sampling rate of the waveform data;
[0007] Performing waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain expected pulse width or waveform data;
[0008] A sampling period is determined according to the expected carrier sampling rate, and a driving signal is generated based on the expected pulse width or waveform data and the sampling period; so as to drive the motor to vibrate based on the driving signal.
[0009] In a second aspect, an embodiment of the present application provides a vibration device, the device comprising:
[0010] An acquisition unit, which acquires a preset waveform signal frequency and an expected waveform signal frequency of the waveform data, and / or a preset carrier sampling rate and an expected carrier sampling rate;
[0011] A waveform adaptation unit, configured to perform waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, to obtain an expected pulse width or waveform data;
[0012] A signal generating unit is used to determine a sampling period according to the expected carrier sampling rate, and to generate a driving signal based on the expected pulse width or waveform data and the sampling period; so as to drive the motor to vibrate based on the driving signal.
[0013] In a third aspect, an embodiment of the present application provides a vibration device, which includes: a processor, a memory, and a communication bus; when the processor executes an operating program stored in the memory, the vibration control method as described above is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, wherein the computer program implements the vibration control method as described above when executed by a processor.
[0015] The embodiment of the present application provides a vibration control method, a vibration device, and a storage medium, the method comprising: obtaining a preset waveform signal frequency and an expected waveform signal frequency of waveform data, and / or a preset carrier sampling rate and an expected carrier sampling rate; waveform adaptation of the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain an expected pulse width or waveform data; determining a sampling period according to the expected carrier sampling rate, and generating a driving signal based on the expected pulse width or waveform data and the sampling period; and driving the motor to vibrate based on the driving signal. The above method is implemented by performing waveform adaptation on the waveform data based on the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, and re-determining the expected pulse width or waveform data, the expected pulse width or waveform data retains more details of the vibration waveform, and further, adjusting the sampling period according to the expected carrier sampling rate, and generating a final driving signal based on the expected pulse width or waveform data and the sampling period, so that when the motor is driven to vibrate using the expected pulse width or waveform data, the vibration effect can be improved, and the amount of stored waveform data is not increased. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of a vibration control method provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of an exemplary method of realizing vibration according to a vibration waveform provided in an embodiment of the present application;
[0018] Figure 3 A flowchart of an exemplary vibration device provided in an embodiment of the present application;
[0019] Figure 4 A flowchart of an exemplary sampling rate matching unit provided in an embodiment of the present application;
[0020] Figure 5 A structural diagram of a vibration device provided in an embodiment of the present application Figure 1 ;
[0021] Figure 6 A structural diagram of a vibration device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0022] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] The present application embodiment proposes a vibration control method, such as Figure 1 As shown, the method may include:
[0024] S101 . Acquire a preset waveform signal frequency and an expected waveform signal frequency of waveform data, and / or a preset carrier sampling rate and an expected carrier sampling rate.
[0025] A vibration control method proposed in an embodiment of the present application is applicable to scenarios where vibration is required, such as message prompts, phone prompts, and alarm prompts.
[0026] It should be noted that the vibration device can be any terminal with vibration and data processing functions, such as tablet computers, mobile phones, personal computers (PCs), laptop computers, cameras, wearable devices and other vibration devices.
[0027] It should be noted that the vibration device can set different vibration waveforms for different vibration scenes. The vibration device controls the motor to vibrate based on different vibration waveforms to achieve vibration effects corresponding to different vibration scenes. In the embodiment of the present application, Figure 2 As shown, different expected vibration waveforms are designed in advance, and then the expected vibration waveform is sampled according to the preset waveform signal frequency to obtain amplitude data corresponding to each discrete point in the expected vibration waveform, and the amplitude data is the waveform data of the expected vibration waveform, such as a1, a2, a3, a4..., and the waveform data is stored. Then, the amplitude data is converted into pulse width data, and the pulse width signal is converted into a PWM drive signal based on the preset carrier sampling rate fp. Then, the motor is driven to vibrate according to the expected vibration waveform based on the PWM drive signal.
[0028] In the embodiment of the present application, the mismatch between the preset waveform signal frequency and the preset carrier sampling rate will cause waveform distortion, which will cause the motor to be unable to vibrate completely according to the desired vibration waveform, resulting in poor vibration effect. Figure 2 like Figure 3 As shown, the above-mentioned waveform data is stored in a waveform data storage unit, and the process of converting into a drive signal is implemented by a motor drive unit. A sampling rate matching unit is added between the waveform data storage unit and the motor drive unit to realize the matching process of the preset waveform signal frequency and the preset carrier sampling rate.
[0029] Specifically, in the embodiment of the present application, different parameters can be determined based on different frequency conversion processes.
[0030] Optionally, if the frequency conversion process is based on the waveform signal frequency, the preset waveform signal frequency and the expected waveform signal frequency are obtained; if the frequency conversion process is based on the carrier sampling rate, the preset carrier sampling rate and the expected carrier sampling rate are obtained; if the frequency conversion process is based on the waveform signal frequency and the carrier sampling rate, the preset carrier sampling rate, the preset waveform signal frequency, the expected waveform signal frequency and the expected carrier sampling rate are obtained. Among them, the expected carrier sampling rate and the expected waveform signal frequency are the waveform signal frequency and the carrier sampling rate actually output.
[0031] S102: Perform waveform adaptation on the waveform data according to a preset waveform signal frequency and an expected waveform signal frequency, and / or a preset carrier sampling rate and an expected carrier sampling rate to obtain an expected pulse width or waveform data.
[0032] In an embodiment of the present application, the data adjustment quantity corresponding to the expected pulse width or waveform data is first determined based on the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, and then the specific waveform adaptation method for the waveform data is determined based on the data adjustment quantity and the preset quantity threshold.
[0033] In the embodiment of the present application, if the data adjustment quantity is determined according to the preset waveform signal frequency and the expected waveform signal frequency, as shown in formula (1),
[0034]
[0035] m is the data adjustment quantity, fw is the preset waveform signal frequency, and fw` is the expected waveform signal frequency.
[0036] In the embodiment of the present application, if the data adjustment amount is determined according to the preset carrier sampling rate and the expected carrier sampling rate, as shown in formula (2),
[0037]
[0038] fp is the preset waveform signal frequency, and fp` is the expected waveform signal frequency.
[0039] In the embodiment of the present application, if the data adjustment amount is determined according to the preset waveform signal frequency, the expected waveform signal frequency, the preset carrier sampling rate and the expected carrier sampling rate, as shown in formula (3),
[0040]
[0041] In an optional embodiment, when the data adjustment quantity is greater than a preset quantity threshold, the waveform data is interpolated according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data, and the expected pulse width or waveform data is obtained based on the waveform data and the interpolation data.
[0042] In the embodiment of the present application, waveform data is acquired from a waveform data storage unit, and then interpolation processing is performed on the waveform data based on the previously calculated data adjustment quantity to obtain interpolation data between every two adjacent waveform data.
[0043] In an optional embodiment, the data adjustment quantity can be rounded to obtain a first quantity; then, the amplitude step value is determined based on the first quantity, the first waveform data and the second waveform data; wherein the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; then, based on the first waveform data and the amplitude step value, multiple interpolation data between the first waveform data and the second waveform data are determined; the number of the multiple interpolation data is the same as the first quantity.
[0044] For example, the waveform data is a1, a2, a3...an, and four interpolation data are inserted between a1 and a2, a2 and a3...an-1 and an respectively. Taking inserting four interpolation data between a1 and a2 as an example, the amplitude step value step is first calculated according to formula (4).
[0045] step=(a2-a1) / 4 (4)
[0046] Then, the first interpolation data between a1 and a2 is a1 plus step, the second interpolation data is a1 plus two steps, the third interpolation data is a1 plus three steps, and the third interpolation data is a1 plus four steps.
[0047] In another optional embodiment, the data adjustment quantity can be rounded to obtain a first quantity; then, the first waveform data is determined as each interpolation data between the first waveform data and the second waveform data to obtain multiple interpolation data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; the number of the multiple interpolation data is the same as the first number.
[0048] Exemplarily, the waveform data are a1, a2, a3…an, and 4 interpolation data are inserted between a1 and a2, a2 and a3…an-1 and an respectively. Taking inserting 4 interpolation data between a1 and a2 as an example, the four interpolation data between a1 and a2 are all a1.
[0049] In another optional embodiment, a waveform function corresponding to the waveform data is fitted according to the waveform data; then, the time step value is determined according to the data adjustment quantity and the preset waveform signal frequency; the sampling time of each waveform data is determined according to the preset waveform signal frequency, and the sampling time and time step value of each waveform data are input into the waveform function to obtain multiple interpolation data between every two adjacent waveform data; the number of the multiple interpolation data is the same as the data adjustment number.
[0050] In the embodiment of the present application, there is no need to round the data adjustment quantity, that is, the data adjustment quantity can be an integer or a non-integer, and the corresponding interpolation data can be determined in the fitted waveform function.
[0051] In the embodiment of the present application, the sampling interval between every two adjacent waveform data can be determined according to the preset waveform signal frequency, and then the time step value is determined according to the sampling interval and the number of differences.
[0052] Exemplarily, the waveform data are a1, a2, a3…an, and 4 interpolation data are inserted between a1 and a2, a2 and a3…an-1 and an respectively. Taking the insertion of 4 interpolation data between a1 and a2 as an example, the first interpolation data between a1 and a2 is the data obtained by inputting the sum of the sampling time and time step values of a1 into the waveform function as independent variables, the second interpolation data between a1 and a2 is the data obtained by inputting the sum of the sampling time and two time step values of a1 into the waveform function as independent variables, the third interpolation data between a1 and a2 is the data obtained by inputting the sum of the sampling time and three time step values of a1 into the waveform function as independent variables, and the fourth interpolation data between a1 and a2 is the data obtained by inputting the sampling time and four time step values of a1 into the waveform function as independent variables.
[0053] In another optional embodiment, when the data adjustment quantity is less than or equal to a preset quantity threshold, the sampling interval is determined according to the data adjustment quantity; a group of data is filtered out from the waveform data based on the sampling interval, and the group of data is determined as the expected pulse width or waveform data.
[0054] In the embodiment of the present application, the inverse of the data adjustment quantity can be determined as the sampling interval. Then, for the waveform data, one waveform data is determined every sampling interval, and finally a group of data is obtained.
[0055] S103, determining a sampling period according to an expected carrier sampling rate, and generating a driving signal based on an expected pulse width or waveform data and the sampling period; and driving the motor to vibrate based on the driving signal.
[0056] In the present application embodiment, Figure 4 As shown, the sampling rate matching unit is composed of a waveform data reading cache unit, a waveform data interpolation operation unit and a drive signal output unit, wherein the process of calculating the interpolation data can be implemented by the waveform data interpolation operation unit, and the process of generating the drive signal can be implemented by the drive signal output unit.
[0057] It should be noted that the reference Figure 4 After the driving signal is generated, the waveform data in the waveform data read cache unit can also be updated based on the driving signal. The specific operation can be selected according to the actual situation, and the embodiment of the present application does not make specific limitations.
[0058] In an embodiment of the present application, the inverse of the desired carrier sampling rate is determined as the sampling period, and then the sum of each pulse width data and the sampling period is determined as the number of high levels in each sampling period, and the remaining number except the high level data in each sampling period is determined as the number of low levels, thereby obtaining a driving signal, and finally driving the motor to vibrate according to the driving signal to achieve the corresponding vibration effect.
[0059] It should be noted that the driving signal of the embodiment of the present application includes but is not limited to a PWM signal, which can be a single-stage PWM signal, a bipolar PWM signal, or other driving modes. The specific one can be selected according to the actual situation, and the embodiment of the present application does not make any specific limitation.
[0060] It can be understood that, based on the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, the waveform data is waveform-modified to re-determine the expected pulse width or waveform data, which retains more details of the vibration waveform. Furthermore, the sampling period is adjusted according to the expected carrier sampling rate, and the final driving signal is generated based on the expected pulse width or waveform data and the sampling period, so that when the motor is driven to vibrate using the expected pulse width or waveform data, the vibration effect can be improved without increasing the amount of stored waveform data.
[0061] The present application embodiment provides a vibration device 1. Figure 5 As shown, the device 1 comprises:
[0062] An acquisition unit 10 acquires a preset waveform signal frequency and an expected waveform signal frequency of the waveform data, and / or a preset carrier sampling rate and an expected carrier sampling rate;
[0063] A waveform adaptation unit 11, configured to perform waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, to obtain an expected pulse width or waveform data;
[0064] The signal generating unit 12 is used to determine a sampling period according to the expected carrier sampling rate, and to generate a driving signal based on the expected pulse width or waveform data and the sampling period, so as to drive the motor to vibrate based on the driving signal.
[0065] Optionally, the waveform adaptation unit 11 is specifically used to determine the data adjustment quantity corresponding to the expected pulse width or waveform data based on the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; when the data adjustment quantity is greater than a preset quantity threshold, interpolate the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data; and obtain the expected pulse width or waveform data based on the waveform data and the interpolation data.
[0066] Optionally, the device further comprises: an interpolation unit;
[0067] The interpolation unit is used to round the data adjustment quantity to obtain a first quantity; determine an amplitude step value according to the first quantity, first waveform data and second waveform data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; determine multiple interpolation data between the first waveform data and the second waveform data according to the first waveform data and the amplitude step value; the number of the multiple interpolation data is the same as the first quantity.
[0068] Optionally, the interpolation unit is also used to round the data adjustment quantity to obtain a first quantity; determine the first waveform data as each interpolation data between the first waveform data and the second waveform data to obtain multiple interpolation data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; the number of the multiple interpolation data is the same as the first number.
[0069] Optionally, the interpolation unit is also used to fit a waveform function corresponding to the waveform data based on the waveform data; determine the time step value based on the data adjustment quantity and the preset waveform signal frequency; determine the sampling time of each waveform data based on the preset waveform signal frequency, and input the sampling time of each waveform data and the step value into the waveform function to obtain multiple interpolation data between every two adjacent waveform data; the number of the multiple interpolation data is the same as the data adjustment number.
[0070] Optionally, the waveform adaptation unit 11 is specifically used to determine the data adjustment quantity corresponding to the expected pulse width or waveform data based on the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; when the data adjustment quantity is less than or equal to a preset quantity threshold, determine the sampling interval based on the data adjustment quantity; based on the sampling interval, filter out a group of data from the waveform data, and determine the group of data as the expected pulse width or waveform data.
[0071] The embodiment of the present application provides a vibration device, which obtains the preset waveform signal frequency and the expected waveform signal frequency of the waveform data, and / or the preset carrier sampling rate and the expected carrier sampling rate; performs waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain the expected pulse width or waveform data; determines the sampling period according to the expected carrier sampling rate, and generates a driving signal based on the expected pulse width or waveform data and the sampling period; and drives the motor to vibrate based on the driving signal. It can be seen that the vibration device proposed in this embodiment performs waveform adaptation on the waveform data based on the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, and re-determines the expected pulse width or waveform data, which retains more details of the vibration waveform, and further, adjusts the sampling period according to the expected carrier sampling rate, and generates the final driving signal based on the expected pulse width or waveform data and the sampling period, so that when the motor is driven to vibrate using the expected pulse width or waveform data, the vibration effect can be improved, and the amount of stored waveform data is not increased.
[0072] Figure 6 A schematic diagram of the structure of a vibration device 1 provided in an embodiment of the present application Figure 2 In practical applications, based on the same disclosure concept of the above embodiments, Figure 6 As shown, the vibration device 1 of this embodiment includes: a processor 14 , a memory 15 and a communication bus 16 .
[0073] In the process of the specific embodiment, the acquisition unit 10, the waveform adaptation unit 11, the signal generation unit 12 and the interpolation unit can be implemented by a processor 14 located on the vibration device 1, and the processor 14 can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing image processing device (DSPD), a programmable logic image processing device (PLD), a field programmable gate array (FPGA), a CPU, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and this embodiment does not specifically limit it.
[0074] In the embodiment of the present application, the communication bus 16 is used to realize the connection and communication between the processor 14 and the memory 15; when the processor 14 executes the running program stored in the memory 15, the following vibration control method is realized:
[0075] Acquire a preset waveform signal frequency and an expected waveform signal frequency, and / or a preset carrier sampling rate and an expected carrier sampling rate of the waveform data; perform waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain an expected pulse width or waveform data; determine a sampling period according to the expected carrier sampling rate, and generate a driving signal based on the expected pulse width or waveform data and the sampling period; and drive the motor to vibrate based on the driving signal.
[0076] Furthermore, the processor 14 is also used to determine the data adjustment quantity corresponding to the expected pulse width or waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; when the data adjustment quantity is greater than a preset quantity threshold, interpolate the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data; and obtain the expected pulse width or waveform data according to the waveform data and the interpolation data.
[0077] Furthermore, the above-mentioned processor 14 is also used to round the data adjustment quantity to obtain a first quantity; determine the amplitude step value according to the first quantity, the first waveform data and the second waveform data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; determine multiple interpolation data between the first waveform data and the second waveform data according to the first waveform data and the amplitude step value; the number of the multiple interpolation data is the same as the first quantity.
[0078] Furthermore, the above-mentioned processor 14 is also used to round the data adjustment quantity to obtain a first quantity; determine the first waveform data as each interpolation data between the first waveform data and the second waveform data to obtain multiple interpolation data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; the number of the multiple interpolation data is the same as the first number.
[0079] Furthermore, the above-mentioned processor 14 is also used to fit a waveform function corresponding to the waveform data according to the waveform data; determine the time step value according to the data adjustment quantity and the preset waveform signal frequency; determine the sampling time of each waveform data according to the preset waveform signal frequency, and input the sampling time of each waveform data and the step value into the waveform function to obtain multiple interpolation data between every two adjacent waveform data; the number of the multiple interpolation data is the same as the data adjustment number.
[0080] Furthermore, the processor 14 is also used to determine the data adjustment quantity corresponding to the expected pulse width or waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; when the data adjustment quantity is less than or equal to a preset quantity threshold, determine the sampling interval according to the data adjustment quantity; based on the sampling interval, filter out a group of data from the waveform data, and determine the group of data as the expected pulse width or waveform data.
[0081] An embodiment of the present application provides a storage medium having a computer program stored thereon. The computer-readable storage medium stores one or more programs. The one or more programs can be executed by one or more processors and applied to a vibration device. The computer program implements the vibration control method as described above.
[0082] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the relevant technology, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for enabling an image display device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0084] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.
Claims
1. A vibration control method, characterized in that: The method comprises: Acquiring a preset waveform signal frequency and an expected waveform signal frequency, and / or a preset carrier sampling rate and an expected carrier sampling rate of waveform data; the waveform data includes amplitude data obtained by sampling the vibration waveform; Performing waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain expected pulse width or waveform data; A sampling period is determined according to the expected carrier sampling rate, and a driving signal is generated based on the expected pulse width or waveform data and the sampling period; so as to drive the motor to vibrate based on the driving signal.
2. The method according to claim 1, characterized in that The waveform data is waveform-adapted according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain the expected pulse width or waveform data, including: Determining the data adjustment quantity corresponding to the expected pulse width or waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; In the case where the data adjustment quantity is greater than a preset quantity threshold, interpolation processing is performed on the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data; The expected pulse width or waveform data is obtained according to the waveform data and the interpolation data.
3. The method according to claim 2, characterized in that The interpolation processing is performed on the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data, including: Rounding the data adjustment quantity to obtain a first quantity; Determine an amplitude step value according to the first quantity, first waveform data and second waveform data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; A plurality of interpolation data between the first waveform data and the second waveform data is determined according to the first waveform data and the amplitude step value; the number of the plurality of interpolation data is the same as the first number.
4. The method according to claim 2, characterized in that: The interpolation processing is performed on the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data, including: Rounding the data adjustment quantity to obtain a first quantity; The first waveform data is determined as each interpolation data between the first waveform data and the second waveform data to obtain multiple interpolation data; the first waveform data and the second waveform data are any two adjacent waveform data in the waveform data; the number of the multiple interpolation data is the same as the first number.
5. The method according to claim 2, characterized in that: The interpolation processing is performed on the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data, including: According to the waveform data, fitting a waveform function corresponding to the waveform data; Determining a time step value according to the data adjustment quantity and the preset waveform signal frequency; The sampling time of each waveform data is determined according to the preset waveform signal frequency, and the sampling time of each waveform data and the step value are input into the waveform function to obtain multiple interpolation data between every two adjacent waveform data; the number of the multiple interpolation data is the same as the data adjustment number.
6. The method according to claim 1, characterized in that The waveform data is waveform-adapted according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate to obtain the expected pulse width or waveform data, including: Determining the data adjustment quantity corresponding to the expected pulse width or waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; When the data adjustment amount is less than or equal to a preset amount threshold, determining a sampling interval according to the data adjustment amount; A group of data is screened out from the waveform data based on the sampling interval, and the group of data is determined as the expected pulse width or waveform data.
7. A vibration device, characterized in that: The device comprises: An acquisition unit, which acquires a preset waveform signal frequency and an expected waveform signal frequency, and / or a preset carrier sampling rate and an expected carrier sampling rate of waveform data; the waveform data includes amplitude data obtained by sampling the vibration waveform; A waveform adaptation unit, configured to perform waveform adaptation on the waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate, to obtain an expected pulse width or waveform data; A signal generating unit is used to determine a sampling period according to the expected carrier sampling rate, and to generate a driving signal based on the expected pulse width or waveform data and the sampling period; so as to drive the motor to vibrate based on the driving signal.
8. The device according to claim 7, characterized in that The waveform adaptation unit is specifically used to determine the data adjustment quantity corresponding to the expected pulse width or waveform data according to the preset waveform signal frequency and the expected waveform signal frequency, and / or the preset carrier sampling rate and the expected carrier sampling rate; when the data adjustment quantity is greater than a preset quantity threshold, interpolate the waveform data according to the data adjustment quantity to obtain interpolation data between every two adjacent waveform data; and obtain the expected pulse width or waveform data according to the waveform data and the interpolation data.
9. A vibration device, characterized in that: The device comprises: a processor, a memory and a communication bus; when the processor executes the running program stored in the memory, the method according to any one of claims 1 to 6 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
