A low-pass filtering method, system and low-pass filter
The speech signal is decomposed through the principal component analysis algorithm, the characteristic value and importance of the signal components are obtained, and the cutoff frequency of the low-pass filter is dynamically adjusted, which solves the problem that the cutoff frequency cannot be adjusted accurately in real time and improves the filtering effect of the speech signal.
Patent Information
- Application Number
- CN202510696285.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-05-28
AI Technical Summary
Existing low-pass filters cannot accurately adjust the cutoff frequency in real time, resulting in the inability to effectively distinguish user voice from background noise in complex noise environments, affecting call quality.
The speech signal is decomposed into signal components through the principal component analysis algorithm, and the characteristic value and importance of each signal component are obtained. The target frequency range and cutoff frequency adjustment coefficient are determined based on the spectral energy distribution, and the cutoff frequency of the low-pass filter is dynamically adjusted.
Real-time accurate filtering of voice signals in noisy environments is realized, effectively improving call clarity and quality.
Smart Images

Figure CN120220710B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of speech signal enhancement, and in particular 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 while attenuating high-frequency signals. It 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 while retaining useful low-frequency information. Low-pass filters are generally divided into passive and active low-pass filters. Passive low-pass filters have a fixed cutoff frequency and cannot dynamically adapt to environmental changes. They have poor filtering effects in complex noisy environments, and voice signals may be attenuated after passing through passive low-pass filters. Active low-pass filters can dynamically change the cutoff frequency by adjusting feedback network parameters (such as variable resistors), enhancing high-frequency suppression capabilities while compensating for voice signal attenuation. In the field of audio processing, dynamic adjustment of the cutoff frequency of active low-pass filters is key to improving noise suppression.
[0003] In the existing methods, the cutoff frequency of the active low-pass filter is adjusted based on the threshold method, spectrum analysis method or fixed rule adjustment method of signal energy. However, in actual situations, the user voice and background noise overlap, and the background noise appears randomly. In the existing methods, it is impossible to accurately distinguish the frequency distribution difference between the user voice and the background noise in real time, and thus it is impossible to adjust the cutoff frequency of the active low-pass filter in a timely and accurate manner, which is not conducive to accurate denoising of the call voice signal and affects the call quality. Summary of the Invention
[0004] In order to solve the technical problem that the existing method cannot adjust the cutoff frequency of the active low-pass filter in a timely and accurate manner, the purpose of the present invention is to provide a low-pass filtering method, system and low-pass filter. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present invention provides a low-pass filtering method, the method comprising the following steps:
[0006] Get the voice signal of the current time period;
[0007] The speech signal is decomposed into signal components by the principal component analysis algorithm and the characteristic value of each signal component is obtained; the importance of each signal component is obtained according to the signal distribution and characteristic value of each signal component;
[0008] The target signal component is obtained based on the importance, and the target frequency range is determined according to the energy distribution in the spectrum corresponding to the target signal component; the maximum frequency in the target frequency range is used as the split frequency, and the cutoff frequency adjustment coefficient of the speech signal at the current moment is obtained based on the energy distribution difference in the non-target frequency range on both sides of the split frequency in the spectrum corresponding to each signal component and the energy distribution in the target frequency range;
[0009] Get the current cutoff frequency based on the cutoff frequency adjustment coefficient.
[0010] Furthermore, the method for obtaining the importance is:
[0011] For any signal component, based on the fluctuation of the signal in the signal component, the signal component is divided into local signal segments;
[0012] Obtaining the volume stability of the signal component according to the number of local signal segments and the duration and amplitude fluctuation of each local signal segment;
[0013] According to the change of the signal in any two adjacent local signal segments, the volume gradient of the signal component is obtained;
[0014] The result of normalizing the product of the characteristic value of the signal component, the volume stability and the volume gradual change is used as the importance of the signal component.
[0015] Furthermore, the method for obtaining the local signal segment is:
[0016] The amplitude difference between each maximum point in the signal component and its previous adjacent minimum point is used as the instantaneous volume of each maximum point;
[0017] Arrange the instantaneous volume according to the time sequence of the corresponding maximum value points to obtain the instantaneous volume sequence corresponding to the signal component;
[0018] The instantaneous volume sequence is divided into local volume segments using an adaptive piecewise constant approximation algorithm, and the maximum point corresponding to the last instantaneous volume of each local volume segment is used as the segmentation point of the signal component.
[0019] The signal component is divided into local signal segments by the split points.
[0020] Furthermore, the method for obtaining the volume stability is:
[0021] 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;
[0022] Using the variance of the volume change values of all local signal segments in the signal component as the first stable analysis value of the signal component;
[0023] Obtaining the duration of each local signal segment as the local duration, and taking the ratio of the maximum local duration to the duration corresponding to the current time period as the second stable analysis value of the signal component;
[0024] The volume stability of the signal component is obtained based on the number of local signal segments, the first stable analysis value and the second stable analysis value of the signal component; wherein, the number of local signal segments and the first stable analysis value are negatively correlated with the volume stability, and the second stable analysis value is positively correlated with the volume stability.
[0025] Furthermore, the method for obtaining the volume gradient is as follows:
[0026] 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 a target curve;
[0027] Negatively correlating and normalizing the fitting error of the target curve, and using the result as the reference weight of the reference signal segment;
[0028] The result of negative correlation of the average absolute value of the tangent slope of all data points on the target curve is used as the reference gradient of the reference signal segment;
[0029] The product of the reference weight and the reference gradient is used as the local volume gradient of the reference signal segment;
[0030] The average of the local volume gradients of all reference signal segments of the signal component is used as the volume gradient of the signal component.
[0031] Furthermore, the method of obtaining the target signal component based on the importance and determining the target frequency range according to the energy distribution in the spectrum graph corresponding to the target signal component is:
[0032] The signal component corresponding to the greatest importance is taken as the target signal component;
[0033] The spectrum graph corresponding to the target signal component is obtained by short-time Fourier transform, and the spectrum graph is fitted by the least square method to obtain the spectrum curve;
[0034] The peaks and valleys in the spectrum curve are obtained by using a peak-valley detection algorithm, and the area between two adjacent valleys is taken as the peak area; the area of each peak area is obtained and taken as the characteristic area;
[0035] When the characteristic area is greater than the preset area threshold, the frequency range corresponding to the corresponding peak area is used as the target frequency range.
[0036] Furthermore, the method for obtaining the cutoff frequency adjustment coefficient is:
[0037] For any signal component, the area of the frequency spectrum curve segment after the split frequency in the frequency spectrum curve corresponding to the signal component is obtained as the high-frequency interference degree of the signal component;
[0038] Obtaining the areas corresponding to all spectrum curve segments located before the split frequency and not within the target frequency range in the spectrum curve corresponding to the signal component as the low-frequency interference degree of the signal component;
[0039] Obtaining a reference adjustment coefficient of the signal component based on a difference between a low-frequency interference level and a high-frequency interference level;
[0040] Obtaining a ratio of the area of the region corresponding to all spectrum curve segments within the target frequency range in the spectrum curve corresponding to the signal component to the area of the region corresponding to the spectrum curve corresponding to the signal component as the effectiveness of the signal component;
[0041] The product of the effectiveness and importance of the signal component is used as the attention level of the signal component;
[0042] The ratio of the attention level of the signal component to the cumulative attention level of all signal components is used as the adjustment weight of the signal component;
[0043] The product of the adjustment weight and the reference adjustment coefficient is used as the real participation adjustment coefficient of the signal component;
[0044] The sum of the actual participating adjustment coefficients of all signal components is used as the cutoff frequency adjustment coefficient of the speech signal at the current moment.
[0045] Furthermore, the method for obtaining the cutoff frequency at the current moment based on the cutoff frequency adjustment coefficient is:
[0046] The product of the initial cutoff frequency, the preset frequency adjustment index and the cutoff frequency adjustment coefficient is used as the cutoff frequency adjustment value of the speech signal at the current moment;
[0047] The sum of the initial cutoff frequency and the cutoff frequency adjustment value is used as the cutoff frequency at the current moment.
[0048] In a second aspect, another embodiment of the present invention provides a low-pass filtering system, the system comprising:
[0049] A voice signal acquisition module is used to acquire the voice signal of the current time period;
[0050] The importance acquisition module is used to decompose the speech signal into signal components through the principal component analysis algorithm and obtain the characteristic value of each signal component; according to the signal distribution and characteristic value of each signal component, the importance of each signal component is obtained;
[0051] A cutoff frequency adjustment coefficient acquisition module is used to obtain target signal components based on their importance, determine the target frequency range based on the energy distribution in the spectrum corresponding to the target signal components, use the maximum frequency in the target frequency range as the split frequency, and obtain the cutoff frequency adjustment coefficient of the speech signal at the current moment based on the energy distribution difference in the non-target frequency range on both sides of the split frequency in the spectrum corresponding to each signal component and the energy distribution in the target frequency range;
[0052] The cutoff frequency acquisition module is used to obtain the cutoff frequency at the current moment based on the cutoff frequency adjustment coefficient.
[0053] In a third aspect, another embodiment of the present invention provides a low-pass filter, comprising: a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above methods are implemented.
[0054] The present invention has the following beneficial effects:
[0055] The present invention first decomposes the speech signal into signal components through the principal component analysis algorithm and obtains the characteristic value of each signal component, which is conducive to the subsequent accurate analysis of the signal situation corresponding to the user's speech; then, according to the signal distribution and characteristic value of each signal component, the importance of each signal component is obtained, and the possibility of each signal component being the user's speech component is accurately reflected; then, based on the importance, the target signal component is obtained, and the main signal component of the user's speech corresponding to the speech signal is accurately determined; further, according to the distribution of energy in the spectrum corresponding to the target signal component, the target frequency range is determined, and the frequency range corresponding to the user's speech is accurately determined, which is conducive to the subsequent accurate acquisition of the cutoff frequency corresponding to the speech signal; in order to accurately analyze each signal component The interference situation is obtained, and the maximum frequency in the target frequency range is used as the cutting frequency, so that each signal component is accurately analyzed to see whether it is subject to low-frequency interference or high-frequency interference, which is conducive to the subsequent accurate analysis of the adjustment of the cutoff frequency at the current moment; and then according to the energy distribution difference in the non-target frequency range between the two sides of the cutting frequency in the spectrum diagram corresponding to each signal component, and the energy distribution in the target frequency range, the cutoff frequency adjustment coefficient of the speech signal at the current moment is obtained, which accurately reflects the degree of adjustment of the cutoff frequency of the low-pass filter at the current moment; and then based on the cutoff frequency adjustment coefficient, the cutoff frequency at the current moment is accurately obtained, so that the speech signal can be filtered in real time and accurately, effectively improving the quality of the speech signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 A schematic flow chart of a low-pass filtering method provided by one embodiment of the present invention;
[0058] Figure 2 A flow chart of a method for obtaining importance provided by one embodiment of the present invention;
[0059] Figure 3 A spectrum diagram of a signal component provided by an embodiment of the present invention after short-time Fourier transform;
[0060] Figure 4 A structural diagram of a low-pass filtering system provided by one embodiment of the present invention;
[0061] Figure 5 A schematic diagram of a computer device provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0062] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a low-pass filtering method, system, and low-pass filter according to the present invention, including their specific implementation, structure, features, and effectiveness. In the following description, references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0063] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0064] The following describes in detail a low-pass filtering method, system and specific scheme of a low-pass filter provided by the present invention with reference to the accompanying drawings.
[0065] Example 1:
[0066] The specific scenario of this embodiment is: the audio device used for calls is in a noisy environment, and the sources of sounds interfering with calls are complex, such as crowd noise, vehicles passing by, and business audio advertisements. If the dynamic adjustment of the low-pass filter's cutoff frequency is not accurate and timely, it may cause the low-pass filter to filter out the interfering sounds poorly, resulting in unclear call voice. Therefore, this embodiment obtains the voice signal of the current time period, analyzes the voice signal of the current time period, accurately obtains the cutoff frequency of the voice signal at the current moment, and then accurately and timely dynamically adjusts the cutoff frequency of the low-pass filter to ensure that the interference noise is filtered out to the greatest extent possible, effectively improving the clarity of the call voice.
[0067] The present invention proposes a low-pass filtering method, please refer to Figure 1 , which shows a schematic flow chart of a low-pass filtering method provided by an embodiment of the present invention, the method comprising the following steps:
[0068] Step S1: Acquire the speech signal of the current time period.
[0069] Specifically, this embodiment collects voice signals in real time through the microphone of the call device. This embodiment sets the sampling frequency of the voice signal to 8kHz. The implementer can set the sampling frequency of the voice signal according to actual conditions, which is not limited here. In order to obtain the cutoff frequency of the low-pass filter at the current moment in real time, this embodiment obtains the voice signal of the current time period for analysis. This embodiment sets the length of the current time period to 3 minutes. The implementer can set the length of the current time period according to actual conditions, which is not limited here. It should be noted that the end time of the current time period must be the current moment.
[0070] In addition, this embodiment sets the voice signal of the first 3 minutes of the current moment to be filtered through a low-pass filter using the set initial cutoff frequency. This embodiment sets the initial cutoff frequency to 3400 Hz. The implementer can set the size of the initial cutoff frequency according to actual conditions, and it is not limited here.
[0071] Step S2: Decompose the speech signal into signal components using a principal component analysis algorithm and obtain the eigenvalue of each signal component; obtain the importance of each signal component based on the signal distribution and eigenvalue of each signal component.
[0072] Specifically, in a noisy environment, the voice signal recorded by a microphone is composed of an overlapping mix of the user's voice and various interfering sounds. It's known that a person's vocal cord length, thickness, and vocal tract shape are fixed, and their voice characteristics, pronunciation habits, and techniques are also consistent. Therefore, the voice of the same person remains relatively stable over time. Interfering sounds, on the other hand, are chaotic and disordered, constantly changing with the user's movement or the movement and transformation of sound interference sources (such as passersby and vehicles). Therefore, this embodiment first decomposes the voice signal using a principal component analysis algorithm to obtain its individual signal components. These components are then analyzed to distinguish between the user's voice component and the interfering sound component, enabling accurate adjustment of the low-pass filter's cutoff frequency. The principal component analysis algorithm is well known and will not be described in detail here. It's known that the principal component analysis algorithm can be used to obtain the eigenvalue of each signal component. The larger the eigenvalue, the more likely the corresponding signal component is the main component of the voice signal, i.e., the user's voice component. Furthermore, a more stable signal distribution for a signal component also indicates that it is more likely to be the user's voice component. Furthermore, this embodiment obtains the importance of each signal component based on the signal distribution and characteristic value of each signal component. The greater the importance, the more likely the corresponding signal component is the user voice component.
[0073] Preferably, in one possible implementation of this embodiment, the method for obtaining the importance degree is as follows: Figure 2 , which shows a flow chart of a method for obtaining the importance provided by this embodiment, the method comprising the following steps:
[0074] Step S201: For any signal component, based on the fluctuation of the signal in the signal component, the signal component is divided into local signal segments.
[0075] It is known that the user's voice component is relatively stable, while the signal amplitude corresponding to the interfering sound component fluctuates greatly. To accurately analyze the likelihood that each signal component is the user's voice component, each signal component is first divided into local signal segments based on its signal fluctuations. The volume within the same local signal segment is similar.
[0076] In one possible implementation 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 by the derivative method, and then obtain 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 volume according to the time sequence of the corresponding maximum point to obtain the instantaneous volume sequence corresponding to the signal component; divide the instantaneous volume sequence by the adaptive piecewise constant approximation algorithm to obtain local volume segments; wherein, the instantaneous volume in the same local volume segment is similar. In order to divide continuous signals with similar volume into the same signal segment, the maximum point corresponding to the last instantaneous volume of each local volume segment is used as the segmentation point of the signal component; finally, the signal component is divided into local signal segments by the segmentation point. Among them, the derivative method and the adaptive piecewise constant approximation algorithm are both well-known technologies and will not be described in detail.
[0077] At this point, the local signal segment of each signal component is obtained.
[0078] Step S202: obtaining the volume stability of the signal component according to the number of local signal segments and the duration and amplitude fluctuation of each local signal segment.
[0079] When a signal component is divided into fewer local signal segments, it indirectly indicates that the signal component is more stable; when the duration corresponding to the local signal segments of the signal component is longer, it indirectly reflects that the signal component is more stable; when the signal fluctuations in all local signal segments of the signal component are more similar, it also indicates that the signal component is more stable. Therefore, this embodiment obtains the volume stability of the signal component based on the number of local signal segments and the duration and amplitude fluctuations of each local signal segment. The greater the volume stability, the more likely the corresponding signal component is the user voice component.
[0080] In one possible implementation of this embodiment, the method for obtaining the volume stability 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 stable analysis value of the signal component; the smaller the first stable analysis value, the more stable the sound volume corresponding to the signal component; the duration of each local signal segment is obtained as the local duration, and the larger the maximum local duration, the more stable the signal component is. In order to accurately analyze the signal The stability of the component is further determined by taking the ratio of the maximum local duration to the duration corresponding to the current time period as the second stability analysis value of the signal component; the larger the second stability analysis value is, the more stable the signal component is; 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, and then according to the number of local signal segments of the signal component, the first stability analysis value and the second stability analysis value, the volume stability of the signal component is obtained; wherein, the number of local signal segments and the first stability analysis value are negatively correlated with the volume stability, and the second stability analysis value is positively correlated with the volume stability.
[0081] The calculation formula for volume stability is: Where, is the volume stability of the i-th signal component; is the number of local signal segments of the i-th signal component; is the first stable analysis value of the i-th signal component; is the first preset constant, which is greater than 0; is the maximum local duration of the local signal segment of the i-th signal component; T is the duration corresponding to the current time period; is the second stable analysis value of the i-th signal component.
[0082] This embodiment sets To avoid the denominator being 0, the implementer can set it according to the actual situation The size is not limited here.
[0083] At this point, the volume stability of each signal component is obtained.
[0084] Step S203: according to the change of the signal in any two adjacent local signal segments, the volume gradual change degree of the signal component is obtained.
[0085] When entering a noisy environment from a quiet environment, the user will subconsciously increase the volume of their speech to ensure that their voice can be heard. This behavior is known as the "Lorenz effect" in psychology and acoustics. Therefore, when the sound environment changes, the volume of the user's voice may become unstable. However, when the user enters a noisy environment from a quiet environment, they will not immediately increase the volume significantly. Instead, they will gradually adapt to the new noise level and gradually increase the volume until they think that 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 the interfering sound is disordered, and the sudden appearance and disappearance of different interfering sound sources causes the volume to increase and decrease instantaneously. Therefore, for any signal component, this embodiment obtains the degree of volume gradient of the signal component based on the change of the signal in any two adjacent local signal segments of the signal component. The greater the degree of volume gradient, the more stable the change of the signal component, and the more likely the signal component is the user's voice component.
[0086] In one possible implementation of this embodiment, the method for obtaining the degree of volume gradient is as follows: for any two adjacent local signal segments in any signal component, the two local signal segments are merged into a reference signal segment. For example, if the local signal segments of the signal component are {local signal segment 1, local signal segment 2, local signal segment 3, local signal segment 4}, the corresponding reference signal segments are {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 as the target curve by the least squares method; wherein the least squares method is a well-known technology and will not be described in detail. The smaller the fitting error of the target curve, the more accurate the characteristics reflected by the target curve and the more reference significance it has. 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, the mean of the absolute value of the tangent slope of all data points on the target curve is negatively correlated and used as the reference gradient of the reference signal segment. The larger the reference gradient, the more stable the signal change in the reference signal segment.
[0087] In order to accurately obtain the volume change corresponding to the reference signal segment, the product of the reference weight and the reference gradient is used as the local volume gradient of the reference signal segment; in order to comprehensively analyze the signal change in the signal component, the average of the local volume gradients of all reference signal segments of the signal component is used as the volume gradient of the signal component.
[0088] The calculation formula for the volume gradient is: Where, is the volume gradient 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 mth reference signal segment of the i-th signal component; is the reference weight of the mth reference signal segment of the ith signal component; exp is an exponential function with a natural constant as the base; is the mean of the absolute values of the tangent slopes of all data points on the target curve corresponding to the mth reference signal segment of the i-th signal component; is the absolute value function; is the second preset constant, which is greater than 0; is the reference gradient of the mth reference signal segment of the i-th signal component; is the local volume gradient of the mth reference signal segment of the i-th signal component.
[0089] This embodiment sets To avoid the denominator being 0, the implementer can set it according to the actual situation The size is not limited here.
[0090] At this point, the volume gradient of each signal component is obtained.
[0091] Step S204: normalizing the product of the characteristic value of the signal component, the volume stability and the volume gradual change, and using the result as the importance of the signal component.
[0092] When the eigenvalue, volume stability, and volume gradient of a signal component are all larger, it indicates that the signal component is likely to be a user voice component. Therefore, this embodiment normalizes the product of the eigenvalue, volume stability, and volume gradient of the signal component to determine its importance. This embodiment normalizes the product of the eigenvalue, volume stability, and volume gradient of the signal component using the norm normalization function.
[0093] At this point, the importance of each signal component is obtained.
[0094] Step S3: Obtain the target signal component based on the importance, and determine the target frequency range according to the energy distribution in the spectrum corresponding to the target signal component; take the maximum frequency in the target frequency range as the split frequency, and obtain the cutoff frequency adjustment coefficient of the speech signal at the current moment according to the energy distribution difference in the non-target frequency range between the two sides of the split frequency in the spectrum corresponding to each signal component, and the energy distribution in the target frequency range.
[0095] It is known that the greater the importance, the more likely the corresponding signal component is the user voice component, and thus, in this embodiment, the signal component corresponding to the greatest importance is used 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, then any one of the signal components is selected as the target signal component. Among them, the target signal component contains the most user voice signal and the least interference sound information. It is known that the energy distribution in the spectrum reflects the relative strength of different frequency components in the voice signal, and in the target signal component, the user voice is the main component, and then the target frequency range is first determined based on the energy distribution in the spectrum 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.
[0096] The principal component analysis algorithm is a dimensionality reduction technique that converts multidimensional data into a small number of principal components. By combining all principal components, the main directions of variation in the data can be captured. Therefore, representing the entire user voice signal using only the target signal component is generally insufficient, as it results in significant information loss and poor voice signal quality. This is because some user voice information is also present in signal components other than the target signal component. Therefore, all signal components must be analyzed to accurately adjust the cutoff frequency of the voice signal. Considering that areas of relatively concentrated energy in a spectrogram typically correspond to formants, and given that the position and intensity of formants are determined by the vocal cord length and shape of the same individual, the spectral characteristics of formants in the spectrograms corresponding to different signal components are consistent. That is, the frequency range of the formants for the same individual's voice signal is consistent across these different signal components. Therefore, the target frequency range in the spectrogram corresponding to each signal component is considered to be the frequency range corresponding to the user's voice.
[0097] In order to analyze the interference situation in each signal component and enable the subsequent accurate low-pass filtering of the voice signal, this embodiment uses the maximum frequency in the target frequency range as the split frequency, so that each signal component can be accurately analyzed to see whether it has low-frequency interference or high-frequency interference, and then the degree of participation of each signal component in adjusting the cutoff frequency at the current moment can be determined, so that the cutoff frequency adjustment coefficient of the voice signal at the current moment can be accurately obtained, which is conducive to the subsequent accurate acquisition of the cutoff frequency at the current moment and the realization of more accurate low-pass filtering of the voice signal. Therefore, this embodiment obtains the cutoff frequency adjustment coefficient of the voice signal at the current moment based on the energy distribution difference in the non-target frequency range between the two sides of the split frequency in the spectrum diagram corresponding to each signal component, and the energy distribution in the target frequency range.
[0098] Preferably, in one possible implementation of this embodiment, the target frequency range is obtained by: obtaining a spectrum corresponding to the target signal component by short-time Fourier transform, wherein the horizontal axis of the spectrum is frequency and the vertical axis is energy at different frequencies, such as Figure 3 The figure shows the spectrum of the signal component after short-time Fourier transform (SFT). In this embodiment, the horizontal axis frequency range of the spectrum is set to 0-4500 Hz. The implementer can set the horizontal axis frequency range of the spectrum according to actual conditions and is not limited here. The spectrum is then curve-fitted using the least squares method to obtain a spectrum curve. To determine the frequency range of the user's voice, a peak-valley detection algorithm is used to obtain the peaks and troughs in the spectrum curve, with the area between two adjacent troughs being the peak area. The area of each peak area is obtained through a definite integral and used as the characteristic area. The larger the characteristic area, the more likely the frequency range corresponding to the peak area is the frequency range corresponding to the user's voice. Furthermore, in this embodiment, a preset area threshold is set to 0.7. The implementer can set the preset area threshold according to actual conditions and is not limited here. When the characteristic area is greater than the preset area threshold, the frequency range corresponding to the peak area is used as the target frequency range. Both the short-time Fourier transform (SFT) and the peak-valley detection algorithm are well-known technologies and will not be described in detail here.
[0099] Preferably, in one implementation of this embodiment, the method for obtaining the cutoff frequency adjustment coefficient is as follows: for any signal component, the area of the region corresponding to the spectrum curve segment located after the cutoff frequency in the spectrum curve corresponding to the signal component is obtained by definite integral, as the high-frequency interference degree of the signal component; the greater the high-frequency interference degree, the greater the high-frequency interference suffered by the signal component; the area of the region corresponding to all spectrum curve segments located before the cutoff frequency and not within the target frequency range in the spectrum curve corresponding to the signal component is obtained by definite integral, as the low-frequency interference degree of the signal component; the greater the low-frequency interference degree, the greater the low-frequency interference suffered by the signal component; in order to accurately analyze the interference condition suffered by the signal component, the difference between the low-frequency interference degree and the high-frequency interference degree is normalized by 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 and 1, and the normalized result is used as the reference adjustment coefficient of the signal component; therefore, the formula of the reference adjustment coefficient is: Where, 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 degree of high-frequency interference of the i-th signal component; tanh is the hyperbolic tangent function. When the reference adjustment coefficient is close to -1, it means that there is relatively more high-frequency interference in the signal component, and it is necessary to lower the cutoff 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 means that there is relatively more low-frequency interference in the signal component, and it is necessary to increase the cutoff frequency of the low-pass filter to retain rich high-frequency details, ensure that more voice signal components are retained, and improve the perceived quality of the voice signal;
[0100] The ratio of the area of the region corresponding to all the spectrum curve segments in the target frequency range in the spectrum curve corresponding to the signal component to the area of the region corresponding to the spectrum curve corresponding to the signal component is obtained as the effectiveness of the signal component; when the effectiveness and importance of the signal component are greater, it means that more attention should be paid to the signal component during filtering. Furthermore, this embodiment uses the product of the effectiveness and importance of the signal component as the attention level of the signal component. Then, the ratio of the attention level of the signal component to the cumulative result of the attention levels of all signal components is used as the adjustment weight of the signal component; finally, the product of the adjustment weight and the reference adjustment coefficient is used as the real participation adjustment coefficient of the signal component; in order to determine the cutoff frequency adjustment coefficient of the speech signal at the current moment, the sum of the real participation adjustment coefficients of all signal components is used as the cutoff frequency adjustment coefficient of the speech signal at the current moment.
[0101] Step S4: obtaining the current cutoff frequency based on the cutoff frequency adjustment coefficient.
[0102] Specifically, in order to adjust the cutoff frequency within a certain range and avoid situations where the cutoff frequency is too large or too small, this embodiment sets the preset frequency adjustment index to 10%. The implementer can set the preset frequency adjustment index based on actual conditions, and this is not limited here. The product of the initial cutoff frequency, the preset frequency adjustment index, and the cutoff frequency adjustment coefficient is used as the cutoff frequency adjustment value for the speech signal at the current moment. The sum of the initial cutoff frequency and the cutoff frequency adjustment value is then used as the cutoff frequency at the current moment.
[0103] At this point, the cutoff frequency of the low-pass filter is accurately obtained in real time, so that in a noisy environment, the low-pass filter can dynamically adjust the cutoff frequency to remove background interference sounds to the greatest extent, effectively improving the clarity and quality of calls.
[0104] It is known that the low-pass filter is composed of resistors and capacitors, and uses a digital potentiometer with an I²C or SPI interface to remotely and dynamically adjust the cutoff frequency of the low-pass filter. The specific process is: dynamically adjust the resistance value through the I²C or SPI interface according to the cutoff frequency , where R is the resistance value and C is the capacitance value. =π, so the cutoff frequency can be adjusted by adjusting the resistance value while keeping the capacitance constant. Therefore, with the capacitance fixed, the corresponding resistance value can be obtained in real time based on the cutoff frequency obtained in real time. A microcontroller (such as an STM32) then sends a control instruction (real-time resistance) to the digital potentiometer. The digital potentiometer receives the control instruction from the microcontroller and changes the resistance value inside the low-pass filter, thereby adjusting the cutoff frequency of the low-pass filter connected to it.
[0105] In summary, the present embodiment obtains the voice signal of the current time period and decomposes it into signal components and obtains the characteristic value of each signal component; according to the signal distribution and characteristic value of each signal component, the importance of each signal component is obtained and then the target signal component is obtained, and the target frequency range is determined according to the energy distribution in the spectrum corresponding to the target signal component; the maximum frequency in the target frequency range is used as the split frequency, and according to the energy distribution difference in the non-target frequency range on both sides of the split frequency in the spectrum corresponding to the signal component and the energy distribution in the target frequency range, the cutoff frequency adjustment coefficient of the voice signal at the current moment is obtained and then the cutoff frequency at the current moment is obtained. The present invention effectively improves the effect of filtering the voice signal by accurately obtaining the cutoff frequency of the low-pass filter in real time.
[0106] Example 2:
[0107] The present invention also proposes a low-pass filtering system, see Figure 4 , which shows a structural diagram of a low-pass filtering system provided by an embodiment of the present invention, the system includes: a speech signal acquisition module 10, an importance acquisition module 20, a cutoff frequency adjustment coefficient acquisition module 30 and a cutoff frequency acquisition module 40.
[0108] The voice signal acquisition module 10 is used to acquire the voice signal of the current time period.
[0109] The importance acquisition module 20 is used to decompose the speech signal into signal components by using a principal component analysis algorithm and obtain the eigenvalue of each signal component; and obtain the importance of each signal component according to the signal distribution and eigenvalue of each signal component.
[0110] The cutoff frequency adjustment coefficient acquisition module 30 is used to obtain the target signal component based on the importance, and determine the target frequency range according to the energy distribution in the spectrum diagram corresponding to the target signal component; the maximum frequency in the target frequency range is used as the split frequency, and the cutoff frequency adjustment coefficient of the speech signal at the current moment is obtained according to the energy distribution difference in the non-target frequency range between the two sides of the split frequency in the spectrum diagram corresponding to each signal component, and the energy distribution in the target frequency range.
[0111] The cutoff frequency acquisition module 40 is configured to acquire the cutoff frequency at a current moment based on the cutoff frequency adjustment coefficient.
[0112] It should be noted that the system provided in the above embodiment is merely exemplified by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the low-pass filtering system and the low-pass filtering method provided in the above embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0113] Example 3:
[0114] The present invention also provides a low-pass filter comprising a memory and a processor, wherein the memory stores executable program code, and the processor is configured to call and execute the executable program code to perform a low-pass filtering method provided in an embodiment of the present application. The low-pass filter can be a chip, component, or module, and the chip can include a connected processor and memory; wherein the memory is configured to store instructions, and when the processor calls and executes the instructions, the chip can perform a low-pass filtering method provided in the above embodiment.
[0115] In addition, the present application also protects a computer device, see 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, wherein when the processor 402 executes the computer program 403, the computer device can perform any one of the low-pass filtering methods introduced above.
[0116] Example 4:
[0117] This embodiment also provides a computer-readable storage medium, which stores computer program code. When the computer program code runs on a computer, the computer executes the above-mentioned related method steps to implement a low-pass filtering method provided by the above embodiment.
[0118] Example 5:
[0119] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement a low-pass filtering method provided by the above embodiment.
[0120] Among them, the low-pass filter, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0121] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0122] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A low-pass filtering method, characterized in that: The method comprises the following steps: Get the voice signal of the current time period; The speech signal is decomposed into signal components by the principal component analysis algorithm and the characteristic value of each signal component is obtained; the importance of each signal component is obtained according to the signal distribution and characteristic value of each signal component; The target signal component is obtained based on the importance, and the target frequency range is determined according to the energy distribution in the spectrum corresponding to the target signal component; the maximum frequency in the target frequency range is used as the split frequency, and the cutoff frequency adjustment coefficient of the speech signal at the current moment is obtained based on the energy distribution difference in the non-target frequency range on both sides of the split frequency in the spectrum corresponding to each signal component and the energy distribution in the target frequency range; Obtain the current cutoff frequency based on the cutoff frequency adjustment coefficient; The method for obtaining the importance is: For any signal component, based on the fluctuation of the signal in the signal component, the signal component is divided into local signal segments; Obtaining the volume stability of the signal component according to the number of local signal segments and the duration and amplitude fluctuation of each local signal segment; According to the change of the signal in any two adjacent local signal segments, the volume gradient of the signal component is obtained; The result of normalizing the product of the characteristic value of the signal component, the volume stability and the volume gradual change is used as the importance of the signal component.
2. A low-pass filtering method according to claim 1, characterized in that: The method for obtaining the local signal segment is: The amplitude difference between each maximum point in the signal component and its previous adjacent minimum point is used as the instantaneous volume of each maximum point; Arrange the instantaneous volume according to the time sequence of the corresponding maximum value points to obtain the instantaneous volume sequence corresponding to the signal component; The instantaneous volume sequence is divided into local volume segments using an adaptive piecewise constant approximation algorithm, and the maximum point corresponding to the last instantaneous volume of each local volume segment is used as the segmentation point of the signal component. The signal component is divided into local signal segments by the split points.
3. A low-pass filtering method according to claim 1, characterized in that: The method for obtaining the volume stability is: 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; Using the variance of the volume change values of all local signal segments in the signal component as the first stable analysis value of the signal component; Obtaining the duration of each local signal segment as the local duration, and taking the ratio of the maximum local duration to the duration corresponding to the current time period as the second stable analysis value of the signal component; The volume stability of the signal component is obtained based on the number of local signal segments, the first stable analysis value and the second stable analysis value of the signal component; wherein, the number of local signal segments and the first stable analysis value are negatively correlated with the volume stability, and the second stable analysis value is positively correlated with the volume stability.
4. A low-pass filtering method as claimed in claim 2, characterized in that: The method for obtaining the volume gradient 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 a target curve; Negatively correlating and normalizing the fitting error of the target curve, and using the result as the reference weight of the reference signal segment; The result of negative correlation of the average absolute value of the tangent slope of all data points on the target curve is used as the reference gradient of the reference signal segment; The product of the reference weight and the reference gradient is used as the local volume gradient of the reference signal segment; The average of the local volume gradients of all reference signal segments of the signal component is used as the volume gradient of the signal component.
5. A low-pass filtering method according to claim 1, characterized in that: The method of obtaining the target signal component based on the importance and determining the target frequency range according to the energy distribution in the spectrum corresponding to the target signal component is as follows: The signal component corresponding to the greatest importance is taken as the target signal component; The spectrum graph corresponding to the target signal component is obtained by short-time Fourier transform, and the spectrum graph is fitted by the least square method to obtain the spectrum curve; The peak and valley detection algorithm is used to obtain the peaks and valleys in the spectrum curve, and the area between two adjacent valleys is regarded as the peak area; Get the area of each peak region as the characteristic area; When the characteristic area is greater than the preset area threshold, the frequency range corresponding to the corresponding peak area is used as the target frequency range.
6. A low-pass filtering method according to claim 5, characterized in that: The method for obtaining the cutoff frequency adjustment coefficient is: For any signal component, the area of the frequency spectrum curve segment after the split frequency in the frequency spectrum curve corresponding to the signal component is obtained as the high-frequency interference degree of the signal component; Obtaining the areas corresponding to all spectrum curve segments located before the split frequency and not within the target frequency range in the spectrum curve corresponding to the signal component as the low-frequency interference degree of the signal component; Obtaining a reference adjustment coefficient of the signal component based on a difference between a low-frequency interference level and a high-frequency interference level; Obtaining a ratio of the area of the region corresponding to all spectrum curve segments within the target frequency range in the spectrum curve corresponding to the signal component to the area of the region corresponding to the spectrum curve corresponding to the signal component as the effectiveness of the signal component; The product of the effectiveness and importance of the signal component is used as the attention level of the signal component; The ratio of the attention level of the signal component to the cumulative attention level 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 real participation adjustment coefficient of the signal component; The sum of the actual participating adjustment coefficients of all signal components is used as the cutoff frequency adjustment coefficient of the speech signal at the current moment.
7. A low-pass filtering method according to claim 1, characterized in that: The method for obtaining the cutoff frequency at the current moment based on the cutoff frequency adjustment coefficient is: The product of the initial cutoff frequency, the preset frequency adjustment index and the cutoff frequency adjustment coefficient is used as the cutoff frequency adjustment value of the speech signal at the current moment; The sum of the initial cutoff frequency and the cutoff frequency adjustment value is used as the cutoff frequency at the current moment.
8. A low-pass filtering system, characterized in that: The system comprises: A voice signal acquisition module is used to acquire the voice signal of the current time period; The importance acquisition module is used to decompose the speech signal into signal components through the principal component analysis algorithm and obtain the characteristic value of each signal component; according to the signal distribution and characteristic value of each signal component, the importance of each signal component is obtained; A cutoff frequency adjustment coefficient acquisition module is used to obtain target signal components based on their importance, determine the target frequency range based on the energy distribution in the spectrum corresponding to the target signal components, use the maximum frequency in the target frequency range as the split frequency, and obtain the cutoff frequency adjustment coefficient of the speech signal at the current moment based on the energy distribution difference in the non-target frequency range on both sides of the split frequency in the spectrum corresponding to each signal component and the energy distribution in the target frequency range; A cutoff frequency acquisition module, configured to acquire the cutoff frequency at the current moment based on the cutoff frequency adjustment coefficient; The method for obtaining the importance is: For any signal component, based on the fluctuation of the signal in the signal component, the signal component is divided into local signal segments; Obtaining the volume stability of the signal component according to the number of local signal segments and the duration and amplitude fluctuation of each local signal segment; According to the change of the signal in any two adjacent local signal segments, the volume gradient of the signal component is obtained; The result of normalizing the product of the characteristic value of the signal component, the volume stability and the volume gradual change is used as the importance of the signal component.
9. 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 executing the computer program, the processor implements the steps of a low-pass filtering method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Electroencephalogram signal preprocessing method and system and terminal equipment
CN117898743A
Audio Signal Processing Apparatus And Method For Processing An Input Audio Signal
US20180213342A1