Computer-implemented method for automatic calibration of audio delay based on anomaly detection, electronic device, and storage medium
By employing anomaly detection algorithms and adaptive calibration methods, the problems of time-consuming, labor-intensive, and unstable accuracy in traditional multi-device audio system calibration are solved, achieving high-precision and stable automatic audio delay calibration that adapts to environmental changes and device status fluctuations.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- LINKPLAY TECHNOLOGY INC NANJING
- Filing Date
- 2025-04-11
- Publication Date
- 2026-06-18
AI Technical Summary
Traditional calibration methods for multi-device audio systems are time-consuming and labor-intensive, highly susceptible to subjective factors, unable to effectively identify and filter abnormal data, lack adaptive capabilities, and cannot cope with environmental changes, resulting in unstable calibration accuracy.
An anomaly detection algorithm is adopted, which combines Gaussian filtering, wavelet transform, Z-score and Mahalanobis distance for signal preprocessing and anomaly detection. Delay compensation is calculated through cross-correlation analysis and phase difference algorithm. The sound velocity parameter is corrected by temperature and humidity sensor. The calibration model is optimized by PID control model and machine learning to achieve real-time dynamic calibration.
It achieves millisecond-level delay calibration accuracy, improves the synchronization accuracy and stability of multi-device audio systems, has environmental adaptability and fault detection capabilities, and significantly enhances calibration results.
Smart Images

