Gain value adjustment method and device for signal, and processing method for sound signal
By identifying the start and end conditions of events in sensor signals and adjusting the gain value in real time, the contradiction between low power consumption and high accuracy in sensor devices is resolved, achieving efficient signal processing and low power consumption, which is suitable for voice recognition chips and electronic devices.
Patent Information
- Application Number
- CN202211663652.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-23
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2042-12-23
AI Technical Summary
Existing technologies that integrate sensors cannot simultaneously meet the requirements of low power consumption and high precision, especially when processing random, sparse, and large amplitude range sensor signals. This results in high-performance systems processing invalid data for extended periods and having low signal quantization accuracy.
By identifying the start and end conditions of events in the target signal, the gain value is adjusted in real time. The adjustment step size is set using the signal amplitude statistics, and the gain value is adjusted only during the duration of the target event, thus achieving reasonable gain control.
It improves the quantization accuracy of signal processing and reduces ineffective power consumption, balancing the requirements of high precision and low power consumption, and is suitable for speech recognition chips and electronic devices.
Smart Images

Figure CN115954014B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of signal processing, and in particular to methods and apparatus for adjusting the gain of signals and methods for processing sound signals. Background Technology
[0002] With the development of emerging application scenarios such as the Internet of Things and the metaverse, devices can amplify and quantize various signals collected by their integrated sensors, such as physiological signals, sound signals, and touch signals, to obtain signals for data processing. The events detected by these sensors are characterized by randomness, sparsity, and large amplitude variations. Figure 1 This is a schematic diagram illustrating the characteristics of the sensor signal. (For example...) Figure 1 As shown, on the one hand, events in sensor signals generally exhibit random and sparse characteristics in the time dimension. Here, randomness refers to the random occurrence of events detected by the sensor, such as... Figure 1 The distribution of events 1, 2, and 3 in the middle is random; while sparsity refers to the long intervals between the occurrence of events, for example... Figure 1 The interval between event 1 and event 2 is relatively long. On the other hand, the events in the sensor signal exhibit large amplitude variations, for example... Figure 1 The amplitude ranges of events 1 and 3 are relatively small, while the amplitude range of event 2 is relatively large. Therefore, the amplitude range changes significantly from event 1 to event 2 and then to event 3.
[0003] Due to the random and sparse nature of events in signals, the high-performance system in the device, composed of microcontrollers, central processing units, neural network processors, and high-precision digital-to-analog converters, needs to be in always-on mode to handle randomly generated events. This results in the high-performance system spending a significant amount of time processing invalid data, leading to high invalid energy consumption and overall high power consumption. Furthermore, the large amplitude variation of events requires the digital-to-analog converter to cover its maximum amplitude range. Consequently, when the signal amplitude is small, the accuracy of the quantized data is low, or even impossible to quantize the event.
[0004] Currently, automatic gain control (AGC) is often used to adjust the gain used to amplify the signal in real time based on the signal amplitude range. This method results in high energy consumption, and combined with the random and sparse characteristics of the events mentioned above, it makes it impossible for devices to meet low-power requirements. Therefore, current applications of devices integrating sensors cannot simultaneously meet the requirements of low power consumption and high accuracy.
[0005] There is currently no effective solution to the problem that the application of devices with integrated sensors in related technologies cannot simultaneously meet the requirements of low power consumption and high precision. Summary of the Invention
[0006] This embodiment provides a signal gain adjustment method, device, and sound signal processing method to solve the problem that in the application of devices with integrated sensors in related technologies, the requirements for low power consumption and high precision cannot be simultaneously met.
[0007] Firstly, this embodiment provides a method for adjusting the gain value of a signal, including:
[0008] Acquire the target signal;
[0009] Identify whether a target event exists in the target signal; if so, adjust the gain value of the target signal during the duration of the target event.
[0010] In some embodiments, identifying whether a target event exists in the target signal; if so, adjusting the gain value of the target signal during the duration of the target event includes:
[0011] Detect whether the target signal meets the preset event start conditions; if the target signal meets the preset event start conditions, perform signal amplitude statistics on the target signal read in real time;
[0012] If the result of the signal amplitude statistics meets the preset gain adjustment conditions, the gain value of the target signal is adjusted based on the result of the signal amplitude statistics, and the adjustment of the gain value ends when the target signal meets the preset event termination conditions.
[0013] This embodiment, based on the detection of the start and end of the target event, triggers the adjustment of the gain value. It can improve the quantization accuracy of the target event in the signal based on gain control, while reducing the invalid power consumption and the average power consumption of the overall usage time, thus taking into account the requirements of high accuracy and low power consumption in the signal processing process.
[0014] In some embodiments, the step of performing signal amplitude statistics on the target signal read in real time includes:
[0015] The amplitude of the target signal, which is read in real time, is counted the number of times it touches the top within a preset number of frames to obtain a count value; wherein, the number of times the amplitude of the target signal touches the preset amplitude threshold.
[0016] Adjusting the gain value based on the statistical value of the number of times the signal amplitude hits the top within a preset number of frames can achieve reasonable adjustment of the gain value, thereby making the range of signal amplitude affected by the gain value tend to the desired preset range and improving the accuracy of quantized data.
[0017] In some embodiments, adjusting the gain value of the target signal during the duration of the target event further includes:
[0018] If the amplitude of the target signal meets the preset gain amplification condition, an adjustment step size is set, and the gain value of the target signal is amplified according to the adjustment step size during the duration of the target event.
[0019] If the amplitude of the target signal meets the preset gain reduction condition, an adjustment step size is set, and the gain value of the target signal is reduced according to the adjustment step size during the duration of the target event.
[0020] Based on the different gain adjustment conditions met by the results of signal amplitude statistics, amplifying or reducing the gain value can achieve a more reasonable adjustment of the gain value, stabilize the amplitude range of the target signal within the preset value, and improve data accuracy.
[0021] In some embodiments, adjusting the gain value of the target signal during the duration of the target event further includes:
[0022] The result of the signal amplitude statistics of the target signal is compared with at least two different statistical ranges. If the result of the signal amplitude statistics belongs to one of the at least two different statistical ranges, the adjustment step size is determined based on the statistical range to which the result of the signal amplitude statistics belongs.
[0023] During the duration of the target event, the gain value of the target signal is amplified or reduced according to the adjustment step size. In this embodiment, different adjustment step sizes are set based on the different statistical ranges matched by the signal amplitude statistics results, which can achieve reasonable adjustment of the gain value, realize more precise control of the signal gain, and thus ensure that the amplitude range of the signal affected by the gain value can be stabilized within the desired preset range, improving the data accuracy and stability of subsequent signal processing.
[0024] In some embodiments, the method further includes:
[0025] Based on the adjusted and updated gain value, the target signal is used to determine the event start condition and the event end condition. Feeding the updated gain value back to the event start and event end detection of the target signal can improve the accuracy of target event detection, thereby further improving data precision and reducing power consumption.
[0026] In some embodiments, the method further includes:
[0027] If the target signal is detected to meet the preset event termination condition, the adjustment of the gain value of the target signal is stopped, and the gain value at the end of the event is obtained.
[0028] Based on the gain value at the end of the event, the amplitude of the target signal is adjusted during the duration of the new target event. The updated gain value will be applied to the next target event, enabling the amplitude to be adjusted based on only one gain value throughout the entire duration of each target event, thereby maintaining the shape of the signal time.
[0029] Secondly, this embodiment provides a method for processing sound signals, including:
[0030] Acquire sound signals;
[0031] Identify whether a speech event exists in the sound signal; if so, adjust the gain value of the sound signal during the duration of the speech event.
[0032] The aforementioned audio signal processing method can adjust the gain value based on the triggering of a speech event. This improves the quantization accuracy of the speech event through gain control while reducing the power consumption for processing invalid audio signals and lowering the average power consumption throughout the entire signal processing process, thus achieving a balance between high accuracy and low power consumption in speech signal processing. Furthermore, by applying the adjusted gain value to a newly detected speech event, the signal amplitude of the speech event can be adjusted based on the same gain value throughout the duration of a single speech event. This preserves the signal profile of the speech event, thereby improving the accuracy of subsequent speech recognition results and achieving the desired speech recognition accuracy while reducing hardware or power consumption costs.
[0033] Thirdly, this embodiment provides a signal gain adjustment device, including: an event detection module and a gain control module; wherein:
[0034] The output of the event detection module is connected to the input of the gain control module. The event detection module is used to acquire the target signal and identify whether a target event exists in the target signal.
[0035] The gain control module is used, when triggered by the event detection module, to adjust the gain value of the target signal during the duration of the target event, and output an updated gain value, when the target event exists in the target signal.
[0036] The gain adjustment device can realize a linkage mechanism based on target event triggering. While improving the quantization accuracy of the target event by gain control, it reduces the number of operations on the signal amplitude over the overall usage time, thereby reducing invalid power consumption and average power consumption over the overall usage time, thus meeting the requirements of high precision and low power consumption.
[0037] In some embodiments, the signal gain adjustment device further includes: a gain amplification module and an analog-to-digital conversion module; wherein:
[0038] The output of the gain amplification module is connected to the input of the analog-to-digital conversion module. The gain amplification module is used to adjust the amplitude of the input signal based on the gain value and output a gain adjustment signal to the analog-to-digital conversion module.
[0039] The output of the analog-to-digital conversion module is connected to the event detection module and the gain control module, respectively; the analog-to-digital conversion module is used to perform analog-to-digital conversion on the gain adjustment signal and output the target signal to the event detection module and the gain control module;
[0040] The output of the gain control module is connected to the input of the gain amplification module. The gain control module is also used to output an updated gain value to the gain amplification module. In this embodiment, the gain value is adjusted based on the triggering of a target event, and the adjusted gain value is output to the gain amplification module to adjust the amplitude of the target signal. This allows the amplitude of the target signal to be maintained within the desired range so that the processed target signal meets the requirements of subsequent signal processing.
[0041] In some embodiments, the output of the gain control module is also connected to the input of the event detection module; the gain control module is also used to feed back the updated gain value to the event detection module. By feeding back the updated gain value to the event detection module, the updated gain value can be combined with the target signal output by the analog-to-digital conversion module to express richer information and improve the accuracy of target event detection.
[0042] In some embodiments, the event detection module includes an event start detection unit and an event end detection unit; wherein:
[0043] The event start detection unit is connected to the event end detection unit; the event start detection unit is used to determine whether the amplitude of the target signal reaches a preset event start threshold, and when the amplitude of the target signal reaches the event start threshold, it outputs an event start signal and triggers the event end detection unit to perform event end detection.
[0044] The event end detection unit is used to determine whether the target signal meets the preset event end conditions based on the duration and time frequency characteristics of the target signal, and outputs an event end signal when the target signal meets the event end conditions, and triggers the event start detection unit to perform event start detection.
[0045] The event start detection unit detects the start of an event based on the amplitude of the target signal, while the event end detection unit detects the end of an event based on the duration and time-frequency characteristics of the target signal, thus improving the accuracy of event start and end detection. Based on this, gain control can be triggered promptly when the target signal generates a target event, thereby improving the data accuracy of target event quantization while reducing power consumption.
[0046] In some embodiments, the gain control module includes an amplitude statistics unit, a comparison unit, and a step size adjustment unit; wherein:
[0047] The amplitude statistics unit is connected to the comparison unit. The amplitude statistics unit is used to count the number of times the amplitude of the target signal touches the peak within a preset number of frames based on the triggering of the event start signal, and output the count value to the comparison unit; wherein, the number of times the peak touches the peak is the number of times the amplitude of the target signal touches a preset amplitude threshold.
[0048] The comparison unit is connected to the step size adjustment unit. The comparison unit is used to compare the count value with a preset count range and output the comparison result to the step size adjustment unit.
[0049] The step size adjustment unit is used to set the adjustment step size based on the comparison result, and to amplify or reduce the gain of the target signal according to the adjustment step size. Based on the amplitude statistics unit and the comparison unit, the number of times the target signal's amplitude reaches its peak is counted, enabling gain value adjustment based on the statistical value of the number of peaks. This allows for reasonable control of the signal gain, ensuring that the amplitude range of the target signal affected by the gain value remains stable within the desired preset range.
[0050] Fourthly, this embodiment provides a voice recognition chip that applies the signal gain adjustment method described in the first aspect, or the sound signal processing method described in the second aspect, or the signal gain adjustment device described in the third aspect. The aforementioned voice recognition chip can improve the quantization accuracy of converting voice signals into digital signals based on gain control, while reducing the ineffective power consumption of signal processing and the average power consumption during overall use, thereby balancing the requirements of high accuracy and low power consumption and expanding the applicability of the voice recognition chip.
[0051] Fifthly, this embodiment provides an electronic device that applies the speech recognition chip described in the fourth aspect above. This electronic device supports gain adjustment triggered by a speech event, thereby improving the quantization accuracy of converting speech signals into digital signals based on gain control while reducing the ineffective power consumption and average power consumption during overall use, thus balancing the requirements of high accuracy and low power consumption during the use of the electronic device.
[0052] Compared with related technologies, the signal gain adjustment method, apparatus, and sound signal processing method provided in this embodiment acquire a target signal; identify whether a target event exists in the target signal; and if so, adjust the gain value of the target signal during the duration of the target event. This enables a linkage mechanism based on target event triggering. While improving the quantization accuracy of the target event through gain control, it reduces the number of operations on signal amplitude over the overall usage time, thereby reducing invalid power consumption and average power consumption over the overall usage time, thus achieving a balance between high precision and low power consumption.
[0053] 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
[0054] 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:
[0055] Figure 1 This is a schematic diagram illustrating the characteristics of the sensor signal;
[0056] Figure 2 This is an application scenario diagram of the signal gain adjustment method in this embodiment;
[0057] Figure 3 This is a flowchart of the signal gain adjustment method in this embodiment;
[0058] Figure 4a This is a schematic diagram showing the relationship between sound acquisition distance and sound amplitude range;
[0059] Figure 4b This is a schematic diagram illustrating the relationship between amplitude range and ADC quantization accuracy;
[0060] Figure 5 This is a schematic diagram showing the number of times the device touches the top in this embodiment;
[0061] Figure 6 This is a schematic diagram of the adjustment step size setting in this embodiment;
[0062] Figure 7 This is a flowchart of the gain control method of this preferred embodiment;
[0063] Figure 8 This is a structural block diagram of the signal gain adjustment device in this embodiment;
[0064] Figure 9 This is a schematic diagram of the event detection module in this embodiment;
[0065] Figure 10 This is a schematic diagram of the gain control module in this embodiment;
[0066] Figure 11 This is a schematic diagram of the gain control results in this embodiment;
[0067] Figure 12 This is a flowchart of the sound signal processing method in this embodiment. Detailed Implementation
[0068] 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.
[0069] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as 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 such processes, methods, products, or devices. The terms “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. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.
[0070] Figure 2 This diagram illustrates an application scenario of the signal gain adjustment method described in this embodiment. For example... Figure 2 As shown, gain amplifier 201 amplifies the amplitude of the input analog signal based on its set gain value, and inputs the processed analog signal to analog-to-digital converter 202 for analog-to-digital conversion. Analog-to-digital converter 202 outputs the converted target signal to event detection circuit 203 to detect target events in the target signal. Event detection circuit 203 identifies whether a target event exists in the target signal and triggers gain control circuit 204 to adjust the gain value when it is determined that a target event exists. When event detection circuit 203 detects the presence of a target event in the target signal, gain control circuit 204 adjusts the gain value of the target signal during the duration of the target event. Gain control circuit 204 then feeds back the adjusted gain value to gain amplifier 201, so that gain amplifier 201 amplifies the amplitude of the input analog signal based on the adjusted gain value.
[0071] For example, the gain amplifier 201 can specifically be a programmable gain amplifier; the event detection circuit 203 can specifically be a circuit including a plurality of comparators, counters, time-frequency feature judgment circuits, and AND gate logic circuits; the gain control circuit 204 can specifically be a circuit including a framer, comparator, buffer, and accumulator. Furthermore, the aforementioned input analog signal can specifically be sensor signals such as physiological signals, sound signals, and touch signals collected by sensors.
[0072] This embodiment provides a signal gain adjustment method. Figure 3 This is a flowchart of the signal gain adjustment method in this embodiment, as shown below. Figure 3 As shown, the process includes the following steps:
[0073] Step S310: Acquire the target signal;
[0074] Step S320: Identify whether a target event exists in the target signal; if so, adjust the gain value of the target signal during the duration of the target event.
[0075] The target signal can be a digital signal acquired by a sensor and processed through gain amplification and analog-to-digital conversion. To reduce the high energy consumption caused by real-time detection and processing of signal amplitude in traditional gain control schemes, the gain adjustment process in this embodiment is triggered by the occurrence of a target event and terminated when the target event ends. The target event refers to a specific signal detected in the target signal whose amplitude, waveform, time-frequency characteristics, etc., differ from other parts of the target signal, or that meets preset conditions. These signal characteristics and preset conditions can be determined according to the application scenario. It should be understood that this embodiment does not specifically limit the specific identification of the target event, the extracted signal characteristics, or the preset conditions used. For example, in a speech recognition scenario, a speech signal whose amplitude differs from background white noise, car horns, and other sounds in the environment is the target event in that speech recognition scenario, or a speech event.
[0076] Furthermore, smart devices with voice recognition capabilities support activation triggered by specific voice keywords. Before voice recognition, they require a series of preprocessing steps on the received voice signal, including amplification. When no voice event is detected, the received signal is ambient noise, primarily white noise. In this case, the received target signal does not contain the target event, therefore there is no need to adjust the gain of the current target signal or amplify it based on the gain value. However, when the smart speaker receives a voice signal that meets preset recognition conditions, such as ambient conversation or a voice command to wake up the smart speaker, it recognizes the voice signal as the aforementioned target event and triggers the gain adjustment function for subsequent processing and recognition of the voice event.
[0077] As described above, based on the actual application scenario, it can be determined whether the corresponding signal characteristics meet preset conditions to ascertain whether a target event exists in the target signal. Preferably, the detection of the target event can be divided into two parts: event start detection and event end detection. When the signal characteristics of the target signal, such as amplitude, waveform, time-frequency characteristics, duration, or a combination of the above characteristics, meet the preset event start conditions, it can be confirmed that the start of the target event has been detected. Thus, the detection of the end of the target event is initiated until the signal characteristics of the target signal meet the preset event end conditions, thereby completing the detection of the current target event. For example, by analyzing the signal amplitude of the target signal, when the signal amplitude of the target signal is greater than a preset event occurrence threshold, it can be confirmed that the start of the target event has been detected. That is, the event start condition can be whether the signal amplitude of the target signal reaches the preset event occurrence threshold.
[0078] In addition, Figure 4a This is a schematic diagram illustrating the relationship between sound acquisition distance and sound amplitude range. Figure 4a It can be seen that when the sound source is close to the microphone, the amplitude range of the collected sound signal is larger, while when the sound source is far from the microphone, the amplitude range of the collected sound signal is smaller. Figure 4b This diagram illustrates the relationship between amplitude range and ADC quantization accuracy. The relationship between signal resolution (LSB) and ADC range (FSR) is LSB = FSR / 2. N The larger the ADC range, the worse its resolution. For example... Figure 4b In general, target events with a large amplitude range can fully utilize the ADC's range, resulting in high accuracy of the quantized data. However, because the ADC's resolution is relatively large compared to target events with a small amplitude range, the accuracy of the quantized data for such small-amplitude target events is reduced. Therefore, this embodiment, upon detecting the presence of a target event in the target signal, adjusts the gain value of the target signal by amplifying or decreasing it. This addresses the issue of large amplitude range variations in the signal, thereby improving the accuracy of the quantized data.
[0079] Furthermore, in this embodiment, upon detecting a target event, the signal characteristics of the target signal can be further analyzed to determine whether it meets preset gain adjustment conditions. These gain adjustment conditions can be one or more. Taking signal amplitude as an example, the statistical result of the target signal's amplitude can be compared with a preset statistical threshold or range. Based on the comparison result, the gain value can be reduced or amplified. The specific adjustment step size for reducing or amplifying the gain value can also be set based on the comparison result. Additionally, different adjustment step sizes can be set for different statistical ranges or for different exceedances of the preset statistical threshold. For example, if the number of times the signal amplitude touches the preset amplitude threshold reaches a large threshold, the gain value is reduced based on a larger adjustment step size; if it reaches a small threshold, the gain value is reduced based on a smaller adjustment step size. In this embodiment, by adjusting the gain value based on the statistical results of signal amplitude, a corresponding adjustment step size is set. This ensures that the signal amplitude statistical results of the signal affected by the adjusted gain value tend to approach a preset statistical range, stabilizing the signal amplitude within the preset range. This achieves reasonable control of the target signal amplitude, thereby improving the data accuracy and stability of subsequent signal processing. It is understood that the specific adjustment method described above can be set based on actual application scenarios, and this embodiment does not impose specific limitations.
[0080] Furthermore, by changing the number of frames or the time range for analyzing signal features, analysis results of signal features within different frame numbers or time ranges can be obtained. Based on these analysis results as the number of frames or time progresses, the gain value can be adjusted, thus achieving continuous updating of the gain value. The adjusted gain value can be applied to the target signal in the next frame outside the current frame number range of signal feature analysis, or to the next detected target event. By updating the gain value, it is possible to set the gain value more reasonably based on the changes in the target signal itself. Under the effect of the updated gain value, the data accuracy of target signal processing and the accuracy of starting and ending target event detection can be improved.
[0081] Furthermore, when the end of the target event is detected, that is, when the target signal meets the preset event end condition, in order to reduce the energy consumption caused by adjusting the gain and avoid increasing invalid energy consumption, this embodiment will end the adjustment of the current gain value and start the detection of the event start. Preferably, the currently adjusted gain value can also be fed back to the start and end detection of the target event to improve the accuracy of signal detection.
[0082] Compared to related technologies, where the random and sparse nature of target events leads to prolonged processing of invalid data and high energy consumption due to invalid data, this embodiment, based on the detection of the start and end of target events, can adjust the gain value only when the target event occurs. This avoids processing invalid data, reduces the energy consumption of invalid gain control, and consequently reduces the overall energy consumption of signal gain adjustment.
[0083] The following explanation uses a speech recognition scenario as an example to illustrate the gain adjustment method. Before speech recognition processing, sound signals need to be acquired by sound acquisition devices such as microphones. To process the weak signals into fuller signals for subsequent speech recognition, this embodiment amplifies the acquired sound signals based on the adjusted gain value. Specifically, this embodiment utilizes an event-triggered mechanism. Only when a speech signal distinct from white noise or other environmental noise is detected in the sound signal—that is, when a change in human voice is detected—is the gain value adjusted based on the statistical results of the signal amplitude of the acquired speech event. The adjusted gain value is then applied to the sound signal for amplification. After digital-to-analog conversion by an analog-to-digital converter, the signal is sent to the subsequent speech recognition module for speech recognition processing. Understandably, this embodiment does not require amplification or gain adjustment of invalid signals such as white noise or car horns when the desired speech event is not acquired. Therefore, this embodiment can improve the data accuracy of the quantization processing of speech events based on the adjusted gain value while also reducing the power consumption of the entire speech recognition process.
[0084] Furthermore, combining Figure 4a , Figure 4b As the above analysis shows, the amplitude of the sound signal collected varies depending on the distance between the microphone and the sound source. During speech recognition, if the distance between the speaker and the microphone changes, the amplitude of the speech event collected by the microphone will be inconsistent over the duration of the speech. In other words, the appearance of a speech event to be recognized will be distorted. Considering that speech events need to be recognized based on the appearance of the signal, this situation presents an obstacle to recognition accuracy due to the distance of the speaker.
[0085] In speech recognition, the technology often uses a fixed gain value to amplify the sound signal. This method cannot solve the problem of morphological distortion of the speech event. Therefore, the amplified signal still has distortion, which affects the accuracy of speech recognition.
[0086] Optionally, in applications such as speech recognition that require analysis based on the signal's inherent shape, this embodiment, when using the signal frame at the end of the detected target event as the last frame for calculating the aforementioned signal amplitude statistics, can apply the gain value adjusted based on the signal amplitude statistics to the next target event. This ensures that each event, throughout the entire continuous event, is amplified using only one gain value, thus preserving the signal's shape. Specifically, this embodiment applies the gain value adjusted based on the signal amplitude of the currently detected speech event to the next speech event. That is, when a speech event is detected, the gain value is adjusted based on the statistical results of the signal amplitude of the current speech event during its occurrence, until the end of the current speech event is detected, ending the adjustment of the gain value for the current stage. Subsequently, when a new speech event to be recognized is detected, the latest updated gain value is applied to the new speech event.
[0087] Therefore, this embodiment can amplify the voice event signal to form a uniform signal shape, avoiding interference from amplitude distortion of the voice. On the one hand, it can improve the accuracy of voice recognition, and on the other hand, it can achieve the desired voice recognition accuracy with less hardware cost or power consumption cost.
[0088] It is worth noting that for application scenarios requiring signal shape analysis and recognition, such as the aforementioned speech recognition scenario or ECG acquisition and diagnosis scenarios based on electronic devices, this embodiment can adjust the signal amplitude based on the same gain value within the duration of a single target event by setting the time or number of frames for signal amplitude statistics. However, for other application scenarios that do not require attention to signal shape, this embodiment can also employ other methods to achieve signal gain control. For example, for heart rate statistics applications that require signal quality for each frame of signal itself, or for frequency domain signal processing applications, it is not necessary to maintain the signal shape. When applied to application scenarios that do not require maintaining the signal shape, this embodiment can independently set different gain values for each frame of signal or for each preset number of frames of signal, amplifying the amplitude of the corresponding frame of signal to obtain a signal that meets the preset recognition requirements.
[0089] Steps S310 to S320 involve acquiring a target signal; identifying whether a target event exists within the target signal; and if so, adjusting the gain value of the target signal during the duration of the target event. This enables a linkage mechanism triggered by a target event. While improving the quantization accuracy of the target event through gain control, it reduces the number of operations on the signal amplitude over the overall usage time, thereby reducing invalid power consumption and the average power consumption over the overall usage time, thus achieving a balance between high precision and low power consumption.
[0090] In one embodiment, based on the above step S320, identifying whether a target event exists in the target signal; if so, adjusting the gain value of the target signal during the duration of the target event, further includes:
[0091] Step S321: Detect whether the target signal meets the preset event start conditions; if the target signal meets the preset event start conditions, perform signal amplitude statistics on the target signal read in real time.
[0092] The aforementioned event initiation conditions can be set based on actual application scenarios. For example, it could be whether the signal amplitude reaches a preset amplitude requirement, or whether the signal waveform change conforms to a preset change rule. This embodiment does not impose specific limitations here. This embodiment performs signal amplitude statistics on the target signal, specifically based on preset statistical rules, to perform statistical statistics on the signal amplitude within a preset time period or a preset number of frames. Specifically, the target signal can be first processed into frames, and then the cases where the signal amplitude exceeds a preset amplitude threshold within the preset number of frames can be counted to obtain the above signal amplitude statistics results. Preferably, the average number of times the signal amplitude in each frame within the preset number of frames touches the preset amplitude threshold can be counted, that is, the average number of times the target signal hits the peak, thereby obtaining the signal amplitude statistics results. Alternatively, the maximum value, minimum value, median value, or other statistical processing can be performed on the number of times the target signal hits the peak within the preset number of frames, which is not specifically limited here.
[0093] Step S322: If the result of the signal amplitude statistics meets the preset gain adjustment conditions, adjust the gain value of the target signal based on the result of the signal amplitude statistics, and end the adjustment of the gain value when the target signal meets the preset event termination conditions.
[0094] The aforementioned preset gain adjustment conditions may include preset gain amplification conditions or preset gain reduction conditions. If the signal amplitude statistics result meets the preset gain amplification conditions, the gain value can be amplified based on the signal amplitude statistics result; if the signal amplitude statistics result meets the preset gain reduction conditions, the gain value can be reduced.
[0095] Steps S321 to S322, based on the detection of the start and end of the target event, trigger the adjustment of the gain value. This can improve the quantization accuracy of the target event in the signal based on gain control, while reducing the power consumption of invalid power and the average power consumption of the overall usage time, thus taking into account the requirements of high accuracy and low power consumption in the signal processing process.
[0096] In one embodiment, based on the above step S321, the amplitude of the target signal read in real time is statistically analyzed. Specifically, this may include: counting the number of times the amplitude of the target signal read in real time touches the top within a preset number of frames to obtain a count value; wherein, the number of times the amplitude of the target signal touches the preset amplitude threshold.
[0097] Specifically, the count can be the average, maximum, minimum, or other statistical value of the number of times the device touches the top in each frame or in each preset frame within a preset number of frames. The following explanation uses the average number of times the device touches the top in each frame from frame 1 to frame M as an example. Figure 5 This is a schematic diagram illustrating the number of times the device touches the top in this embodiment. For example... Figure 5 As shown, after the target signal is divided into frames, the number of times the signal amplitude hits the peak in each frame from frame 1 to frame M is counted sequentially. The value of M ranges from [1, N]. Figure 5 The two horizontal lines represent the maximum input range of the ADC and the threshold for peak detection, respectively, which is the amplitude threshold mentioned above. N can be the total number of frames read. For example, if the number of times the signal amplitude reaches or exceeds the amplitude threshold in a frame is 0, then the peak detection count for that frame is 0; if the number of times the signal amplitude reaches or exceeds the amplitude threshold in a frame is m, then the peak detection count for that frame is m; if the number of times the signal amplitude reaches or exceeds the amplitude threshold in a frame is n, then the peak detection count for that frame is n. And so on, combined with... Figure 5 The average number of times the signal amplitude hits the peak in each of the M frames is calculated frame by frame, and the average number of times the signal amplitude hits the peak in the M frames is obtained as shown in the following formula:
[0098] Overhedad_Avg=(0+…+m+…+n+…+0) / M (1)
[0099] Where Overhedad_Avg is the average number of times the signal amplitude touches the top within the M frames, which can also be expressed as:
[0100]
[0101] Among them, Overhead_Cnt i This represents the number of times the signal touches the top in the i-th frame. Furthermore, as the frame count progresses, the frame range can be changed. For example, the average number of touches can be calculated using frames 2 to M+1, or frames N to N+P. As the number of frames read progresses, the average number of touches in subsequent frames is recalculated, and the gain value is updated until the end of the target event is detected. This embodiment, by statistically analyzing the number of times the signal amplitude touches the top within a preset number of frames and adjusting the gain value based on this statistical value, can adjust the gain value based on the signal amplitude after the target event occurs, thereby improving the accuracy of the quantized data.
[0102] Furthermore, the gain value of the target signal can be adjusted when the statistical count reaches a preset range. For example, if the average number of times the signal hits the peak falls within a preset range, the result of the signal amplitude statistics is determined to meet the preset gain adjustment conditions, thereby amplifying or reducing the gain value. This embodiment adjusts the gain value based on the result of the signal amplitude statistics, and then applies the adjusted gain value to the subsequent target signal. Under the influence of the gain value, the amplitude range of the target signal can be stabilized within a preset value, improving the data accuracy of signal quantization processing. In addition, this embodiment adjusts the gain value only when the statistical count reaches a preset range, avoiding ineffective or over-adjustment of the gain value, achieving reasonable gain control of the signal while improving the efficiency of gain value adjustment.
[0103] In one embodiment, adjusting the gain value of the target signal during the duration of the target event, based on step S320 above, may further include the following steps:
[0104] Step S323: If the amplitude of the target signal meets the preset gain amplification conditions, set the adjustment step size, and amplify the gain value of the target signal according to the adjustment step size during the duration of the target event.
[0105] Step S324: If the amplitude of the target signal meets the preset gain reduction condition, set the adjustment step size, and reduce the gain value of the target signal according to the adjustment step size during the duration of the target event.
[0106] Continuing with the example of using the average number of times the signal touches the top as the result of signal amplitude statistics, if the average number of times the signal touches the top within a preset number of frames is 0, or greater than 0 but lower than a preset minimum threshold, then it is confirmed that the gain value of the target signal needs to be increased; that is, the result of the signal amplitude statistics meets the preset gain amplification condition. In this case, the gain value is amplified by setting an adjustment step size. If the average number of times the signal touches the top within a preset number of frames is greater than the preset minimum threshold, or higher than the preset maximum threshold, then it is confirmed that the gain value of the target signal needs to be decreased; that is, the result of the signal amplitude statistics meets the preset gain reduction condition. It is understood that the above-mentioned gain reduction and gain amplification conditions can also be determined based on other methods, and this embodiment does not specifically limit them here.
[0107] In this embodiment, the gain value is amplified when the signal amplitude statistics result meets the preset gain amplification condition, and the gain value is reduced when the signal amplitude statistics result meets the preset gain reduction condition. This can stabilize the amplitude range of the target signal within the preset value and improve data accuracy.
[0108] In another embodiment, based on the above step S320, adjusting the gain value of the target signal during the duration of the target event may further include the following steps:
[0109] Step S325: Compare the result of the signal amplitude statistics of the target signal with at least two different statistical ranges. If the result of the signal amplitude statistics belongs to one of the at least two different statistical ranges, determine the adjustment step size based on the statistical range to which the result of the signal amplitude statistics belongs.
[0110] Step S326: During the duration of the target event, the gain value of the target signal is amplified or reduced according to the adjustment step size.
[0111] For example, the above-mentioned gain reduction conditions and gain amplification conditions can be further subdivided. Figure 6 This is a schematic diagram illustrating the adjustment step size setting in this embodiment. Figure 6 As shown, two threshold values for the number of times the device hits the top are set. The larger threshold value is the first threshold value, and the smaller threshold value is the second threshold value. The average number of times the device hits the top is compared with these two threshold values. If the average number of times the device hits the top is greater than the first threshold value, the gain value is reduced by a larger adjustment step size, i.e., the second adjustment step size. Figure 6 The double-pointed horn pointing downwards; if the average number of times it touches the top is greater than the second threshold but less than the first threshold, the gain value is adjusted with a smaller step size, that is, the first adjustment step size is reduced, such as... Figure 6 A single-pointed horn pointing downwards; if the average number of times it touches the top is equal to 0, i.e., no top has occurred, then the gain increases with a larger second adjustment step, such as... Figure 6 The double-pointed horn pointing upwards; if the average number of times it touches the top is greater than 0 and less than the threshold for the second count, the gain value increases with a small first adjustment step, such as... Figure 6 The single horn points upwards in the center. Based on this, the gain value can be adjusted by adding or subtracting a first adjustment step size, or by adding or subtracting a second adjustment step size.
[0112] Understandably, more statistical ranges can be set for the statistical results based on the needs of actual application scenarios. Based on the range matched by the signal amplitude statistics results, corresponding adjustment step sizes can be set to amplify or decrease the gain value. This embodiment will not elaborate further. In this embodiment, setting different adjustment step sizes based on different ranges matched by the signal amplitude statistics results enables more precise control of the signal gain, thereby stabilizing the amplitude range of the signal affected by the gain value within the desired preset range, improving the data accuracy and stability of subsequent signal processing.
[0113] In one embodiment, the above-mentioned signal gain adjustment method may further include the following steps:
[0114] Step S330 involves determining the event start condition and the event end condition of the target signal based on the adjusted and updated gain value. Specifically, the updated gain value is fed back to the event start detection and event end detection of the target signal to improve the accuracy of target event detection, thereby further improving data precision.
[0115] In another embodiment, the above-described signal gain adjustment method may further include the following steps:
[0116] Step S341: If the target signal is detected to meet the preset event termination condition, the adjustment of the gain value of the target signal is stopped, and the gain value at the end of the event is obtained.
[0117] Step S342: Based on the gain value at the end of the event, adjust the amplitude of the target signal during the duration of the new target event of the target signal.
[0118] For example, in application scenarios that require signal recognition based on signal morphology, this embodiment uses the signal frame at the end of the detected event as the last frame for signal amplitude statistics. The updated gain value will be applied to the next target event, so that the amplitude of each target event is adjusted based on only one gain value throughout the entire continuous event. This can maintain the morphology of the signal time and thus improve the accuracy of signal recognition.
[0119] The present embodiment will now be described and illustrated through preferred embodiments.
[0120] Figure 7 This is a flowchart of the gain control method according to a preferred embodiment. Figure 7 As shown, the gain control method includes the following steps:
[0121] Step S701: Detect the start of the target event;
[0122] Step S702: Determine whether the start of the target event has been detected; if yes, execute step S703 and trigger step S709 to start execution; otherwise, return to execute step S701.
[0123] Step S703: Frame the target event; wherein, the target event is framed starting from the start time of the event;
[0124] Step S704: Count the number of times the signal amplitude of each frame hits the peak.
[0125] Step S705: Average the number of times the device touches the top in each frame from frame 1 to frame M to obtain the average number of times the device touches the top.
[0126] Step S706: Compare the average number of times the device touches the top with a preset threshold number of times.
[0127] Step S707: Adjust the gain value according to the comparison result using a preset adjustment step size;
[0128] Step S708: Change the frame range and calculate the new average number of times the top is touched; for example, take the 2nd frame to the (M+1)th frame, calculate the new average number of times the top is touched, and return to execute steps S706 to S707.
[0129] Step S709: Detect the end of the target event;
[0130] Step S710: Determine whether the end of the target event has been detected; if yes, proceed to step S711; otherwise, return to step S709.
[0131] Step S711: Stop the execution of the gain control process and trigger the execution of step S701; wherein, the gain control process includes steps S703 to S708.
[0132] Figure 8 This is a structural block diagram of the signal gain adjustment device 80 in this embodiment, as shown below. Figure 8 As shown, the signal gain adjustment device 80 includes an event detection module 86 and a gain control module 88; wherein: the output of the event detection module 86 is connected to the input of the gain control module 88, the event detection module 86 is used to acquire the target signal and identify whether a target event exists in the target signal; the gain control module 88 is used to adjust the gain value of the target signal during the duration of the target event when the target event exists in the target signal, triggered by the event detection module 86, and output an updated gain value.
[0133] Depend on Figure 8 It is understood that the gain adjustment device 80 also includes a gain amplification module 82 and an analog-to-digital conversion module 84. Specifically, the gain amplification module 82 can be a programmable gain amplifier, which is configured with a gain value for amplifying the analog signal. When the gain value is not adjusted, the gain amplification module 82 amplifies the input analog signal with an initial gain value and sends the amplified analog signal to the analog-to-digital conversion module 84 for processing. The analog-to-digital conversion module 84 can be an analog-to-digital converter, which converts the analog signal to digital and outputs a digital signal, i.e., the aforementioned target signal, to the event detection module 86.
[0134] The event detection module 86 can specifically be a circuit structure that includes event start detection and event end detection. Specifically, the event detection module 86 compares the amplitude of the target signal with a preset event occurrence threshold. If the signal amplitude is greater than the event occurrence threshold, the start of the target event is confirmed, thereby triggering the gain control module 88 to start operating. Additionally, after the event detection module 86 detects the start of the target event, it also activates the event end detection function. The event detection module 86 detects whether the target event has ended based on event duration analysis and time-frequency domain characteristics. If the end of the target event is detected, the gain adjustment operation of the gain control module 88 is stopped, and the event start detection function is activated.
[0135] Specifically, the gain control module 88 can be a gain control circuit. After adjusting the gain value, it can send the adjusted gain value to the aforementioned gain amplification module 82, so that the gain amplification module 82 can amplify the input analog signal based on the adjusted gain value. Furthermore, the gain control module 88 can also feed back the adjusted gain value to the event detection module 86, so that the event detection module 86 can detect the start and end of events based on the adjusted gain value.
[0136] The gain adjustment device 80 of the aforementioned signal can realize a linkage mechanism based on target event triggering. While improving the quantization accuracy of the target event by gain control, it reduces the number of operations on the signal amplitude over the overall usage time, thereby reducing invalid power consumption and average power consumption over the overall usage time, thus meeting the requirements of high precision and low power consumption.
[0137] Furthermore, in one embodiment, the gain adjustment device 80 for the signal further includes: a gain amplification module 82 and an analog-to-digital conversion module 84; wherein: the output of the gain amplification module 82 is connected to the input of the analog-to-digital conversion module 84, the gain amplification module 82 is used to adjust the amplitude of the input signal based on the gain value, and output a gain adjustment signal to the analog-to-digital conversion module 84; the output of the analog-to-digital conversion module 84 is connected to the event detection module 86 and the gain control module 88 respectively; the analog-to-digital conversion module 84 is used to perform analog-to-digital conversion on the gain adjustment signal, and output a target signal to the event detection module 86 and the gain control module 88; the output of the gain control module 88 is connected to the input of the gain amplification module 82, and the gain control module 88 is also used to output an updated gain value to the gain amplification module 82.
[0138] Furthermore, in one embodiment, the output of the gain control module 88 is also connected to the input of the event detection module 86; the gain control module 88 is also used to feed back the updated gain value to the event detection module 86. By feeding back the adjusted gain value to the event detection module for target event detection, the accuracy of target event detection and data precision can be improved.
[0139] In another embodiment, the event detection module 86 includes an event start detection unit and an event end detection unit; wherein: the event start detection unit is connected to the event end detection unit; the event start detection unit is used to determine whether the amplitude of the target signal reaches a preset event start threshold, and when the amplitude of the target signal reaches the event start threshold, outputs an event start signal and triggers the event end detection unit to perform event end detection; the event end detection unit is used to determine whether the target signal meets a preset event end condition based on the duration and time-frequency characteristics of the target signal, and when the target signal meets the event end condition, outputs an event end signal and triggers the event start detection unit to perform event start detection.
[0140] Figure 9 This is a schematic diagram of the event detection module 86 in this embodiment. Figure 9 As shown, the event detection module 86 may include: a first comparator, a counter, a second comparator, a third comparator, a time-frequency feature judgment circuit, and an AND gate logic circuit. The event initiation detection unit includes a first comparator, which compares the amplitude of the input target signal with a preset event occurrence threshold. If the signal amplitude is greater than the event occurrence threshold, the counter and the second comparator are triggered to run.
[0141] The event end detection unit includes a counter, a second comparator, a third comparator, a time-frequency feature judgment circuit, and an AND gate logic circuit. The counter calculates the duration of the target event and inputs the calculated duration into the third comparator. The third comparator compares the event duration with a preset duration threshold to determine the event duration. Once the event duration reaches the preset threshold, it outputs a signal 1 to the AND gate logic circuit and sends an event start trigger signal to the gain control module 88. The second comparator compares the target signal with another preset amplitude threshold. If the signal amplitude is less than the preset amplitude threshold, it triggers a time-frequency feature judgment. When the target signal meets the preset time-frequency characteristics, the time-frequency feature judgment circuit outputs a signal 1 to the AND gate logic circuit. With all inputs being signal 1, the AND gate logic circuit outputs signal 1, indicating that the end of the target event has been detected, and sends an event end trigger signal to the gain control module 88.
[0142] In another embodiment, the gain control module 88 includes an amplitude statistics unit, a comparison unit, and a step size adjustment unit; wherein: the amplitude statistics unit is connected to the comparison unit, and the amplitude statistics unit is used to count the number of times the amplitude of the target signal hits the peak within a preset number of frames based on the triggering of the event start signal, and output the count statistics value to the comparison unit; wherein the peak count is the number of times the amplitude of the target signal touches a preset amplitude threshold; the comparison unit is connected to the step size adjustment unit, and the comparison unit is used to compare the count statistics value with a preset count range, and output the comparison result to the step size adjustment unit; the step size adjustment unit is used to set the adjustment step size based on the comparison result, and amplify or reduce the gain of the target signal according to the adjustment step size.
[0143] Figure 10 This is a schematic diagram of the gain control module 88 in this embodiment. Figure 10 As shown, the gain control module 88 includes: a frame divider, a fourth comparator, a top-touch count accumulator, a buffer, an averaging circuit, a fifth comparator, a parameter memory, and a gain control value adjustment circuit. The amplitude statistics unit may include a frame divider, a fourth comparator, a top-touch count accumulator, a buffer, and an averaging circuit; the comparison unit may include a fifth comparator; and the step size adjustment unit may include a gain control value adjustment circuit.
[0144] Specifically, triggered by the event start signal, the frame divider divides the target signal into frames and sends the framed signals to the touch-the-peak count accumulator and the buffer. The fourth comparator compares the target signal with the amplitude threshold read from the parameter memory. If the signal amplitude is greater than the amplitude threshold, it is confirmed that the signal amplitude has reached the peak. At this time, the touch-the-peak count accumulator will increment the accumulated value by 1. The framing signal will control the touch-the-peak count accumulator to buffer the accumulated value into the buffer at the end of each frame and then clear the accumulated value. The buffer stores the touch-the-peak count for each frame. The averaging circuit averages the touch-the-peak count for each frame to obtain the average touch-the-peak count over a preset number of frames.
[0145] Next, the fifth comparator compares the average number of touches calculated by the averaging circuit with the touch count threshold stored in the parameter memory, and sends the comparison result to the gain control value adjustment circuit. The gain control value adjustment circuit increases or decreases the gain value using the adjustment step size stored in the parameter memory, and outputs the adjusted gain value to achieve gain control. If the gain control module 88 receives an event end signal, it will stop the above gain control process and reset the entire gain control module.
[0146] Figure 11 This is a schematic diagram of the gain control results in this embodiment. Figure 11As shown, by adjusting the gain value using the signal gain adjustment device provided in the above embodiment and applying the adjusted gain value to the signal amplitude, the average number of times the target signal hits the peak can be reduced, approaching the preset minimum number threshold. Therefore, by reasonably setting the minimum number threshold, the amplitude of the target signal can be kept within the desired range.
[0147] This embodiment also provides a method for processing sound signals. Figure 12 This is a flowchart of the sound signal processing method in this embodiment. Figure 12 As shown, the method for processing this sound signal includes the following steps:
[0148] Step S121: Acquire sound signal;
[0149] Step S122: Identify whether there is a speech event in the sound signal. If so, adjust the gain value of the sound signal during the duration of the speech event.
[0150] The aforementioned voice events are voice signals detected from sound signals, such as conversations, voice commands, or laughter. After gain control of these voice events, they can be input into an associated analog-to-digital converter for processing to obtain corresponding digital signals. These digital signals are then used by an associated speech recognition system for speech recognition, yielding recognition results for the corresponding application scenario. For example, the system can determine whether the voice event includes preset voice keywords or preset command information. This sound signal processing method adjusts the gain value based on the triggering of voice events, thereby improving the quantization accuracy of voice events through gain control while reducing the power consumption for processing invalid sound signals and lowering the average power consumption throughout the signal processing process. This balances the requirements of high accuracy and low power consumption in voice signal processing. Furthermore, when the adjusted gain value is applied to newly detected voice events, the signal amplitude of the voice event can be adjusted based on the same gain value within the duration of a single voice event, thus maintaining the signal profile of the voice event and improving the accuracy of subsequent speech recognition results.
[0151] In this embodiment, a voice recognition chip is also provided, applied to the signal gain adjustment method, sound signal processing method, or signal gain adjustment device provided in the above embodiments. The above-mentioned voice recognition chip can improve the quantization accuracy of converting voice signals into digital signals based on gain control, while reducing the ineffective power consumption of signal processing and the average power consumption during overall use, thereby balancing the requirements of high accuracy and low power consumption and expanding the applicability of the voice recognition chip.
[0152] In this embodiment, an electronic device is also provided, which applies the voice recognition chip provided in the above embodiments. Specifically, the electronic device can be a smart speaker that plays audio based on voice command interaction; or a mobile service robot that supports voice control; or a mobile device that supports voice dialogue and voice-to-text conversion. The electronic device provided in this embodiment can support gain adjustment triggered by voice events, thereby improving the quantization accuracy of converting voice signals into digital signals based on gain control while reducing the invalid power consumption of the electronic device and the average power consumption during overall use, thus balancing the requirements of high accuracy and low power consumption.
[0153] 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.
[0154] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0155] 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.
[0156] 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.
[0157] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are 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 adjusting the gain value of a signal, characterized in that, include: Acquire the target signal; Identify whether a target event exists in the target signal; If so, adjusting the gain value of the target signal during the duration of the target event; including: Detect whether the target signal meets the preset event start conditions; if the target signal meets the preset event start conditions, perform signal amplitude statistics on the target signal read in real time; If the result of the signal amplitude statistics meets the preset gain adjustment conditions, the gain value of the target signal is adjusted based on the result of the signal amplitude statistics, and the adjustment of the gain value ends when the target signal meets the preset event termination conditions. In application scenarios where analysis is required based on the shape of the signal itself, when the signal frame at the end of the detected target event is taken as the last frame for calculating the result of the signal amplitude statistics, the gain value adjusted based on the result of the signal amplitude statistics is applied to the next target event. In application scenarios where the shape of the signal does not need to be preserved, different gain values are set independently for each frame of the target signal or for each preset number of frames, and the amplitude of the target signal in the corresponding frame is amplified to obtain a signal that meets the preset recognition requirements.
2. The signal gain adjustment method according to claim 1, characterized in that, The step of performing signal amplitude statistics on the target signal read in real time includes: The amplitude of the target signal, which is read in real time, is counted the number of times it touches the top within a preset number of frames to obtain a count value; wherein, the number of times the amplitude of the target signal touches the preset amplitude threshold.
3. The signal gain adjustment method according to claim 1, characterized in that, The adjustment of the gain value of the target signal during the duration of the target event includes: If the amplitude of the target signal meets the preset gain amplification condition, an adjustment step size is set, and the gain value of the target signal is amplified according to the adjustment step size during the duration of the target event. If the amplitude of the target signal meets the preset gain reduction condition, an adjustment step size is set, and the gain value of the target signal is reduced according to the adjustment step size during the duration of the target event.
4. The signal gain adjustment method according to claim 1, characterized in that, The adjustment of the gain value of the target signal during the duration of the target event further includes: The result of the signal amplitude statistics of the target signal is compared with at least two different statistical ranges. If the result of the signal amplitude statistics belongs to one of the at least two different statistical ranges, the adjustment step size is determined based on the statistical range to which the result of the signal amplitude statistics belongs. During the duration of the target event, the gain value of the target signal is amplified or reduced according to the adjustment step size.
5. The signal gain adjustment method according to claim 1, characterized in that, The method further includes: Based on the adjusted and updated gain value, the target signal is used to determine the event start condition and the event end condition.
6. The method for adjusting the gain value of a signal according to any one of claims 1 to 5, characterized in that, The method further includes: If the target signal is detected to meet the preset event termination condition, the adjustment of the gain value of the target signal is stopped, and the gain value at the end of the event is obtained. Based on the gain value at the end of the event, the amplitude of the target signal is adjusted during the duration of the new target event of the target signal.
7. A signal gain adjustment device, characterized in that, include: Event detection module and gain control module; wherein: The output of the event detection module is connected to the input of the gain control module. The event detection module is used to acquire the target signal and identify whether a target event exists in the target signal. The gain control module is used, when triggered by the event detection module, to adjust the gain value of the target signal during the duration of the target event, and output an updated gain value, when the target event is present in the target signal, during the duration of the target event; including: Detect whether the target signal meets the preset event start conditions; if the target signal meets the preset event start conditions, perform signal amplitude statistics on the target signal read in real time; If the result of the signal amplitude statistics meets the preset gain adjustment conditions, the gain value of the target signal is adjusted based on the result of the signal amplitude statistics, and the adjustment of the gain value ends when the target signal meets the preset event termination conditions. In application scenarios where analysis is required based on the shape of the signal itself, when the signal frame at the end of the detected target event is taken as the last frame for calculating the result of the signal amplitude statistics, the gain value adjusted based on the result of the signal amplitude statistics is applied to the next target event. In application scenarios where the shape of the signal does not need to be preserved, different gain values are set independently for each frame of the target signal or for each preset number of frames, and the amplitude of the target signal in the corresponding frame is amplified to obtain a signal that meets the preset recognition requirements.
8. The signal gain adjustment device according to claim 7, characterized in that, The signal gain adjustment device further includes: a gain amplification module and an analog-to-digital conversion module; wherein: The output of the gain amplification module is connected to the input of the analog-to-digital conversion module. The gain amplification module is used to adjust the amplitude of the input signal based on the gain value and output a gain adjustment signal to the analog-to-digital conversion module. The output of the analog-to-digital conversion module is connected to the event detection module and the gain control module, respectively; the analog-to-digital conversion module is used to perform analog-to-digital conversion on the gain adjustment signal and output the target signal to the event detection module and the gain control module; The output of the gain control module is connected to the input of the gain amplification module, and the gain control module is also used to output an updated gain value to the gain amplification module.
9. The signal gain adjustment device according to claim 7, characterized in that, The output of the gain control module is also connected to the input of the event detection module; the gain control module is also used to feed back the updated gain value to the event detection module.
10. The signal gain adjustment device according to claim 7, characterized in that, The event detection module includes an event start detection unit and an event end detection unit; wherein: The event start detection unit is connected to the event end detection unit; the event start detection unit is used to determine whether the amplitude of the target signal reaches a preset event start threshold, and when the amplitude of the target signal reaches the event start threshold, it outputs an event start signal and triggers the event end detection unit to perform event end detection. The event end detection unit is used to determine whether the target signal meets the preset event end conditions based on the duration and time frequency characteristics of the target signal, and outputs an event end signal when the target signal meets the event end conditions, and triggers the event start detection unit to perform event start detection.
11. The signal gain adjustment device according to any one of claims 7 to 10, characterized in that, The gain control module includes an amplitude statistics unit, a comparison unit, and a step size adjustment unit; wherein: The amplitude statistics unit is connected to the comparison unit. The amplitude statistics unit is used to count the number of times the amplitude of the target signal touches the peak within a preset number of frames based on the triggering of the event start signal, and output the count value to the comparison unit; wherein, the number of times the peak touches the peak is the number of times the amplitude of the target signal touches a preset amplitude threshold. The comparison unit is connected to the step size adjustment unit. The comparison unit is used to compare the count value with a preset count range and output the comparison result to the step size adjustment unit. The step size adjustment unit is used to set the adjustment step size based on the comparison result, and to amplify or reduce the gain of the target signal according to the adjustment step size.
12. A voice recognition chip, characterized in that, The gain adjustment method of the signal according to any one of claims 1 to 6, or the gain adjustment device of the signal according to any one of claims 7 to 11.
13. An electronic device, characterized in that, The speech recognition chip described in claim 12 is used.