Analog signal frequency offset calibration method, video system and readable storage medium
By acquiring the phase deviation value and adjusting the frequency using software algorithms, combined with a simple hardware structure, the problem of high hardware complexity in frequency offset calibration is solved, achieving the effects of cost reduction and simplified design.
Patent Information
- Application Number
- CN202610128915.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-29
- Publication Date
- 2026-04-10
AI Technical Summary
The high hardware complexity of frequency offset calibration in existing technologies leads to increased system costs and design barriers.
By acquiring the phase deviation value, using software algorithms to dynamically analyze the phase deviation and adjust the frequency, and combining it with simple hardware structures such as a phase detector and a frequency control register, frequency calibration can be achieved.
It significantly reduces hardware design complexity and manufacturing costs, and improves the flexibility and applicability of frequency calibration.
Smart Images

Figure CN121841912A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an analog signal frequency offset calibration method, a video system, and a readable storage medium. Background Technology
[0002] Frequency offset is a common phenomenon in multimedia data transmission, including video and audio. This phenomenon stems from a slight difference in the clock sources at the transmitting and receiving ends, leading to inconsistent sampling rates and consequently disrupting the synchronization and stability of audio and video. Particularly in image transmission, this frequency offset can cause color distortion, image jitter, and even decoding failures. The primary cause lies in the inherent precision errors of clock devices such as crystal oscillators; even small frequency deviations can significantly impact system performance over time.
[0003] Currently, most mainstream solutions employ hardware phase-locked loop (PLL) technology for frequency correction. However, PLL solutions rely on complex analog or mixed-signal circuits, which not only increases the overall hardware complexity of the system but also significantly raises manufacturing costs and design barriers.
[0004] Therefore, there is currently no effective solution to the problem of high hardware complexity in frequency offset calibration in existing technologies. Summary of the Invention
[0005] This embodiment provides an analog signal frequency offset calibration method, a video system, and a readable storage medium to solve the problem of high hardware complexity in frequency offset calibration in related technologies.
[0006] Firstly, this embodiment provides an analog signal frequency offset calibration method for a receiving end, the method comprising:
[0007] A phase deviation value is obtained; the phase deviation value is obtained by comparing the phases of a first signal and a second signal; the first signal is a modulated signal received by the receiving end, which is obtained by the transmitting end modulating the target information onto a carrier at the target frequency based on a preset initial phase; the second signal is generated by the receiving end based on the initial phase and the target frequency.
[0008] Based on the phase deviation value and the preset frequency deviation coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency.
[0009] In some embodiments, the method further includes:
[0010] Obtain the system standard information from the sending end;
[0011] Based on the standard information, the initial phase and the target frequency are extracted from the pre-stored standard information-modulation information table; the standard information-modulation information table is used to record the correspondence between the standard information, phase information and frequency information.
[0012] In some embodiments, based on the phase deviation value and a preset frequency deviation coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency, including:
[0013] Based on the phase deviation value, determine whether the phase state of the second signal is leading or lagging.
[0014] Based on the phase deviation value and the preset frequency deviation coefficient, the correction value is calculated;
[0015] Based on the phase state and correction value of the second signal, the current frequency of the second signal is adjusted to obtain the correction frequency;
[0016] Based on the corrected frequency, the calibrated demodulation frequency is obtained.
[0017] In some embodiments, the current frequency of the second signal is adjusted based on the phase state and correction value of the second signal to obtain a corrected frequency, including:
[0018] If the second signal is in a leading state, then the current frequency of the second signal is added to the correction value to obtain the correction frequency;
[0019] If the second signal is lagging, the current frequency of the second signal is subtracted from the correction value to obtain the correction frequency.
[0020] In some embodiments, the calibrated demodulation frequency is obtained based on the correction frequency, including:
[0021] Based on the corrected frequency, the frequency control register is reset to update the second signal;
[0022] Obtain the updated phase deviation value, which is based on the first signal and the updated second signal;
[0023] If the updated phase deviation value is less than the preset ideal frequency deviation range, then the current corrected frequency is used as the calibrated demodulation frequency.
[0024] If the updated phase deviation value is greater than the preset ideal frequency deviation range, the corrected frequency is recalculated based on the updated phase deviation value until the corresponding phase deviation value is less than the preset ideal frequency deviation range, and the current corrected frequency is used as the calibrated demodulation frequency.
[0025] In some embodiments, the receiver includes a phase detector for calculating a phase deviation value between the first signal and the second signal.
[0026] In some embodiments, the receiver further includes: a local oscillator, a phase register, and a frequency control register; the local oscillator is connected to the bit register and the frequency control register;
[0027] Based on the initial phase, configure the phase register; based on the target frequency, configure the frequency control register.
[0028] The local oscillator is controlled to generate the second signal based on the outputs of the phase register and the frequency control register.
[0029] Secondly, this embodiment provides a video system, which includes: a front-end camera and a back-end storage device; the front-end camera and the back-end storage device are connected via a communication cable.
[0030] The front-end camera is used to generate a first signal and transmit the first signal to the back-end storage device;
[0031] The back-end storage device is used to implement the steps of the method described in any one of the first aspects.
[0032] In some embodiments, the front-end camera is used to modulate the chromaticity information of the image to be transmitted onto a color carrier via quadrature amplitude modulation to obtain a first signal.
[0033] Thirdly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the analog signal frequency offset calibration method described in the first aspect.
[0034] Compared with related technologies, the analog signal frequency offset calibration method, video system, and readable storage medium provided in this embodiment obtain a phase offset value based on a comparison of a first signal and a second signal. The first signal is a received modulated signal obtained by the transmitting end modulating the target information onto a carrier at the target frequency based on a preset initial phase. The second signal is generated by the receiving end based on the initial phase and the target frequency. Based on the phase offset value and a preset frequency offset coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency. This solves the problem of high hardware complexity in frequency offset calibration. By combining software algorithms to dynamically analyze the phase offset to correct the frequency offset, the design complexity and manufacturing cost of the hardware are significantly reduced.
[0035] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0036] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0037] Figure 1 This is a hardware structure block diagram of the terminal for the analog signal frequency offset calibration method in the embodiments of this application;
[0038] Figure 2 This is a flowchart illustrating an analog signal frequency offset calibration method in one embodiment of this application;
[0039] Figure 3 This is a schematic diagram of the internal structure of the receiver in one embodiment of this application;
[0040] Figure 4 This is a schematic diagram of the structure of a video system in one embodiment of this application;
[0041] Figure 5 This is a flowchart illustrating the analog signal frequency offset calibration method in a preferred embodiment of this application.
[0042] Figure 6 This is the raw image sent by the front-end camera in one embodiment of this application;
[0043] Figure 7 This is a frequency offset image demodulated by the back-end storage device in one embodiment of this application;
[0044] Figure 8 This is a frequency correction image obtained after frequency compensation by the back-end storage device in one embodiment of this application.
[0045] Reference numerals: 102, processor; 104, memory; 106, transmission device; 108, input / output device. Detailed Implementation
[0046] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0047] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific order of objects.
[0048] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of the terminal for the analog signal frequency offset calibration method in this embodiment. (See diagram for example.) Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.
[0049] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the analog signal frequency offset calibration method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0050] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0051] This embodiment provides a method for calibrating the frequency offset of an analog signal. Figure 2 This is a flowchart of the analog signal frequency offset calibration method in this embodiment, as follows: Figure 2 As shown, the process includes the following steps:
[0052] Step S210: Obtain the phase deviation value; the phase deviation value is obtained by comparing the phases of the first signal and the second signal; the first signal is the modulated signal received by the receiver, which is obtained by the transmitter modulating the target information onto the carrier of the target frequency based on a preset initial phase; the second signal is generated by the receiver based on the initial phase and the target frequency.
[0053] Step S220: Based on the phase deviation value and the preset frequency deviation coefficient, adjust the frequency of the second signal to obtain the calibrated demodulation frequency.
[0054] Specifically, frequency offset refers to a slight difference between the decoding clock at the receiving end and the encoding clock at the transmitting end, resulting in inconsistent sampling rates and affecting information synchronization and stability. This phenomenon is mainly caused by accuracy errors in the clock source. In video transmission, this frequency difference can lead to significant changes in image color. For example, a camera outputs a 1080P video signal, which theoretically requires a 38MHz color carrier frequency for modulation. However, due to crystal oscillator accuracy issues, the camera might output a color carrier frequency of 38.001MHz. If the receiving end demodulates the color carrier at 38MHz, the resolved chroma signal will be incorrect, resulting in color cast. In actual transmission systems, both the transmitting and receiving crystal oscillators exhibit this error. When both ends have this error, the overall error becomes larger, leading to more severe image color cast problems.
[0055] In signal processing, there is a clear mathematical relationship between frequency and phase. Frequency is essentially the rate of change of phase over time. If the phase changes linearly (i.e., the phase increases uniformly with time), then the frequency is constant. If the rate of phase change increases or decreases, it indicates a frequency shift. Therefore, frequency shift can be determined by detecting the phase of the received signal. In this embodiment, after a frequency shift occurs, the frequency offset, i.e., the phase deviation value, is dynamically calculated using a software algorithm. Then, adjustments are made based on the phase deviation value and a preset frequency offset coefficient to correct the frequency shift.
[0056] In this embodiment, a phase deviation value is obtained by comparing a first signal and a second signal. The first signal is the received modulated signal, which is obtained by the transmitter modulating the target information onto a carrier at the target frequency based on a preset initial phase. The second signal is generated by the receiver based on the initial phase and the target frequency. Based on the phase deviation value and a preset frequency deviation coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency. This solves the problem of high hardware complexity in frequency deviation calibration. Combined with software algorithms to dynamically analyze the phase deviation to correct the frequency deviation, the hardware design complexity and manufacturing cost are significantly reduced.
[0057] In some embodiments, the method further includes:
[0058] Step S110: Obtain the system information of the sending end.
[0059] Step S120: Based on the standard information, extract the initial phase and target frequency from the pre-stored standard information-modulation information table; the standard information-modulation information table is used to record the correspondence between standard information, phase information and frequency information.
[0060] Specifically, taking video signals as an example, when the transmitting end modulates each video signal from YUV to high-definition analog composite signals such as CVI, in order to separate the luminance and chrominance signals of the image information, the chrominance information (i.e., the target information) of the image is modulated onto a color carrier using quadrature amplitude modulation (QAM) and transmitted in the same coaxial cable as the luminance signal. The color carrier is arranged in a high-frequency band (e.g., from hundreds of kHz to several MHz, depending on the standard) to achieve frequency division multiplexing and prevent luminance and chrominance crosstalk. Different standards have different phases and frequencies when modulating the color carrier. For example, the color carrier frequency for CVI 1080P resolution is 38MHz, while the color carrier frequency for CVI 4K resolution is 68MHz. The standard information, phase information, and frequency information used are recorded in the table below, as shown in Table 1. Each standard has its corresponding color carrier frequency and phase value.
[0061] Table 1
[0062]
[0063] In some of these embodiments, see Figure 3 The receiving end also includes: a local oscillator, a phase register, and a frequency control register; the local oscillator is connected to the bit register and the frequency control register.
[0064] The controller within the receiver can quantize the phase and frequency information corresponding to the standard information, mapping it to different parameters in the phase register and frequency control register. For example, the CVI 1080P has a phase of π / 4 and a frequency of 38MHz. Its corresponding phase register needs to be configured to 0x400, and the frequency control register to 0x30. Therefore, analog signal frequency offset calibration methods also include:
[0065] In step S130, the receiving end configures the phase register based on the initial phase and the frequency control register based on the target frequency.
[0066] Step S140: Control the local oscillator to generate a second signal based on the outputs of the phase register and the frequency control register.
[0067] In this embodiment, the reliability of generating the second signal is ensured through a simple hardware structure, including a local oscillator, a phase register, and a frequency control register.
[0068] In some embodiments, step S220 above, which adjusts the frequency of the second signal based on the phase deviation value and a preset frequency deviation coefficient to obtain the calibrated demodulation frequency, includes:
[0069] Step S221: Based on the phase deviation value, determine whether the phase state of the second signal is leading or lagging.
[0070] Specifically, if the phase deviation value is greater than zero, the local oscillator is ahead, and the phase state of the corresponding second signal is determined to be ahead; if the phase deviation value is less than zero, the local oscillator is behind, and the phase state of the corresponding second signal is determined to be behind.
[0071] Step S222: Calculate the correction value based on the phase deviation value and the preset frequency deviation coefficient.
[0072] Specifically, the correction value can be calculated based on the product of the absolute value of the phase deviation and the frequency deviation coefficient. The frequency deviation coefficient is a pre-saved calibration value, which can be obtained through extensive testing or dynamically modified. Variations in the correction value within a reasonable range will only affect the speed of frequency deviation correction, and will not significantly impact the final frequency correction result.
[0073] Step S223: Based on the phase state and correction value of the second signal, adjust the current frequency of the second signal to obtain the corrected frequency.
[0074] Specifically, if the second signal is in an advanced state, the current frequency of the second signal is added to the correction value to obtain the correction frequency; if the second signal is in a lagging state, the current frequency of the second signal is subtracted from the correction value to obtain the correction frequency.
[0075] Step S224: Based on the corrected frequency, obtain the calibrated demodulation frequency.
[0076] Specifically, the corrected frequency can be directly used as the calibrated demodulation frequency, or the adjustment result can be verified based on the corrected frequency, and the optimal solution of the corrected frequency can be used as the calibrated demodulation frequency. The process of verifying the adjustment result may include: updating the second signal based on the corrected frequency and recalculating the phase deviation value until the phase deviation value is less than a preset ideal frequency deviation range, then using the current corrected frequency as the optimal solution. Alternatively, after calculating the phase deviation value a preset number of times, the corrected frequency corresponding to the phase deviation value with the smallest absolute value can be selected as the optimal solution. The specific implementation method is not limited in this embodiment.
[0077] In this embodiment, the demodulation frequency is calibrated by a pre-calibrated frequency offset coefficient according to the specific phase state, and the frequency offset is dynamically adjusted.
[0078] In some embodiments, step S224 above, based on the correction frequency, obtains the calibrated demodulation frequency, including:
[0079] Step S224-A: Based on the corrected frequency, reset the frequency control register to update the second signal.
[0080] Specifically, the original value stored in the frequency control register is the initial target frequency or the corrected frequency from the previous calibration. The frequency control register needs to be updated continuously based on the current corrected frequency. For cases where the second signal lags behind in phase, the frequency control register's PhaseValue = the original value InitPhaseValue – the correction value Δr. For cases where the second signal leads in phase, the frequency control register's PhaseValue = the original value InitPhaseValue + the correction value Δr. Updating the frequency control register will affect the phase and frequency of the local oscillator output signal (the second signal).
[0081] Step S224-B: Obtain the updated phase deviation value, which is based on the first signal and the updated second signal.
[0082] In step S224-C, if the updated phase deviation value is less than the preset ideal frequency deviation range, the current corrected frequency is used as the calibrated demodulation frequency.
[0083] Step S224-D: If the updated phase deviation value is greater than the preset ideal frequency deviation range, the correction frequency is recalculated based on the updated phase deviation value until the corresponding phase deviation value is less than the preset ideal frequency deviation range, and the current correction frequency is used as the calibrated demodulation frequency.
[0084] In this embodiment, the frequency offset is dynamically calculated using a software algorithm, and then the values in the on-chip registers are adjusted to regulate the oscillator frequency, thereby stabilizing the phase of the second signal and achieving frequency offset correction. This gradual correction method improves the accuracy of frequency offset correction.
[0085] In some embodiments, step S224-B is followed by step S224-E: determining whether the current phase deviation value is less than the previous phase deviation value; if it is less, then determining whether the current phase deviation value is less than the preset ideal frequency deviation range, and executing step S224-C or step S224-D; if it is greater, then generating an error message, which is then adjusted or reset by the staff.
[0086] In some embodiments, the receiver includes a phase detector for calculating the phase deviation between the first signal and the second signal.
[0087] Specifically, taking video signals as an example, the color sync head in the received signal (first signal) is mixed or digitally compared with the output of the local oscillator (second signal). The phase detector calculates the phase difference between the two and outputs an error voltage or digital error value Δf. If Δf is greater than 0, the local oscillator is ahead; if Δf is negative, the local oscillator is behind.
[0088] In this embodiment, there is no need to design a complex phase-locked loop circuit; only a phase detector needs to be integrated into the hardware, which simplifies the design complexity and reduces the hardware cost.
[0089] This embodiment provides a video system, which includes a front-end camera and a back-end storage device; the front-end camera and the back-end storage device are connected by a communication cable.
[0090] The front-end camera is used to generate the first signal and transmit the first signal to the back-end storage device; the front-end camera is used to modulate the chromaticity information of the image to be transmitted onto the color carrier through quadrature amplitude modulation to obtain the first signal.
[0091] A back-end storage device is used to implement the steps of the analog signal frequency offset calibration method in any of the above embodiments.
[0092] In this embodiment, a phase deviation value is obtained by comparing a first signal and a second signal. The first signal is the received modulated signal, which is obtained by the transmitter modulating the target information onto a carrier at the target frequency based on a preset initial phase. The second signal is generated by the receiver based on the initial phase and the target frequency. Based on the phase deviation value and a preset frequency deviation coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency. This solves the problem of high hardware complexity in frequency deviation calibration during video transmission. By combining software algorithms to dynamically analyze the phase deviation to correct the frequency deviation, the design complexity and manufacturing cost of the hardware are significantly reduced.
[0093] The present embodiment will now be described and illustrated through preferred embodiments.
[0094] Currently, the front-end cameras connected to back-end storage devices (XVRs) are all analog cameras, and image signal transmission is carried out via communication cables such as coaxial cables and twisted-pair cables (hereinafter, we will refer to coaxial cables uniformly). Analog cameras transmit high-definition analog composite signals on the coaxial cable. To separate the luminance and chrominance signals of the image information, the chrominance information is modulated onto a color carrier using quadrature amplitude modulation (QAM) and transmitted along the same coaxial cable as the luminance signal. The luminance signal is concentrated in the low-frequency band (around 0-5MHz), while the color carrier is arranged in the high-frequency band (e.g., hundreds of kHz to several MHz, depending on the standard) to achieve frequency division multiplexing and prevent luminance and chrominance crosstalk. Therefore, the color carrier needs to be demodulated at the receiving end to recover the chrominance information sent by the camera. The receiving end recovers the chrominance signal through synchronous demodulation, which requires using a color carrier with the same frequency and phase as the transmitting end. If the clock source accuracy at the transmitting and receiving ends is insufficient, or if oscillator frequency drift is caused by temperature changes, frequency deviations may occur when the back-end XVR device demodulates the chrominance signal. This frequency deviation can cause inconsistencies between the chromaticity information sent by the camera and the actual chromaticity information sent by the camera. Slight deviations can result in color casts, while larger deviations can lead to color loss, causing significant image degradation. For example, consider a front-end camera sending a pure red image to an XVR device. Figure 6 As shown. When frequency offset occurs, the image displayed by the XVR device is as follows. Figure 7 As shown, the left side of the image is pure red, while the right side has turned pink, indicating a color cast issue. Figure 8 The image shown is the result of restoring the received signal using the demodulation frequency calibrated by the receiver according to this preferred embodiment. It can be seen that the color cast problem can be solved well.
[0095] See Figure 4 The analog signal frequency offset calibration method in this preferred embodiment is applied to a video system, which includes a front-end camera and a back-end storage device; the front-end camera and the back-end storage device are connected via a communication cable. See also Figure 3 The back-end storage device includes a controller, a local oscillator, a phase register, a frequency control register, and a phase detector. The analog signal frequency offset calibration method is performed by the back-end storage device. Figure 5 This is a flowchart of the analog signal frequency offset calibration method according to a preferred embodiment of the present invention, as follows: Figure 5 As shown, the method specifically includes the following steps:
[0096] S1, Initialization Configuration: Determine the system standard information of the connected front-end camera, and configure the bit register and frequency control register based on the system standard information.
[0097] Specifically, when each video signal standard modulates from YUV to a high-definition analog composite signal such as CVI, in order to separate the luminance and chrominance signals of the image information, the chrominance information of the image is modulated onto a color carrier via quadrature amplitude modulation (QAM) and transmitted in the same coaxial cable as the luminance signal. The color carrier is arranged in a high-frequency band (e.g., hundreds of kHz to several MHz, depending on the standard) to achieve frequency division multiplexing and prevent luminance and chrominance crosstalk. Different standards have different phases and frequencies when modulating the color carrier. For example, the color carrier frequency offset of CVI 1080P resolution is 38MHz, while the color carrier frequency of CVI 4K resolution is 68MHz.
[0098] Therefore, the first step is to configure the default phase register and frequency control register for the access standard. The back-end storage device demodulates the signal according to the configured default initial phase and frequency values, thereby enabling the complete recovery of UV color information by demodulating the signal according to the frequency of the modulated color carrier for different standards. However, due to frequency offset, the frequency of the signal demodulated by the back-end storage device differs from the color carrier frequency of the actual signal sent by the front-end camera, resulting in demodulation deviation. To determine the frequency error value, it is necessary to read the difference between the phase of the color carrier acquired by the back-end storage device and the initial phase when the front-end camera modulates the color carrier, and then correct the phase deviation to resolve the frequency offset.
[0099] S2, Phase Error Calculation: After receiving the first signal (video signal transmitted from the front-end camera), the back-end storage device uses a phase detector to compare the phase difference between the local oscillator output and the color carrier in the first signal. The phase and frequency of the local oscillator are configured and generated by the phase register and frequency control register in S1. The color synchronization head in the first signal is mixed or digitally compared with the local oscillator output. The phase detector calculates the phase difference between the two and outputs an error voltage or digital error value Δf, i.e., the phase deviation value. If Δf is greater than 0, the local oscillator is ahead; if Δf is negative, the local oscillator is behind.
[0100] S3, Frequency Offset Correction: Based on the absolute value of the phase deviation |Δf| calculated in S2, the frequency of the local oscillator is dynamically adjusted, and it is monitored in real time whether the phase deviation |Δf| has been reduced to a certain threshold range (i.e., the ideal frequency deviation range P, the value of P can be configured empirically). If the adjusted phase deviation |Δf| is less than P, the frequency offset calibration is considered complete; otherwise, the frequency of the local oscillator is adjusted again. The specific steps are as follows:
[0101] S3.1, calculate the correction value Δr of the carrier frequency control register using Δf: Δr = |Δf| × i, where i represents the frequency offset coefficient. This formula for calculating Δr is derived from extensive testing, and the values within the formula can be dynamically modified. Variations in the value of Δr within a reasonable range will only affect the speed of frequency offset correction, and will not significantly impact the final frequency correction result.
[0102] S3.2, Modify the frequency control register based on Δr:
[0103] If Δf is less than 0, then PhaseValue = InitPhaseValue – Δr. If Δf is greater than 0, then PhaseValue = InitPhaseValue + Δr. Here, PhaseValue represents the updated value of the frequency control register, and InitPhaseValue represents the initial value of the frequency control register.
[0104] S3.3, due to the update of the frequency control register, the phase and frequency of the newly generated second signal of the local oscillator have changed. The phase deviation value Δf output by the phase detector is read at this time. It is determined whether |Δf| is less than the previously read |Δf|. If the |Δf| value is smaller than the previous value, it indicates that the frequency calibration by modifying the carrier frequency control register is effective. Then, it is determined whether the current phase deviation |Δf| is less than the ideal frequency deviation range P. If |Δf| is greater than P, steps S3.1 and S3.2 are repeated until the finally calculated phase deviation value |Δf| is less than the ideal frequency deviation range P. At this point, the frequency offset compensation function is considered complete, and the calibrated demodulation frequency is obtained.
[0105] In this preferred embodiment, a hybrid hardware and software architecture is proposed to address frequency offset in video signals. First, a hardware phase detector quickly acquires phase information, then software analyzes the phase change trend to determine if frequency offset exists. Finally, closed-loop correction is achieved by adjusting the local demodulation frequency. This approach offers significant advantages in hardware circuit design and cost compared to hardware phase-locked loop (PLL) solutions. It eliminates the need for complex PLL circuits; only the phase detector needs to be integrated into the hardware, simplifying hardware design complexity, reducing hardware costs, and improving the flexibility and applicability of frequency offset calibration.
[0106] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0107] Furthermore, in conjunction with the analog signal frequency offset calibration method provided in the above embodiments, this embodiment can also provide a storage medium for implementation. The storage medium stores a computer program; when executed by a processor, the computer program implements any one of the analog signal frequency offset calibration methods in the above embodiments.
[0108] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0109] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0110] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0111] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. A method for calibrating the frequency offset of an analog signal, characterized in that, For use at the receiving end, the method includes: A phase deviation value is obtained; the phase deviation value is obtained by comparing the phases of a first signal and a second signal; the first signal is a modulated signal received by the receiving end, which is obtained by the transmitting end modulating the target information onto a carrier at the target frequency based on a preset initial phase; the second signal is generated by the receiving end based on the initial phase and the target frequency. Based on the phase deviation value and the preset frequency deviation coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency.
2. The analog signal frequency offset calibration method according to claim 1, characterized in that, Before obtaining the phase deviation value, the following is also included: Obtain the system standard information from the sending end; Based on the standard information, the initial phase and the target frequency are extracted from the pre-stored standard information-modulation information table; the standard information-modulation information table is used to record the correspondence between the standard information, phase information and frequency information.
3. The analog signal frequency offset calibration method according to claim 1, characterized in that, Based on the phase deviation value and a preset frequency deviation coefficient, the frequency of the second signal is adjusted to obtain the calibrated demodulation frequency, including: Based on the phase deviation value, determine whether the phase state of the second signal is leading or lagging. Based on the phase deviation value and the preset frequency deviation coefficient, the correction value is calculated; Based on the phase state and correction value of the second signal, the current frequency of the second signal is adjusted to obtain the correction frequency; Based on the corrected frequency, the calibrated demodulation frequency is obtained.
4. The analog signal frequency offset calibration method according to claim 3, characterized in that, Based on the phase state and correction value of the second signal, the current frequency of the second signal is adjusted to obtain the corrected frequency, including: If the second signal is in a leading state, then the current frequency of the second signal is added to the correction value to obtain the correction frequency; If the second signal is lagging, the current frequency of the second signal is subtracted from the correction value to obtain the correction frequency.
5. The analog signal frequency offset calibration method according to claim 3, characterized in that, Based on the corrected frequency, the calibrated demodulation frequency is obtained, including: Based on the corrected frequency, the frequency control register is reset to update the second signal; Obtain the updated phase deviation value, which is based on the first signal and the updated second signal; If the updated phase deviation value is less than the preset ideal frequency deviation range, then the current corrected frequency is used as the calibrated demodulation frequency. If the updated phase deviation value is greater than the preset ideal frequency deviation range, the corrected frequency is recalculated based on the updated phase deviation value until the corresponding phase deviation value is less than the preset ideal frequency deviation range, and the current corrected frequency is used as the calibrated demodulation frequency.
6. The analog signal frequency offset calibration method according to claim 1, characterized in that, The receiving end includes a phase detector, which is used to calculate the phase deviation value between the first signal and the second signal.
7. The analog signal frequency offset calibration method according to claim 1, characterized in that, The receiving end further includes: a local oscillator, a phase register, and a frequency control register; the local oscillator is connected to the bit register and the frequency control register; Based on the initial phase, configure the phase register; based on the target frequency, configure the frequency control register. The local oscillator is controlled to generate the second signal based on the outputs of the phase register and the frequency control register.
8. A video system, characterized in that, The video system includes: a front-end camera and a back-end storage device; the front-end camera and the back-end storage device are connected via a communication cable. The front-end camera is used to generate a first signal and transmit the first signal to the back-end storage device; The back-end storage device is used to implement the steps of the method according to any one of claims 1 to 7.
9. The video system according to claim 8, characterized in that, The front-end camera is used to modulate the chromaticity information of the image to be transmitted onto a color carrier wave via quadrature amplitude modulation to obtain a first signal.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.