Figure CN2025088540_18062026_PF_FP_ABST
Abstract
Description
Computer-based implementation method, electronic device, and storage medium for automatic audio delay calibration based on anomaly detection
[0001] This application claims priority to Chinese Patent Application No. 2024117973011, filed on December 9, 2024, entitled “Automatic Audio Delay Calibration Method, Apparatus, Device and Storage Medium Based on Anomaly Detection”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This invention relates to the field of multi-device audio playback technology, and in particular to a computer implementation method, electronic device, and storage medium for automatic audio delay calibration based on anomaly detection. Background Technology
[0003] In the field of modern multi-device audio systems, audio latency is becoming increasingly prominent. Whether it's a home theater system, professional audio equipment, or smart speakers, latency differences between multiple devices significantly affect sound reproduction. Traditional calibration methods mainly rely on manual operation or preset parameters, which is not only time-consuming and labor-intensive but also easily affected by subjective factors. Furthermore, due to the lack of consideration for environmental factors (temperature, humidity, etc.), calibration results are often unstable. Existing technologies cannot effectively identify and filter abnormal data, making it difficult to guarantee calibration accuracy. In addition, traditional methods lack adaptability, failing to cope with the effects of environmental changes such as temperature and humidity, and cannot achieve real-time dynamic calibration. These problems severely restrict the performance of multi-device audio systems, urgently requiring an innovative solution. Summary of the Invention
[0004] This invention provides a computer-based method, electronic device, and storage medium for automatic audio delay calibration based on anomaly detection. It innovatively introduces anomaly detection algorithms, achieving accurate identification and filtering of interference data through intelligent data analysis. Employing real-time analysis and automated processing mechanisms, it overcomes the limitations of traditional manual calibration. The system can dynamically sense environmental changes and adaptively adjust calibration parameters, achieving millisecond-level delay calibration accuracy. Furthermore, by optimizing the calibration model through machine learning algorithms, it ensures the continuous and stable operation of multi-device audio systems, significantly improving calibration effectiveness.
[0005] The first aspect of this invention provides a computer-based method for automatic audio delay calibration based on anomaly detection, applicable to a multi-device audio system, comprising the following steps:
[0006] The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data.
[0007] Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data.
[0008] Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism.
[0009] The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
[0010] In one implementation, the preprocessing of the acquired audio signal further includes:
[0011] A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise;
[0012] The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
[0013] In one implementation, the abnormal data detection process, which involves acquiring delay time measurements, environmental data, and the audio signal, further includes:
[0014] The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies.
[0015] Abnormal data was identified using Mahalanobis distance detection.
[0016] In one implementation, calculating the delay compensation based on the audio signal and the delay time measurement further includes:
[0017] The delay range is estimated using a cross-correlation analysis algorithm;
[0018] A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
[0019] In one implementation, calculating environmental factor compensation based on the environmental data further includes:
[0020] Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed.
[0021] Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
[0022] In one implementation, the automatic audio delay calibration based on the delay compensation and the environmental factor compensation via a real-time feedback mechanism further includes:
[0023] The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay.
[0024] The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
[0025] In one implementation, evaluating system performance based on real-time acquired audio signals and delay time measurements, and further optimizing the real-time feedback mechanism in real time, includes:
[0026] Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model.
[0027] The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
[0028] In one implementation, the system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including:
[0029] During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
[0030] A second aspect of the present invention provides an electronic device for automatic audio delay calibration based on anomaly detection, comprising a memory and a processor, wherein the memory stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to perform the following steps:
[0031] The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data.
[0032] Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data.
[0033] Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism.
[0034] The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
[0035] In one implementation, the preprocessing of the acquired audio signal further includes:
[0036] A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise;
[0037] The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
[0038] In one implementation, the abnormal data detection process, which involves acquiring delay time measurements, environmental data, and the audio signal, further includes:
[0039] The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies.
[0040] Abnormal data was identified using Mahalanobis distance detection.
[0041] In one implementation, calculating the delay compensation based on the audio signal and the delay time measurement further includes:
[0042] The delay range is estimated using a cross-correlation analysis algorithm;
[0043] A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
[0044] In one implementation, calculating environmental factor compensation based on the environmental data further includes:
[0045] Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed.
[0046] Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
[0047] In one implementation, the automatic audio delay calibration based on the delay compensation and the environmental factor compensation via a real-time feedback mechanism further includes:
[0048] The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay.
[0049] The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
[0050] In one implementation, evaluating system performance based on real-time acquired audio signals and delay time measurements, and further optimizing the real-time feedback mechanism in real time, includes:
[0051] Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model.
[0052] The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
[0053] In one implementation, the system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including:
[0054] During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
[0055] A third aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to perform the following steps:
[0056] The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data.
[0057] Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data.
[0058] Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism.
[0059] The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
[0060] The technical solution provided by this invention calculates a delay compensation value based on the audio signal and delay time measurements. Based on environmental data, the impact of environmental factors on the audio signal is calculated, and corresponding compensations are made. For example, changes in temperature and humidity affect the speed of sound, thus affecting the propagation time of the audio signal. The calculated delay compensation and environmental factor compensation values are applied to the audio system through a real-time feedback mechanism to dynamically adjust the audio signal delay, thereby achieving synchronization between multiple devices. Furthermore, the internal parameters of the real-time feedback mechanism model are adaptively adjusted based on the real-time performance evaluation results of the system, such as adjusting the parameters of the PID control model, thereby improving the system's delay accuracy and stability. Attached Figure Description
[0061] Figure 1 is a schematic diagram of an embodiment of the electronic device in this embodiment;
[0062] Figure 2 is a flowchart illustrating the computer implementation method of the automatic audio delay calibration based on anomaly detection according to the present invention.
[0063] Figure 3 is a schematic diagram of the process of automatic audio delay calibration based on the delay compensation and environmental factor compensation through a real-time feedback mechanism in one embodiment. Detailed Implementation
[0064] This invention provides a computer implementation method, electronic device, and storage medium for automatic audio delay calibration based on anomaly detection. By using persistent audio capture sessions and dynamic audio processing pipelines, it effectively solves the problem of audio input players reopening capture when switching modes.
[0065] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0066] In a first aspect, embodiments of the present invention provide an electronic device. Referring to FIG1, the electronic device includes a processor 100 and a memory 101, the memory 101 storing machine-executable instructions that can be executed by the processor 100, and the processor 100 executing the machine-executable instructions.
[0067] Furthermore, the electronic device shown in FIG1 also includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103 and the memory 101 are connected through the bus 102.
[0068] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only a single bidirectional arrow is used in Figure 1, but this does not imply that there is only one bus or one type of bus.
[0069] The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in this embodiment can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101. The processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the following steps:
[0070] S100: Acquire audio signals for preprocessing, acquire delay time measurements, environmental data, and the audio signals for abnormal data detection;
[0071] S200: Calculate delay compensation based on the audio signal and the delay time measurement value, and calculate environmental factor compensation based on the environmental data;
[0072] S300: Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism;
[0073] S400: Evaluate system performance based on real-time acquired audio signals and delay time measurements, and optimize the real-time feedback mechanism in real time.
[0074] Referring to Figure 2, the technical solution of this embodiment calculates a delay compensation value based on the audio signal and delay time measurements. According to environmental data, the impact of environmental factors on the audio signal is calculated, and corresponding compensations are made. For example, changes in temperature and humidity affect the speed of sound, thus affecting the propagation time of the audio signal. The calculated delay compensation and environmental factor compensation values are applied to the audio system through a real-time feedback mechanism to dynamically adjust the audio signal delay, thereby achieving synchronization between multiple devices. Furthermore, the internal parameters of the real-time feedback mechanism model are adaptively adjusted based on the real-time performance evaluation results of the system, such as adjusting the parameters of the PID control model, thereby improving the system's delay accuracy and stability.
[0075] It should be noted that the multi-device audio system of the present invention adopts a distributed architecture and includes at least the following hardware components:
[0076] Main controller: responsible for data processing and algorithm calculation;
[0077] High-precision microphone array: Each speaker is equipped with at least 3 microphones;
[0078] Environmental sensors: used to collect data such as temperature, humidity, and air pressure;
[0079] Clock synchronization module: Provides microsecond-level time synchronization.
[0080] For example, in a typical 5.1 channel system, the configuration is as follows: each of the six speakers is equipped with three microphones distributed at 120°, the ambient sensor sampling rate is 10Hz, and the clock synchronization accuracy is ±1 microsecond. The audio signal sampling rate is 48kHz, the bit depth is 24bit, and the acquisition window is 20ms.
[0081] In one implementation, the preprocessing of the acquired audio signal further includes:
[0082] A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise;
[0083] The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
[0084] The technical solution in this embodiment uses a Gaussian function to perform a weighted average on the signal, which can effectively smooth the audio signal and reduce abrupt changes and noise. The Gaussian filter has a good suppression effect on high-frequency components, effectively removing high-frequency noise from the audio signal and improving the signal-to-noise ratio. While smoothing the signal, it can better preserve the original characteristics of the signal, avoiding signal distortion caused by over-smoothing. The formula for Gaussian filtering to remove high-frequency noise is: G(x,y)=(1 / 2πσ 2 )e^(-(x 2 +y 2 ) / 2σ 2 ), where σ is the standard deviation, typically taken as 1.5. Simultaneously, using selected wavelet basis functions to perform multi-scale decomposition of the audio signal can capture local features of the signal, suitable for the analysis of non-stationary signals. After removing noise components, the processed wavelet coefficients are reconstructed using inverse wavelet transform to obtain the denoised audio signal. During reconstruction, attention must be paid to handling boundary effects to avoid introducing additional noise. Specifically, wavelet transform is used for multi-scale analysis, with the formula: ψa,b(t)=(1 / √a)ψ((tb) / a), where a is the scale parameter and b is the translation parameter.
[0085] In one implementation, the abnormal data detection process, which involves acquiring delay time measurements, environmental data, and the audio signal, further includes:
[0086] The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies.
[0087] Abnormal data was identified using Mahalanobis distance detection.
[0088] In this embodiment, the Z-score anomaly detection method identifies outliers by calculating the standard deviation of data points from the dataset mean. This method is simple, fast, and suitable for initially determining the range of anomalies. Standardizing the data allows for comparison of data with different dimensions, which helps improve the accuracy of anomaly detection. Furthermore, Mahalanobis distance considers data correlation and is suitable for anomaly detection in multivariate data. It can effectively identify data points that deviate from normal patterns across multiple dimensions, is insensitive to data scale, and has strong robustness, accurately detecting anomalous data even in the presence of outliers.
[0089] Specifically, in the Z-score anomaly detection method, Z = (x - μ) / σ, where x is the observed value, μ is the mean, and σ is the standard deviation. An anomaly is identified when |Z| > 3. For different data objects, x can be audio sampling data, delay time measurements, or environmental parameters (temperature, humidity, etc.). The Z-score anomaly detection method marks and temporarily stores data points identified as anomalies, using historical valid data from a sliding window for interpolation compensation. If consecutive anomaly data appears, a system alarm is triggered, and a fault-tolerant handling mechanism is activated. In the Mahalanobis distance anomaly detection method, D = √((x - μ)^TΣ^(-1)(x - μ)), where Σ is the covariance matrix and x is the observed vector. The Z-score method is mainly used for anomaly detection in single-dimensional data, such as delay time series from a single sensor. Mahalanobis distance detection is used for joint anomaly detection in multi-dimensional data, such as collaborative analysis of data from multiple sensors. Combining these two methods—first using the Z-score method for rapid screening, then using Mahalanobis distance for precise determination—forms a dual verification mechanism.
[0090] In one implementation, calculating the delay compensation based on the audio signal and the delay time measurement further includes:
[0091] The delay range is estimated using a cross-correlation analysis algorithm;
[0092] A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
[0093] In this embodiment, the cross-correlation analysis algorithm estimates the time delay between two signals by calculating their cross-correlation function. It is suitable for signals with similar waveforms and provides a preliminary delay estimate. Due to its relatively simple calculation, it is suitable for real-time processing. Furthermore, cross-correlation analysis is robust to noise and can effectively estimate delays in noisy environments. While the phase difference algorithm provides high-precision delay estimates, the computational complexity of calculating the FFT and phase difference is significant, potentially affecting real-time performance. Therefore, this embodiment first uses the cross-correlation analysis algorithm to roughly estimate the delay range, and then uses the phase difference method for precise calculation, forming a coarse-tuning + fine-tuning process. Rapid screening through cross-correlation analysis reduces the amount of data required for subsequent phase difference calculations, thereby improving overall computational efficiency. The complementary nature of these two methods effectively improves the real-time performance and accuracy of delay compensation.
[0094] Specifically, the cross-correlation analysis algorithm is: R(τ)=∑(x(t)y(t+τ)), where τ is the time delay, and x(t) and y(t) are two audio signals. The delay estimation based on phase difference is: Δφ=2πfΔt, where f is the signal frequency and Δt is the time delay.
[0095] In one implementation, calculating environmental factor compensation based on the environmental data further includes:
[0096] Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed.
[0097] Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
[0098] This embodiment deploys a high-precision temperature sensor in the audio processing environment to ensure real-time monitoring of ambient temperature changes. Combining temperature and humidity data for sound velocity correction significantly improves the accuracy of delay compensation and reduces errors. Real-time environmental data acquisition and sound velocity correction enable the system to quickly adapt to environmental changes and optimize response time. In the temperature and sound velocity mathematical model, the sound velocity correction formula is: c = 331.3 + 0.606t, where t is the temperature (°C). In the humidity and sound velocity mathematical model, the humidity effect correction formula is: Δc = c0(1 + αH), where c0 is the sound velocity under standard conditions, H is the relative humidity, and α is the correction coefficient.
[0099] Furthermore, the following methods are used to optimize synchronization among multiple devices in the audio system:
[0100] Least squares optimization: min∑(di-d~i) 2 Where di represents the measurement delay, and d~i represents the target delay. Optimization using the least squares method can significantly improve the synchronization accuracy of multi-device audio systems and reduce audio desynchronization. Real-time delay compensation calculation and feedback mechanisms enable the system to quickly adapt to environmental changes and device status fluctuations, improving response speed. Accurate synchronization and fast response speed enhance the user's listening experience and satisfaction.
[0101] Gradient descent optimization: Here, α is the learning rate, and J(θ) is the cost function. The calculated latency compensation value is applied to each device through a real-time feedback mechanism to dynamically adjust the audio processing parameters of the devices to achieve synchronization. Optimization using gradient descent can significantly improve the synchronization accuracy of multi-device audio systems and reduce audio-video desynchronization. The real-time latency compensation calculation and feedback mechanism enable the system to quickly adapt to environmental changes and device state fluctuations, improving response speed.
[0102] Referring to Figure 3, in one implementation, the automatic audio delay calibration based on the delay compensation and the environmental factor compensation via a real-time feedback mechanism further includes:
[0103] The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay.
[0104] The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
[0105] This embodiment achieves precise automatic calibration of audio delay through adaptive adjustment of a PID control model and a machine learning model, thereby improving the synchronization accuracy of multi-device audio systems. The PID control model is responsible for real-time closed-loop control, ensuring rapid system response. The machine learning model adaptively and dynamically adjusts the PID control model parameters to adapt to environmental changes. Specifically, in the PID control model, u(t) = Kpe(t) + Ki∫e(t)dt + Kd(de / dt), where Kp, Ki, and Kd are the parameters of the proportional, integral, and derivative components, respectively. In the adaptive adjustment control, K(t) = K0 + ΔK(t), where K0 is the initial gain and ΔK(t) is the dynamic adjustment value.
[0106] As a preferred approach, the machine learning model employs Support Vector Machine (SVM) regression: f(x) = ∑(αi - αi*)K(xi,x) + b, where K is the kernel function, and αi and αi* are Lagrange multipliers. The input to the SVM consists of multidimensional features such as historical calibration data, environmental parameters, and equipment status. The output is optimized suggestions for calibration parameters, including predicting optimal PID parameters, environmental compensation coefficients, and sampling window size. Using the SVM regression model can improve calibration accuracy, shorten convergence time, and enhance anti-interference capabilities.
[0107] As a preferred embodiment, the machine learning model adopts a feedforward neural network structure. The input layer consists of delayed data (6-8 dimensions) and environmental data (3-4 dimensions). The hidden layer has two layers with 64 nodes each. The activation function is ReLU: f(x) = max(0, x). The output layer consists of calibration compensation values and PID parameter adjustment values. The network weights are continuously optimized through online learning to achieve adaptive improvement of system performance, thereby reducing calibration time, improving accuracy and stability, and enhancing environmental adaptability.
[0108] In one implementation, evaluating system performance based on real-time acquired audio signals and delay time measurements, and further optimizing the real-time feedback mechanism in real time, includes:
[0109] Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model.
[0110] The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
[0111] In one implementation, the system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including:
[0112] During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
[0113] For example, latency accuracy evaluation: Where yi is the actual value. This is a predicted value. Stability assessment: σ 2 =∑(xi-μ) 2 / n, where σ 2 Let be the variance and μ be the mean.
[0114] As a preferred option, the system performs the following during operation:
[0115] Adaptive threshold adjustment: T(t)=T0+β·σ(t), where T0 is the base threshold and β is the adjustment coefficient.
[0116] Automatic parameter tuning: Optimization is achieved using a genetic algorithm with a population size of 100, a crossover rate of 0.8, and a mutation rate of 0.1.
[0117] As a preferred approach, the system implements the following exception handling and fault tolerance mechanisms:
[0118] Exception handling strategy:
[0119] 1) Fault detection algorithm: F(t)=∑wi·fi(t), where wi is the weight coefficient and fi is the fault feature.
[0120] 2) Fault tolerance: Backup switch time: <10ms, data recovery mechanism: circular buffer.
[0121] System monitoring and maintenance:
[0122] 1) Performance monitoring metrics: CPU utilization threshold: 80%, memory utilization threshold: 75%, network latency threshold: 5ms.
[0123] 2) Automatic maintenance strategy: Log recording cycle: 10 minutes, system self-check cycle: 1 hour, data backup cycle: 24 hours.
[0124] The above technical solutions, through systematic step design and detailed algorithm implementation, ensure high accuracy and stability of automatic audio delay calibration for multiple devices. Each step is equipped with specific implementation examples and algorithm formulas, facilitating technical implementation and subsequent optimization. This invention significantly improves the synchronization accuracy and stability of multi-device audio systems by innovatively introducing multi-level anomaly detection methods and adaptive algorithms, achieving millisecond-level delay calibration accuracy. The multi-level anomaly detection mechanism, at the data processing level, combines preprocessing algorithms such as Gaussian filtering and wavelet transform to achieve accurate identification and filtering of interference data. Combined with multi-dimensional anomaly detection methods such as Z-score and Mahalanobis distance, the anomaly range is first determined, and then the anomaly data is accurately identified, reducing computational load and significantly improving data reliability. Simultaneously, through distributed architecture design and an adaptive compensation mechanism for environmental factors, the problem of unstable calibration accuracy in complex environments, a problem inherent in traditional solutions, is successfully solved. At the optimization level, the dynamic compensation algorithm based on the influence of sound velocity and humidity, and the intelligent optimization system integrating PID control models and machine learning, are organically combined to enable the system to process 5000+ data points simultaneously, achieving millisecond-level delay calibration accuracy. Furthermore, through intelligent fault detection and fault-tolerance mechanisms, the system's stable operation is ensured, possessing environmental adaptability and automatic fault detection capabilities, significantly surpassing existing technological levels. Compared to traditional solutions, this invention achieves significant improvements in calibration accuracy, system stability, and environmental adaptability, providing an efficient and reliable technical solution for the synchronous control of multi-device audio systems.
[0125] Secondly, embodiments of the present invention also provide an electronic device for automatic audio delay calibration based on anomaly detection, including a memory and a processor. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the following steps:
[0126] The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data.
[0127] Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data.
[0128] Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism.
[0129] The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
[0130] The technical solution of this embodiment calculates a delay compensation value based on audio signal and delay time measurements. According to environmental data, the impact of environmental factors on the audio signal is calculated, and corresponding compensations are made. For example, changes in temperature and humidity affect the speed of sound, thus affecting the propagation time of the audio signal. The calculated delay compensation and environmental factor compensation values are applied to the audio system through a real-time feedback mechanism to dynamically adjust the audio signal delay, thereby achieving synchronization between multiple devices. Furthermore, the internal parameters of the real-time feedback mechanism model are adaptively adjusted based on the real-time performance evaluation results of the system, such as adjusting the parameters of the PID control model, thereby improving the system's delay accuracy and stability.
[0131] It should be noted that the multi-device audio system of the present invention adopts a distributed architecture and includes at least the following hardware components:
[0132] Main controller: responsible for data processing and algorithm calculation;
[0133] High-precision microphone array: Each speaker is equipped with at least 3 microphones;
[0134] Environmental sensors: used to collect data such as temperature, humidity, and air pressure;
[0135] Clock synchronization module: Provides microsecond-level time synchronization.
[0136] For example, in a typical 5.1 channel system, the configuration is as follows: each of the six speakers is equipped with three microphones distributed at 120°, the ambient sensor sampling rate is 10Hz, and the clock synchronization accuracy is ±1 microsecond. The audio signal sampling rate is 48kHz, the bit depth is 24bit, and the acquisition window is 20ms.
[0137] In one implementation, the preprocessing of the acquired audio signal further includes:
[0138] A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise;
[0139] The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
[0140] The technical solution in this embodiment uses a Gaussian function to perform a weighted average of the signal, which can effectively smooth the audio signal and reduce abrupt changes and noise. The Gaussian filter has a good suppression effect on high-frequency components, effectively removing high-frequency noise from the audio signal and improving the signal-to-noise ratio. While smoothing the signal, it can better preserve the original characteristics of the signal, avoiding signal distortion caused by over-smoothing. The formula for removing high-frequency noise using Gaussian filtering is: G(x,y)=(1 / 2πσ2)e^(-(x2+y2) / 2σ2), where σ is the standard deviation, typically taken as 1.5. Simultaneously, using a selected wavelet basis function to perform multi-scale decomposition of the audio signal can capture the local features of the signal, suitable for the analysis of non-stationary signals. After removing noise components, the processed wavelet coefficients are reconstructed using inverse wavelet transform to obtain the denoised audio signal. During the reconstruction process, attention needs to be paid to handling boundary effects to avoid introducing additional noise. Specifically, wavelet transform is used for multi-scale analysis, and the formula is: ψa,b(t)=(1 / √a)ψ((tb) / a), where a is the scale parameter and b is the translation parameter.
[0141] In one implementation, the abnormal data detection process, which involves acquiring delay time measurements, environmental data, and the audio signal, further includes:
[0142] The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies.
[0143] Abnormal data was identified using Mahalanobis distance detection.
[0144] In this embodiment, the Z-score anomaly detection method identifies outliers by calculating the standard deviation of data points from the dataset mean. This method is simple, fast, and suitable for initially determining the range of anomalies. Standardizing the data allows for comparison of data with different dimensions, which helps improve the accuracy of anomaly detection. Furthermore, Mahalanobis distance considers data correlation and is suitable for anomaly detection in multivariate data. It can effectively identify data points that deviate from normal patterns across multiple dimensions, is insensitive to data scale, and has strong robustness, accurately detecting anomalous data even in the presence of outliers.
[0145] In one implementation, calculating the delay compensation based on the audio signal and the delay time measurement further includes:
[0146] The delay range is estimated using a cross-correlation analysis algorithm;
[0147] A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
[0148] Specifically, in the Z-score anomaly detection method, Z = (x - μ) / σ, where x is the observed value, μ is the mean, and σ is the standard deviation. An anomaly is identified when |Z| > 3. For different data objects, x can be audio sampling data, delay time measurements, or environmental parameters (temperature, humidity, etc.). The Z-score anomaly detection method marks and temporarily stores data points identified as anomalies, using historical valid data from a sliding window for interpolation compensation. If consecutive anomaly data appears, a system alarm is triggered, and a fault-tolerant handling mechanism is activated. In the Mahalanobis distance anomaly detection method, D = √((x - μ)^TΣ^(-1)(x - μ)), where Σ is the covariance matrix and x is the observed vector. The Z-score method is mainly used for anomaly detection in single-dimensional data, such as delay time series from a single sensor. Mahalanobis distance detection is used for joint anomaly detection in multi-dimensional data, such as collaborative analysis of data from multiple sensors. Combining these two methods—first using the Z-score method for rapid screening, then using Mahalanobis distance for precise determination—forms a dual verification mechanism.
[0149] In one implementation, calculating environmental factor compensation based on the environmental data further includes:
[0150] Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed.
[0151] Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
[0152] In this embodiment, the cross-correlation analysis algorithm estimates the time delay between two signals by calculating their cross-correlation function. It is suitable for signals with similar waveforms and provides a preliminary delay estimate. Due to its relatively simple calculation, it is suitable for real-time processing. Furthermore, cross-correlation analysis is robust to noise and can effectively estimate delays in noisy environments. While the phase difference algorithm provides high-precision delay estimates, the computational complexity of calculating the FFT and phase difference is significant, potentially affecting real-time performance. Therefore, this embodiment first uses the cross-correlation analysis algorithm to roughly estimate the delay range, and then uses the phase difference method for precise calculation, forming a coarse-tuning + fine-tuning process. Rapid screening through cross-correlation analysis reduces the amount of data required for subsequent phase difference calculations, thereby improving overall computational efficiency. The complementary nature of these two methods effectively improves the real-time performance and accuracy of delay compensation.
[0153] Specifically, the cross-correlation analysis algorithm is: R(τ)=∑(x(t)y(t+τ)), where τ is the time delay, and x(t) and y(t) are two audio signals. The delay estimation based on phase difference is: Δφ=2πfΔt, where f is the signal frequency and Δt is the time delay.
[0154] In one implementation, the automatic audio delay calibration based on the delay compensation and the environmental factor compensation via a real-time feedback mechanism further includes:
[0155] The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay.
[0156] The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
[0157] In one implementation, evaluating system performance based on real-time acquired audio signals and delay time measurements, and further optimizing the real-time feedback mechanism in real time, includes:
[0158] Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model.
[0159] The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
[0160] In one implementation, the system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including:
[0161] During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
[0162] Thirdly, embodiments of the present invention also provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to perform the following steps:
[0163] The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data.
[0164] Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data.
[0165] Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism.
[0166] The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
[0167] In one implementation, the preprocessing of the acquired audio signal further includes:
[0168] A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise;
[0169] The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
[0170] In one implementation, the abnormal data detection process, which involves acquiring delay time measurements, environmental data, and the audio signal, further includes:
[0171] The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies.
[0172] Abnormal data was identified using Mahalanobis distance detection.
[0173] In one implementation, calculating the delay compensation based on the audio signal and the delay time measurement further includes:
[0174] The delay range is estimated using a cross-correlation analysis algorithm;
[0175] A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
[0176] In one implementation, calculating environmental factor compensation based on the environmental data further includes:
[0177] Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed.
[0178] Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
[0179] In one implementation, the automatic audio delay calibration based on the delay compensation and the environmental factor compensation via a real-time feedback mechanism further includes:
[0180] The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay.
[0181] The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
[0182] In one implementation, evaluating system performance based on real-time acquired audio signals and delay time measurements, and further optimizing the real-time feedback mechanism in real time, includes:
[0183] Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model.
[0184] The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
[0185] In one implementation, the system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including:
[0186] During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
[0187] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0188] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0189] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A computer-based method for automatic audio delay calibration based on anomaly detection, applied to a multi-device audio system, wherein, Includes the following steps: The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data. Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data. Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism. The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
2. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, The preprocessing of acquired audio signals further includes: A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise; The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
3. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, The abnormal data detection process, which involves collecting delay time measurements, environmental data, and the audio signal, further includes: The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies. Abnormal data was identified using Mahalanobis distance detection.
4. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, Calculating delay compensation based on the audio signal and the delay time measurement further includes: The delay range is estimated using a cross-correlation analysis algorithm; A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
5. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, Calculating environmental factor compensation based on the aforementioned environmental data further includes: Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed. Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
6. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, The automatic audio delay calibration based on the aforementioned delay compensation and environmental factor compensation via a real-time feedback mechanism further includes: The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay. The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
7. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including: Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model. The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
8. The computer-based method for automatic audio delay calibration based on anomaly detection according to claim 1, wherein, The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including: During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
9. An electronic device for automatic audio delay calibration based on anomaly detection, comprising a memory and a processor, wherein the memory stores machine-executable instructions executable by the processor, and the processor executes the machine-executable instructions to perform the following steps: The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data. Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data. Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism. The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.
10. The electronic device according to claim 9, wherein, The preprocessing of acquired audio signals further includes: A Gaussian filter is applied to the audio signal to smooth the signal and remove high-frequency noise; The audio signal is decomposed into multiple scales using selected wavelet basis functions to obtain wavelet coefficients at different scales. The decomposed wavelet coefficients are then thresholded to remove noise components, and the denoised audio signal is reconstructed.
11. The electronic device according to claim 9, wherein, The abnormal data detection process, which involves collecting delay time measurements, environmental data, and the audio signal, further includes: The Z-score anomaly detection method was used to quickly screen and initially determine the range of anomalies. Abnormal data was identified using Mahalanobis distance detection.
12. The electronic device according to claim 9, wherein, Calculating delay compensation based on the audio signal and the delay time measurement further includes: The delay range is estimated using a cross-correlation analysis algorithm; A fast Fourier transform is performed using a phase difference algorithm to obtain a frequency domain representation. The phase difference is calculated based on the frequency domain representation. The relative delay is estimated based on the relationship between the phase difference and the time delay, and delay compensation is calculated.
13. The electronic device according to claim 9, wherein, Calculating environmental factor compensation based on the aforementioned environmental data further includes: Temperature data is collected in real time by temperature and humidity sensors, and sound speed parameters are corrected based on a mathematical model of temperature and sound speed. Humidity data is collected in real time by temperature and humidity sensors, and the sound speed parameters are corrected based on a mathematical model of humidity and sound speed.
14. The electronic device according to claim 9, wherein, The automatic audio delay calibration based on the aforementioned delay compensation and environmental factor compensation via a real-time feedback mechanism further includes: The real-time acquired delay compensation and environmental factor compensation are input into a preset PID control model, and the PID control model outputs the dependent variable audio delay time to achieve automatic calibration of audio delay. The parameters of the proportional, integral, and derivative components of the PID control model are adaptively adjusted using a machine learning model.
15. The electronic device according to claim 9, wherein, The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including: Input the data, which includes at least historical calibration data, environmental parameters, and equipment status, into the trained support vector machine model. The support vector machine model outputs optimized data including at least the parameters of the proportional, integral, and derivative components of the PID control model.
16. The electronic device according to claim 9, wherein, The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is further optimized in real time, including: During system operation, audio signals, delay time measurements, and environmental data are recorded in real time. The recorded data are then statistically analyzed to calculate system performance indicators.
17. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the following steps: The audio signal is collected and preprocessed, and the delay time measurement value, environmental data, and the audio signal are collected to detect abnormal data. Delay compensation is calculated based on the audio signal and the delay time measurement, and environmental factor compensation is calculated based on the environmental data. Based on the aforementioned delay compensation and environmental factor compensation, audio delay is automatically calibrated through a real-time feedback mechanism. The system performance is evaluated based on real-time acquired audio signals and delay time measurements, and the real-time feedback mechanism is optimized in real time.