Low-pass filtering method, low-pass filtering system and low-pass filter
The voice signal is decomposed through the principal component analysis algorithm, the importance and frequency range of signal components are determined, and the cutoff frequency of the low-pass filter is dynamically adjusted, which solves the problem that the cutoff frequency cannot be adjusted in time and accurately in the prior art, and efficient denoising of the voice signal is achieved, and the call quality is improved.
Patent Information
- Application Number
- CN202510696285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-28
Smart Images

Figure CN120220710A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of speech signal enhancement, and particularly relates to a low-pass filtering method, system and low-pass filter. Background Art
[0002] A low-pass filter is an electronic circuit that allows low-frequency signals to pass through while attenuating high-frequency signals, and is widely used in signal processing, communication systems and audio equipment. Its core function is to suppress high-frequency noise through specific frequency response characteristics and retain useful low-frequency information. Low-pass filters are generally divided into passive low-pass filters and active low-pass filters. Among them, the cut-off frequency of the passive low-pass filter is fixed and cannot adapt to environmental changes dynamically, and its filtering effect is not good in a complex noise environment. The speech signal may be attenuated after passing through the passive low-pass filter. The active low-pass filter can dynamically change the cut-off frequency by adjusting the parameters of the feedback network (such as variable resistors), enhance the high-frequency suppression ability, and at the same time compensate for the attenuation of the speech signal. In the field of audio processing, the technology of dynamically adjusting the cut-off frequency of the active low-pass filter is the key to improving the noise suppression effect.
[0003] In the existing methods, the cut-off frequency of the active low-pass filter is adjusted based on the threshold method of signal energy, spectrum analysis method or fixed rule adjustment method. However, in actual situations, there is an overlap between the user's speech and background noise, and the background noise appears randomly. In the existing methods, it is impossible to accurately distinguish the frequency distribution differences between the user's speech and background noise in real time, and thus it is impossible to adjust the cut-off frequency of the active low-pass filter in a timely and accurate manner, which is not conducive to accurately removing noise from the call speech signal and affects the call quality. Summary of the Invention
[0004] In order to solve the technical problem that the cut-off frequency of the active low-pass filter cannot be adjusted in a timely and accurate manner in the existing methods, the purpose of the present invention is to provide a low-pass filtering method, system and low-pass filter, and the specific technical solutions adopted are as follows: In a first aspect, an embodiment of the present invention provides a low-pass filtering method, which includes the following steps: Obtain the speech signal in the current time period; Decompose the speech signal into signal components by using the principal component analysis algorithm and obtain the eigenvalues of each signal component; according to the signal distribution situation and eigenvalues of each signal component, obtain the importance degree of each signal component; Obtain the target signal component based on the importance level, and determine the target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component; take the maximum frequency in the target frequency range as the segmentation frequency, and obtain the cut-off frequency adjustment coefficient at the current moment of the speech signal according to the energy distribution difference in the non-target frequency range between both sides of the segmentation frequency in the spectrogram corresponding to each signal component and the energy distribution in the target frequency range. Obtain the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient.
[0005] Furthermore, the method for obtaining the importance level is as follows: For any signal component, divide the signal component into local signal segments based on the fluctuation of the signal in the signal component. Obtain the volume stability degree of the signal component according to the number of local signal segments, the duration and amplitude fluctuation of each local signal segment. Obtain the volume gradual change degree of the signal component according to the change of the signal in any two adjacent local signal segments. Take the normalized result of the product of the eigenvalue, volume stability degree and volume gradual change degree of the signal component as the importance level of the signal component.
[0006] Furthermore, the method for obtaining the local signal segment is as follows: Take the amplitude difference between each maximum point and its previous adjacent minimum point in the signal component as the instantaneous volume of each maximum point. Arrange the instantaneous volumes in the time order corresponding to the maximum points to obtain the instantaneous volume sequence corresponding to the signal component. Divide the instantaneous volume sequence through the adaptive piecewise constant approximation algorithm to obtain local volume segments, and take the maximum points corresponding to the last instantaneous volume of each local volume segment as the segmentation points of the signal component. Divide the signal component into local signal segments through the segmentation points.
[0007] Furthermore, the method for obtaining the volume stability degree is as follows: For any local signal segment, take the difference between the maximum amplitude and the minimum amplitude in the local signal segment as the volume change value of the local signal segment. Take the variance of the volume change values of all local signal segments in the signal component as the first stability analysis value of the signal component. Obtain the duration of each local signal segment as the local duration, and take the ratio of the maximum local duration to the corresponding duration of the current time period as the second stability analysis value of the signal component. Obtain the volume stability degree of the signal component according to the number of local signal segments, the first stability analysis value, and the second stability analysis value of the signal component; wherein, both the number of local signal segments and the first stability analysis value are negatively correlated with the volume stability degree, and the second stability analysis value is positively correlated with the volume stability degree.
[0008] Further, the method for obtaining the volume gradual change degree is as follows: For any two adjacent local signal segments in the signal component, merge the two local signal segments into a reference signal segment, fit the elements in the instantaneous volume sequence corresponding to the reference signal segment into a curve, and use it as the target curve; Use the result of negatively correlating and normalizing the fitting error of the target curve as the reference weight of the reference signal segment; Use the result of negatively correlating the mean value of the absolute values of the tangent slopes of all data points on the target curve as the reference gradual change degree of the reference signal segment; Use the product of the reference weight and the reference gradual change degree as the local volume gradual change degree of the reference signal segment; Use the mean value of the local volume gradual change degrees of all reference signal segments of the signal component as the volume gradual change degree of the signal component.
[0009] Further, the method for obtaining the target signal component based on the importance degree and determining the target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component is as follows: Use the signal component corresponding to the maximum importance degree as the target signal component; Obtain the spectrogram corresponding to the target signal component through short-time Fourier transform, and obtain the spectral curve by curve fitting the spectrogram through the least squares method; Obtain the peaks and valleys in the spectral curve through the peak-valley detection algorithm, and regard the region between two adjacent valleys as the peak region; obtain the area of each peak region as the characteristic area; When the characteristic area is greater than the preset area threshold, regard the frequency range corresponding to the corresponding peak region as the target frequency range.
[0010] Further, the method for obtaining the cut-off frequency adjustment coefficient is as follows: For any signal component, obtain the area of the region corresponding to the spectral curve segment after the segmentation frequency in the spectral curve corresponding to the signal component as the high-frequency interference degree of the signal component; Obtain the area of the regions corresponding to all spectral curve segments before the segmentation frequency and not within the target frequency range in the spectral curve corresponding to the signal component as the low-frequency interference degree of the signal component; Obtain the reference adjustment coefficient of the signal component based on the difference between the low-frequency interference degree and the high-frequency interference degree; Obtain the ratio of the area of the region corresponding to all the spectral curve segments within the target frequency range in the spectral curve corresponding to the signal component to the area of the region corresponding to the spectral curve corresponding to the signal component, as the effectiveness degree of the signal component; Take the product of the effectiveness degree and the importance degree of the signal component as the attention degree of the signal component; Take the ratio of the attention degree of the signal component to the cumulative result of the attention degrees of all signal components as the adjustment weight of the signal component; Take the product of the adjustment weight and the reference adjustment coefficient as the true participation adjustment coefficient of the signal component; Take the sum result of the true participation adjustment coefficients of all signal components as the cut-off frequency adjustment coefficient of the speech signal at the current moment.
[0011] Further, the method for obtaining the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient is: Take the product of the initial cut-off frequency, the preset frequency adjustment index, and the cut-off frequency adjustment coefficient as the cut-off frequency adjustment value of the speech signal at the current moment; Take the sum result of the initial cut-off frequency and the cut-off frequency adjustment value as the cut-off frequency at the current moment.
[0012] In a second aspect, another embodiment of the present invention provides a low-pass filtering system, which includes: A speech signal acquisition module, configured to acquire the speech signal in the current time period; An importance degree acquisition module, configured to decompose the speech signal into signal components by using the principal component analysis algorithm and obtain the eigenvalues of each signal component; and obtain the importance degree of each signal component according to the signal distribution situation and the eigenvalues of each signal component; A cut-off frequency adjustment coefficient acquisition module, configured to obtain the target signal component based on the importance degree, determine the target frequency range according to the energy distribution situation in the spectrogram corresponding to the target signal component; take the maximum frequency in the target frequency range as the segmentation frequency, and obtain the cut-off frequency adjustment coefficient of the speech signal at the current moment according to the energy distribution difference between the non-target frequency ranges on both sides of the segmentation frequency in the spectrogram corresponding to each signal component and the energy distribution situation within the target frequency range; A cut-off frequency acquisition module, configured to obtain the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient.
[0013] In a third aspect, another embodiment of the present invention provides a low-pass filter, including: a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above methods are implemented.
[0014] The present invention has the following beneficial effects: First, the present invention decomposes the speech signal into signal components through the principal component analysis algorithm and obtains the eigenvalues of each signal component, which is beneficial to accurately analyzing the signal situation corresponding to the user's speech subsequently; then, according to the signal distribution and eigenvalues of each signal component, the importance of each signal component is obtained, accurately reflecting the possibility that each signal component is the user's speech component; further, based on the importance, the target signal component is obtained, accurately determining the main signal component of the user's speech corresponding to the speech signal; further, according to the energy distribution in the spectrogram corresponding to the target signal component, the target frequency range is determined, accurately determining the frequency range corresponding to the user's speech, which is beneficial to accurately obtaining the cut-off frequency corresponding to the speech signal subsequently; in order to accurately analyze the interference situation of each signal component, the maximum frequency in the target frequency range is used as the segmentation frequency, so as to accurately analyze whether each signal component is affected by low-frequency interference or high-frequency interference, which is beneficial to accurately analyzing the adjustment situation of the cut-off frequency at the current moment; then, according to the energy distribution difference in the non-target frequency range between both sides of the segmentation frequency in the spectrogram corresponding to each signal component and the energy distribution in the target frequency range, the cut-off frequency adjustment coefficient of the speech signal at the current moment is obtained, accurately reflecting the adjustment degree of the cut-off frequency of the low-pass filter at the current moment; further, based on the cut-off frequency adjustment coefficient, the cut-off frequency at the current moment is accurately obtained, so as to perform real-time and accurate filtering processing on the speech signal, effectively improving the quality of the speech signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0016] Figure 1 It is a schematic flowchart of a low-pass filtering method provided by an embodiment of the present invention; Figure 2 It is a flowchart of a method for obtaining the importance provided by an embodiment of the present invention; Figure 3 It is a spectrogram of a signal component after short-time Fourier transform provided by an embodiment of the present invention; Figure 4 A structural diagram of a low-pass filtering system provided by an embodiment of the present invention; Figure 5 A schematic diagram of a computer device provided by an embodiment of the present invention. Specific implementation manners
[0017] In order to further elaborate on the technical means and effects adopted by the present invention to achieve the intended invention purpose, the following combines the accompanying drawings and preferred embodiments to detail the specific implementation manners, structures, features and effects of a low-pass filtering method, system and low-pass filter proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs.
[0019] The following specifically describes the specific solutions of a low-pass filtering method, system and low-pass filter provided by the present invention with reference to the accompanying drawings.
[0020] Embodiment 1: The specific scenario of this embodiment is as follows: In a noisy environment, the sound sources interfering with the call of an audio device for calls are complex, such as noisy crowds, passing vehicles, and commercial audio advertisements. When the cut-off frequency of the low-pass filter is not adjusted accurately and in a timely manner, the interference sound filtering effect of the low-pass filter may be poor, resulting in unclear call sounds. Therefore, in this embodiment, the voice signal in the current time period is obtained, and by analyzing the voice signal in the current time period, the cut-off frequency of the voice signal at the current moment is accurately obtained, and then the cut-off frequency of the low-pass filter is adjusted dynamically, accurately and in a timely manner, so as to ensure that the interference noise is filtered out to the greatest extent and effectively improve the clarity of the call voice.
[0021] The present invention proposes a low-pass filtering method. Please refer to Figure 1 , which shows a schematic flowchart of a low-pass filtering method provided by an embodiment of the present invention. The method includes the following steps: Step S1: Obtain the voice signal in the current time period.
[0022] Specifically, in this embodiment, the voice signal is collected in real time through the microphone of the communication device. Herein, the sampling frequency of the voice signal is set to 8 kHz in this embodiment, and the implementer can set the sampling frequency of the voice signal according to the actual situation, which is not limited herein. In order to obtain the cut-off frequency of the low-pass filter at the current moment in real time, furthermore, this embodiment obtains the voice signal in the current time period for analysis. The duration of the current time period is set to 3 minutes in this embodiment, and the implementer can set the size of the current time period according to the actual situation, which is not limited herein. It should be noted that the end moment of the current time period must be the current moment.
[0023] In addition, in this embodiment, the voice signal in the first 3 minutes before the current moment is filtered through the low-pass filter using the set initial cut-off frequency. The initial cut-off frequency is set to 3400 Hz in this embodiment, and the implementer can set the size of the initial cut-off frequency according to the actual situation, which is not limited herein.
[0024] Step S2: Decompose the voice signal into signal components through the principal component analysis algorithm and obtain the eigenvalues of each signal component; according to the signal distribution and eigenvalues of each signal component, obtain the importance degree of each signal component.
[0025] Specifically, the voice signal collected by the microphone in a noisy environment is composed of the user's voice overlapping with various interference sounds. It is known that the length, thickness and vocal tract shape of a person's vocal cords are fixed, and at the same time, the voice characteristics, pronunciation habits and skills are also consistent. Therefore, the voice of the same person will remain relatively stable at different times; while the interference sound is chaotic and disorderly, and will change continuously with the movement of the user or the movement and transformation of the sound interference source (passers-by, vehicles, etc.). Therefore, in this embodiment, first, the voice signal is decomposed through the principal component analysis algorithm to obtain each signal component, and then each information component is analyzed to distinguish the user voice component from the interference sound component, so as to accurately adjust the cut-off frequency of the low-pass filter subsequently; among them, the principal component analysis algorithm is a well-known technology and will not be elaborated herein. It is known that the eigenvalues of each signal component can be obtained through the principal component analysis algorithm. Among them, the larger the eigenvalue, the more likely the corresponding signal component is the main component of the voice signal, that is, the more likely it is the user voice component. At the same time, when the signal distribution of a certain signal component is more stable, it also indicates that the signal component is more likely to be the user voice component. Furthermore, in this embodiment, according to the signal distribution and eigenvalues of each signal component, the importance degree of each signal component is obtained. The greater the importance degree, the more likely the corresponding signal component is the user voice component.
[0026] Preferably, in a feasible implementation manner of this embodiment, for the method of obtaining the importance degree, please refer to Figure 2 , which shows a flowchart of a method for obtaining the importance degree provided in this embodiment. The method includes the following steps: Step S201: For any signal component, divide the signal component into local signal segments based on the fluctuation of the signal in the signal component.
[0027] It is known that the user voice component is relatively stable, while the signal amplitude corresponding to the interference sound component fluctuates greatly. In order to accurately analyze the possibility that each signal component is a user voice component, each signal component is first divided into local signal segments based on the fluctuation of the signal in each signal component. Among them, the volume in the same local signal segment is similar.
[0028] In a feasible implementation manner of this embodiment, the method for obtaining local signal segments is as follows: For any signal component, first obtain each maximum point and each minimum point in the signal component through the derivative method, and then obtain the amplitude difference between each maximum point in the signal component and its previous adjacent minimum point as the instantaneous volume of each maximum point; arrange the instantaneous volumes in the time order of the corresponding maximum points to obtain the instantaneous volume sequence corresponding to the signal component; divide the instantaneous volume sequence through the adaptive piecewise constant approximation algorithm to obtain local volume segments; among them, the instantaneous volumes in the same local volume segment are similar. In order to divide the continuous signals with similar volumes into the same signal segment, then take the maximum point corresponding to the last instantaneous volume of each local volume segment as the segmentation point of the signal component; finally, divide the signal component into local signal segments through the segmentation point. Among them, the derivative method and the adaptive piecewise constant approximation algorithm are both well-known technologies and will not be elaborated here.
[0029] So far, the local signal segments of each signal component are obtained.
[0030] Step S202: Obtain the volume stability degree of the signal component according to the number of local signal segments, the duration of each local signal segment, and the amplitude fluctuation situation.
[0031] When the number of local signal segments divided for a certain signal component is less, it indirectly indicates that the signal component is more stable; when the duration of the local signal segments corresponding to the signal component is larger, it indirectly reflects that the signal component is more stable; when the signal fluctuation degrees in all local signal segments of the signal component are more similar, it also indicates that the signal component is more stable. Therefore, in this embodiment, the volume stability degree of the signal component is obtained according to the number of local signal segments, the duration of each local signal segment, and the amplitude fluctuation situation. The greater the volume stability degree, the more likely the corresponding signal component is a user voice component.
[0032] In a feasible implementation manner of this embodiment, the method for obtaining the volume stability degree is as follows: for any local signal segment, the difference between the maximum amplitude and the minimum amplitude in the local signal segment is used as the volume change value of the local signal segment; for any signal component, the variance of the volume change values of all local signal segments in the signal component is used as the first stability analysis value of the signal component; the smaller the first stability analysis value, the more stable the volume corresponding to the signal component; the duration of each local signal segment is obtained as the local duration, and when the maximum local duration is larger, it indicates that the signal component is more stable. To accurately analyze the stability degree of the signal component, further, the ratio of the maximum local duration to the corresponding duration of the current time period is used as the second stability analysis value of the signal component; the larger the second stability analysis value, the more stable the signal component; it is known that when the number of local signal segments of the signal component is smaller, it indicates that the signal component is more stable. Furthermore, based on the number of local signal segments, the first stability analysis value, and the second stability analysis value of the signal component, the volume stability degree of the signal component is obtained; among them, both the number of local signal segments and the first stability analysis value are negatively correlated with the volume stability degree, and the second stability analysis value is positively correlated with the volume stability degree.
[0033] Among them, the calculation formula for the volume stability degree is: ; in the formula, is the volume stability degree of the i-th signal component; is the number of local signal segments of the i-th signal component; is the first stability analysis value of the i-th signal component; is the first preset constant, greater than 0; is the maximum local duration of the local signal segments of the i-th signal component; T is the corresponding duration of the current time period; is the second stability analysis value of the i-th signal component.
[0034] This embodiment sets to 1 to avoid a zero denominator. The implementer can set the size of according to the actual situation, which is not limited here.
[0035] Thus, the volume stability degree of each signal component is obtained.
[0036] Step S203: According to the change situation of the signal in any two adjacent local signal segments, obtain the volume gradual change degree of the signal component.
[0037] When a user enters a noisy environment from a quiet one, they will subconsciously increase their speaking volume to ensure that their voice can be heard. This behavior is known as the "Lorenz effect" in psychology and acoustics. Therefore, when the acoustic environment changes, the volume of the user's voice may become unstable. However, when the user first enters a noisy environment from a quiet one, they do not immediately increase their volume significantly. Instead, they gradually adapt to the new noise level and gradually increase their volume until they believe their voice can be clearly heard by others. Therefore, it can be inferred that the volume of the user's voice is stable or gradually changing. The volume change of interfering sounds is disorderly, and there are instantaneous increases and decreases in volume due to the sudden appearance and disappearance of different interfering sound sources. Therefore, for any signal component, in this embodiment, according to the change of the signal in any two adjacent local signal segments of the signal component, the volume gradual change degree of the signal component is obtained. The greater the volume gradual change degree, the more stable the change of the signal component, and the more likely the signal component is the user voice component.
[0038] In a feasible implementation manner of this embodiment, the method for obtaining the volume gradual change degree is as follows: for any two adjacent local signal segments in any signal component, the two local signal segments are combined into a reference signal segment. For example, if the local signal segments of the signal component are successively {local signal segment 1, local signal segment 2, local signal segment 3, local signal segment 4}, the corresponding reference signal segments are respectively: {local signal segment 1, local signal segment 2}, {local signal segment 2, local signal segment 3}, and {local signal segment 3, local signal segment 4}. According to the method for obtaining the instantaneous volume sequence corresponding to the signal component in step S201, the instantaneous volume sequence corresponding to the reference signal segment is obtained, and then the elements in the instantaneous volume sequence corresponding to the reference signal segment are fitted into a curve by the least squares method as the target curve; among them, the least squares method is a well-known technology and will not be elaborated here. When the fitting error of the target curve is smaller, it indicates that the characteristics reflected by the target curve are more accurate and more meaningful as a reference. Furthermore, the result of negative correlation and normalization of the fitting error of the target curve is used as the reference weight of the reference signal segment; in order to analyze the change of the signal in the reference signal segment, furthermore, the result of negative correlation of the average value of the absolute values of the tangent slopes of all data points on the target curve is used as the reference gradual change degree of the reference signal segment; the greater the reference gradual change degree, the more stable the signal change in the reference signal segment; In order to accurately obtain the volume change situation corresponding to the reference signal segment, furthermore, the product of the reference weight and the reference gradual change degree is used as the local volume gradual change degree of the reference signal segment; in order to comprehensively analyze the change of the signal in the signal component, furthermore, the average value of the local volume gradual change degrees of all reference signal segments of the signal component is used as the volume gradual change degree of the signal component.
[0039] Among them, the calculation formula for the volume gradual change degree is: ; in the formula, is the volume fade degree of the i-th signal component; is the number of reference signal segments of the i-th signal component; is the fitting error of the target curve corresponding to the m-th reference signal segment of the i-th signal component; is the reference weight of the m-th reference signal segment of the i-th signal component; exp is the exponential function with the natural constant as the base; is the mean value of the absolute values of the tangent slopes of all data points on the target curve corresponding to the m-th reference signal segment of the i-th signal component; is the absolute value function; is the second preset constant, greater than 0; is the reference fade degree of the m-th reference signal segment of the i-th signal component; is the local volume fade degree of the m-th reference signal segment of the i-th signal component.
[0040] This embodiment sets to 1 to avoid the denominator being 0. The implementer can set the size of according to the actual situation, and no limitation is made here.
[0041] Thus, the volume fade degree of each signal component is obtained.
[0042] Step S204: Use the normalized result of the product of the eigenvalue, volume stability degree, and volume fade degree of the signal component as the importance degree of the signal component.
[0043] When the eigenvalue, volume stability degree, and volume fade degree of a certain signal component are all larger, it indicates that the signal component may also be the user voice component. Therefore, in this embodiment, the normalized result of the product of the eigenvalue, volume stability degree, and volume fade degree of the signal component is used as the importance degree of the signal component. In this embodiment, the norm normalization function is used to normalize the product of the eigenvalue, volume stability degree, and volume fade degree of the signal component.
[0044] Thus, the importance degree of each signal component is obtained.
[0045] Step S3: Obtain the target signal component based on the importance degree, and determine the target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component; Use the largest frequency in the target frequency range as the segmentation frequency, and obtain the cut-off frequency adjustment coefficient of the speech signal at the current moment according to the energy distribution difference in the non-target frequency range between both sides of the segmentation frequency and the energy distribution in the target frequency range in the spectrogram corresponding to each signal component.
[0046] The greater the known importance, the more likely the corresponding signal component is the user voice component. Thus, in this embodiment, the signal component corresponding to the greatest importance is taken as the target signal component, i.e., the user voice component. It should be noted that if there are at least two signal components corresponding to the greatest importance, any one of them can be selected as the target signal component. Among them, the target signal component contains the most user voice signals and the least interference sound information. The energy distribution in the known spectrogram reflects the relative intensity of different frequency components in the voice signal, and in the target signal component, the user voice is the main component. Thus, first, the target frequency range is determined according to the energy distribution in the spectrogram corresponding to the target signal component. Among them, the target frequency range is the frequency range corresponding to the user voice in the target signal component.
[0047] The known principal component analysis algorithm is a dimensionality reduction technique that can convert multi-dimensional data into a few principal components, and all the principal components can capture the main change directions of the data. Therefore, it is usually not enough to reflect all the user voice signals only through the target signal component, as a large amount of information will be lost, resulting in poor voice signal quality, because there will also be some user voice information in other signal components besides the target signal component. Therefore, all signal components need to be analyzed to accurately adjust the cut-off frequency of the voice signal subsequently. Considering that the region where the energy is relatively concentrated in the spectrogram usually corresponds to the formant, and it is known that the vocal cord length and vocal tract shape of the same person determine the position and intensity of its formants. Therefore, the spectral characteristics of the formants in the spectrograms corresponding to different signal components will show consistency, i.e., the frequency range where the formants of the voice signal of the same person are located in the spectrograms corresponding to different signal components is the same. Therefore, the target frequency range in the spectrogram corresponding to each signal component is considered to be the frequency range corresponding to the user voice.
[0048] To analyze the interference situation in each signal component and accurately perform low-pass filtering on the voice signal subsequently, in this embodiment, the maximum frequency in the target frequency range is taken as the segmentation frequency, so as to accurately analyze whether there is low-frequency interference or high-frequency interference in each signal component subsequently, and then determine the participation degree of each signal component in adjusting the cut-off frequency at the current moment, so as to accurately obtain the cut-off frequency adjustment coefficient of the voice signal at the current moment, which is beneficial to accurately obtaining the cut-off frequency at the current moment subsequently and realizing more accurate low-pass filtering of the voice signal. Therefore, in this embodiment, the cut-off frequency adjustment coefficient of the voice signal at the current moment is obtained according to the energy distribution difference in the non-target frequency range between both sides of the segmentation frequency in the spectrogram corresponding to each signal component and the energy distribution situation in the target frequency range.
[0049] Preferably, in an implementable manner of this embodiment, the method for obtaining the target frequency range is as follows: obtaining the spectrogram corresponding to the target signal component through short-time Fourier transform, where the horizontal axis of the spectrogram is frequency and the vertical axis is the energy at different frequencies. As Figure 3 shown is the spectrogram of the signal component after short-time Fourier transform. In this embodiment, the horizontal axis frequency range of the spectrogram is set to 0 - 4500 Hz. The implementer can set the horizontal axis frequency range of the spectrogram according to the actual situation, which is not limited here. Then, curve fitting is performed on the spectrogram by the least squares method to obtain the spectral curve; in order to determine the frequency range of the user's voice, the peaks and valleys in the spectral curve are obtained through the peak-valley detection algorithm, and the region between two adjacent valleys is regarded as the peak region; the area of each peak region is obtained through definite integral and regarded as the characteristic area; the larger the characteristic area, the more likely the frequency range corresponding to the peak region is the frequency range corresponding to the user's voice. Furthermore, in this embodiment, the preset area threshold is set to 0.7. The implementer can set the size of the preset area threshold according to the actual situation, which is not limited here. When the characteristic area is greater than the preset area threshold, the frequency range corresponding to the corresponding peak region is used as the target frequency range. Among them, the short-time Fourier transform and the peak-valley detection algorithm are both well-known technologies and will not be elaborated here.
[0050] Preferably, in an implementable manner of this embodiment, the method for obtaining the cut-off frequency adjustment coefficient is as follows: for any signal component, the area of the region corresponding to the spectral curve segment after the segmentation frequency in the spectral curve corresponding to the signal component is obtained through definite integral and used as the high-frequency interference degree of the signal component; the greater the high-frequency interference degree, the greater the high-frequency interference received in the signal component; the area of the region corresponding to all spectral curve segments before the segmentation frequency and not within the target frequency range in the spectral curve corresponding to the signal component is obtained through definite integral and used as the low-frequency interference degree of the signal component; the greater the low-frequency interference degree, the greater the low-frequency interference received in the signal component; in order to accurately analyze the interference situation of the signal component, the difference between the low-frequency interference degree and the high-frequency interference degree is normalized through the hyperbolic tangent function tanh, so that the difference between the low-frequency interference degree and the high-frequency interference degree is normalized to the range of -1 to 1, and the normalized result is used as the reference adjustment coefficient of the signal component; therefore, the formula for the reference adjustment coefficient is: ; in the formula, is the reference adjustment coefficient of the i-th signal component; is the low-frequency interference degree of the i-th signal component; is the high-frequency interference level of the i-th signal component; tanh is the hyperbolic tangent function. When the reference adjustment coefficient is close to -1, it indicates that there is relatively more high-frequency interference in this signal component. Then, it is necessary to reduce the cut-off frequency of the low-pass filter, which can effectively filter out the high-frequency interference sound, while retaining the low-frequency part of the voice signal and improving the voice quality. When the reference adjustment coefficient is close to 1, it indicates that there is relatively more low-frequency interference in this signal component. Then, it is necessary to increase the cut-off frequency of the low-pass filter to retain rich high-frequency details, ensure that more voice signal components are retained, and improve the perceptual quality of the voice signal; Obtain the ratio of the area corresponding to all the spectral curve segments within the target frequency range in the spectral curve corresponding to this signal component to the area corresponding to the spectral curve corresponding to this signal component, as the effectiveness of this signal component. When both the effectiveness and importance of this signal component are greater, it indicates that more attention needs to be paid to this signal component during filtering. Furthermore, in this embodiment, the product of the effectiveness and importance of this signal component is used as the attention level of this signal component. Then, the ratio of the attention level of this signal component to the cumulative result of the attention levels of all signal components is used as the adjustment weight of this signal component. Finally, the product of the adjustment weight and the reference adjustment coefficient is used as the true participation adjustment coefficient of this signal component. In order to determine the cut-off frequency adjustment coefficient at the current moment of the voice signal, furthermore, the sum result of the true participation adjustment coefficients of all signal components is used as the cut-off frequency adjustment coefficient at the current moment of the voice signal.
[0051] Step S4: Obtain the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient.
[0052] Specifically, in order to enable the cut-off frequency to be adjusted within a certain range and avoid the situation where the cut-off frequency is too large or too small. Therefore, in this embodiment, the preset frequency adjustment index is set to 10%. The implementer can set the size of the preset frequency adjustment index according to the actual situation, which is not limited here. The product of the initial cut-off frequency, the preset frequency adjustment index, and the cut-off frequency adjustment coefficient is used as the cut-off frequency adjustment value at the current moment of the voice signal. Then, the sum result of the initial cut-off frequency and the cut-off frequency adjustment value is used as the cut-off frequency at the current moment.
[0053] So far, the cut-off frequency of the low-pass filter is obtained in real time and accurately, enabling the low-pass filter to dynamically adjust the cut-off frequency in a noisy environment to remove background interference sounds to the greatest extent, effectively improving the clarity and quality of the call.
[0054] It is known that the low-pass filter is composed of resistors and capacitors, and a digital potentiometer using the I²C or SPI interface is used to remotely and dynamically adjust the cut-off frequency of the low-pass filter. The specific process is as follows: Dynamically adjust the resistance value through the I²C or SPI interface, according to the cut-off frequency , where R is the resistance value and C is the capacitance value. is the ratio of the circumference of a circle to its diameter. Therefore, with the capacitance value kept constant, the cut-off frequency can be adjusted by adjusting the resistance value. Thus, when the capacitance is fixed, the corresponding resistance value can be obtained in real time according to the cut-off frequency obtained in real time. Then, the microcontroller (such as STM32) sends a control instruction (real-time resistance) to the digital potentiometer. The digital potentiometer changes the resistance value inside the low-pass filter by receiving the control instruction from the microcontroller, thereby adjusting the cut-off frequency of the connected low-pass filter.
[0055] In summary, in this embodiment, the voice signal in the current time period is obtained and decomposed into signal components, and the eigenvalue of each signal component is obtained. According to the signal distribution and eigenvalue of each signal component, the importance degree of each signal component is obtained, and then the target signal component is obtained. The target frequency range is determined according to the energy distribution in the spectrogram corresponding to the target signal component. The maximum frequency in the target frequency range is used as the segmentation frequency. According to the energy distribution difference in the non-target frequency ranges on both sides of the segmentation frequency and the energy distribution in the target frequency range in the spectrogram corresponding to the signal component, the cut-off frequency adjustment coefficient of the voice signal at the current moment is obtained, and then the cut-off frequency at the current moment is obtained. By accurately obtaining the cut-off frequency of the low-pass filter in real time, the present invention effectively improves the filtering effect on the voice signal.
[0056] Embodiment 2: The present invention also provides a low-pass filtering system. Please refer to Figure 4 , which shows the structure diagram of a low-pass filtering system provided by an embodiment of the present invention. The system includes: a voice signal acquisition module 10, an importance degree acquisition module 20, a cut-off frequency adjustment coefficient acquisition module 30, and a cut-off frequency acquisition module 40.
[0057] The voice signal acquisition module 10 is configured to acquire the voice signal in the current time period.
[0058] The importance degree acquisition module 20 is configured to decompose the voice signal into signal components by using the principal component analysis algorithm and obtain the eigenvalue of each signal component; and obtain the importance degree of each signal component according to the signal distribution and eigenvalue of each signal component.
[0059] The cut-off frequency adjustment coefficient acquisition module 30 is configured to obtain the target signal component based on the importance degree, determine the target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component; use the maximum frequency in the target frequency range as the segmentation frequency, and obtain the cut-off frequency adjustment coefficient of the voice signal at the current moment according to the energy distribution difference in the non-target frequency ranges on both sides of the segmentation frequency and the energy distribution in the target frequency range in the spectrogram corresponding to each signal component.
[0060] A cut-off frequency acquisition module 40, configured to acquire a cut-off frequency at the current moment based on a cut-off frequency adjustment coefficient.
[0061] It should be noted that: for the system provided in the above embodiments, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the low-pass filter system and the low-pass filtering method provided in the above embodiments belong to the same concept. For the specific implementation process, please refer to the method embodiments, which will not be elaborated here.
[0062] Embodiment 3: The present invention also provides a low-pass filter, including a memory and a processor. Among them, an executable program code is stored in the memory, and the processor is configured to call and execute the executable program code to execute a low-pass filtering method provided in an embodiment of the present application. The low-pass filter may specifically be a chip, a component or a module. The chip may include a connected processor and a memory; among them, the memory is used to store instructions. When the processor calls and executes the instructions, the chip may execute a low-pass filtering method provided in the above embodiments.
[0063] In addition, an embodiment of the present application also protects a computer device. Please refer to Figure 5 , the computer device includes a memory 401, a processor 402, and a computer program 403 stored in the memory 401 and running on the processor 402. Among them, when the processor 402 executes the computer program 403, the computer device can execute any one of the low-pass filtering methods introduced above.
[0064] Embodiment 4: This embodiment also provides a computer-readable storage medium, in which computer program code is stored. When the computer program code runs on a computer, the computer is enabled to execute the above-related method steps to implement a low-pass filtering method provided in the above embodiments.
[0065] Embodiment 5: This embodiment also provides a computer program product. When the computer program product runs on a computer, the computer is enabled to execute the above-related steps to implement a low-pass filtering method provided in the above embodiments.
[0066] Among them, the low-pass filter, the computer-readable storage medium, the computer program product or the chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, which will not be elaborated here.
[0067] It should be noted that the above order of the embodiments of the present invention is only for description and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0068] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A low-pass filtering method, characterized in that, The method includes the following steps: Obtain the voice signal in the current time period; Decompose the voice signal into signal components through the principal component analysis algorithm and obtain the eigenvalue of each signal component; according to the signal distribution and eigenvalue of each signal component, obtain the importance degree of each signal component; Obtain the target signal component based on the importance degree, and determine the target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component; take the maximum frequency in the target frequency range as the segmentation frequency, and according to the energy distribution difference in the non-target frequency range between both sides of the segmentation frequency in the spectrogram corresponding to each signal component, as well as the energy distribution in the target frequency range, obtain the cut-off frequency adjustment coefficient at the current moment of the voice signal; Obtain the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient.
2. The low-pass filtering method according to claim 1, wherein The method for obtaining the importance degree is as follows: For any signal component, based on the fluctuation of the signal in the signal component, divide the signal component into local signal segments; According to the number of local signal segments, as well as the duration and amplitude fluctuation of each local signal segment, obtain the volume stability degree of the signal component; According to the change of the signal between any two adjacent local signal segments, obtain the volume gradual change degree of the signal component; Take the normalized result of the product of the eigenvalue, volume stability degree, and volume gradual change degree of the signal component as the importance degree of the signal component.
3. A low-pass filtering method according to claim 2, characterized in that, The method for obtaining the local signal segment is as follows: Take the amplitude difference between each maximum point in the signal component and its previous adjacent minimum point as the instantaneous volume of each maximum point; Arrange the instantaneous volumes in the time order corresponding to the maximum points to obtain the instantaneous volume sequence corresponding to the signal component; Divide the instantaneous volume sequence through the adaptive piecewise constant approximation algorithm to obtain local volume segments, and take the maximum point corresponding to the last instantaneous volume of each local volume segment as the segmentation point of the signal component; Divide the signal component into local signal segments through the segmentation point.
4. A low-pass filtering method according to claim 2, characterized in that, The method for obtaining the volume stability degree is as follows: For any local signal segment, take the difference between the maximum amplitude and the minimum amplitude in the local signal segment as the volume change value of the local signal segment; Take the variance of the volume change values of all local signal segments in the signal component as the first stability analysis value of the signal component; Obtain the duration of each local signal segment as the local duration, and take the ratio of the maximum local duration to the corresponding duration of the current time period as the second stability analysis value of the signal component; According to the number of local signal segments, the first stability analysis value, and the second stability analysis value of the signal component, obtain the volume stability degree of the signal component; among them, both the number of local signal segments and the first stability analysis value are negatively correlated with the volume stability degree, and the second stability analysis value is positively correlated with the volume stability degree.
5. The low-pass filtering method according to claim 3, wherein, The method for obtaining the volume gradual change degree is as follows: For any two adjacent local signal segments in the signal component, merge the two local signal segments into a reference signal segment, and fit the elements in the instantaneous volume sequence corresponding to the reference signal segment into a curve as the target curve; The result of taking the fitting error of the target curve with negative correlation and normalization is used as the reference weight of the reference signal segment; The result of taking the negative correlation of the average value of the absolute values of the tangent slopes of all data points on the target curve is used as the reference gradient degree of the reference signal segment; The product of the reference weight and the reference gradient degree is used as the local volume gradient degree of the reference signal segment; The average value of the local volume gradient degrees of all reference signal segments of the signal component is used as the volume gradient degree of the signal component.
6. The low-pass filtering method according to claim 1, wherein The method for obtaining the target signal component based on the importance degree and determining the target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component is as follows: The signal component corresponding to the maximum importance degree is used as the target signal component; The spectrogram corresponding to the target signal component is obtained through short-time Fourier transform, and the spectral curve is obtained by curve fitting the spectrogram through the least squares method; The peaks and valleys in the spectral curve are obtained through the peak-valley detection algorithm, and the region between two adjacent valleys is used as the peak region; The area of each peak region is obtained and used as the characteristic area; When the characteristic area is greater than the preset area threshold, the frequency range corresponding to the peak region is used as the target frequency range.
7. The low-pass filtering method according to claim 6, wherein The method for obtaining the cut-off frequency adjustment coefficient is as follows: For any signal component, the area of the region corresponding to the spectral curve segment after the segmentation frequency in the spectral curve corresponding to the signal component is obtained and used as the high-frequency interference degree of the signal component; The area of all spectral curve segments before the segmentation frequency and not within the target frequency range in the spectral curve corresponding to the signal component is obtained and used as the low-frequency interference degree of the signal component; Based on the difference between the low-frequency interference degree and the high-frequency interference degree, the reference adjustment coefficient of the signal component is obtained; The ratio of the area of the region corresponding to all spectral curve segments within the target frequency range in the spectral curve corresponding to the signal component to the area of the region corresponding to the spectral curve corresponding to the signal component is obtained and used as the effectiveness degree of the signal component; The product of the effectiveness degree of the signal component and the importance degree is used as the attention degree of the signal component; The ratio of the attention degree of the signal component to the accumulated result of the attention degrees of all signal components is used as the adjustment weight of the signal component; The product of the adjustment weight and the reference adjustment coefficient is used as the actual participation adjustment coefficient of the signal component; The sum of the actual participation adjustment coefficients of all signal components is used as the cut-off frequency adjustment coefficient of the speech signal at the current moment.
8. The low-pass filtering method according to claim 1, characterized in that, The method for obtaining the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient is as follows: The product of the initial cut-off frequency, the preset frequency adjustment index, and the cut-off frequency adjustment coefficient is used as the cut-off frequency adjustment value of the speech signal at the current moment; The sum of the initial cut-off frequency and the cut-off frequency adjustment value is used as the cut-off frequency at the current moment.
9. A low-pass filter system, characterized in that, The system includes: A speech signal acquisition module for acquiring the speech signal in the current time period; An importance degree acquisition module, which is used to decompose a voice signal into signal components through a principal component analysis algorithm and obtain the eigenvalue of each signal component; and obtain the importance degree of each signal component according to the signal distribution and eigenvalue of each signal component. A cut-off frequency adjustment coefficient acquisition module, which is used to obtain a target signal component based on the importance degree, determine a target frequency range according to the energy distribution in the spectrogram corresponding to the target signal component; use the maximum frequency in the target frequency range as the cut-off frequency, and obtain the cut-off frequency adjustment coefficient of the voice signal at the current moment according to the energy distribution difference in the non-target frequency range between both sides of the cut-off frequency in the spectrogram corresponding to each signal component and the energy distribution in the target frequency range. A cut-off frequency acquisition module, which is used to obtain the cut-off frequency at the current moment based on the cut-off frequency adjustment coefficient.
10. A low-pass filter, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the low-pass filtering method described in any one of claims 1-8 above.
Citation Information
Patent Citations
Electroencephalogram signal preprocessing method and system and terminal equipment
CN117898743A
Method and apparatus for multiple signal identification and finding the basis functions of the received signal
US20100002816A1
Audio Signal Processing Apparatus And Method For Processing An Input Audio Signal
US20180213342A1