CN112671376B - Method, device, terminal and computer readable storage medium for clipping detection of signal - Google Patents

Method, device, terminal and computer readable storage medium for clipping detection of signal Download PDF

Info

Publication number
CN112671376B
CN112671376B CN202011490348.5A CN202011490348A CN112671376B CN 112671376 B CN112671376 B CN 112671376B CN 202011490348 A CN202011490348 A CN 202011490348A CN 112671376 B CN112671376 B CN 112671376B
Authority
CN
China
Prior art keywords
amplitude
signal
detected
clipping
histogram
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011490348.5A
Other languages
Chinese (zh)
Other versions
CN112671376A (en
Inventor
王艳芬
严锋贵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN202011490348.5A priority Critical patent/CN112671376B/en
Publication of CN112671376A publication Critical patent/CN112671376A/en
Application granted granted Critical
Publication of CN112671376B publication Critical patent/CN112671376B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present application belongs to the technical field of signal processing, and in particular, to a method, an apparatus, a terminal and a computer-readable storage medium for detecting clipping of a signal, wherein the method for detecting clipping of a signal includes: acquiring a signal to be detected; determining an amplitude histogram of the signal to be detected, wherein the amplitude histogram comprises a plurality of amplitude intervals; if a first amplitude interval of the amplitude histogram jumps, determining an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; carrying out clipping detection on the signal to be detected by using the clipping threshold value; the accuracy of signal clipping detection is improved.

Description

Method, device, terminal and computer readable storage medium for clipping detection of signal
Technical Field
The present application belongs to the field of signal processing technologies, and in particular, to a method, an apparatus, a terminal, and a computer-readable storage medium for detecting clipping of a signal.
Background
Clipping is a distorted form of a signal that can occur when the signal is digitized, or when analog-to-digital conversion of the signal occurs at any other time. For example, soft clipping or hard clipping occurs.
In order to repair a clipped signal, it is necessary to perform clipping detection on the signal first to determine whether the signal is clipped. However, the conventional clip detection method generally detects that a signal is hard-clipped only when the signal is hard-clipped, but cannot detect that the signal is soft-clipped when the signal is soft-clipped, and thus has a problem of low clip detection accuracy.
Disclosure of Invention
The embodiment of the application provides a method, a device, a terminal and a computer readable storage medium for detecting signal clipping, which can solve the problem of low accuracy of signal clipping detection.
A first aspect of an embodiment of the present application provides a method for detecting clipping of a signal, where the method for detecting clipping of a signal includes:
acquiring a signal to be detected;
determining an amplitude histogram of the signal to be detected, wherein the amplitude histogram comprises a plurality of amplitude intervals;
if a first amplitude interval of the amplitude histogram jumps, determining an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; wherein the first amplitude interval is one of the plurality of amplitude intervals;
and carrying out clipping detection on the signal to be detected by using the clipping threshold value.
A second aspect of the embodiments of the present application provides a device for detecting clipping of a signal, including:
the acquisition unit is used for acquiring a signal to be detected;
the first determining unit is used for determining an amplitude histogram of the signal to be detected, and the amplitude histogram comprises a plurality of amplitude intervals;
a second determining unit, configured to determine, if a first amplitude interval of the amplitude histogram jumps, an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; wherein the first amplitude interval is one of the plurality of amplitude intervals;
and the detection unit is used for carrying out clipping detection on the signal to be detected by utilizing the clipping threshold value.
A third aspect of the embodiments of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method when executing the computer program.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the above method.
In the embodiment of the application, when the first amplitude interval of the amplitude histogram of the signal to be detected is determined to jump, the amplitude corresponding to the first amplitude interval is determined as the clipping threshold of the signal to be detected, so that the self-adaptive detection of the clipping threshold is realized, when the clipping threshold obtained by the method is used for carrying out clipping detection on the signal to be detected, the signal to be detected can be detected to be subjected to hard clipping when the signal to be detected is subjected to hard clipping, and the signal to be detected can be detected to be subjected to soft clipping when the signal to be detected is subjected to soft clipping; the method has the advantages that the clipping threshold obtained by the method is used for carrying out clipping detection on the signal to be detected, so that the detection of hard clipping of the signal can be realized, the detection of soft clipping of the signal can be realized, the problem that the signal is detected to have soft clipping under the condition that the signal has soft clipping when the fixed threshold is used for carrying out clipping detection on the signal to be detected is effectively avoided, and the precision of the signal clipping detection is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram of a signal with clipping provided by an embodiment of the application;
fig. 2 is a schematic flowchart of a first implementation of a method for clipping detection of a signal according to an embodiment of the present application;
fig. 3 is a schematic diagram of a histogram of amplitudes of a signal without clipping provided by an embodiment of the present application;
fig. 4 is a schematic flowchart of a specific implementation process for determining whether a first amplitude interval of an amplitude histogram jumps or not according to an embodiment of the present application;
FIG. 5 is a schematic diagram of overlapping framing of signals according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a second implementation of a method for detecting clipping of a signal according to an embodiment of the present application;
fig. 7 is a schematic diagram of a histogram of the amplitudes of a clipped signal provided by an embodiment of the application;
fig. 8 is a schematic flowchart of a third implementation of a method for detecting clipping of a signal according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a clipping detection apparatus for a signal according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In order to explain the technical means of the present application, the following description will be given by way of specific examples.
The clipped form of the signal includes hard clipping and soft clipping. Where hard clipping refers to distortion in which the magnitude of a signal exceeds the range of values available to represent the magnitude of the signal.
For example, when converting an analog audio signal into a digital signal for storage, if a 16-bit signed integer is used for representation, the available value range that can be used to represent the amplitude of the speech signal is-32768 to 32768. When the amplitude of the sampled voice signal needs to be represented by a value outside the available value range, the amplitude of the sampled voice signal can be represented by the maximum value or the minimum value in the available value range only by means of clipping because the amplitude of the voice signal exceeds the available value range, and the actual amplitude of the voice signal cannot be stored, so that the voice signal is distorted as shown in fig. 1, that is, the signal is hard-clipped.
Soft clipping refers to amplitude distortion that occurs after further compression, where the amplitude of the signal is still within the available range of values for the amplitude of the signal.
For example, if the usable value range for representing the amplitude of the speech signal is-1 to 1 and the actual amplitude of a certain speech signal is-0.8 to 0.8, after the amplitude of the speech signal is amplified by 1.5 times, hard clipping may occur because the amplitude range of the amplified signal exceeds the usable value range of the amplitude of the speech signal by-1 to 1, and if the amplitude of the speech signal after the hard clipping is reduced to-0.8 to 0.8, the reduced amplitude of 0.8 and the actual amplitude of 0.8 of the original speech signal will not correspond to each other, and the content of the speech signal will be distorted, that is, the speech signal will be soft clipped.
Currently, in the process of performing clip detection on a signal, a fixed threshold is usually set to perform clip detection on the signal to be detected. However, this detection method can only detect whether or not the signal is hard-clipped, and cannot detect whether or not the signal is soft-clipped, which has a problem of low detection accuracy.
For example, for the above-described hard clipping that occurs after amplifying a speech signal by 1.5 times, clip detection can be performed by the previously set fixed thresholds-1 and 1. And after the amplitude of the voice signal after the hard clipping is reduced to-0.8 to 0.8, the soft clipping of the voice signal is caused, and the detection can not be carried out by utilizing preset fixed thresholds-1 and-1.
Based on this, embodiments of the present application provide a method, an apparatus, a terminal, and a computer-readable storage medium for detecting clipping of a signal, which can implement both hard clipping detection and soft clipping detection of the signal, and can effectively improve the clipping detection accuracy of the signal.
Fig. 2 shows a schematic flow chart of implementation of a method for detecting clipping of a signal provided in an embodiment of the present application, where the method can be applied to a terminal in the embodiment of the present application and is executed by a device for detecting clipping of a signal configured on the terminal. The terminal can be an intelligent terminal such as a mobile phone, a tablet computer and wearable equipment. The clipping detection method of the signal may include steps 201 to 204, which are detailed as follows:
step 201, acquiring a signal to be detected.
In this embodiment, the signal to be detected may be a signal that needs to be detected whether clipping occurs, such as a voice signal and an image signal. Also, the signal to be detected may have hard clipping or soft clipping.
Step 202, determining an amplitude histogram of the signal to be detected, where the amplitude histogram includes multiple amplitude intervals.
In some embodiments, the determining the histogram of the amplitude of the signal to be detected may include: and carrying out histogram statistics on the amplitude of the signal to be detected to obtain an amplitude histogram of the signal to be detected.
Specifically, when histogram statistics is performed on the amplitude of the signal to be detected, the amplitude of the signal to be detected to be clipped may be divided into L amplitude intervals, and then statistics values of the amplitude of the signal to be detected in each amplitude interval are counted to obtain an amplitude histogram of the signal to be detected.
The specific value of the amplitude interval number L can be determined according to actual application, and the larger the amplitude interval number L is, the smaller the group interval width of the amplitude histogram is, and the more accurate the amplitude histogram statistics is. For example, it may be set to an integer within the interval [100, 9999 ].
In other embodiments, when the amplitude of the signal to be detected is represented by a signed integer or floating point, the determining the histogram of the amplitude of the signal to be detected may further include: and carrying out histogram statistics on the absolute value of the amplitude of the signal to be detected to obtain an amplitude histogram of the signal to be detected.
For example, when the available value range for representing the amplitude of the signal is-1 to 1, and histogram statistics is performed on the absolute value of the amplitude of the signal y (n) to be detected, a formula index (m) = min (| y (n) |, 1) × (L-1) may be used to determine which amplitude interval index (m) each amplitude of the signal y (n) to be detected is located in, and statistics hist (index (m)) of each amplitude interval index (m) is obtained through statistics, so as to generate an amplitude histogram of the signal y (n) to be detected; wherein m is more than or equal to 1 and less than or equal to L, and m is an integer.
Step 203, if a first amplitude interval of the amplitude histogram jumps, determining an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; wherein the first amplitude interval is any one of the amplitude intervals.
In this embodiment of the application, the determining, in the step 203, the amplitude corresponding to the first amplitude interval as the clipping threshold for clipping the signal to be detected may refer to determining any one of the amplitudes located in the first amplitude interval as the clipping threshold for clipping the signal to be detected.
For example, the minimum amplitude value located in the first amplitude interval is determined as a clipping threshold value at which clipping occurs in the signal to be detected.
As shown in fig. 3, for a signal that is not clipped, the magnitude histogram of the signal is smoothly transitioned between each adjacent magnitude interval. That is, in the amplitude interval where the amplitude is smaller than 0, the statistical value of each amplitude interval is smoothly increased, and in the amplitude interval where the amplitude is greater than or equal to 0, the statistical value of each amplitude interval is smoothly decreased. When a signal is clipped, the amplitude histogram of the signal will not be smoothed in a certain adjacent amplitude interval, that is, jump, so in practical application, it may be determined whether a first amplitude interval of the amplitude histogram jumps or not, and when it is determined that the first amplitude interval of the amplitude histogram jumps, the amplitude corresponding to the first amplitude interval is determined as the clipping threshold of the signal to be detected.
Optionally, as shown in fig. 4, the determining whether the first amplitude interval of the amplitude histogram jumps or not may include: step 401 to step 402.
Step 401, calculating a ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval; wherein the second amplitude interval is one of the plurality of amplitude intervals.
In an embodiment of the present invention, the second amplitude interval may be located before the first amplitude interval or after the first amplitude interval, and the first amplitude interval and the second amplitude interval may be adjacent amplitude intervals.
For example, if the first amplitude interval is the kth amplitude interval of the amplitude histogram, the second amplitude interval may be the (k-1) th amplitude interval of the amplitude histogram, and k is an integer greater than or equal to 2; or, the first amplitude interval is a kth amplitude interval of the amplitude histogram, and the second amplitude interval may be a (k + 1) th amplitude interval of the amplitude histogram, where k is an integer greater than or equal to 1.
That is, in step 401, calculating the ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval may include: and calculating the ratio of the statistical value of the kth amplitude interval in the amplitude histogram to the statistical value of the (k-1) th amplitude interval, or calculating the ratio of the statistical value of the kth amplitude interval in the amplitude histogram to the statistical value of the (k + 1) th amplitude interval.
Step 402, judging whether the amplitude histogram jumps in the first amplitude interval according to the ratio.
In this embodiment of the application, the determining whether the first amplitude interval of the amplitude histogram jumps according to the ratio may include: and judging whether the amplitude histogram jumps in the kth amplitude interval or not according to the ratio of the statistical value of the kth amplitude interval in the amplitude histogram to the statistical value of the (k-1) th amplitude interval.
Optionally, in some embodiments of the application, when the amplitude histogram is a histogram obtained by performing histogram statistics on an absolute value of an amplitude of the signal to be detected, because the amplitude histogram of the signal includes only an amplitude interval whose amplitude is greater than or equal to 0, determining, according to a ratio of a statistical value of a kth amplitude interval in the amplitude histogram to a statistical value of a (k-1) th amplitude interval, whether the amplitude histogram jumps in the kth amplitude interval may include: and if the ratio of the statistical value of the kth amplitude interval in the amplitude histogram to the statistical value of the (k-1) th amplitude interval is greater than a ratio threshold value, determining that the amplitude histogram jumps in the kth amplitude interval.
That is to say, when the ratio of the statistical value of the kth amplitude interval in the amplitude histogram to the statistical value of the (k-1) th amplitude interval is greater than the ratio threshold, it indicates that the speed of decreasing the statistical value of the amplitude histogram of the signal to be detected in the kth amplitude interval is slow, that is, a jump occurs.
It should be noted that, when the amplitude histogram is a histogram obtained by directly performing histogram statistics on the amplitudes of the signal to be detected, and the amplitudes of the signal to be detected are amplitudes represented by signed values, since the variation trend of the ratio between the first amplitude interval and the second amplitude interval of the signal to be detected is inconsistent, that is, for a signal that does not undergo clipping, the statistical values of the amplitude histogram of the signal in the amplitude interval in which the amplitudes are less than 0 are increased smoothly, and the statistical values of the amplitude intervals in which the amplitudes are greater than or equal to 0 are decreased smoothly in the amplitude interval in which the amplitudes are greater than or equal to 0, it is necessary to compare the statistical values of the amplitude interval in which the amplitudes are less than 0 and the statistical values of the amplitude interval in which the amplitudes are greater than or equal to 0 with a ratio threshold value, and determine whether the amplitude interval in which the amplitudes are less than 0 have hopped, and determine whether the amplitude interval in which the amplitudes are greater than or equal to 0 has hopped, but determine that the statistical values of the k-th amplitude interval in the amplitude histogram in which the statistical values are greater than the ratio between the statistical values of the k-1-th amplitude interval in the histogram of the histogram to be detected and the amplitude of the histogram in which the amplitude to be detected are greater than the ratio threshold value of the amplitude interval in which is not to be detected.
Specifically, when the amplitude histogram is a histogram obtained by directly performing histogram statistics on the amplitude of the signal to be detected, and the amplitude of the signal to be detected is an amplitude represented by a signed value, in step 401, when the ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval is calculated, the ratio of the statistical value of the kth amplitude interval in the amplitude histogram in the amplitude interval having an amplitude smaller than 0 to the statistical value of the (k + 1) th amplitude interval in the amplitude histogram in the amplitude interval having an amplitude greater than or equal to 0 to the statistical value of the (k-1) th amplitude interval in the amplitude histogram in the amplitude interval having an amplitude greater than or equal to 0 needs to be calculated.
Correspondingly, in the step 402, determining whether the amplitude histogram jumps in the first amplitude interval according to the ratio includes: in an amplitude interval with the amplitude smaller than 0, when the ratio of the statistical value of the kth amplitude interval in the amplitude histogram to the statistical value of the (k + 1) th amplitude interval is larger than a ratio threshold value, determining that the amplitude histogram of the signal to be detected jumps in the kth amplitude interval; and in the amplitude interval with the amplitude being greater than or equal to 0, when the ratio of the statistical value of the kth amplitude interval to the statistical value of the (k-1) th amplitude interval in the amplitude histogram is greater than a ratio threshold value, determining that the amplitude histogram of the signal to be detected jumps in the kth amplitude interval.
It should be noted that the ratio threshold may be a threshold obtained from practical experience or experiments. For example, the ratio threshold may be a ratio threshold calculated according to a ratio of a statistical value of a first amplitude interval to a statistical value of a second amplitude interval of an amplitude histogram of a signal in which clipping does not occur; moreover, the ratio threshold may be a ratio threshold corresponding to one amplitude interval, or may be a ratio threshold corresponding to each amplitude interval together, which is not limited in the present application.
And 204, carrying out clipping detection on the signal to be detected by using the clipping threshold value.
In the embodiment of the present application, the clipping threshold is determined by determining whether a transition occurs in the first amplitude interval of the amplitude histogram of the signal to be detected, instead of directly using a fixed threshold as the clipping threshold. Therefore, when the clipping threshold obtained by the method is used for clipping detection of a signal to be detected, the detection of hard clipping can be realized, and the detection of soft clipping can be realized.
Specifically, for example, if the available value range for representing the amplitude of a speech signal is-1 to 1 and the actual amplitude of a speech signal is-0.8 to 0.8, when a hard clip occurs after the amplification of the speech signal by 1.5 times, the histogram statistics of the amplitude of the speech signal is performed to obtain the amplitude histogram of the speech signal, and the ratio of the statistics of the first amplitude interval to the statistics of the second amplitude interval in the amplitude histogram is calculated, it can be determined that the amplitude histogram jumps in the last amplitude interval, and thus, any amplitude of the last amplitude interval of the amplitude histogram can be used as the clipping threshold of the speech signal, for example, the amplitude 1 in the last amplitude interval is used as the clipping threshold of the speech signal, that is, the available value ranges of the amplitudes of the speech signal are interval end points-1 and 1 as the clipping threshold of the speech signal, and the detection of the hard clip is realized.
For another example, after the voice signal is amplified by 1.5 times and hard clipping occurs, if the amplitude of the voice signal after the hard clipping occurs is further reduced to-0.8 to 0.8, the clipping threshold value will no longer be the interval end points-1 and 1 of the available value range of the amplitude of the voice signal at this time, the amplitude histogram of the voice signal is obtained by performing histogram statistics on the amplitude of the voice signal, and the ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval in the amplitude histogram is calculated, so that it can be determined that the clipping threshold value of the voice signal has been changed to-0.8 and 0.8.
Therefore, the adaptive detection of the clipping threshold value can be realized, so that when the clipping threshold value obtained by the method is used for carrying out clipping detection on the signal to be detected, the signal to be detected can be detected to have hard clipping when the signal to be detected has hard clipping, and when the signal to be detected has soft clipping, the signal to be detected can be detected to have soft clipping. The clipping threshold obtained by the method carries out clipping detection on the signal to be detected, so that the detection of hard clipping of the signal can be realized, the detection of soft clipping of the signal can be realized, the problem that whether the signal can not be detected to be subjected to soft clipping or not when the fixed threshold is used for carrying out clipping detection on the signal to be detected is effectively avoided, and the precision of signal clipping detection is improved.
Optionally, in some embodiments of the present application, the step 204 may be implemented by: detecting whether the absolute value of the amplitude of the signal to be detected is greater than or equal to the absolute value of the clipping threshold value; and if the absolute value of the amplitude values of the continuous signals to be detected is larger than or equal to the absolute value of the clipping threshold value, determining that the signals to be detected are clipped.
For example, when the absolute value of the amplitude of two consecutive signals to be detected is detected to be greater than or equal to the absolute value of the clipping threshold, it can be determined that the signal to be detected is clipped at the time point corresponding to the amplitude. That is, when the clipping detection method of the present application is used to clip the signal to be detected, not only can it be determined whether the signal to be detected is clipped, but also the position where the signal to be detected is clipped can be determined when the signal to be detected is clipped,
optionally, when the amplitude histogram is a histogram obtained by performing histogram statistics on absolute values of the amplitudes of the signal to be detected, performing clipping detection on the signal to be detected by using a clipping threshold in step 204 may also be implemented in the following manner: detecting whether the absolute value of the amplitude of the signal to be detected is greater than or equal to the clipping threshold value; and if the absolute value of the amplitudes of the continuous signals to be detected is larger than or equal to the clipping threshold value, determining that the signals to be detected are clipped.
In this embodiment, since the amplitude histogram is a histogram obtained by performing histogram statistics on the absolute values of the amplitudes of the signals to be detected, and the clipping threshold is a positive number, when performing clipping detection on the signals to be detected by using the clipping threshold, it may be determined that the signals to be detected are clipped when the absolute values of the amplitudes of a plurality of consecutive signals to be detected are detected to be greater than or equal to the clipping threshold.
In some embodiments, before the step 202, the clipping detection method may further include: and performing overlapping framing on the signal to be detected to obtain a plurality of framing signals.
Specifically, when the signal to be detected is a speech signal, since the speech signal is a non-stationary time-varying signal, the generation process thereof is closely related to the movement of the vocal organs. The state of the sounding organ changes much more slowly than the sound vibrates, so the speech signal can be considered as stationary for a short time. For example, in the range of 10 to 30ms, some physical characteristic parameters of the speech signal remain substantially unchanged. Thus, a speech signal can be divided into a plurality of short-time speech segments, and each segment signal is referred to as a framing signal.
In order to improve the clipping detection precision of the signal, in the embodiment of the present application, a plurality of framing signals may be obtained by performing overlapping framing on the signal to be detected. For example, as shown in fig. 5, the subframes 1 to 4 have overlapping contents with each other.
Accordingly, step 202 may include: and determining the amplitude histogram of the signal to be detected according to the amplitude histograms of the plurality of framing signals. That is, the amplitude histogram of each frame signal is used as the amplitude histogram of the signal to be detected.
In this embodiment, after performing overlapping framing on a signal to be detected to obtain a plurality of framing signals, histogram statistics may be performed on each framing signal to obtain an amplitude histogram corresponding to each framing signal, and a clipping threshold of each framing signal is determined according to the amplitude histogram corresponding to each framing signal, so as to perform clipping detection on each framing signal by using the clipping threshold, and finally obtain a clipping detection result of the signal to be detected.
The clipping threshold value corresponding to the signal to be detected may be different for each framing signal, and the clipping detection result of the signal to be detected obtained by the method of this embodiment is obtained by summarizing the clipping detection of each framing signal, that is, by calculating the clipping threshold value of each framing signal, and then by using the clipping threshold value of each framing signal, respectively performing clipping detection on the corresponding framing signal, so as to obtain the clipping detection result of each framing signal, and then summarizing the clipping detection result of each framing signal, so as to obtain the clipping detection result of the signal to be detected; instead of performing histogram statistics on the whole signal to be detected to obtain a clipping threshold, and performing clipping detection on the whole signal to be detected by using the clipping threshold, therefore, the method has the characteristic of high detection precision.
Optionally, in some embodiments of the present application, overlapping framing of the signal to be detected may be implemented by using a window function to perform windowing on the signal to be detected.
For example, the frame signal y (N) is obtained by windowing the signal y (N) to be detected with a window function w (N) =0.54-0.46cos (2 π nN), 0 ≦ N ≦ N i (n)=y i (n) w (n); where N is the window length and i is the sequence number of the framing signal.
In some embodiments of the present application, in order to further improve the accuracy of clipping detection of a signal, on the basis of the clipping detection method described in the foregoing embodiments, further supplementary detection may be performed on the signal to be detected. For example, as shown in fig. 6, the clipping detection method may further include: step 601 to step 602.
Step 601, judging whether the statistic value of a preset amplitude interval in the plurality of amplitude intervals is greater than a first statistic threshold value.
In this embodiment of the application, the preset amplitude interval may be an amplitude interval in which an absolute value of an amplitude is greater than an amplitude threshold.
For example, as shown in fig. 7, when a speech signal has a break or a sharp sound, the amplitude of the signal may instantaneously exceed the maximum value or the minimum value of the available value range of the signal, and therefore, the statistical value of the amplitude interval corresponding to a larger amplitude or the statistical value of the amplitude interval corresponding to a smaller amplitude (the amplitude interval having an amplitude close to 1 and-1 in fig. 7) may be higher, and therefore, it may be determined whether the signal to be detected is clipped by setting an amplitude threshold, taking the amplitude interval having an absolute value greater than the amplitude threshold as a preset amplitude interval, and determining whether the statistical value of the preset amplitude interval in the multiple amplitude intervals of the amplitude histogram is greater than a first statistical threshold.
Step 602, if the statistical value of the preset amplitude interval is greater than the first statistical threshold, it is determined that the signal to be detected is clipped.
In this embodiment of the application, when the statistical value of the preset amplitude interval is greater than the first statistical threshold, it indicates that clipping occurs in the signal to be detected, and when the statistical value of the preset amplitude interval is less than or equal to the first statistical threshold, it indicates that clipping does not occur in the signal to be detected.
The first statistical threshold may be a threshold obtained from practical experience or experiments. For example, the first statistical threshold may be a statistical value of an amplitude histogram of a signal in which clipping does not occur in a preset amplitude interval; moreover, the first statistical threshold may be a preset amplitude interval corresponding to a first statistical threshold, or each preset amplitude interval may correspond to a first statistical threshold together, which is not limited in this application.
It should be noted that, the above-mentioned clip detection method shown in fig. 6 is used as a supplementary detection for clip detection of a signal to be detected, and the terminal may continue to execute the above-mentioned clip detection method shown in fig. 6 after executing the above-mentioned clip detection method in each embodiment, or may first execute the above-mentioned clip detection method shown in fig. 6 after executing step 202, and continue to execute the method steps that are not executed in each embodiment after executing the clip detection method shown in fig. 6.
In this embodiment, the clipping detection method shown in fig. 6 is used as a supplementary detection for clipping detection of a signal to be detected, so that the signal to be detected is equivalent to twice clipping detection, and thus, the clipping detection precision of the signal can be effectively improved.
It should be noted that, because the clipping detection method shown in fig. 6 directly determines that the signal to be detected is clipped after determining that the statistical value of the preset amplitude interval is greater than the first statistical threshold, without performing the calculation of the clipping threshold, the clipping detection method shown in fig. 6 may not determine that the signal to be detected is clipped when the signal to be detected is soft-clipped.
Thus, in order to further improve the clipping detection accuracy of the signal, in some embodiments of the present application, as shown in fig. 8, the clipping detection may further include: steps 801 to 804.
Step 801, normalizing the amplitude of the signal to be detected by using the clipping threshold.
Step 802, performing histogram statistics on the amplitude of the signal to be detected after the normalization processing to obtain a normalized amplitude histogram of the signal to be detected.
Step 803, determining whether the statistical value of the preset amplitude interval of the normalized amplitude histogram is greater than a second statistical threshold.
The determination manner of the second statistical threshold may refer to the determination manner of the first statistical threshold in step 602, which is not described herein again.
Step 804, if the statistical value of the preset amplitude interval of the normalized amplitude histogram is greater than the second statistical threshold, determining that the signal to be detected is clipped.
In the embodiment of the application, the amplitude of the signal to be detected is normalized by using the clipping threshold, so that under the condition that the signal to be detected is subjected to soft clipping, the statistical value corresponding to the preset amplitude interval of the normalized amplitude histogram obtained by performing histogram statistics on the amplitude of the signal to be detected after the normalization processing is increased, and therefore, whether the signal to be detected is subjected to clipping or not can be determined by judging whether the statistical value of the preset amplitude interval of the normalized amplitude histogram is greater than the second statistical threshold, that is, when the signal to be detected is subjected to soft clipping, the signal to be detected is determined to be subjected to clipping.
It should be noted that for simplicity of description, the above-mentioned method embodiments are described as a series of combinations of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders according to the present invention.
Fig. 9 shows a schematic structural diagram of a clipping detection apparatus 900 for a signal according to an embodiment of the present application, which includes an acquisition unit 901, a first determination unit 902, a second determination unit 903, and a detection unit 904.
An acquiring unit 901, configured to acquire a signal to be detected;
a first determining unit 902, configured to determine an amplitude histogram of the signal to be detected, where the amplitude histogram includes a plurality of amplitude intervals;
a second determining unit 903, configured to determine, if a first amplitude interval of the amplitude histogram jumps, an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; wherein the first amplitude interval is one of the plurality of amplitude intervals;
a detection unit 904, configured to perform clipping detection on the signal to be detected by using the clipping threshold.
In some embodiments of the application, the second determining unit 903 may be further configured to: after the amplitude histogram of the signal to be detected is determined, calculating the ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval; judging whether the amplitude histogram jumps in the first amplitude interval or not according to the ratio; wherein the second amplitude interval is one of the amplitude intervals.
In some embodiments of the present application, the first determining unit 902 may be further configured to: and carrying out histogram statistics on the absolute value of the amplitude of the signal to be detected to obtain an amplitude histogram of the signal to be detected.
In some embodiments of the present application, the first determining unit 902 may be further configured to: before determining the amplitude histogram of the signal to be detected, performing overlapping framing on the signal to be detected to obtain a plurality of framed signals; and determining the amplitude histogram of the signal to be detected according to the amplitude histograms of the plurality of framing signals.
In some embodiments of the present application, the detecting unit 904 may further be configured to: detecting whether the absolute value of the amplitude of the signal to be detected is greater than or equal to the absolute value of the clipping threshold value; and if the absolute value of the amplitude values of the continuous signals to be detected is larger than or equal to the absolute value of the clipping threshold value, determining that the signals to be detected are clipped.
In some embodiments of the present application, the detecting unit 904 may further be configured to: judging whether the statistic value of a preset amplitude interval in the amplitude intervals is larger than a first statistic threshold value or not; and if the statistic value of the preset amplitude interval is greater than the first statistic threshold value, determining that the signal to be detected is clipped.
In some embodiments of the present application, the detecting unit 904 may further be configured to: normalizing the amplitude of the signal to be detected by using the clipping threshold; performing histogram statistics on the amplitude of the signal to be detected after normalization processing to obtain a normalized amplitude histogram of the signal to be detected; judging whether the statistic value of the preset amplitude interval of the normalized amplitude histogram is larger than a second statistic threshold value or not; and if the statistical value of the preset amplitude interval of the normalized amplitude histogram is greater than the second statistical threshold, determining that the signal to be detected is clipped.
For convenience and simplicity of description, the specific working process of the above-described clipping detection apparatus 900 for a signal may refer to the corresponding process of the method described in fig. 1 to fig. 8, and is not described again here.
As shown in fig. 10, the present application provides a terminal for implementing the above-mentioned clipping detection method for a signal, and the terminal may include: a processor 11, a memory 12, one or more input devices 13 (only one shown in fig. 1), and one or more output devices 14 (only one shown in fig. 10). The processor 11, memory 12, input device 13 and output device 14 are connected by a bus 15.
It should be understood that, in the embodiment of the present Application, the Processor 11 may be a Central Processing Unit (CPU), and the Processor may also be other general-purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 13 may include a virtual keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 14 may include a display, a speaker, etc.
Memory 12 may include both read-only memory and random access memory and provides instructions and data to processor 11. Some or all of memory 12 may also include non-volatile random access memory. For example, the memory 12 may also store device type information.
The memory 12 stores a computer program that is executable by the processor 11, and the computer program is, for example, a program of a signal clip detection method. The processor 11 implements steps in an embodiment of the method for clipping detection of a signal, such as steps 201 to 204 shown in fig. 2, when executing the computer program. Alternatively, the processor 11 may implement the functions of the units in the above device embodiment, such as the functions of the acquiring unit 901 to the detecting unit 904 shown in fig. 9, when executing the above computer program.
The computer program may be divided into one or more modules/units, which are stored in the memory 12 and executed by the processor 11 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal performing the clipping detection of the signal. For example, the computer program may be divided into an acquisition unit, a first determination unit, a second determination unit, and a detection unit, and each unit may specifically function as follows:
the acquisition unit is used for acquiring a signal to be detected;
the first determining unit is used for determining an amplitude histogram of the signal to be detected, and the amplitude histogram comprises a plurality of amplitude intervals;
a second determining unit, configured to determine, if a first amplitude interval of the amplitude histogram jumps, an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected;
and the detection unit is used for carrying out clipping detection on the signal to be detected by utilizing the clipping threshold value.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps of the method for detecting clipping of a signal in the above embodiments.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal are merely illustrative, and for example, the division of the above-described modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by the present application, and the computer program can also be executed by a computer program to instruct related hardware, where the computer program can be stored in a computer readable storage medium, and when the computer program is executed by a processor, the steps of the various method embodiments described above can be realized. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, and the like. It should be noted that the computer readable medium described above may include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A method of clip detection of a signal, the method comprising:
acquiring a signal to be detected;
determining an amplitude histogram of the signal to be detected, wherein the amplitude histogram comprises a plurality of amplitude intervals;
if a first amplitude interval of the amplitude histogram jumps, determining an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; wherein the first amplitude interval is one of the plurality of amplitude intervals;
carrying out clipping detection on the signal to be detected by using the clipping threshold value;
after the determining the histogram of amplitudes of the signal to be detected, the clipping detection method comprises:
calculating the ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval; wherein the second amplitude interval is one of the plurality of amplitude intervals;
and judging whether the first amplitude interval of the amplitude histogram jumps or not according to the ratio.
2. The clipping detection method of claim 1, wherein the determining a histogram of magnitudes of the signal to be detected comprises:
and carrying out histogram statistics on the absolute value of the amplitude of the signal to be detected to obtain an amplitude histogram of the signal to be detected.
3. The clipping detection method of claim 1 or 2, wherein prior to said determining the histogram of magnitudes of the signal to be detected, the clipping detection method comprises:
overlapping and framing the signal to be detected to obtain a plurality of framing signals;
the determining the amplitude histogram of the signal to be detected includes:
and determining the amplitude histogram of the signal to be detected according to the amplitude histograms of the plurality of framing signals.
4. The clipping detection method of claim 1 or 2, wherein the clipping detection of the signal to be detected using the clipping threshold comprises:
detecting whether the absolute value of the amplitude of the signal to be detected is greater than or equal to the absolute value of the clipping threshold;
and if the absolute value of the amplitudes of the continuous signals to be detected is larger than or equal to the absolute value of the clipping threshold value, determining that the signals to be detected are clipped.
5. The clip detection method of claim 1 or 2, characterized in that the clip detection method further comprises:
judging whether the statistic value of a preset amplitude interval in the multiple amplitude intervals is larger than a first statistic threshold value or not;
and if the statistical value of the preset amplitude interval is larger than the first statistical threshold, determining that the signal to be detected is clipped.
6. The clip detection method of claim 1 or 2, characterized in that the clip detection method further comprises:
normalizing the amplitude of the signal to be detected by using the clipping threshold;
performing histogram statistics on the amplitude of the signal to be detected after normalization processing to obtain a normalized amplitude histogram of the signal to be detected;
judging whether the statistic value of the preset amplitude interval of the normalized amplitude histogram is larger than a second statistic threshold value or not;
and if the statistical value of the preset amplitude interval of the normalized amplitude histogram is greater than the second statistical threshold, determining that the signal to be detected is clipped.
7. A clip detection apparatus for a signal, the clip detection apparatus for a signal comprising:
the acquisition unit is used for acquiring a signal to be detected;
the first determining unit is used for determining an amplitude histogram of the signal to be detected, and the amplitude histogram comprises a plurality of amplitude intervals;
a second determining unit, configured to determine, if a first amplitude interval of the amplitude histogram jumps, an amplitude corresponding to the first amplitude interval as a clipping threshold of the signal to be detected; wherein the first amplitude interval is one of the plurality of amplitude intervals;
the detection unit is used for carrying out clipping detection on the signal to be detected by utilizing the clipping threshold value;
the second determining unit is further configured to:
after the amplitude histogram of the signal to be detected is determined, calculating the ratio of the statistical value of the first amplitude interval to the statistical value of the second amplitude interval; wherein the second amplitude interval is one of the plurality of amplitude intervals;
and judging whether the first amplitude interval of the amplitude histogram jumps or not according to the ratio.
8. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202011490348.5A 2020-12-16 2020-12-16 Method, device, terminal and computer readable storage medium for clipping detection of signal Active CN112671376B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011490348.5A CN112671376B (en) 2020-12-16 2020-12-16 Method, device, terminal and computer readable storage medium for clipping detection of signal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011490348.5A CN112671376B (en) 2020-12-16 2020-12-16 Method, device, terminal and computer readable storage medium for clipping detection of signal

Publications (2)

Publication Number Publication Date
CN112671376A CN112671376A (en) 2021-04-16
CN112671376B true CN112671376B (en) 2022-12-06

Family

ID=75404254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011490348.5A Active CN112671376B (en) 2020-12-16 2020-12-16 Method, device, terminal and computer readable storage medium for clipping detection of signal

Country Status (1)

Country Link
CN (1) CN112671376B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03126377A (en) * 1989-10-12 1991-05-29 Matsushita Electric Ind Co Ltd Gradation correction device
TW537884B (en) * 2001-05-28 2003-06-21 Health Devices Pte Ltd Heart diagnosis system
JP2015065505A (en) * 2013-09-24 2015-04-09 住友電気工業株式会社 Signal amplitude detection circuit
WO2018184178A1 (en) * 2017-04-06 2018-10-11 Oppo广东移动通信有限公司 Charging system, charging method and power adapter
CN108988832A (en) * 2017-06-02 2018-12-11 上海诺基亚贝尔股份有限公司 For detecting and the method for the associated delay of electronic device and corresponding electronic device
CN109120245A (en) * 2017-06-26 2019-01-01 谷歌有限责任公司 Soft slicing detection based on mixed model
CN110179451A (en) * 2019-06-10 2019-08-30 深圳市是源医学科技有限公司 Electrocardiosignal quality determining method, device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5239594B2 (en) * 2008-07-30 2013-07-17 富士通株式会社 Clip detection apparatus and method
US8818283B2 (en) * 2008-08-19 2014-08-26 Shared Spectrum Company Method and system for dynamic spectrum access using specialty detectors and improved networking
US9426592B2 (en) * 2013-02-14 2016-08-23 Google Inc. Audio clipping detection

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03126377A (en) * 1989-10-12 1991-05-29 Matsushita Electric Ind Co Ltd Gradation correction device
TW537884B (en) * 2001-05-28 2003-06-21 Health Devices Pte Ltd Heart diagnosis system
JP2015065505A (en) * 2013-09-24 2015-04-09 住友電気工業株式会社 Signal amplitude detection circuit
WO2018184178A1 (en) * 2017-04-06 2018-10-11 Oppo广东移动通信有限公司 Charging system, charging method and power adapter
CN108988832A (en) * 2017-06-02 2018-12-11 上海诺基亚贝尔股份有限公司 For detecting and the method for the associated delay of electronic device and corresponding electronic device
CN109120245A (en) * 2017-06-26 2019-01-01 谷歌有限责任公司 Soft slicing detection based on mixed model
CN110179451A (en) * 2019-06-10 2019-08-30 深圳市是源医学科技有限公司 Electrocardiosignal quality determining method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112671376A (en) 2021-04-16

Similar Documents

Publication Publication Date Title
CN107731223B (en) Voice activity detection method, related device and equipment
CN103903612A (en) Method for performing real-time digital speech recognition
CN105118522B (en) Noise detection method and device
CN1210608A (en) Noisy speech parameter enhancement method and apparatus
CN110088835B (en) Blind source separation using similarity measures
CN111028845A (en) Multi-audio recognition method, device, equipment and readable storage medium
CN110556125B (en) Feature extraction method and device based on voice signal and computer storage medium
CN110111811B (en) Audio signal detection method, device and storage medium
EP3015996B1 (en) Filter coefficient group computation device and filter coefficient group computation method
CN111696580A (en) Voice detection method and device, electronic equipment and storage medium
CN110503973B (en) Audio signal transient noise suppression method, system and storage medium
CN111868823A (en) Sound source separation method, device and equipment
CN107564512B (en) Voice activity detection method and device
CN112671376B (en) Method, device, terminal and computer readable storage medium for clipping detection of signal
CN106816157A (en) Audio recognition method and device
CN112599148A (en) Voice recognition method and device
WO2017128910A1 (en) Method, apparatus and electronic device for determining speech presence probability
CN113496706A (en) Audio processing method and device, electronic equipment and storage medium
CN113724694B (en) Voice conversion model training method and device, electronic equipment and storage medium
CN111028860B (en) Audio data processing method and device, computer equipment and storage medium
CN111596261B (en) Sound source positioning method and device
CN109274826B (en) Voice playing mode switching method and device, terminal and computer readable storage medium
CN113889086A (en) Training method of voice recognition model, voice recognition method and related device
CN105513587B (en) MFCC extraction method and device
CN113316075A (en) Howling detection method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant