Method and apparatus for detecting flicker frequency of ambient light source, and electronic device
Through the combination of light intensity sensing module and audio chip, high-precision and low-cost ambient light source flicker frequency detection is achieved, solving the problem of water ripple in the light source flickering scene of electronic devices and improving the photography effect.
Patent Information
- Application Number
- PCT/CN2024/142465
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-09
- Filing Date
- 2024-12-25
- Publication Date
- 2025-07-17
AI Technical Summary
In the prior art, electronic devices are prone to water ripples when taking pictures in a light source scintillation scene, and the accuracy and sampling rate of the integrated ambient light sensor are low, resulting in poor detection effect of the light source signal frequency.
The light intensity sensing module, analog-to-digital conversion module and data processing module are used to use the high sampling rate and high quantization accuracy of the audio chip to detect the light intensity signal of the ambient light source through the photodiode and convert it into a digital voltage signal. The flickering frequency is calculated using the audio DSP, and the camera parameters are adjusted to eliminate water ripple.
It realizes high-precision and low-cost flicker frequency detection of ambient light source, which can effectively eliminate water ripple in the image collected by the camera.
Smart Images

Figure CN2024142465_17072025_PF_FP_ABST
Abstract
Description
Method, device and electronic device for detecting flicker frequency of ambient light source
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on January 9, 2024, with application number 202410034448.9 and invention name “A method, device and electronic device for detecting the flicker frequency of an ambient light source”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of terminals, and in particular to a method, device, and electronic device for detecting the flicker frequency of an ambient light source. Background Art
[0003] Currently, when a light source flickers, such as an incandescent bulb or screen driven by 50Hz AC power, electronic devices can easily produce debanding in photos. To eliminate debanding, the flicker frequency of the light source can be detected and the camera parameters adjusted accordingly.
[0004] In the related art, an integrated ambient light sensor can be installed in an electronic device to detect the flicker frequency of a light source. However, the integrated ambient light sensor has low accuracy and low sampling rate, resulting in poor frequency detection of the light source signal. Summary of the Invention
[0005] The embodiments of the present application provide a method, device, and electronic device for detecting the flicker frequency of an ambient light source, which can detect the flicker frequency of an ambient light source with high detection accuracy and low cost.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In the first aspect, an electronic device is provided, including: a light intensity sensing module, an analog-to-digital conversion module and a data processing module; the light intensity sensing module is connected to the analog-to-digital conversion module, and the analog-to-digital conversion module is connected to the data processing module; the light intensity sensing module includes a photodiode (PD), the light intensity sensing module is used to detect the light intensity signal of the ambient light source, and convert the light intensity signal into an analog voltage signal; the analog-to-digital conversion module is used to convert the analog voltage signal into a digital voltage signal; the analog-to-digital conversion module is an audio chip, and the audio chip is connected to a microphone and / or a speaker; the data processing module is used to calculate the flicker frequency of the ambient light source based on the digital voltage signal.
[0008] The solution provided by the embodiments of the present application can reuse an audio chip (e.g., an audio codec or ADC) to process an analog signal (an analog voltage signal corresponding to the light intensity signal of an ambient light source) to obtain a digital signal (a digital voltage signal), and then calculate the flicker frequency of the ambient light source based on the digital voltage signal. Due to the high sampling rate (e.g., 8-192 kHz) and high quantization accuracy (e.g., >= 24 bits) of the audio chip, the flicker frequency of the ambient light source can be effectively detected with high accuracy and without incurring additional costs (i.e., low cost).
[0009] In one possible implementation, the electronic device further includes an application processor (AP) and a camera. The data processing module is further configured to transmit the flicker frequency of the ambient light source to the AP. The AP is configured to set camera parameters based on the flicker frequency of the ambient light source, including exposure time and / or frame rate. In this way, the camera parameters can be adjusted based on the detected flicker frequency of the ambient light source to eliminate water ripples in images captured by the camera.
[0010] In one possible implementation, the audio chip includes an audio codec (CODEC) or an audio analog-to-digital converter (ADC). Because the CODEC or ADC has a high sampling rate and high quantization accuracy, it can effectively detect the flicker frequency of ambient light sources with high accuracy and without incurring additional costs.
[0011] In one possible implementation, the data processing module is an audio digital signal processor, which can be reused to calculate the digital voltage signal to obtain the flicker frequency of the ambient light source, with high calculation efficiency and no additional cost.
[0012] In one possible implementation, the analog-to-digital conversion module is used to high-pass filter the analog voltage signal to obtain an AC voltage signal, then amplify the AC voltage signal and perform analog-to-digital conversion on the amplified AC voltage signal to obtain a digital voltage signal. This allows filtering out DC signals that do not contribute to light source frequency detection, while amplifying the AC signal, enhancing detection of fluctuation signals and thus better detecting flicker in AC light sources.
[0013] In one possible implementation, the light intensity sensing module includes a photodiode, a first sampling resistor, a first capacitor, and a second capacitor. The cathode of the photodiode is connected to a bias voltage, the anode of the photodiode is connected to one end of the first sampling resistor, and the other end of the first sampling resistor is connected to DC ground. One end of the second capacitor is connected to the anode of the photodiode, and the other end of the second capacitor is connected to AC ground. One end of the first capacitor is connected to the other end of the first sampling resistor, and the other end of the first capacitor is connected to AC ground. In this way, the light intensity signal of the ambient light source can be detected by the photodiode, and the light intensity signal can be converted into an analog voltage signal by the first sampling resistor and other components.
[0014] In one possible implementation, the light intensity sensing module further includes a first magnetic bead and a second magnetic bead; one end of the first magnetic bead is connected to one end of the second capacitor and the anode of the photodiode, and one end of the second magnetic bead is connected to one end of the first capacitor and the other end of the first sampling resistor. The first and second magnetic beads can suppress high-frequency noise and spike interference, and absorb electrostatic pulses.
[0015] In one possible implementation, the light intensity sensing module includes a photodiode, a second sampling resistor, and a first operational amplifier. The cathode of the photodiode is connected to one end of the second sampling resistor and the inverting input of the first operational amplifier, while the anode of the photodiode is grounded. The other end of the second sampling resistor is connected to the output of the first operational amplifier, while the positive input of the first operational amplifier is grounded. In this way, the light intensity signal of the ambient light source can be detected by the photodiode and converted into an analog voltage signal by the second sampling resistor and other components.
[0016] In one possible implementation, the light intensity sensing module includes a photodiode, a second operational amplifier, and a charging capacitor. The cathode of the photodiode is connected to one end of the charging capacitor and the inverting input of the second operational amplifier, and the anode of the photodiode is grounded. The other end of the charging capacitor is connected to the output of the second operational amplifier, and the positive input of the second operational amplifier is connected to a bias voltage. In this way, the light intensity signal of the ambient light source can be detected by the photodiode and converted into an analog voltage signal by components such as the charging capacitor.
[0017] In one possible implementation, the analog-to-digital conversion module includes a high-pass filter, a programmable gain amplifier (PGA), an analog-to-digital converter, and a data transmission module. The input of the high-pass filter is connected to the output of the light intensity sensing module, the output of the high-pass filter is connected to the input of the PGA, the output of the PGA is connected to the input of the analog-to-digital converter, the output of the analog-to-digital converter is connected to the input of the data transmission module, and the output of the data transmission module is connected to the data processing module. The high-pass filter is used to receive an analog voltage signal from the output of the light intensity sensing module. The high-pass filter filters the DC voltage signal of the analog voltage signal to obtain an AC voltage signal. The PGA amplifies the AC voltage signal. The analog-to-digital converter converts the amplified AC voltage signal into a digital voltage signal. The data transmission module sends the digital voltage signal to the data processing module via a bus. In this way, the DC signal that does not contribute to the detection of the light source frequency can be filtered, and the AC signal can be amplified, which can enhance the detection of the fluctuation signal, thereby better detecting the flicker of the AC light source.
[0018] In one possible implementation, the analog-to-digital conversion module includes a programmable gain amplifier, an analog-to-digital converter and a data transmission module. The input end of the PGA is connected to the output end of the light intensity sensing module, the output end of the PGA is connected to the input end of the analog-to-digital converter, the output end of the analog-to-digital converter is connected to the input end of the data transmission module, and the output end of the data transmission module is connected to the data processing module; the PGA is used to receive an analog voltage signal from the output end of the light intensity sensing module and amplify the analog voltage signal; the analog-to-digital converter converts the amplified analog voltage signal into a digital voltage signal; and the data transmission module sends the digital voltage signal to the data processing module through a bus.
[0019] In the second aspect, a device for detecting the flicker frequency of an ambient light source is provided, comprising: a light intensity sensing module, an analog-to-digital conversion module and a data processing module; the light intensity sensing module is connected to the analog-to-digital conversion module, and the analog-to-digital conversion module is connected to the data processing module; the light intensity sensing module includes a photodiode, the light intensity sensing module is used to detect the light intensity signal of the ambient light source and convert the light intensity signal into a voltage signal; the analog-to-digital conversion module is used to convert the analog voltage signal into a digital voltage signal; the data processing module is used to calculate the flicker frequency of the ambient light source based on the digital voltage signal.
[0020] The device for detecting the flicker frequency of an ambient light source provided in an embodiment of the present application can detect the light intensity signal of the ambient light source through a light intensity sensing module and convert the light intensity signal into a voltage signal; convert the analog voltage signal into a digital voltage signal through an analog-to-digital conversion module; and calculate the flicker frequency of the ambient light source based on the digital voltage signal through a data processing module. This device can effectively detect the flicker frequency of the ambient light source. Based on the detected flicker frequency of the ambient light source, camera parameters can be adjusted to eliminate water ripples in images captured by the camera.
[0021] In one possible implementation, the analog-to-digital conversion module is used to perform high-pass filtering on the analog voltage signal to obtain an AC voltage signal, then amplify the AC voltage signal, and perform analog-to-digital conversion on the amplified AC voltage signal to obtain a digital voltage signal.
[0022] In one possible implementation, the light intensity sensing module includes a photodiode, a first sampling resistor, a first capacitor, and a second capacitor; the cathode of the photodiode is connected to the bias voltage, the anode of the photodiode is connected to one end of the first sampling resistor, and the other end of the first sampling resistor is DC grounded; one end of the second capacitor is connected to the anode of the photodiode, and the other end of the second capacitor is AC grounded; one end of the first capacitor is connected to the other end of the first sampling resistor, and the other end of the first capacitor is AC grounded.
[0023] In one possible implementation, the light intensity sensing module also includes a first magnetic bead and a second magnetic bead; one end of the first magnetic bead is connected to one end of the second capacitor and the anode of the photodiode, and one end of the second magnetic bead is connected to one end of the first capacitor and the other end of the first sampling resistor.
[0024] In one possible implementation, the light intensity sensing module includes a photodiode, a second sampling resistor and a first operational amplifier; the cathode of the photodiode is connected to one end of the second sampling resistor and the reverse input end of the first operational amplifier, and the anode of the photodiode is grounded; the other end of the second sampling resistor is connected to the output end of the first operational amplifier, and the positive input end of the first operational amplifier is grounded.
[0025] In one possible implementation, the light intensity sensing module includes a photodiode, a second operational amplifier and a charging capacitor; the cathode of the photodiode is connected to one end of the charging capacitor and the reverse input end of the second operational amplifier, and the anode of the photodiode is grounded; the other end of the charging capacitor is connected to the output end of the second operational amplifier, and the positive input end of the second operational amplifier is connected to the bias voltage.
[0026] In one possible implementation, the analog-to-digital conversion module includes a high-pass filter, a programmable gain amplifier, an analog-to-digital converter and a data transmission module, the input end of the high-pass filter is connected to the output end of the light intensity sensing module, the output end of the high-pass filter is connected to the input end of the PGA, the output end of the PGA is connected to the input end of the analog-to-digital converter, the output end of the analog-to-digital converter is connected to the input end of the data transmission module, and the output end of the data transmission module is connected to the data processing module; the high-pass filter is used to receive an analog voltage signal from the output end of the light intensity sensing module; the high-pass filter filters the DC voltage signal of the analog voltage signal to obtain an AC voltage signal; the PGA amplifies the AC voltage signal; the analog-to-digital converter converts the amplified AC voltage signal into a digital voltage signal; and the data transmission module sends the digital voltage signal to the data processing module via a bus.
[0027] In one possible implementation, the analog-to-digital conversion module includes a programmable gain amplifier, an analog-to-digital converter and a data transmission module. The input end of the PGA is connected to the output end of the light intensity sensing module, the output end of the PGA is connected to the input end of the analog-to-digital converter, the output end of the analog-to-digital converter is connected to the input end of the data transmission module, and the output end of the data transmission module is connected to the data processing module; the PGA is used to receive an analog voltage signal from the output end of the light intensity sensing module and amplify the analog voltage signal; the analog-to-digital converter converts the amplified analog voltage signal into a digital voltage signal; and the data transmission module sends the digital voltage signal to the data processing module through a bus.
[0028] On the third aspect, a method for detecting the flicker frequency of an ambient light source is provided, which is applied to an electronic device, the electronic device including a light intensity sensing module, an analog-to-digital conversion module and a data processing module; the light intensity sensing module includes a photodiode, the light intensity sensing module is connected to the analog-to-digital conversion module, and the analog-to-digital conversion module is connected to the data processing module, the method including: the light intensity sensing module detects the light intensity signal of the ambient light source and converts the light intensity signal into a voltage signal; the analog-to-digital conversion module converts the voltage signal into a digital voltage signal; the analog-to-digital conversion module is an audio chip, and the audio chip is connected to a microphone and / or a speaker; the data processing module calculates the flicker frequency of the ambient light source based on the digital voltage signal.
[0029] The method for detecting the flicker frequency of an ambient light source provided in an embodiment of the present application can detect the light intensity signal of the ambient light source through a light intensity sensing module and convert the light intensity signal into a voltage signal; convert the analog voltage signal into a digital voltage signal through an analog-to-digital conversion module; and calculate the flicker frequency of the ambient light source based on the digital voltage signal through a data processing module. This method can effectively detect the flicker frequency of the ambient light source. Based on the detected flicker frequency of the ambient light source, camera parameters can be adjusted to eliminate water ripples in images captured by the camera.
[0030] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the third aspect.
[0031] In a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on the electronic device, the electronic device executes the method as described in the third aspect.
[0032] Among them, the technical effects of the second to fifth aspects refer to the technical effects of the first aspect and any of its embodiments, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] FIG1 is a schematic diagram of a module provided in an embodiment of the present application;
[0034] FIG2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0035] FIG3 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
[0036] FIG4 is a circuit connection diagram of a light intensity sensing module provided in an embodiment of the present application;
[0037] FIG5 is a circuit connection diagram of an analog-to-digital conversion module provided in an embodiment of the present application;
[0038] FIG6 is a circuit connection diagram of another analog-to-digital conversion module provided in an embodiment of the present application;
[0039] FIG7 is a schematic diagram of a shooting scene provided in an embodiment of the present application;
[0040] FIG8 is a flow chart of a method for detecting the flicker frequency of an ambient light source provided in an embodiment of the present application;
[0041] FIG9 is a schematic diagram of a spectrum diagram provided in an embodiment of the present application;
[0042] FIG10 is a schematic diagram of a display provided in an embodiment of the present application;
[0043] FIG11 is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;
[0044] FIG12 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] To make the description of the following embodiments clear and concise, a brief introduction to the relevant concepts or technologies is first given:
[0046] Rolling shutter: This is an exposure method where the camera scans and exposes pixels row by row until all pixels are exposed. Different rows of pixels have different exposure times.
[0047] Flicker light sources: This refers to scenes (or environments) where flickering light sources exist. Flicker light sources can include AC-powered light sources, such as indoor chandeliers, TV screens, and electronic screens in shopping malls or high-speed rail stations.
[0048] In scenes with flickering light sources, debanding is easily captured when electronic devices use a rolling shutter exposure method to shoot.
[0049] In order to eliminate water ripples, the flickering frequency of the light source can be detected, and the parameters of the camera can be adjusted according to the flickering frequency of the light source to eliminate water ripples.
[0050] In the related art, an integrated ambient light sensor can be installed in an electronic device to detect the flicker frequency of a light source. However, the integrated ambient light sensor has low accuracy and low sampling rate, resulting in poor frequency detection of the light source signal.
[0051] The embodiments of the present application provide a device and method for detecting the flicker frequency of an ambient light source, which can detect the flicker frequency of an ambient light source with high detection accuracy and low cost.
[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality of" means two or more than two. In addition, in order to facilitate the clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0053] As shown in Figure 1, an embodiment of the present application provides a device for detecting the flicker frequency of an ambient light source. The device can include three parts: a light intensity sensing module, an analog-to-digital conversion module, and a data processing module. The light intensity sensing module is connected to the analog-to-digital conversion module, which is in turn connected to the data processing module.
[0054] The light intensity sensing module includes a photodiode PD, and is used to detect the light intensity signal of the ambient light source and convert the light intensity signal into a voltage signal (analog voltage signal).
[0055] The analog-to-digital conversion module is used to convert a voltage signal (analog voltage signal) into a digital voltage signal.
[0056] The data processing module is used to calculate the flicker frequency of the ambient light source according to the digital voltage signal.
[0057] In some embodiments, the above-mentioned device for detecting the flicker frequency of an ambient light source can be applied to electronic devices.
[0058] As shown in Figure 2, an electronic device may include an audio chip, a speaker, a microphone, a PD photoelectric detection circuit, a SoC, and other modules. The SoC may include an ADSP and an application processor (AP). In other words, the ADSP and AP may be integrated on the SoC.
[0059] In an embodiment of the present application, the audio chip can serve as an analog-to-digital conversion module. The audio chip can be connected to a PD photoelectric detection circuit. The PD photoelectric detection circuit can serve as a light intensity sensing module, used to detect the light intensity signal of an ambient light source and convert the light intensity signal into an analog voltage signal. The audio chip can be used to convert the analog voltage signal into a digital voltage signal. The audio chip can also be connected to a microphone and / or speaker.
[0060] In embodiments of the present application, an audio digital signal processor (DSP) of an electronic device can serve as a data processing module. The audio DSP can also be referred to as an ADSP. The audio DSP can use a fast Fourier transform (FFT) algorithm to process digital voltage signals to obtain the flicker frequency of one or more ambient light sources.
[0061] Optionally, the data processing module can also send frequency information (the flicker frequency of one or more ambient light sources) to the application processor (AP). That is, the Audio DSP can send the calculated frequency information (the flicker frequency of one or more ambient light sources) to the application processor (AP). The AP can set camera parameters (e.g., exposure time) based on the received frequency information to eliminate water ripples.
[0062] The present application also provides an electronic device (eg, electronic device 100 ) that uses the above-mentioned device for detecting the flicker frequency of an ambient light source.
[0063] FIG3 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. As shown in FIG3 , the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a light intensity sensor module 170E, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195.
[0064] Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0065] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0066] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, an audio digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0067] The charging management module 140 is configured to receive charging input from a charger. While charging the battery 142 , the charging management module 140 can also provide power to the electronic device through the power management module 141 .
[0068] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
[0069] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0070] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network.
[0071] The mobile communication module 150 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low-noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1.
[0072] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs sound signals through an audio device (including but not limited to the speaker 170A, the receiver 170B, etc.) or displays images or videos through the display screen 194.
[0073] The wireless communication module 160 can provide wireless communication solutions including WLAN (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signal, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0074] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0075] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0076] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED).
[0077] The electronic device 100 can realize the shooting function through the ISP, camera 193, video codec, GPU, display screen 194 and application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. The digital voltage signal processor is used to process digital voltage signals. In addition to processing digital image signals, it can also process other digital voltage signals. The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0078] The number of cameras 193 may be 1 to N. Each camera includes a photosensitive element (CCD / CMOS), which can sense light, collect photons, and convert them into electric charges.
[0079] For example, the electronic device may include two front cameras and three rear cameras. Among them, the front camera may include a front main camera and a TOF camera. Among them, the TOF camera may include TX and RX, TX may be used to transmit light signals (infrared light or laser pulses), and RX may be used to receive imaging. TX may be, for example, an infrared light transmitter. RX may be, for example, a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor. Optionally, the front camera may also include a front secondary camera.
[0080] The rear camera may include, for example, a rear main camera, a wide-angle camera (also referred to as an ultra-wide-angle camera), and a telephoto camera. Of course, the rear camera may also include other types of cameras, such as a depth camera module, a black and white camera module, a macro camera module, etc., which are not limited in this application. The rear main camera may be a wide-angle camera, and the viewing angles of the rear main camera and the ultra-wide-angle camera may be different.
[0081] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are saved in the external memory card. The internal memory 121 can be used to store computer executable program code, and the executable program code includes instructions. The processor 110 can execute various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0082] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0083] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. The speaker 170A, also known as a "speaker," is used to convert audio electrical signals into sound signals. The receiver 170B, also known as a "handset," is used to convert audio electrical signals into sound signals. The microphone 170C, also known as a "microphone" or "microphone," is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0084] In the embodiment of the present application, the audio module 170 may be an audio chip, which may be, for example, an audio codec (Audio codec) or an audio analog-to-digital converter ADC.
[0085] The light intensity sensing module 170E includes a photodiode, which is used to convert the light intensity signal of the ambient light source into an analog voltage signal.
[0086] In the embodiment of the present application, the audio module 170 is also used to sample, quantize and encode the analog voltage signal from the light intensity sensing module 170E to obtain a digital voltage signal.
[0087] In this embodiment of the present application, the audio module 170 can send the digital voltage signal to the Audio DSP in the processor 110, which can serve as a data processing module. The Audio DSP can process the digital voltage signal using an FFT algorithm and a peak-finding algorithm to obtain one or more flicker frequencies (each flicker frequency corresponds to an ambient light source).
[0088] Furthermore, the Audio DSP in the processor 110 may send frequency information (the flicker frequency of one or more ambient light sources) to the application processor in the processor 110. The application processor may set camera parameters (e.g., exposure time) based on the received frequency information to eliminate water ripples.
[0089] The buttons 190 include a power button, a volume button, etc. The buttons 190 can be mechanical buttons. They can also be touch buttons. The electronic device 100 can receive button inputs and generate key signal inputs related to the user settings and function controls of the electronic device 100. The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts or for touch vibration feedback. The indicator 192 can be an indicator light that can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
[0090] For example, FIG4 illustrates the light intensity sensing module in detail.
[0091] As shown in (a) in Figure 4, it is a circuit connection diagram of a light intensity sensing module (i.e., a PD photoelectric detection circuit). As shown in (a) in Figure 4, the light intensity sensing module may include a photodiode PD, a sampling resistor R1 (first sampling resistor), a filter capacitor C1 (first capacitor) and C2 (second capacitor). Among them, the cathode (negative pole) of the photodiode PD is connected to the bias voltage Vbias, the anode (positive pole) of the photodiode PD is connected to one end of the sampling resistor R1, and the other end of the sampling resistor R1 is DC grounded. One end of the filter capacitor C1 is connected to port 2 and the other end of the resistor R1, and the other end of the filter capacitor C1 is AC grounded. One end of the filter capacitor C2 is connected to the anode of the photodiode PD and port 1, and the other end of the filter capacitor C2 is AC grounded. Among them, port 1 is an analog voltage signal, and port 2 is a ground signal.
[0092] As shown in (b) of Figure 4, a circuit connection diagram of a light intensity sensing module (i.e., a PD photoelectric detection circuit) is provided. As shown in (b) of Figure 4, the light intensity sensing module may include a photodiode PD, a sampling resistor R1, filter capacitors C1 and C2, magnetic beads L1 (first magnetic bead) and L2 (second magnetic bead), etc. Among them, the cathode (negative pole) of the photodiode PD is connected to the bias voltage Vbias, the anode (positive pole) of the photodiode PD is connected to one end of the sampling resistor R1, and the other end of the sampling resistor R1 is DC grounded. One end of the magnetic bead L1 is connected to one end of the filter capacitor C2 and the anode of the photodiode PD, and the other end of the filter capacitor C2 is AC grounded. One end of the magnetic bead L2 is connected to one end of the filter capacitor C1 and the other end of the resistor R1, and the other end of the filter capacitor C1 is AC grounded. The other end of the magnetic bead L1 is connected to port 1, and the other end of the magnetic bead L2 is connected to port 2. Among them, port 1 is an analog voltage signal, and port 2 is a ground signal. Among them, the magnetic beads L1 and L2 can suppress high-frequency noise and spike interference, as well as absorb electrostatic pulses.
[0093] As shown in (c) in Figure 4, another circuit connection diagram of the light intensity sensing module is shown. As shown in (c) in Figure 4, the light intensity sensing module includes a photodiode PD, a sampling resistor R2 (a second sampling resistor), and an operational amplifier 1 (a first operational amplifier). The cathode of the photodiode PD is connected to one end of the sampling resistor R2 and the reverse input end of the operational amplifier 1, and the anode of the photodiode PD is grounded. The other end of the sampling resistor R2 is connected to the output end of the operational amplifier 1. The positive input end of the operational amplifier 1 is grounded. Port 1 is connected to the output port of the operational amplifier 1 and one end of the sampling resistor R2, and port 2 is connected to the positive end of the photodiode PD. Among them, port 1 is an analog voltage signal, and port 2 is a ground signal.
[0094] As shown in (d) in Figure 4, it is another circuit connection diagram of the light intensity sensing module. As shown in (d) in Figure 4, the light intensity sensing module includes a photodiode PD, an operational amplifier 2 (a second operational amplifier) and a charging capacitor C3. The cathode of the photodiode PD is connected to one end of the charging capacitor C3 and the reverse input end of the operational amplifier 2, and the anode of the photodiode PD is grounded. The other end of the charging capacitor C3 is connected to the output end of the operational amplifier 2. The positive input end of the operational amplifier 2 is connected to the bias voltage Vbias. Port 1 is connected to the output port of the operational amplifier 2 and one end of the charging capacitor C3, and port 2 is connected to the positive end of the photodiode PD. Among them, port 1 is an analog voltage signal, and port 2 is a ground signal.
[0095] Figures (a)-(d) in Figure 4 illustrate the circuit connections of the light intensity sensing module, and the circuit of the light intensity sensing module is not limited thereto. For example, in some possible implementations, the light intensity sensing module may include multiple photodiodes, or the light intensity sensing module may also include other components, which are not specifically limited in this application.
[0096] For example, FIG5-FIG6 provide an expanded description of the analog-to-digital conversion module.
[0097] In one possible design, as shown in Figure 5, the analog-to-digital conversion module includes a high-pass filter, a programmable gain amplifier (PGA), an analog-to-digital converter (ADC TX), and a data transmission module. The input of the high-pass filter is connected to the output of the light intensity sensing module (i.e., ports 1 and 2 of the light intensity sensing module), the output of the high-pass filter is connected to the input of the PGA, the output of the PGA is connected to the input of the analog-to-digital converter, the output of the analog-to-digital converter is connected to the input of the data transmission module, and the output of the data transmission module is connected to the data processing module.
[0098] Among them, the high-pass filter is connected to port 1 and port 2 of the light intensity sensing module, and the high-pass filter can receive analog voltage signals from port 1 and port 2 of the light intensity sensing module (that is, the analog voltage signal corresponding to the light intensity signal detected by the photodiode PD).
[0099] The high-pass filter can filter the low-frequency DC signal of the analog voltage signal to obtain an AC voltage signal (a high-frequency AC voltage signal). In this way, the high-pass filter can filter out the DC signal that does not contribute to the detection of the light source frequency and enhance the detection of the fluctuating signal (AC signal).
[0100] It should be noted that ambient light sources can include DC and AC light sources. The light emitted by a DC light source (e.g., a DC-powered light bulb) is continuous and uniform, without flicker. However, because the voltage and current direction of AC power fluctuate continuously at a certain frequency, the brightness (i.e., the light intensity signal) of an AC light source (e.g., an AC-powered light bulb) also flickers with the fluctuations of the AC power. The light intensity signal detected by the light intensity sensing module can include the light intensity signal of the DC light source and the light intensity signal of the AC light source. After converting the light intensity signal detected by the light intensity sensing module into an analog voltage signal, the analog voltage signal can include a DC voltage signal and an AC voltage signal. The DC voltage signal corresponds to the light intensity signal of the DC light source, and the AC voltage signal corresponds to the light intensity signal of the AC light source. Since the light emitted by a DC light source does not flicker, the DC voltage signal does not contribute to the detection of flicker. Therefore, the DC voltage signal can be blocked, while the AC voltage signal is retained, to better detect the flicker of the AC light source. The DC voltage signal can be blocked using a high-pass filter. This is because the DC signal has a zero frequency and cannot pass through the high-pass filter, thus enabling the high-pass filter to block the DC power.
[0101] The PGA amplifies the filtered signal (AC voltage signal). The ADC TX converts the amplified signal (amplified AC voltage signal) into a digital voltage signal. The data transmission module transmits the digital voltage signal and can send it to the data processing module via the bus.
[0102] In another possible design, the analog-to-digital conversion module may not include a high-pass filter. For example, as shown in FIG6 , the analog-to-digital conversion module includes a PGA, an analog-to-digital converter, and a data transmission module. The input of the PGA is connected to the output of the light intensity sensing module, the output of the PGA is connected to the input of the analog-to-digital converter, the output of the analog-to-digital converter is connected to the input of the data transmission module, and the output of the data transmission module is connected to the data processing module.
[0103] The PGA may receive analog voltage signals from port 1 (ie, port 1) and port 2 (ie, port 2). The PGA may amplify the analog voltage signals.
[0104] The analog-to-digital converter can sample and quantize the amplified analog voltage signal, thereby converting the analog voltage signal into a digital voltage signal.
[0105] The data transmission module may be responsible for transmitting the digital voltage signal and sending the digital voltage signal to the data processing module through the bus.
[0106] The data processing module is used to process the digital voltage signal. The data processing module can be an audio DSP. The audio DSP can use an FFT algorithm to analyze the frequency domain of the digital voltage signal to obtain the flicker frequency of one or more ambient light sources.
[0107] It is understandable that the process of converting the light intensity signal of the ambient light source into a digital voltage signal involved in the embodiment of the present application is similar to the recording process. During the recording process, the microphone (also called a "microphone") can collect analog sound signals and convert the analog sound signals into analog electrical signals. The audio module is used to convert the analog electrical signal into a digital audio signal. Similarly, in the process of converting the light intensity signal of the ambient light source into a digital voltage signal, the light intensity sensing module can detect the light intensity signal of the ambient light source and convert the light intensity signal into an analog voltage signal. The audio module can convert the analog voltage signal into a digital audio signal.
[0108] In one possible design, the analog-to-digital conversion module can be an audio codec or an audio ADC. The audio codec or audio ADC can amplify, sample, quantize and encode the analog voltage signal detected by the light intensity sensing module to obtain a digital voltage signal. The audio codec or audio ADC has a high sampling rate (8-192KHz), high quantization accuracy (>=24Bit), and a low-frequency cutoff function (that is, it can cut off low-frequency DC signals), and can detect the flicker frequency of the ambient light source with high detection accuracy. Moreover, the present application reuses the audio codec or ADC when detecting the flicker frequency of the ambient light source, which does not increase additional costs.
[0109] It should be noted that the audio codec or audio ADC can be a standalone chip or integrated into other chips. For example, the audio codec can be integrated into a power management integrated circuit (PMIC).
[0110] Of course, the analog-to-digital conversion module is not limited to an audio chip (eg, an audio codec or an audio ADC). The analog-to-digital conversion module can be a module (or chip) independent of the audio chip, which is not limited in this application.
[0111] The solution for detecting the flicker frequency of an ambient light source provided in the embodiment of the present application can be applied to at least one scenario such as a local light source scenario, a dark light scene, a high-frequency light source scene, and a mixed light source scene.
[0112] Among them, the local light source scene refers to the presence of a local light source in the shooting scene. For example, taking the electronic device as a mobile phone as an example, as shown in (a) in Figure 7, the mobile phone can display a shooting preview interface 701. The shooting preview interface 701 displays the picture captured by the camera of the mobile phone. According to the shooting preview interface 701, it can be seen that the location corresponding to the current shooting scene is the living room, and the light sources in the living room include natural light (sunlight) and the TV display. Natural light can cover the entire living room, and the light emitted by the TV display covers part of the living room. The TV display can be regarded as a local light source.
[0113] A low-light scene refers to a scene where the ambient light source present in the scene is relatively weak. For example, as shown in (b) of FIG7 , the mobile phone may display a shooting preview interface 702. Shooting preview interface 702 displays the image captured by the mobile phone's camera. Shooting preview interface 702 indicates that the current shooting scene corresponds to a bedroom. If it is nighttime, the bedroom's light source only includes a desk lamp (which may be located on a nightstand). Due to the low light intensity of the desk lamp, it can be considered that the current scene is a low-light environment.
[0114] A high-frequency light source scene refers to a scene where the ambient light source present in the scene has a high flickering frequency. For example, as shown in (c) of Figure 7 , the phone may display a shooting preview interface 703. Shooting preview interface 703 displays the image captured by the phone's camera. Shooting preview interface 703 indicates that the current shooting scene corresponds to a high-speed rail waiting station, which includes a high-frequency display screen. Therefore, it can be considered that the scene is currently in a high-frequency light source scene.
[0115] A mixed light source scene refers to a scene in which there are multiple ambient light sources, and the flickering frequencies of the multiple ambient light sources are different. For example, as shown in (d) in FIG7 , the mobile phone may display a shooting preview interface 704. The shooting preview interface 704 displays the image captured by the mobile phone's camera. According to the shooting preview interface 704, the location corresponding to the current shooting scene is the living room, and the light sources in the living room include the TV display and the table lamp. The flickering frequencies of the TV display and the table lamp are different, that is, the current scene is a mixed light source scene.
[0116] It should be understood that two or more of the local light source scene, the dark light scene, the high-frequency light source scene, and the mixed light source scene may exist at the same time.
[0117] As shown in FIG8 , an embodiment of the present application provides a method for detecting the flicker frequency of an ambient light source, which is applied to an electronic device. The electronic device includes a light intensity sensing module, an analog-to-digital conversion module, and a data processing module. The light intensity sensing module is connected to the analog-to-digital conversion module, which is connected to the data processing module. The method includes:
[0118] 801. Detect a light intensity signal of an ambient light source and convert the light intensity signal into an analog voltage signal.
[0119] The light intensity sensing module of the electronic device can detect the light intensity signal of the ambient light source through the PD and convert the light intensity signal of the ambient light source into an analog voltage signal.
[0120] 802. Convert the analog voltage signal into a digital voltage signal.
[0121] The analog-to-digital conversion module of the electronic device can convert the analog voltage signal into a digital voltage signal. The specific process can be referred to the above description of the analog-to-digital conversion module, which will not be repeated here.
[0122] 803. Calculate the flicker frequency of the ambient light source according to the digital voltage signal.
[0123] The data processing module (eg, Audio DSP) of the electronic device can calculate the flicker frequency of the ambient light source according to the digital voltage signal. Detailed procedures can be referred to the above description of the data processing module and will not be elaborated here.
[0124] For example, as shown in (a) of FIG9 , a time-domain digital voltage signal received by the data processing module from the analog-to-digital conversion module is shown. The horizontal axis represents time, with units in milliseconds (ms). The vertical axis represents amplitude, with units in dB (decibels). After the data processing module performs FFT processing on the digital voltage signal shown in (a) of FIG9 , a spectrum plot as shown in (b) of FIG9 is obtained. This spectrum plot is a logarithmic amplitude spectrum plot. The horizontal axis represents frequency, with units in Hertz (Hz). The vertical axis represents amplitude, with units in dB (decibels). After the data processing module performs FFT processing on the digital voltage signal, the frequencies and amplitudes of multiple sinusoidal wave signals are obtained. Furthermore, the data processing module can determine the frequency of a target peak using a peak-finding algorithm and use the frequency of the target peak as the flicker frequency of the ambient light source. The target peak may refer to a peak whose amplitude exceeds a preset amplitude. For example, assuming the preset amplitude is 2, peaks exceeding the preset amplitude may include Peak 1, Peak 2, and Peak 3. That is, the target peak positions include peak 1, peak 2, and peak 3. Peak 1, peak 2, and peak 3 correspond to frequencies of 100 Hz, 2160 Hz, and 4200 Hz, respectively. That is, the flicker frequencies of the ambient light source may include 100 Hz, 2160 Hz, and 4200 Hz.
[0125] 804. Set camera parameters according to the flicker frequency of the ambient light source.
[0126] Furthermore, a data processing module (e.g., an audio DSP) can send frequency information (the flicker frequency of one or more ambient light sources) to an application processor of the electronic device. The application processor can set / adjust camera parameters based on the received frequency information to eliminate water ripples.
[0127] The parameters of the camera include exposure time (also called shutter time) and / or frame rate (also called frame interval).
[0128] In some embodiments, the application processor can determine the light cycle based on the flickering frequency of the light source. The flickering frequency of the light source is the inverse of the light cycle. The application processor can set the camera exposure time to an integer multiple of the light cycle, or the camera frame rate to an integer multiple of the light cycle, thereby eliminating water ripples.
[0129] If there are multiple ambient light sources with different light cycle times, the application processor can set the camera's exposure time or frame rate based on the lowest common multiple of the light cycle times of the multiple ambient light sources. For example, the camera's exposure time can be set to an integer multiple of the lowest common multiple of the light cycle times of the multiple ambient light sources, or the camera's frame rate can be set to an integer multiple of the lowest common multiple of the light cycle times of the multiple ambient light sources, thereby eliminating water ripples.
[0130] For example, it is assumed that the location corresponding to the current shooting scene is a high-speed rail waiting station, which includes a high-frequency (flickering frequency is higher than a preset threshold) flickering light source (e.g., a train number display screen), that is, it is currently in a high-frequency light source scene. As shown in (a) of Figure 10, after the light emitted by the train number display screen 1002 is captured by the camera of the electronic device, water ripples may appear in the display area of the train number display screen 1002 in the shooting preview interface 1001, affecting the user experience. In one possible scenario, if the light emitted by the train number display screen 1002 is irradiated by the surrounding reflective objects and is captured by the camera of the electronic device, as shown in (b) of Figure 10, water ripples may appear in the entire display area of the shooting preview interface 1003, affecting the user experience. The electronic device provided in the embodiment of the present application can detect the flickering frequency of the train number display screen 1002 and adjust the camera parameters (e.g., exposure time and / or frame rate) according to the flickering frequency of the train number display screen 1002, so as to avoid water ripples. As shown in (c) in Figure 10, after adjusting the camera parameters (for example, exposure time and / or frame rate) according to the flashing frequency of the train number display screen 1002 (for example, setting the camera exposure time to an integer multiple of the light source period), the electronic device can display a shooting preview interface 1004. There are no water ripples in the shooting preview interface 1004, which can improve the user experience.
[0131] The solution provided in this application can reuse the audio codec or ADC to process the analog signal (the analog voltage signal corresponding to the light intensity signal of the ambient light source). Since the audio codec or ADC has a high sampling rate (for example, the sampling rate can reach 8-192KHz), high quantization accuracy (for example, quantization accuracy >= 24Bit), and a low-frequency cutoff function (that is, it can isolate low-frequency DC signals), it can effectively detect the flicker frequency of ambient light sources in scenes such as local light source scenes, dark light scenes, high-frequency light source scenes, and mixed light source scenes.
[0132] In the related art, electronic devices detect the flickering frequency of ambient light sources through integrated ambient light sensors. Due to the low accuracy and low sampling rate of the integrated ambient light sensors, the frequency detection effect of the light source signal is poor (for example, the flickering frequency of some light source signals (for example, high-frequency light sources, local light sources, etc.) cannot be detected).
[0133] As shown in Table 1, the detection of the flicker frequency of the ambient light source using the relevant technical solutions and the solution of the present application in different scenarios is shown.
[0134] Table 1
[0135] The solution provided by the present application is different from the solution adopted in the related art that detects the flicker frequency of the ambient light source through an integrated ambient light sensor. The solution provided by the present application adopts a segmented processing when detecting the flicker frequency of the ambient light source. The light intensity signal of the ambient light source is detected by the light intensity sensing module, and the light intensity signal is converted into an analog voltage signal. The audio module of the electronic device (for example, an audio codec or ADC) is then used to isolate, amplify, sample, quantize, and encode the analog voltage signal to obtain a digital voltage signal. Due to the high precision and high sampling rate of the audio codec or ADC, the flicker frequency of the ambient light source can be detected more accurately. Moreover, the present application reuses the audio codec or ADC when detecting the flicker frequency of the ambient light source, which does not increase additional costs. That is, the solution provided by the present application has high detection accuracy and low cost.
[0136] Alternatively, an audio module (e.g., an audio codec or ADC) and a data processing module (e.g., an audio DSP) can be reused to implement the functionality of a spectrum analyzer. A spectrum analyzer can be used for frequency domain analysis of analog signals (e.g., light intensity signals, temperature signals, etc.), for example, to determine the power and frequency of the analog signal. For example, an audio codec or ADC can be reused to process the analog voltage signal corresponding to the light intensity signal of an ambient light source to generate a digital voltage signal. After performing FFT processing on the digital voltage signal using a data processing module (e.g., an audio DSP), a spectrum of the light intensity signal can be obtained.
[0137] An embodiment of the present application provides an electronic device, which may include: an audio chip, a light intensity sensing module (PD photoelectric detection circuit), a memory, and one or more processors (for example, an ADSP and an application processor AP). The audio chip, the light intensity sensing module, the memory, and the processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to the structure of the electronic device shown in Figure 2 or Figure 3.
[0138] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplarily described.
[0139] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through interfaces. In some embodiments, The system may include an application layer, an application framework layer, an Android runtime and system libraries, a hardware abstraction layer (HAL) and a kernel layer. Taking the system as an example, in other operating systems (such as IOS system, etc.), as long as the functions implemented by each functional module are similar to the embodiments of the present application, the solution of the present application can also be implemented.
[0140] Among them, the application layer can include a series of application packages.
[0141] As shown in Figure 11, the application package may include applications such as camera, gallery, calendar, call, map, navigation, wireless local area network (WLAN), Bluetooth, music, video, short message, lock screen application, setting application, etc. Of course, the application layer may also include other application packages, such as payment application, shopping application, banking application, chat application or financial application, etc., which are not limited in this application.
[0142] The camera application has the functions of photographing and recording video. In response to the user opening the camera application, the electronic device can photograph or record video.
[0143] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example, it may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, and a camera service. This embodiment of the application does not impose any restrictions on this.
[0144] Among them, the Camera Service can be started when the electronic device is turned on and can be used to transmit and save camera-related information.
[0145] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0146] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0147] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0148] OpenGL ES is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0149] SGL is a graphics engine for 2D graphics.
[0150] The Android Runtime consists of core libraries and a virtual machine (VM). The Android Runtime is responsible for scheduling and management of the Android system. The core libraries consist of two parts: one for Java-based functions and the other for the Android core library. The application layer and the application framework layer run in the VM. The VM executes the Java files in the application layer and application framework layer as binary files. The VM is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0151] The HAL layer is an encapsulation of the Linux kernel driver, providing an interface to the upper layer and shielding the implementation details of the low-level hardware.
[0152] The HAL layer may include Wi-Fi HAL, audio HAL, and camera HAL.
[0153] Among them, the camera HAL is the core software framework of the camera.
[0154] The kernel layer is the layer between hardware and software. It includes at least the display driver, camera driver, audio driver, and sensor driver. The camera driver is the driver layer for camera devices and is primarily responsible for interacting with the hardware.
[0155] In an embodiment of the present application, the core layer may further include a flicker frequency interface, which is used to interact with the ADSP, obtain the flicker frequency of the ambient light source from the ADSP, and pass it to the upper-layer application. The upper-layer application (e.g., a camera application) can set camera parameters (e.g., exposure time) based on the flicker frequency of the ambient light source to eliminate water ripples.
[0156] The hardware layer includes display, camera, PD photoelectric detection circuit (abbreviated as PD in the figure), audio chip, ADSP, etc.
[0157] The PD photoelectric detection circuit detects the light intensity signal of the ambient light source and converts it into an analog voltage signal. The audio chip receives the analog voltage signal from the PD photoelectric detection circuit and converts it into a digital voltage signal. The ADSP uses an FFT algorithm to process the digital voltage signal to obtain the flicker frequency of the ambient light source (the flicker frequency of one or more ambient light sources).
[0158] An embodiment of the present application also provides a chip system (e.g., a system on a chip (SoC)). As shown in Figure 12, the chip system includes at least one processor 1201 and at least one interface circuit 1202. The processor 1201 and the interface circuit 1202 can be interconnected via lines. For example, the interface circuit 1202 can be used to receive signals from other devices (e.g., a memory of an electronic device). For another example, the interface circuit 1202 can be used to send signals to other devices (e.g., a processor 1201 or a touch screen of an electronic device). Exemplarily, the interface circuit 1202 can read instructions stored in the memory and send the instructions to the processor 1201. When the instructions are executed by the processor 1201, the electronic device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete components, which is not specifically limited in the embodiment of the present application.
[0159] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes the various functions or steps executed by the electronic device in the above-mentioned method embodiment.
[0160] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0161] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0162] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0163] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0164] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0165] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. An electronic device, characterized in that, Comprising: A light intensity sensing module, an analog-to-digital conversion module, and a data processing module; the light intensity sensing module is connected to the analog-to-digital conversion module, and the analog-to-digital conversion module is connected to the data processing module; The light intensity sensing module includes a photodiode, and the light intensity sensing module is used to detect the light intensity signal of the ambient light source and convert the light intensity signal into an analog voltage signal; The analog-to-digital conversion module is used to convert the analog voltage signal into a digital voltage signal; the analog-to-digital conversion module is an audio chip, and the audio chip is connected to a microphone and / or a speaker; The data processing module is used to calculate the flicker frequency of the ambient light source according to the digital voltage signal.
2. The electronic device according to claim 1, wherein The electronic device further includes an application processor AP and a camera; The data processing module is further used to send the flicker frequency of the ambient light source to the AP; The AP is used to set the parameters of the camera according to the flicker frequency of the ambient light source, and the parameters of the camera include exposure time and / or frame rate.
3. The electronic device according to claim 1 or 2, wherein The audio chip includes an audio codec or an audio analog-to-digital converter ADC.
4. The electronic device according to claim 2 or 3, wherein The data processing module is an audio digital signal processor.
5. The electronic device according to any one of claims 1-4, wherein The analog-to-digital conversion module is used to perform high-pass filtering on the analog voltage signal to obtain an AC voltage signal, then amplify the AC voltage signal, and perform analog-to-digital conversion on the amplified AC voltage signal to obtain the digital voltage signal.
6. The electronic device according to any one of claims 1-5, characterized in that, The light intensity sensing module includes the photodiode, a first sampling resistor, a first capacitor, and a second capacitor; The cathode of the photodiode is connected to a bias voltage, the anode of the photodiode is connected to one end of the first sampling resistor, and the other end of the first sampling resistor is directly grounded; one end of the second capacitor is connected to the anode of the photodiode, and the other end of the second capacitor is AC grounded; one end of the first capacitor is connected to the other end of the first sampling resistor, and the other end of the first capacitor is AC grounded.
7. The electronic device according to claim 6, wherein The light intensity sensing module further includes a first bead and a second bead; One end of the first bead is connected to one end of the second capacitor and the anode of the photodiode, and one end of the second bead is connected to one end of the first capacitor and the other end of the first sampling resistor.
8. The electronic device according to any one of claims 1-5, wherein The light intensity sensing module includes the photodiode, a second sampling resistor, and a first operational amplifier; the cathode of the photodiode is connected to one end of the second sampling resistor and the inverting input terminal of the first operational amplifier, and the anode of the photodiode is grounded; the other end of the second sampling resistor is connected to the output terminal of the first operational amplifier, and the non-inverting input terminal of the first operational amplifier is grounded.
9. The electronic device according to any one of claims 1-5, wherein The light intensity sensing module includes the photodiode, a second operational amplifier, and a charging capacitor; the cathode of the photodiode is connected to one end of the charging capacitor and the inverting input terminal of the second operational amplifier, and the anode of the photodiode is grounded; the other end of the charging capacitor is connected to the output terminal of the second operational amplifier, and the non-inverting input terminal of the second operational amplifier is connected to a bias voltage.
10. The electronic device according to any one of claims 1-9, characterized in that The analog-to-digital conversion module includes a high-pass filter, a programmable gain amplifier PGA, an analog-to-digital converter, and a data transmission module. The input terminal of the high-pass filter is connected to the output terminal of the light intensity sensing module, the output terminal of the high-pass filter is connected to the input terminal of the PGA, the output terminal of the PGA is connected to the input terminal of the analog-to-digital converter, the output terminal of the analog-to-digital converter is connected to the input terminal of the data transmission module, and the output terminal of the data transmission module is connected to the data processing module; The high-pass filter is configured to receive the analog voltage signal from the output terminal of the light intensity sensing module; The high-pass filter filters the DC voltage signal of the analog voltage signal to obtain an AC voltage signal; The PGA amplifies the AC voltage signal; The analog-to-digital converter converts the amplified AC voltage signal into a digital voltage signal; The data transmission module sends the digital voltage signal to the data processing module through a bus.
11. The electronic device according to any one of claims 1-9, characterized in that The analog-to-digital conversion module includes a programmable gain amplifier PGA, an analog-to-digital converter, and a data transmission module. The input terminal of the PGA is connected to the output terminal of the light intensity sensing module, the output terminal of the PGA is connected to the input terminal of the analog-to-digital converter, the output terminal of the analog-to-digital converter is connected to the input terminal of the data transmission module, and the output terminal of the data transmission module is connected to the data processing module; The PGA is configured to receive the analog voltage signal from the output terminal of the light intensity sensing module and amplify the analog voltage signal; The analog-to-digital converter converts the amplified analog voltage signal into the digital voltage signal; The data transmission module sends the digital voltage signal to the data processing module through a bus.
12. A detection device for the flickering frequency of an ambient light source, characterized in that, Comprising: A light intensity sensing module, an analog-to-digital conversion module, and a data processing module; the light intensity sensing module is connected to the analog-to-digital conversion module, and the analog-to-digital conversion module is connected to the data processing module; The light intensity sensing module includes a photodiode. The light intensity sensing module is configured to detect the light intensity signal of the ambient light source and convert the light intensity signal into a voltage signal; The analog-to-digital conversion module is configured to convert the analog voltage signal into a digital voltage signal; The data processing module is configured to calculate the flicker frequency of the ambient light source according to the digital voltage signal.
13. The device according to claim 12, characterized in that The analog-to-digital conversion module is used to perform high-pass filtering on the analog voltage signal to obtain an AC voltage signal, then amplify the AC voltage signal, and perform analog-to-digital conversion on the amplified AC voltage signal to obtain the digital voltage signal.
14. The device according to claim 12 or 13, characterized in that The light intensity sensing module includes the photodiode, a first sampling resistor, a first capacitor, and a second capacitor; The cathode of the photodiode is connected to the bias voltage, the anode of the photodiode is connected to one end of the first sampling resistor, and the other end of the first sampling resistor is grounded directly; one end of the second capacitor is connected to the anode of the photodiode, and the other end of the second capacitor is grounded through AC; one end of the first capacitor is connected to the other end of the first sampling resistor, and the other end of the first capacitor is grounded through AC.
15. The device according to claim 14, characterized in that, The light intensity sensing module further includes a first bead and a second bead; One end of the first bead is connected to one end of the second capacitor and the anode of the photodiode, and one end of the second bead is connected to one end of the first capacitor and the other end of the first sampling resistor.
16. The device according to claim 12 or 13, wherein The light intensity sensing module includes the photodiode, a second sampling resistor, and a first operational amplifier; the cathode of the photodiode is connected to one end of the second sampling resistor and the inverting input terminal of the first operational amplifier, and the anode of the photodiode is grounded; the other end of the second sampling resistor is connected to the output terminal of the first operational amplifier, and the non-inverting input terminal of the first operational amplifier is grounded.
17. The device according to claim 12 or 13, wherein The light intensity sensing module includes the photodiode, a second operational amplifier, and a charging capacitor; the cathode of the photodiode is connected to one end of the charging capacitor and the inverting input terminal of the second operational amplifier, and the anode of the photodiode is grounded; the other end of the charging capacitor is connected to the output terminal of the second operational amplifier, and the non-inverting input terminal of the second operational amplifier is connected to the bias voltage.
18. The device according to any one of claims 12-17, wherein The analog-to-digital conversion module includes a high-pass filter, a programmable gain amplifier (PGA), an analog-to-digital converter, and a data transmission module. The input terminal of the high-pass filter is connected to the output terminal of the light intensity sensing module, the output terminal of the high-pass filter is connected to the input terminal of the PGA, the output terminal of the PGA is connected to the input terminal of the analog-to-digital converter, the output terminal of the analog-to-digital converter is connected to the input terminal of the data transmission module, and the output terminal of the data transmission module is connected to the data processing module; The high-pass filter is used to receive the analog voltage signal from the output terminal of the light intensity sensing module; The high-pass filter filters the DC voltage signal of the analog voltage signal to obtain an AC voltage signal; The PGA performs amplification processing on the AC voltage signal; The analog-to-digital converter converts the amplified AC voltage signal into a digital voltage signal; The data transmission module sends the digital voltage signal to the data processing module through a bus.
19. The device according to any one of claims 12-17, wherein the analog-to-digital conversion module includes a programmable gain amplifier PGA, an analog-to-digital converter, and a data transmission module. The input end of the PGA is connected to the output end of the light intensity sensing module, the output end of the PGA is connected to the input end of the analog-to-digital converter, the output end of the analog-to-digital converter is connected to the input end of the data transmission module, and the output end of the data transmission module is connected to the data processing module; the PGA is configured to receive the analog voltage signal from the output end of the light intensity sensing module and perform amplification processing on the analog voltage signal; the analog-to-digital converter converts the amplified analog voltage signal into the digital voltage signal; the data transmission module sends the digital voltage signal to the data processing module through a bus.
20. A method for detecting the flicker frequency of an ambient light source, characterized in that, Applied to an electronic device, the electronic device includes a light intensity sensing module, an analog-to-digital conversion module, and a data processing module; the light intensity sensing module includes a photodiode, the light intensity sensing module is connected to the analog-to-digital conversion module, and the analog-to-digital conversion module is connected to the data processing module. The method includes: the light intensity sensing module detects the light intensity signal of the ambient light source and converts the light intensity signal into a voltage signal; the analog-to-digital conversion module converts the voltage signal into a digital voltage signal; the analog-to-digital conversion module is an audio chip, and the audio chip is connected to a microphone and / or a speaker; the data processing module calculates the flicker frequency of the ambient light source according to the digital voltage signal.
Citation Information
Patent Citations
Method and device for detecting flicker frequency of ambient light source and electronic equipment
CN120333771A
Improved audio circuit
CN105228057A
Stroboscopic frequency information detection method and device, and stroboscopic suppression method and device
CN113280913A
Analog-to-digital conversion circuit and ambient light detection circuit
CN115208404A
Microphone circuit, device, chip, electronic equipment and microphone circuit output method
CN116567482A