Method and apparatus for adjusting pulse width modulation (PWM) frequency, and electronic device
By adjusting the number and width of electromagnetic pulses to form an intermediate state of non-equal width, the screen flicker problem during PWM frequency switching is solved and a smooth transition of brightness is achieved.
Patent Information
- Application Number
- CN202411862625.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In PWM dimming mode, the display screen has a transient screen flicker problem when the brightness switches, especially when switching between low brightness and high brightness ranges, the screen flicker problem is caused by inconsistent brightness.
By adjusting the number and width of electromagnetic pulses, M first electromagnetic pulses are adjusted to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses, and the width of the electromagnetic pulses is gradually adjusted to form an intermediate state of non-equal width, thereby optimizing the PWM frequency switching process.
It reduces the transient screen flicker when the PWM frequency switches, ensures a smooth transition of the display brightness, and avoids the problem of inconsistent brightness.
Smart Images

Figure CN119766937B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of image processing, and particularly relates to a pulse width modulation (PWM) frequency adjustment method and device and electronic equipment. BACKGROUND
[0002] An organic light-emitting diode (OLED) screen controls a pulse width modulation (PWM) frequency by controlling the number of times of switching of an electromagnetic pulse (EM Pulse), for example, in a direct current (DC) 18 Pulse mode, an EM Pulse is switched 18 times per frame, if the screen refresh rate is 120 Hz, the number of times of switching of an EM Pulse per second is 18 multiplied by 120, equaling 2160, that is, the PWM frequency is 2160 Hz, therefore, the number of times of switching of an EM Pulse can control different PWM frequencies.
[0003] In a PWM dimming (multi-pulse) mode, using a camera to adjust an exposure time can capture a frame of a display screen to display multiple black lines, in a DC 18 Pulse mode, an EM Pulse is switched 8 times per frame, there are 8 black lines, the width of a black line is an EM Pulse width, the greater the width, the more rows of pixel points of the screen are turned off (or not displayed), the more the number of black lines (that is, the more the number of times of switching of an EM Pulse), the more the total number of rows of pixel points not displayed per frame, and the lower the brightness of the display screen.
[0004] The existing scheme has the following deficiencies:
[0005] Currently, a mobile phone screen adopts a high-frequency PWM dimming mode at a low brightness (for example, below 90 nit), and switches to a lower-frequency PWM for dimming in a high-brightness range to achieve the effect of power saving. However, when the display screen adjusts the brightness to switch different PWM frequencies, the duty ratio of screen display is not completely consistent per frame, and there is a difference in brightness, and directly switching to a target PWM frequency per frame can cause a transient screen flicker. For example, when switching from a DC 18 Pulse mode to a DC 6 Pulse mode, the display screen changes from 18 equal-width black lines to 6 equal-width black lines, and because the EM Pulse width is inconsistent in different modes, the screen flicker caused by the change in brightness due to single-frame transient switching. SUMMARY
[0006] The purpose of the embodiments of the present application is to provide a pulse width modulation (PWM) frequency adjustment method and device and electronic equipment, which can solve the problem of screen flicker caused by the change in brightness due to single-frame transient switching.
[0007] In a first aspect, the embodiments of the present application provide a method for adjusting a pulse width modulation (PWM) frequency, comprising:
[0008] obtaining a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency;
[0009] determining N second electromagnetic pulses corresponding to a second PWM frequency after adjusting the PWM frequency, in a case where a preset condition is met;
[0010] adjusting the M first electromagnetic pulses to combined electromagnetic pulses of P third electromagnetic pulses and Q fourth electromagnetic pulses based on the M first electromagnetic pulses and the N second electromagnetic pulses, to obtain a second frame of image, a width of the first electromagnetic pulse and a width of the third electromagnetic pulse are both a first width, a width of the second electromagnetic pulse and a width of the fourth electromagnetic pulse are both a second width, and a sum of P and Q is N;
[0011] adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image, in a case where the second frame of image is obtained;
[0012] wherein M, N, P, and Q are positive integers.
[0013] In a second aspect, the embodiments of the present application provide an apparatus for adjusting a pulse width modulation (PWM) frequency, comprising:
[0014] an obtaining module configured to obtain a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency;
[0015] a determining module configured to determine N second electromagnetic pulses corresponding to a second PWM frequency after adjusting the PWM frequency, in a case where a preset condition is met;
[0016] a first adjusting module configured to adjust the M first electromagnetic pulses to combined electromagnetic pulses of P third electromagnetic pulses and Q fourth electromagnetic pulses based on the M first electromagnetic pulses and the N second electromagnetic pulses, to obtain a second frame of image, a width of the first electromagnetic pulse and a width of the third electromagnetic pulse are both a first width, a width of the second electromagnetic pulse and a width of the fourth electromagnetic pulse are both a second width, and a sum of P and Q is N;
[0017] a second adjusting module configured to adjust the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image, in a case where the second frame of image is obtained;
[0018] wherein M, N, P, and Q are positive integers.
[0019] In a third aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0020] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0021] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method described in the first aspect.
[0022] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method described in the first aspect.
[0023] In an embodiment of the present application, a first frame of image is first obtained based on M first electromagnetic pulses corresponding to a first PWM frequency. If a preset condition is met, N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted are determined. Then, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame of image. Since the widths of the first electromagnetic pulses and the third electromagnetic pulses are both the first width, and the widths of the second electromagnetic pulses and the fourth electromagnetic pulses are both the second width, the number of first electromagnetic pulses is first adjusted from M to N, and the widths of a portion of the N first electromagnetic pulses are adjusted to obtain the second frame of image. When the second frame image is obtained, the first widths of the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted to the second width to obtain the third frame image, that is, after adjusting the widths of a part of the N first electromagnetic pulses to obtain the second frame image, the widths of another part of the N first electromagnetic pulses are adjusted. By gradually adjusting the widths of the electromagnetic pulses, one or more frames of intermediate states of electromagnetic pulses with non-equal widths are added, and the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulses within a single frame when switching the PWM frequency is optimized, so that the PWM frequency switching can be made smoother. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 1 is a flow chart of a pulse width modulation (PWM) frequency adjustment method provided in an embodiment of the present application;
[0025] Figure 2 This is one of the schematic diagrams for adjusting the width of an electromagnetic pulse provided in an embodiment of the present application;
[0026] Figure 3 This is the second schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;
[0027] Figure 4 This is the third schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;
[0028] Figure 5 This is the fourth schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;
[0029] Figure 6 This is the fifth schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;
[0030] Figure 7 Schematic diagram of the structure of the pulse width modulation (PWM) frequency adjustment device provided in an embodiment of the present application;
[0031] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of the present application;
[0032] Figure 9 This is a structural block diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0034] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0035] The pulse width modulation (PWM) frequency adjustment method provided in the embodiment of the present application is described below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0036] like Figure 1 As shown, the embodiment of the present application provides a method for adjusting the pulse width modulation (PWM) frequency, which may specifically include the following steps:
[0037] Step 101 : obtaining a first frame image based on M first electromagnetic pulses corresponding to a first PWM frequency, where M is a positive integer.
[0038] The electronic device obtains a first frame image of the display screen based on the first PWM frequency. The number of first electromagnetic pulses corresponding to the first PWM frequency is M. The widths of the M first electromagnetic pulses are the same, which is the first width, that is, the electromagnetic pulse of the first width is the first electromagnetic pulse.
[0039] Step 102 : When a preset condition is met, determine N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted, where N is a positive integer.
[0040] Specifically, PWM dimming changes the brightness of the display by controlling the duty cycle of the display's alternating on and off switching. A PWM dimming display does not emit a continuous glow when it is on, but rather it switches on and off continuously. When the on and off switching speed is fast, the user perceives the display as being constantly on. During the process of the display turning on and off, the longer the off state lasts, the lower the brightness of the display perceived by the user. The longer the display is on, the shorter the off time, and the user perceives the display as being brighter. Therefore, the brightness of the display can be adjusted by adjusting the PWM frequency.
[0041] The preset conditions include, but are not limited to: user input for display brightness adjustment, and the brightness of the current environment where the electronic device is located meeting the conditions for PWM frequency adjustment.
[0042] If the electronic device meets the aforementioned preset conditions, it can determine a second PWM frequency after the PWM frequency adjustment. The number of second electromagnetic pulses corresponding to the second PWM frequency is N, and the widths of the N second electromagnetic pulses are identical, namely, the second width. Therefore, the electromagnetic pulses of the second width are considered second electromagnetic pulses. Thus, the electronic device adjusts the brightness of the display screen by adjusting the PWM frequency. In other words, the PWM frequency is switched when the display screen changes from one brightness range to another.
[0043] It should be noted that the first width and the second width are different widths.
[0044] Step 103: Based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, the sum of P and Q is N, and P and Q are both positive integers.
[0045] Specifically, after determining the number M of first electromagnetic pulses at a first PWM frequency before PWM frequency adjustment and the number N of second electromagnetic pulses at a second PWM frequency after PWM frequency adjustment, the number of electromagnetic pulses is adjusted from M to N, and the widths of a portion of the adjusted N electromagnetic pulses are maintained at the first width, while the widths of another portion of the electromagnetic pulses are adjusted from the first width to the second width. In other words, the number of electromagnetic pulses is directly adjusted from M to N, and the widths of a portion of the electromagnetic pulses are first adjusted while the widths of the other portion remain unchanged, thereby forming a combined electromagnetic pulse consisting of P third electromagnetic pulses of the first width and Q fourth electromagnetic pulses of the second width. A second frame image of the display screen is obtained based on the combined electromagnetic pulses.
[0046] Step 104 : When the second frame image is obtained, adjust the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame image.
[0047] Specifically, when obtaining a second frame of image on the display screen, in a combined electromagnetic pulse formed by combining the P third electromagnetic pulses of the first width and the Q fourth electromagnetic pulses of the second width, the first width of the P third electromagnetic pulses of the first width is adjusted to the second width. Thus, the P third electromagnetic pulses of the first width in the combined electromagnetic pulse are adjusted to P third electromagnetic pulses of the second width, thereby obtaining N electromagnetic pulses of the second width. The third frame of image on the display screen is obtained based on the N electromagnetic pulses of the second width.
[0048] It should be noted that the second frame image is an intermediate frame image between the first frame image and the third frame image, and there are one or more of them. By gradually adjusting the width of the electromagnetic pulse through the intermediate frames, that is, adding one or more intermediate states of electromagnetic pulses of unequal widths, the PWM frequency switching can be smoother.
[0049] In an embodiment of the present application, a first frame of image is first obtained based on M first electromagnetic pulses corresponding to a first PWM frequency. If a preset condition is met, N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted are determined. Then, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame of image. Since the widths of the first electromagnetic pulses and the third electromagnetic pulses are both the first width, and the widths of the second electromagnetic pulses and the fourth electromagnetic pulses are both the second width, the number of first electromagnetic pulses is first adjusted from M to N, and the widths of a portion of the N first electromagnetic pulses are adjusted to obtain the second frame of image. When the second frame image is obtained, the first widths of the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted to the second width to obtain the third frame image, that is, after adjusting the widths of a part of the N first electromagnetic pulses to obtain the second frame image, the widths of another part of the N first electromagnetic pulses are adjusted. By gradually adjusting the widths of the electromagnetic pulses, one or more frames of intermediate states of electromagnetic pulses with non-equal widths are added, and the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulses within a single frame when switching the PWM frequency is optimized, so that the PWM frequency switching can be made smoother.
[0050] In an optional specific embodiment, step 103 adjusts the M first electromagnetic pulses into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses based on the M first electromagnetic pulses and the N second electromagnetic pulses to obtain a second frame of image, specifically including steps 1031 to 1034:
[0051] Step 1031: Adjust the M first electromagnetic pulses into N third electromagnetic pulses according to the M first electromagnetic pulses and the N second electromagnetic pulses.
[0052] Specifically, after determining the number M of first electromagnetic pulses of the first PWM frequency before the PWM frequency adjustment and the number N of second electromagnetic pulses of the second PWM frequency after the PWM frequency adjustment, the number of electromagnetic pulses is directly adjusted from M to N, that is, M first electromagnetic pulses of the first width are adjusted to N third electromagnetic pulses of the first width.
[0053] Step 1032: Obtain an index corresponding to each of the N third electromagnetic pulses.
[0054] Specifically, the N third electromagnetic pulses are sequentially provided with N corresponding indexes, that is, each of the N third electromagnetic pulses corresponds to an index.
[0055] Step 1033: According to the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses among the N third electromagnetic pulses are kept unchanged, and the Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
[0056] Specifically, when the N indexes corresponding to the N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories, the first category is P third electromagnetic pulses whose widths remain unchanged, and the second category is Q third electromagnetic pulses whose widths need to be adjusted. In other words, the first widths of the P third electromagnetic pulses of the first width among the N third electromagnetic pulses of the first width are kept unchanged, and the Q third electromagnetic pulses of the first width among the N third electromagnetic pulses of the first width are adjusted to Q fourth electromagnetic pulses of the second width, thereby forming a combined electromagnetic pulse composed of the P third electromagnetic pulses of the first width and the Q fourth electromagnetic pulses of the second width.
[0057] It should be noted that in the process of classifying N third electromagnetic pulses, if the indexes of P third electromagnetic pulses or Q third electromagnetic pulses are continuous, the brightness of the display screen portion corresponding to the P third electromagnetic pulses and the display screen portion corresponding to the Q third electromagnetic pulses will be obviously inconsistent. Therefore, the N third electromagnetic pulses can be classified in an alternating manner to ensure that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process.
[0058] Step 1034: Obtain the second frame image based on the combined electromagnetic pulse.
[0059] Specifically, a second frame image of the display screen is obtained based on a combined electromagnetic pulse of P third electromagnetic pulses and Q fourth electromagnetic pulses.
[0060] The following describes in detail the adjustment process of the electromagnetic pulse width through a specific embodiment:
[0061] Example 1
[0062] Step 1033 maintains the first widths of P third electromagnetic pulses among the N third electromagnetic pulses according to the indexes corresponding to the N third electromagnetic pulses, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, which specifically includes:
[0063] According to the odd or even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or
[0064] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and the Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
[0065] Specifically, when the N indices corresponding to N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories based on the odd and even numbers of the indices: the third electromagnetic pulses corresponding to odd-numbered indices are in one category, and the third electromagnetic pulses corresponding to even-numbered indices are in the other category. If there are P third electromagnetic pulses with odd indices, then the first widths of the third electromagnetic pulses with odd indices among the N third electromagnetic pulses remain unchanged, while the first widths of the third electromagnetic pulses with even indices among the N third electromagnetic pulses are adjusted to the second width. That is, the widths of the electromagnetic pulses with odd indices in the combined electromagnetic pulse are the first width, and the widths of the electromagnetic pulses with even indices are the second width.
[0066] If there are P third electromagnetic pulses with even indexes, then the first width of the third electromagnetic pulses with even indexes among the N third electromagnetic pulses remains unchanged, and the first width of the third electromagnetic pulses with odd indexes among the N third electromagnetic pulses is adjusted to the second width. That is, the width of the electromagnetic pulses with even indexes in the combined electromagnetic pulse is the first width, and the width of the electromagnetic pulses with odd indexes is the second width. Specifically, the parity of the index can be determined using the following formula:
[0067] z=2*i-1
[0068] Wherein, i is a positive integer, z is an index, and z is a positive integer less than or equal to N.
[0069] Example: Figure 2 and Figure 3As shown, M takes a value of 18, N takes a value of 6, and 18 first electromagnetic pulses of the first width (the indexes of the 18 first electromagnetic pulses of the first width are 1 to 18, respectively) are adjusted to 6 third electromagnetic pulses of the first width (the indexes of the 6 third electromagnetic pulses of the first width are 1 to 6, respectively). Moreover, the first widths of the third electromagnetic pulses with odd indexes among the 6 third electromagnetic pulses are adjusted to the second width, and the first widths of the third electromagnetic pulses with even indexes remain unchanged. That is, according to the above formula, the index that meets the above formula is an odd index, and the first width needs to be adjusted to the second width. The index that does not meet the above formula is an even index, and the first width remains unchanged. The specific calculation process is as follows:
[0070] When the value of i is 1, the index z calculated by the above formula is 1; when the value of i is 2, the index z calculated by the above formula is 3; when the value of i is 3, the index z calculated by the above formula is 5, that is, the indices 1, 3, and 5 meet the above formula, and the P third electromagnetic pulses are the three third electromagnetic pulses corresponding to the indices 1, 3, and 5; the indices 2, 4, and 6 do not meet the above formula, and the Q third electromagnetic pulses are the three third electromagnetic pulses corresponding to the indices 2, 4, and 6.
[0071] The first width of the third electromagnetic pulses indexed as 1, 3, and 5 is adjusted to the second width, and the first width of the third electromagnetic pulses indexed as even numbers remains unchanged, that is, the first width of the third electromagnetic pulses indexed as 2, 4, and 6 remains unchanged, Figure 2 The left picture is a schematic diagram of 18 first electromagnetic pulses of the first width. Figure 2 The right picture is a schematic diagram of the combined electromagnetic pulse after width adjustment, and the second frame image of the display screen is obtained based on the combined electromagnetic pulse.
[0072] When the second frame image of the display screen is obtained, the first width of the third electromagnetic pulse indexed as 2, 4, and 6 in the above-mentioned combined electromagnetic pulse is adjusted to the second width. Figure 3 The left picture is a schematic diagram of the combined electromagnetic pulse obtained after the first width adjustment. Figure 3 The right picture is a schematic diagram of the six fourth electromagnetic pulses of the second width obtained after the second width adjustment, and the third frame image of the display screen is obtained based on the six fourth electromagnetic pulses of the second width.
[0073] In the above embodiment, the widths of the N third electromagnetic pulses are gradually adjusted in an alternating manner of odd and even numbers, which not only ensures that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process, but also optimizes the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency, making the PWM frequency switching smoother.
[0074] Example 2
[0075] Step 1033, according to the index corresponding to the N third electromagnetic pulses, the first width of P third electromagnetic pulses in the N third electromagnetic pulses is kept unchanged, and the first width of Q third electromagnetic pulses in the N third electromagnetic pulses except the P third electromagnetic pulses is adjusted to Q fourth electromagnetic pulses, to obtain the combined electromagnetic pulses of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, specifically comprising:
[0076] The first width of the P third electromagnetic pulses corresponding to the index not satisfying the first formula among the indexes corresponding to the N third electromagnetic pulses is kept unchanged, and the first width of the Q third electromagnetic pulses corresponding to the index satisfying the first formula among the indexes corresponding to the N third electromagnetic pulses is adjusted to Q fourth electromagnetic pulses, to obtain the combined electromagnetic pulses of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
[0077] Wherein, the first formula is:
[0078] m = 3 * i + 1
[0079] Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.
[0080] Specifically, in the case of knowing the N indexes corresponding to the N third electromagnetic pulses, the N third electromagnetic pulses are divided into two categories according to the first formula, the third electromagnetic pulses corresponding to the indexes satisfying the first formula are one category, and the third electromagnetic pulses corresponding to the indexes not satisfying the first formula are another category. If the indexes not satisfying the first formula are P third electromagnetic pulses, the first width of the third electromagnetic pulses corresponding to the indexes not satisfying the first formula in the N third electromagnetic pulses is unchanged, and the first width of the third electromagnetic pulses corresponding to the indexes satisfying the first formula in the N third electromagnetic pulses is adjusted to a second width, that is, the width of the electromagnetic pulses corresponding to the indexes not satisfying the first formula in the combined electromagnetic pulses is the first width, and the width of the electromagnetic pulses corresponding to the indexes satisfying the first formula is the second width.
[0081] Example: as shown in Figure 4 The value of M is 18, the value of N is 6, the 18 first width first electromagnetic pulses (the indexes of the 18 first width first electromagnetic pulses are 1-18 respectively) are adjusted to 6 first width third electromagnetic pulses (the indexes of the 6 first width third electromagnetic pulses are 1-6 respectively), and the first width of the third electromagnetic pulses corresponding to the indexes satisfying the first formula in the 6 third electromagnetic pulses is adjusted to a second width, and the first width of the third electromagnetic pulses corresponding to the indexes not satisfying the first formula is kept unchanged. The specific calculation process is as follows:
[0082] When i is 0, the index m calculated by the above first formula is 1; when i is 1, the index m calculated by the above first formula is 4, that is, indexes 1 and 4 meet the above first formula, and the Q third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 1 and 4; indexes 2, 3, 5, and 6 do not meet the above first formula, and the P third electromagnetic pulses are the four third electromagnetic pulses corresponding to indexes 2, 3, 5, and 6.
[0083] The first width of the third electromagnetic pulses with indexes 1 and 4 is adjusted to the second width, and the first width of the third electromagnetic pulses with indexes 2, 3, 5, and 6 remains unchanged. Figure 4 The left picture is a schematic diagram of the combined electromagnetic pulse after width adjustment, and the second frame image of the display screen is obtained based on the combined electromagnetic pulse.
[0084] When the second frame image of the display screen is obtained, the first width of the third electromagnetic pulse indexed as 2, 3, 5, and 6 in the above-mentioned combined electromagnetic pulse is adjusted to the second width. Figure 4 The right picture is a schematic diagram of the six fourth electromagnetic pulses of the second width obtained after the second width adjustment, and the third frame image of the display screen is obtained based on the six fourth electromagnetic pulses of the second width.
[0085] In the above embodiment, the widths of N third electromagnetic pulses are gradually adjusted in an alternating manner, which not only ensures that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process, but also optimizes the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency, making the PWM frequency switching smoother.
[0086] Example 3:
[0087] Step 1033 maintains the first widths of P third electromagnetic pulses among the N third electromagnetic pulses according to the indexes corresponding to the N third electromagnetic pulses, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, which specifically includes:
[0088] keeping the first widths of the P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses unchanged, and adjusting the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;
[0089] Among them, the first formula is:
[0090] m=3*i+1
[0091] Where i is a natural number, m is an index, and m is a positive integer less than or equal to N.
[0092] In step 104, when the second frame image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted from the first width to the second width to obtain a third frame image, which specifically includes:
[0093] When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses to obtain an adjusted combined electromagnetic pulse;
[0094] obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse;
[0095] When the fourth frame of image is obtained, the K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image;
[0096] Wherein, the second formula is:
[0097] n=3*i+2
[0098] Where i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and both K and S are positive integers.
[0099] Specifically, when the N indices corresponding to N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories according to the first formula: the third electromagnetic pulses corresponding to the indices that comply with the first formula are classified into one category, and the third electromagnetic pulses corresponding to the indices that do not comply with the first formula are classified into the other category. If there are P third electromagnetic pulses with indices that do not comply with the first formula, then the first widths of the third electromagnetic pulses in the N third electromagnetic pulses that do not comply with the first formula remain unchanged, while the first widths of the third electromagnetic pulses in the N third electromagnetic pulses that comply with the first formula are adjusted to the second width. That is, the widths of the electromagnetic pulses in the combined electromagnetic pulses that do not comply with the first formula are the first width, and the widths of the electromagnetic pulses that comply with the first formula are the second width.
[0100] When a second frame of image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the first widths of the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the P third electromagnetic pulses are adjusted to the second width, thereby obtaining an adjusted combined electromagnetic pulse composed of K third electromagnetic pulses of the first width and Q+S fourth electromagnetic pulses of the second width. A fourth frame of image on the display screen is obtained based on the K third electromagnetic pulses of the first width and the Q+S fourth electromagnetic pulses of the second width.
[0101] When obtaining the fourth frame image of the display screen, the first width of the K third electromagnetic pulses of the first width in the adjusted combined electromagnetic pulses is adjusted to the second width, thereby obtaining N fourth electromagnetic pulses of the second width, and the third frame image is obtained based on the N fourth electromagnetic pulses of the second width.
[0102] It should be noted that the second frame image and the fourth frame image are both intermediate frame images between the first frame image and the third frame image. The width of the electromagnetic pulse is gradually adjusted through the two intermediate frame images, that is, the intermediate state of the two frames of electromagnetic pulses with non-equal widths is added, which can make the PWM frequency switching smoother.
[0103] Example: Figure 5 and Figure 6 As shown, M is 18, N is 6, 18 first electromagnetic pulses of the first width (the indexes of the 18 first electromagnetic pulses of the first width are 1 to 18, respectively) are adjusted to 6 third electromagnetic pulses of the first width (the indexes of the 6 third electromagnetic pulses of the first width are 1 to 6, respectively), and the first widths of the third electromagnetic pulses of the 6 third electromagnetic pulses whose indexes meet the first formula are adjusted to the second width, and the first widths of the third electromagnetic pulses whose indexes do not meet the first formula remain unchanged. The specific calculation process is as follows:
[0104] When i is 0, the index m calculated by the above first formula is 1; when i is 1, the index m calculated by the above first formula is 4, that is, indexes 1 and 4 meet the above first formula, and the Q third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 1 and 4; indexes 2, 3, 5, and 6 do not meet the above first formula, and the P third electromagnetic pulses are the four third electromagnetic pulses corresponding to indexes 2, 3, 5, and 6.
[0105] The first width of the third electromagnetic pulses with indexes 1 and 4 is adjusted to the second width, and the first width of the third electromagnetic pulses with indexes 2, 3, 5, and 6 remains unchanged. Figure 5 The left picture is a schematic diagram of the combined electromagnetic pulse after the first width adjustment, and the second frame image of the display screen is obtained based on the combined electromagnetic pulse.
[0106] When the second frame image of the display screen is obtained, the first width of the third electromagnetic pulses with indexes of 2, 3, 5, and 6 that meet the second formula is adjusted to the second width, and the first width of the third electromagnetic pulses that do not meet the second formula remains unchanged. The specific calculation process is as follows:
[0107] When i is 0, the index n calculated by the above second formula is 2. When i is 1, the index n calculated by the above second formula is 5. That is, indexes 2 and 5 meet the above second formula, and the S third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 2 and 5. Indexes 3 and 6 do not meet the above second formula, and the K third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 3 and 6.
[0108] The first width of the third electromagnetic pulses with indexes 2 and 5 is adjusted to the second width, and the first width of the third electromagnetic pulses with indexes 3 and 6 remains unchanged. Figure 5 The right picture is a schematic diagram of the combined electromagnetic pulse after the second width adjustment, and the fourth frame image of the display screen is obtained based on the adjusted combined electromagnetic pulse.
[0109] When the fourth frame image of the display screen is obtained, the first width of the third electromagnetic pulse with indexes 3 and 6 in the adjusted combined electromagnetic pulse is adjusted to the second width. Figure 6 The left picture is a schematic diagram of the combined electromagnetic pulse after the second width adjustment. Figure 6 The right picture is a schematic diagram of six fourth electromagnetic pulses of the second width obtained after the third width adjustment, and the third frame image of the display screen is obtained based on the six fourth electromagnetic pulses of the second width.
[0110] In the above embodiment, the widths of N third electromagnetic pulses are gradually adjusted in an alternating manner, which not only ensures that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process, but also optimizes the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency, making the PWM frequency switching smoother.
[0111] In summary, in the embodiment of the present application, when adjusting the PWM frequency, the number of first electromagnetic pulses is first adjusted from the number of electromagnetic pulses corresponding to the first PWM frequency to the number of electromagnetic pulses corresponding to the second PWM frequency. Then, after adjusting the width of a portion of the electromagnetic pulses to obtain the second frame image, the width of the remaining electromagnetic pulses is adjusted. By gradually adjusting the width of the electromagnetic pulses described above, an intermediate state of one or more frames of electromagnetic pulses of non-uniform width is added, thereby optimizing the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulses within a single frame when switching the PWM frequency, thereby making the PWM frequency switching smoother. Furthermore, by gradually adjusting the width of the electromagnetic pulses in an alternating manner, the brightness of the entire display screen can be ensured to remain consistent during the PWM frequency adjustment process.
[0112] The pulse width modulation (PWM) frequency adjustment method provided in the embodiments of the present application can be performed by a pulse width modulation (PWM) frequency adjustment device. In the embodiments of the present application, the pulse width modulation (PWM) frequency adjustment method performed by the PWM frequency adjustment device is used as an example to illustrate the PWM frequency adjustment device provided in the embodiments of the present application.
[0113] like Figure 7 As shown, the embodiment of the present application further provides a pulse width modulation (PWM) frequency adjustment device 700, which specifically includes:
[0114] An acquisition module 701 is configured to obtain a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency;
[0115] A determination module 702 is configured to determine N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted, if a preset condition is met;
[0116] a first adjustment module 703, configured to adjust, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses, to obtain a second frame of image, wherein a width of the first electromagnetic pulse and a width of the third electromagnetic pulse are both a first width, a width of the second electromagnetic pulse and a width of the fourth electromagnetic pulse are both a second width, and a sum of P and Q is N;
[0117] A second adjustment module 704 is configured to adjust the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image when the second frame of image is obtained;
[0118] Among them, M, N, P, and Q are all positive integers.
[0119] Optionally, the first adjustment module 703 is specifically configured to:
[0120] According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses;
[0121] Obtaining an index corresponding to each third electromagnetic pulse in the N third electromagnetic pulses;
[0122] According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;
[0123] The second frame image is obtained based on the combined electromagnetic pulse.
[0124] Optionally, when the first adjustment module 703, based on the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses into Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically configured to:
[0125] According to the odd or even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or
[0126] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and the Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
[0127] Optionally, when the first adjustment module 703, based on the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses into Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically configured to:
[0128] keeping the first widths of the P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses unchanged, and adjusting the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;
[0129] Among them, the first formula is:
[0130] m=3*i+1
[0131] Where i is a natural number, m is an index, and m is a positive integer less than or equal to N.
[0132] Optionally, the second adjustment module 704 is specifically configured to:
[0133] When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses to obtain an adjusted combined electromagnetic pulse;
[0134] obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse;
[0135] When the fourth frame of image is obtained, the K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image;
[0136] Wherein, the second formula is:
[0137] n=3*i+2
[0138] Where i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and both K and S are positive integers.
[0139] In summary, in the embodiment of the present application, when adjusting the PWM frequency, the number of first electromagnetic pulses is first adjusted from the number of electromagnetic pulses corresponding to the first PWM frequency to the number of electromagnetic pulses corresponding to the second PWM frequency. Then, after adjusting the width of a portion of the electromagnetic pulses to obtain the second frame image, the width of the remaining electromagnetic pulses is adjusted. By gradually adjusting the width of the electromagnetic pulses described above, an intermediate state of one or more frames of electromagnetic pulses of non-uniform width is added, thereby optimizing the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulses within a single frame when switching the PWM frequency, thereby making the PWM frequency switching smoother. Furthermore, by gradually adjusting the width of the electromagnetic pulses in an alternating manner, the brightness of the entire display screen can be ensured to remain consistent during the PWM frequency adjustment process.
[0140] The pulse width modulation (PWM) frequency adjustment device in the embodiments of the present application can be an electronic device or a component of the electronic device, such as an integrated circuit or chip. The electronic device can be a terminal or other device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine (ATM), or a self-service machine, etc., and the embodiments of the present application do not specifically limit this.
[0141] The pulse width modulation (PWM) frequency adjustment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0142] The pulse width modulation (PWM) frequency adjustment device provided in the embodiment of the present application can achieve Figures 1 to 6 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0143] Alternatively, as Figure 8As shown, an embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802, wherein the memory 802 stores a program or instruction that can be run on the processor 801, and when the program or instruction is executed by the processor 801, the various steps of the embodiment of the pulse width modulation PWM frequency adjustment method are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0144] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0145] Figure 9 A schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0146] The electronic device 1000 includes but is not limited to components such as a radio frequency unit 1001 , a network module 1002 , an audio output unit 1003 , an input unit 1004 , a sensor 1005 , a display unit 1006 , a user input unit 1007 , an interface unit 1008 , a memory 1009 , and a processor 1010 .
[0147] Those skilled in the art will understand that the electronic device 1000 may also include a power source (such as a battery) to power each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system. Figure 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be repeated here.
[0148] The processor 1010 is configured to obtain a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency;
[0149] When a preset condition is met, determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted;
[0150] According to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame of image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N;
[0151] When the second frame of image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted from the first width to the second width to obtain a third frame of image;
[0152] Among them, M, N, P, and Q are all positive integers.
[0153] Optionally, when the processor 1010 adjusts the M first electromagnetic pulses into a combined electromagnetic pulse of P third electromagnetic pulses and Q fourth electromagnetic pulses based on the M first electromagnetic pulses and the N second electromagnetic pulses to obtain the second frame of image, the processor 1010 is specifically configured to:
[0154] According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses;
[0155] Obtaining an index corresponding to each third electromagnetic pulse in the N third electromagnetic pulses;
[0156] According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;
[0157] The second frame image is obtained based on the combined electromagnetic pulse.
[0158] Optionally, when the processor 1010, according to the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses into Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically configured to:
[0159] According to the odd or even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or
[0160] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and the Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
[0161] Optionally, when the processor 1010, according to the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses into Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically configured to:
[0162] keeping the first widths of the P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses unchanged, and adjusting the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;
[0163] Among them, the first formula is:
[0164] m=3*i+1
[0165] Where i is a natural number, m is an index, and m is a positive integer less than or equal to N.
[0166] Optionally, when obtaining the second frame of image, the processor 1010 is specifically configured to adjust the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image:
[0167] When the second frame of image is obtained, the first widths of K third electromagnetic pulses corresponding to indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses to obtain an adjusted combined electromagnetic pulse;
[0168] obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse;
[0169] When the fourth frame of image is obtained, the K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image;
[0170] Wherein, the second formula is:
[0171] n=3*i+2
[0172] Wherein, i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and both K and S are positive integers.
[0173] It should be understood that in an embodiment of the present application, the input unit 1004 may include a graphics processing unit (GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and an operating stick, which will not be repeated here.
[0174] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0175] Processor 1010 may include one or more processing units. Optionally, processor 1010 integrates an application processor and a modem processor. The application processor primarily handles operations related to the operating system, user interface, and application programs, while the modem processor primarily processes wireless communication signals, such as a baseband processor. It is understood that the modem processor may not be integrated into processor 1010.
[0176] An embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the embodiment of the pulse width modulation (PWM) frequency adjustment method described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0177] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0178] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned pulse width modulation (PWM) frequency adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0179] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0180] An embodiment of the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the pulse width modulation (PWM) frequency adjustment method embodiment described above, and can achieve the same technical effects. To avoid repetition, they are not described here.
[0181] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising 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 statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0182] 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 the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0183] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
Claims
1. A method for adjusting the frequency of pulse width modulation (PWM), characterized in that: include: Obtain a first frame of image based on M first electromagnetic pulses corresponding to the first PWM frequency; When a preset condition is met, determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted; According to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame of image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N; When the second frame of image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted from the first width to the second width to obtain a third frame of image; Among them, M, N, P, and Q are all positive integers.
2. The method according to claim 1, characterized in that The adjusting, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses into electromagnetic pulses composed of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame of image includes: According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses; Obtaining an index corresponding to each third electromagnetic pulse in the N third electromagnetic pulses; According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; The second frame image is obtained based on the combined electromagnetic pulse.
3. The method according to claim 2, characterized in that The method further comprises: maintaining the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, including: According to the odd or even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and the Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
4. The method according to claim 2, characterized in that The method further comprises: maintaining the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, including: keeping the first widths of the P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses unchanged, and adjusting the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; Among them, the first formula is: m=3*i+1 Where i is a natural number, m is an index, and m is a positive integer less than or equal to N.
5. The method according to claim 4, characterized in that In the case of obtaining the second frame of image, adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image includes: When the second frame of image is obtained, the first widths of K third electromagnetic pulses corresponding to indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses to obtain an adjusted combined electromagnetic pulse; obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse; When the fourth frame of image is obtained, the K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image; Wherein, the second formula is: n=3*i+2 Where i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and both K and S are positive integers.
6. A pulse width modulation (PWM) frequency adjustment device, characterized in that: include: An acquisition module, configured to obtain a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency; a determination module, configured to determine N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted, when a preset condition is met; a first adjustment module, configured to adjust, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses into electromagnetic pulses composed of P third electromagnetic pulses and Q fourth electromagnetic pulses, so as to obtain a second frame of image, wherein a width of the first electromagnetic pulse and a width of the third electromagnetic pulse are both a first width, a width of the second electromagnetic pulse and a width of the fourth electromagnetic pulse are both a second width, and a sum of P and Q is N; a second adjustment module, configured to adjust the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width, so as to obtain a third frame of image, when the second frame of image is obtained; Among them, M, N, P, and Q are all positive integers.
7. The device according to claim 6, characterized in that The first adjustment module is specifically configured to: According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses; Obtaining an index corresponding to each third electromagnetic pulse in the N third electromagnetic pulses; According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; The second frame image is obtained based on the combined electromagnetic pulse.
8. The device according to claim 7, characterized in that The first adjustment module, when maintaining the first widths of P third electromagnetic pulses among the N third electromagnetic pulses according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses into Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically configured to: According to the odd or even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or, According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of the P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and the Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.
9. The device according to claim 7, characterized in that The first adjustment module, when maintaining the first widths of P third electromagnetic pulses among the N third electromagnetic pulses according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses into Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically configured to: keeping the first widths of the P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses unchanged, and adjusting the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses to Q fourth electromagnetic pulses, thereby obtaining a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; Among them, the first formula is: m=3*i+1 Where i is a natural number, m is an index, and m is a positive integer less than or equal to N.
10. The device according to claim 9, characterized in that The second adjustment module is specifically configured to: When the second frame of image is obtained, the first widths of K third electromagnetic pulses corresponding to indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses to obtain an adjusted combined electromagnetic pulse; obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse; When the fourth frame of image is obtained, the K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image; Wherein, the second formula is: n=3*i+2 Where i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and both K and S are positive integers.
11. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the pulse width modulation (PWM) frequency adjustment method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Display equipment and setting method thereof
CN111899680A
Display equipment and control method for eliminating water ripples displayed on screen
CN112992028A