A horn monomer universal abnormal sound detection method, system and computer equipment
Patent Information
- Application Number
- CN202611264556.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-20
- Publication Date
- 2026-10-27
AI Technical Summary
本发明主要提供了一种喇叭单体通用的异音检测方法,基于以预设的分类模型对获取的音频信号进行分类,能够避免人工分类主观性强的问题,提高分类的一致性,使得检测过程以及结果标准化,且不存在人工分类长时间工作疲劳导致的漏检率高的问题;并且,基于以MFCC 特征、频谱特征、时域特征、频域特征和THD失真特征作为分类依据,对喇叭异音识别更敏感,能够快速分辨正常音和异音,异音识别的鲁棒性更强。
Smart Images

Figure CN122994690A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio detection technology, and in particular to a method, system, and computer device for detecting abnormal noise in a single speaker unit. Background Technology
[0002] During the manufacturing process of speaker drivers, abnormal noises (such as friction noise, unwanted noise, distortion, resonance noise, distortion, and scratching sounds) are common defects. Currently, the industry relies heavily on manual listening for these defects, which presents the following problems: 1. Human judgment is highly subjective and lacks consistency; 2. Prolonged listening can easily cause fatigue and lead to a high rate of missed detections; 3. It is impossible to quantify abnormal sound characteristics, making it difficult to establish standardized detection methods; Existing audio detection algorithms are mostly designed for speech or music, and cannot meet the complex detection requirements of abnormal sounds from individual speaker units. These problems urgently need to be addressed. Summary of the Invention
[0003] This invention discloses a universal method, system, and computer device for detecting abnormal noise in a speaker unit, aiming to solve the technical problems existing in the prior art.
[0004] The present invention adopts the following technical solution: In a first aspect, the present invention provides a method for detecting abnormal noise in a speaker unit, comprising the following steps: Acquire the audio signal when the speaker is playing; The audio signal is preprocessed to obtain a processed signal; The processed signal is subjected to feature extraction to obtain feature information, which includes at least: MFCC features, spectral features, time-domain features, frequency-domain features, and THD distortion features; The feature information is input into a preset classification model to obtain classification results, which include normal sounds and abnormal sounds.
[0005] In the common noise detection method for speaker units of the present invention, the step of preprocessing the audio signal to obtain a processed signal includes: The audio signal is normalized, segmented, and denoised to obtain a denoised audio signal. The effective detection segments in the denoised audio signal are extracted to obtain the processed signal.
[0006] In the common noise detection method for speaker units of the present invention, the step of extracting the effective detection segment from the noise-reduced frequency signal includes: Select consecutive audio frames with RMS energy ≥ a first threshold from the noise-reduced frequency signal as candidate segments, merge adjacent candidate segments, and remove candidate segments with a length of 00ms to obtain the effective detection segment.
[0007] The first threshold E_th = E_global × 10%, where E_global is the global RMS energy of the noise-reduced frequency signal.
[0008] In the common noise detection method for speaker units of the present invention, the frequency domain features include 7-dimensional spectral contrast and 12-dimensional chromaticity vector; The 7-dimensional spectral contrast includes 6-dimensional sub-band contrast and global contrast.
[0009] In the common noise detection method for speaker units of the present invention, the 6-dimensional sub-band contrast acquisition step includes: dividing the processed signal into 6 different frequency bands according to audio frequency; The contrast within each frequency band is calculated to obtain the 6-dimensional sub-band contrast, where the contrast is the difference between the peaks and troughs of the amplitude spectrum or power spectrum of each frequency band. The global contrast ratio is the arithmetic mean of the contrast ratios of each frequency band.
[0010] In the general noise detection method for speaker units of the present invention, the THD distortion feature includes total harmonic distortion rate; and / or the MFCC feature includes the mean and standard deviation of 13-dimensional MFCC coefficients; and / or the spectral feature includes spectral centroid, spectral bandwidth and spectral roll-off point; and / or the time domain feature includes zero-crossing rate and RMS energy.
[0011] In the universal abnormal noise detection method for speaker units of the present invention, the preset classification model is a trained random forest binary classification model, and the training steps are as follows: Acquire audio signal samples, which include multiple normal sound audio signals and multiple abnormal sound audio signals; Acquire the feature information of each audio signal, and establish a correspondence between the feature information of each audio signal and the corresponding tag, wherein the tag includes normal sound and abnormal sound; The feature matrix formed by multiple feature information and the label vector formed by multiple labels are input into the random forest binary classification model for training. The trained random forest binary classification model is obtained.
[0012] In a second aspect, the present invention also provides an automatic noise detection system applicable to all speaker units, comprising: The acquisition module is used to acquire the audio signal when the speaker is playing. The preprocessing module is used to preprocess the audio signal to obtain a processed signal; The extraction module is used to extract features from the processed signal to obtain feature information, which includes at least: MFCC features, spectral features, time-domain features, frequency-domain features, and distortion features; The classification module is used to input the feature information into a preset classification model to obtain the classification result, wherein the classification result includes whether the audio signal is a normal sound or an abnormal sound.
[0013] In the speaker unit universal automatic noise detection system of the present invention, the classification module is also used to automatically complete the training and saving of the preset classification model based on the preset audio signal sample path.
[0014] The speaker unit universal abnormal sound automatic detection system of the present invention also includes a batch detection and result output module, which is used to acquire multiple audio signals and detect them one by one to obtain a CSV format detection report. The detection report includes at least the classification result of normal sound or abnormal sound, the confidence level of the result, and the probability of normal sound or abnormal sound.
[0015] In a third aspect, the present invention also provides a computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described in any of the preceding claims.
[0016] In a fourth aspect, the present invention also provides a computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in any of the preceding claims.
[0017] The technical solution adopted in this invention can achieve the following beneficial effects: This invention provides a universal method for detecting abnormal noise in a single speaker unit. Based on a preset classification model, the acquired audio signal is classified, which avoids the problem of strong subjectivity in manual classification, improves the consistency of classification, standardizes the detection process and results, and avoids the problem of high false negative rate caused by fatigue from long hours of manual classification. Furthermore, based on MFCC features, spectral features, time domain features, frequency domain features, and THD distortion features as classification criteria, it is more sensitive to speaker abnormal noise identification, can quickly distinguish between normal sounds and abnormal sounds, and has stronger robustness in abnormal noise identification. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below, forming part of the present invention. The illustrative embodiments of the present invention and their descriptions explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings: Figure 1 This is a flowchart of a universal abnormal noise detection method for a speaker unit according to the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. In the description of this invention, it should be noted that the term "or" is generally used to include the meaning of "and / or," unless otherwise expressly indicated.
[0020] Unless explicitly stated otherwise, the numerical parameters in this specification and the appended claims may be approximate values and can be varied according to the desired characteristics obtained from the content of this invention. Specifically, all figures used in the specification and claims to indicate the content of composition, reaction conditions, etc., should be understood to be modified by the term "about" in all cases. Generally, this means that there may be variations of ±10% in some embodiments, ±5% in some embodiments, ±1% in some embodiments, and ±0.5% in some embodiments.
[0021] Furthermore, the word "comprising" does not exclude the presence of materials or steps not listed in the claims. The ordinal numbers used in the specification and claims, such as "first," "second," "third," and Arabic numerals and letters, to modify corresponding elements or steps, do not in themselves imply an order of manufacturing process; their use is solely to ensure clear distinction between steps.
[0022] Furthermore, unless specifically described or required to occur in a specific order, the order of the above steps is not limited to those listed above and can be varied or rearranged according to the desired design. Moreover, the above embodiments can be used in combination with each other or with other embodiments based on design and reliability considerations; that is, technical features from different embodiments can be freely combined to form more embodiments.
[0023] Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0024] To address the problems existing in the prior art, embodiments of this application provide a method, system, and computer device for detecting abnormal noise in a single speaker unit.
[0025] Example 1 This embodiment provides a universal method for detecting abnormal noise in a speaker unit, such as... Figure 1 As shown, it includes the following steps: Acquire the audio signal when the speaker is playing; The audio signal is preprocessed to obtain the processed signal; The processed signal is subjected to feature extraction to obtain feature information, which includes at least: MFCC features, spectral features, time-domain features, frequency-domain features, and THD distortion features; The feature information is input into a preset classification model to obtain the classification result, which includes normal sound and abnormal sound, that is, to obtain the detection result of whether the audio signal is normal sound or abnormal sound.
[0026] This invention provides a universal abnormal noise detection method for speaker units. Based on classifying the acquired audio signals using a preset classification model, it avoids the problem of strong subjectivity in manual classification, improves classification consistency, standardizes the detection process and results, and eliminates the problem of high false negative rates caused by fatigue from long hours of manual classification. Furthermore, based on MFCC features, spectral features, time-domain features, frequency-domain features, and THD distortion features as classification criteria, it is more sensitive to abnormal noise detection in speakers, can quickly distinguish between normal and abnormal sounds, and achieves an accuracy rate of over 98%. Compared with conventional identification methods, the accuracy rate is improved by about 13%, and the robustness of abnormal noise detection is stronger.
[0027] In some preferred embodiments, the step of preprocessing the audio signal to obtain a processed signal includes: The audio signal is normalized, segmented, and denoised to obtain a de-noised frequency signal. Effective detection segments are then extracted from this signal to obtain the processed signal. Based on this, firstly, each frame can be individually analyzed (e.g., MFCC calculation, spectrogram analysis), thus accurately capturing the frequency distribution and energy changes of the signal at specific moments. Secondly, the short frames after segmentation (e.g., 10ms-25ms) have high temporal resolution, enabling the capture of rapidly changing transient impulse signals. Thirdly, spectral leakage is reduced, thereby improving the accuracy of spectral analysis and making the extracted features (e.g., fundamental frequency, formants) more accurate.
[0028] Preferably, the normalization process employs a peak normalization algorithm, which calculates the reciprocal of the maximum absolute value of the audio signal as a scaling factor to scale the audio signal amplitude to the range of [-1, 1], thereby eliminating the influence of volume differences.
[0029] Preferably, the frame segmentation processing steps are as follows: Set the frame length L = sampling rate × 0.02 (e.g., when the sampling rate is 48kHz, L = 960 sampling points), and the frame shift S = sampling rate × 0.01 (e.g., when the sampling rate is 48kHz, S = 480 sampling points). Generate a Hanning window w = 0.5 - 0.5 × cos(2πn / (L-1)) (n∈[0,L-1]). Slide the normalized audio signal into frames and add a window. If the last frame is not long enough, fill it with zeros.
[0030] Preferably, the noise reduction process employs spectral subtraction, selecting the first 10 frames as noise samples, and calculating the noise power spectral density N(k) = |FFT(noise_frame)|. 2 / L, where N(k) is the noise power spectral density at the k-th frequency point, FFT(noise_frame): perform FFT on a frame of noise signal, where L is the frame length; perform FFT on each audio frame to obtain the signal power spectral density X(k), where k is the k-th frequency point, subtract noise by spectral subtraction X_denoised(k)=max(X(k)-α×N(k),β) (α=0.9, β=0.001) to obtain the noise reduction power, replace the original signal power spectral density X(k) with the noise reduction power X_denoised(k), perform inverse FFT on X_denoised(k) to obtain the noise-reduced audio frame, and after denoising each audio frame, obtain the noise-reduced audio signal.
[0031] In some preferred embodiments, the step of extracting the effective detection segment from the noise-reduced frequency signal includes: Select consecutive audio frames with RMS energy ≥ the first threshold from the noise-reduced frequency signal as candidate segments, merge adjacent candidate segments (interval ≤ 100ms), and remove candidate segments with a length of 00ms to obtain effective detection segments; based on this, the detection speed can be improved.
[0032] The first threshold is E_th = E_global × 10%, where E_global is the global RMS energy of the noise-reduced audio signal, which is also the RMS energy of the first 10 frames of the audio signal.
[0033] In some preferred embodiments, the frequency domain features include a 7-dimensional spectral contrast and a 12-dimensional chromaticity vector; The 7-dimensional spectral contrast includes 6-dimensional sub-band contrast and 1-dimensional global contrast.
[0034] Preferably, the 6-dimensional sub-band contrast acquisition step includes: dividing the processed signal into 6 different frequency bands according to audio frequency; calculating the contrast within each frequency band to obtain the 6-dimensional sub-band contrast, where the contrast is the difference between the peaks and troughs of the amplitude spectrum or power spectrum of each frequency band; and the global contrast is the arithmetic mean of the contrasts of each frequency band.
[0035] Preferably, the method for obtaining the 12-dimensional chromaticity vector is as follows: Based on the 12-tone equal temperament, the frequency domain of the processed signal is mapped to 12 chromaticity intervals, which are C→C#→D→D#→E→F→F#→G→G#→A→A#→B. Each interval corresponds to a semitone scale, and the frequency ratio of adjacent chromaticity intervals is 2^(1 / 12). Calculate the sum of the power spectrum energy in each chromaticity interval and normalize it (the sum of the energy percentages in each interval is 1). The normalized energy proportions are arranged in the order C→C#→D→D#→E→F→F#→G→G#→A→A#→B to form a 12-dimensional chromaticity vector; Code representation: chroma=librosa.feature.chroma_stft(y=effective detection fragment,sr=44100,n_chroma=12); #The output dimension is (12, frame number), with 12 rows corresponding to 12 chroma ranges; `chroma_mean=np.mean(chroma,axis=1)` # Takes the mean value for each frame to obtain 12-dimensional chroma features. Based on this, by analyzing the energy proportion of each chroma interval, it can be determined whether there is distortion or clipping. The chroma vector of a normal loudspeaker shows a clear peak distribution (the energy proportion of the chroma interval corresponding to the fundamental frequency is ≥30%), while the chroma vector peaks of distorted loudspeakers are dispersed, and the energy proportion of each interval is ≤15%.
[0036] In some preferred embodiments, THD distortion features include total harmonic distortion rate; and / or MFCC features include the mean and standard deviation of 13-dimensional MFCC coefficients; and / or spectral features include spectral centroid, spectral bandwidth, and spectral roll-off point; and / or time-domain features include zero-crossing rate and RMS energy. This enables multi-dimensional feature extraction, such as 40 dimensions or more.
[0037] Preferably, the mean and standard deviation of the 13-dimensional MFCC coefficients can capture the "timbre" characteristics of audio and distinguish the texture of sound. The spectral centroid can reflect the "brightness" of sound; the spectral width can reflect the degree of spectral spread. The zero-crossing rate can distinguish between unvoiced and voiced sounds. The RMS energy (root mean square energy) can reflect the loudness and mechanical vibration intensity of audio, and the spectral roll-off point can distinguish the ratio of pitch to noise.
[0038] In some preferred embodiments, the preset classification model is a trained random forest binary classification model, and the training steps are as follows: Acquire audio signal samples, which include multiple normal sound audio signals and multiple abnormal sound audio signals; Acquire the feature information of each audio signal, and establish a correspondence between the feature information of each audio signal and the corresponding label, which includes normal sound and abnormal sound; The feature matrix formed by multiple feature information and the label vector formed by multiple labels are input into the random forest binary classification model for training. A trained random forest binary classification model is obtained.
[0039] Preferably, the training endpoint is defined as an accuracy of 95% or higher when validated on the validation set.
[0040] Preferably, Audio signal samples, also known as training samples, are WAV files that start with "OK" or "NG" and are stored in folders named with half-width English letters. Normal sounds are labeled "OK" and abnormal sounds are labeled "NG". Preferably, the folder structure and file prefixes under the path can be automatically parsed after selecting the training sample path through the GUI, without the need for manual labeling.
[0041] The feature information is the input to the training model, which is a set of fused feature vectors (X) with ≥40 dimensions (assuming 51 dimensions) and the corresponding label set (y), where X is the feature matrix of all training samples (dimension M×51, M is the number of training samples), and y is the label vector (1 represents OK sample, 0 represents NG sample). Training model output: The trained random forest binary classification model (.pkl format serialized file), which includes the ensemble parameters of 100 decision trees, the importance weights of each feature in the feature information, and the class mapping relationship.
[0042] Preferably, the category mapping relationship is the specific category corresponding to the audio signal source, such as single frequency, fast sweep frequency, step sweep frequency, music, silence, etc.
[0043] Preferably, the random forest binary classification model processes the prediction results of the random forest using the predict_proba method, outputting the probability of abnormal sound P(NG) and the probability of normal sound P(OK) for the audio information. P(NG) and P(OK) are compared; if P(OK) > P(NG), the classification result is OK; otherwise, it is NG. The confidence level of this prediction result is calculated as max(P(NG), P(OK)) × 100%. Specifically, the predict_proba method obtains the probability distribution by statistically analyzing the prediction results of 100 decision trees: for sample x, if 30 of the 100 decision trees predict NG and 70 predict OK, then P(NG) = 30 / 100 = 0.3, P(OK) = 70 / 100 = 0.7.
[0044] In some preferred embodiments, the acquired audio signal during speaker playback is saved as a WAV format audio file.
[0045] Example 2 This embodiment provides a universal automatic noise detection system for speaker units, which includes: The acquisition module is used to acquire the audio signal when the speaker is playing. The preprocessing module is used to preprocess the audio signal to obtain the processed signal; The extraction module is used to extract features from the processed signal to obtain feature information, which includes at least: MFCC features, spectral features, time-domain features, frequency-domain features, and distortion features. The classification module is used to input feature information into a preset classification model to obtain classification results. The classification results include whether the audio signal is normal or abnormal.
[0046] In some preferred embodiments, the classification module is also used to automatically train and save a preset classification model based on a preset audio signal sample path. This enables autonomous model training and updating, adapting to products on different production lines.
[0047] Preferably, the audio information to be tested is stored in the same folder, and the audio information ≥40-dimensional fusion features are extracted one by one by traversing the audio directory to be tested, and the feature matrix X_test (N×51, where N is the number of files to be tested) is constructed.
[0048] In some preferred embodiments, a batch detection and result output module is also included, used to acquire multiple audio signals and detect them one by one to obtain a CSV format detection report. The detection report includes at least the classification result of normal or abnormal sound, the confidence level of the result, and the probability of normal or abnormal sound. This allows for batch detection and automatic report generation, suitable for large-scale quality inspection on production lines.
[0049] In some preferred embodiments, a human-computer interaction GUI module is also included to provide functions such as training path selection, iteration number setting (i.e., the number of decision trees), single file detection, batch detection, and log display.
[0050] Example 3 This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in Embodiment 1 above.
[0051] Example 4 This embodiment provides a computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in Embodiment 1 above.
[0052] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
Claims
1. A method for detecting abnormal noise in a single loudspeaker unit, characterized in that, Includes the following steps: Acquire the audio signal when the speaker is playing; The audio signal is preprocessed to obtain a processed signal; The processed signal is subjected to feature extraction to obtain feature information, which includes at least: MFCC features, spectral features, time-domain features, frequency-domain features, and THD distortion features; The feature information is input into a preset classification model to obtain classification results, which include normal sounds and abnormal sounds.
2. The method for detecting abnormal noise in a speaker unit according to claim 1, characterized in that, The step of preprocessing the audio signal to obtain the processed signal includes: The audio signal is normalized, segmented, and denoised to obtain a denoised audio signal. The effective detection segments in the denoised audio signal are extracted to obtain the processed signal.
3. The method for detecting abnormal noise in a speaker unit according to claim 2, characterized in that, The step of extracting the effective detection segment from the noise-reduced frequency signal includes: Select consecutive audio frames with RMS energy ≥ a first threshold from the noise-reduced frequency signal as candidate segments, merge adjacent candidate segments, and remove candidate segments with a length of 00ms to obtain the effective detection segment. The first threshold E_th = E_global × 10%, where E_global is the global RMS energy of the noise-reduced frequency signal.
4. The method for detecting abnormal noise in a speaker unit according to claim 1, characterized in that, The frequency domain features include 7-dimensional spectral contrast and 12-dimensional chromaticity vector; The 7-dimensional spectral contrast includes 6-dimensional sub-band contrast and global contrast.
5. The method for detecting abnormal noise in a speaker unit according to claim 4, characterized in that, The 6-dimensional sub-band contrast acquisition step includes: dividing the processed signal into 6 different frequency bands according to audio frequency; The contrast within each frequency band is calculated to obtain the 6-dimensional sub-band contrast, where the contrast is the difference between the peaks and troughs of the amplitude spectrum or power spectrum of each frequency band. The global contrast ratio is the arithmetic mean of the contrast ratios of each frequency band.
6. The method for detecting abnormal noise in a speaker unit according to claim 1, characterized in that, The THD distortion features include total harmonic distortion rate; and / or the MFCC features include the mean and standard deviation of 13-dimensional MFCC coefficients; and / or the spectral features include spectral centroid, spectral bandwidth, and spectral roll-off point; and / or the time-domain features include zero-crossing rate and RMS energy.
7. The universal abnormal noise detection method for a speaker unit according to claim 1, characterized in that, The preset classification model is a trained random forest binary classification model, and the training steps are as follows: Acquire audio signal samples, which include multiple normal sound audio signals and multiple abnormal sound audio signals; Acquire the feature information of each audio signal, and establish a correspondence between the feature information of each audio signal and the corresponding tag, wherein the tag includes normal sound and abnormal sound; The feature matrix formed by multiple feature information and the label vector formed by multiple labels are input into the random forest binary classification model for training. The trained random forest binary classification model is obtained.
8. A universal automatic noise detection system for speaker units, characterized in that, include: The acquisition module is used to acquire the audio signal when the speaker is playing. The preprocessing module is used to preprocess the audio signal to obtain a processed signal; The extraction module is used to extract features from the processed signal to obtain feature information, which includes at least: MFCC features, spectral features, time-domain features, frequency-domain features, and distortion features; The classification module is used to input the feature information into a preset classification model to obtain the classification result, wherein the classification result includes whether the audio signal is a normal sound or an abnormal sound.
9. The automatic abnormal noise detection system for a single speaker unit according to claim 8, characterized in that, The classification module is also used to automatically train and save a preset classification model based on a preset audio signal sample path.
10. The automatic abnormal noise detection system for a single speaker unit according to claim 8, characterized in that, It also includes a batch detection and result output module, which is used to acquire multiple audio signals and detect them one by one to obtain a CSV format detection report. The detection report includes at least the classification result of normal sound or abnormal sound, the confidence level of the result, and the probability of normal sound or abnormal sound.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
12. A computer storage medium, characterized in that, The computer storage medium stores instructions that, when executed on the computer, cause the computer to perform the method as described in any one of claims 1 to 7.
