A time-frequency spectrum line spectrum extraction method and system based on K-means clustering

By using a K-means clustering method, the line spectrum features of underwater acoustic signals are automatically extracted, which solves the problems of low automation and poor noise resistance in existing line spectrum detection technologies, and realizes accurate line spectrum extraction and real-time processing in complex environments.

CN122241289APending Publication Date: 2026-06-19INST OF ACOUSTICS CHINESE ACAD OF SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF ACOUSTICS CHINESE ACAD OF SCI
Filing Date
2026-03-10
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies for underwater target identification suffer from low automation in line spectrum detection, poor noise resistance, and incomplete parameter extraction, making it difficult to accurately extract the line spectrum features of underwater acoustic signals in complex environments.

Method used

A K-means clustering method is adopted. The time spectrum of the underwater acoustic signal is obtained for preprocessing, significant energy points are extracted and feature vectors are constructed. The K-means clustering algorithm is used to perform clustering in the frequency-time joint domain and automatically extract line spectrum feature parameters.

Benefits of technology

It enables accurate and automatic detection and extraction of line spectrum features in complex environments, reduces algorithm complexity, and is suitable for real-time processing of large-scale data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241289A_ABST
    Figure CN122241289A_ABST
Patent Text Reader

Abstract

This invention discloses a time-spectrum line spectrum extraction method and system based on K-means clustering. The method includes: acquiring the time spectrum of an underwater acoustic signal and preprocessing it; extracting significant energy points based on statistical percentiles, and constructing each significant energy point into a feature vector containing frequency, time, and energy; using the K-means clustering algorithm to cluster all feature vectors to obtain several clusters, each cluster corresponding to a potential line spectrum trajectory; post-processing the clusters obtained by clustering, extracting line spectrum feature parameters from the effective clusters, and outputting the line spectrum detection result. This invention can fully exploit the similarity and differences between various time-spectrum energy sample points to obtain relatively accurate clustering results; it automatically completes clustering decisions directly based on sample features; and it adopts a processing method combining iterative updates and center optimization, which can effectively reduce the complexity of clustering operations and meet the needs of large-scale data analysis and real-time processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater acoustic signal processing and target recognition, specifically to a time-spectrum line spectrum extraction method and system based on K-means clustering, which can be applied to scenarios such as ship radiated noise analysis, propeller feature extraction, and underwater target recognition. Background Technology

[0002] In various technical fields such as acoustic signal processing and underwater target recognition, time-frequency spectrum is a crucial time-frequency analysis tool that can intuitively display the changes in signal frequency components over time. In practical applications, the spectrum often contains a feature called "line spectrum," which manifests as a narrowband signal that persists continuously in the time dimension and has highly concentrated energy in the frequency dimension. These line spectra are usually directly related to physical phenomena such as shaft frequency, blade frequency, and propeller noise in rotating machinery. Therefore, accurately and automatically detecting and extracting these line spectrum features from complex broadband background noise is of great significance for target feature recognition. Traditional line spectrum detection methods are mostly derived from basic image and signal processing techniques, and their limitations are becoming increasingly apparent. Global / local thresholding: Although computationally simple, its performance is highly dependent on the selection of the threshold. In scenarios with large signal-to-noise ratio fluctuations, a fixed threshold is difficult to balance the detection probability and the false alarm probability, which can easily cause line spectrum breaks or introduce a large amount of noise.

[0003] Morphological manipulation: This method effectively processes slowly changing curve-like line spectra by designing specific structural elements, but the size of the structural elements requires prior knowledge and lacks adaptability.

[0004] Peak tracking method: This method finds local extrema in each time frame and connects them on the time axis to form a trajectory based on the proximity principle. Although this method is physically intuitive, it is prone to error propagation due to false detections or missed detections in a single frame, which can lead to interruption or deviation of the tracking trajectory. The algorithm has poor robustness and is difficult to handle complex situations where multiple line spectrums intersect. Summary of the Invention

[0005] To address the problems of low automation, poor noise resistance, and incomplete parameter extraction in existing online spectrum detection technologies, this invention aims to overcome these shortcomings by proposing a time-spectrum line spectrum extraction method and system based on K-means clustering.

[0006] In view of this, the present invention proposes a time-frequency line spectrum extraction method based on K-means clustering, comprising: Step 1: Obtain the time spectrum of the underwater acoustic signal and perform preprocessing; Step 2: Extract significant energy points based on statistical percentiles, and construct a feature vector containing frequency, time and energy for each significant energy point; Step 3: Use the K-means clustering algorithm to cluster all feature vectors to obtain several clusters, each cluster corresponding to a potential line trajectory; Step 4: Post-process the clusters obtained from clustering, extract line spectrum feature parameters from the valid clusters, and output the line spectrum detection results.

[0007] As an improvement to the above method, the preprocessing in step 1 includes: Power calculations and logarithmic transformations are performed on the time-frequency spectrum to convert the linear scale to a logarithmic scale; The time spectrum is frequency filtered according to a preset effective frequency range, and data within the set frequency range is retained. The filtered time spectrum is normalized.

[0008] As an improvement to the above method, the normalization process adopts the following formula:

[0009] in, This is the normalized time-frequency spectrum. To prevent division by zero constants, This is the filtered time spectrum. and These represent taking the maximum and minimum values, respectively.

[0010] As an improvement to the above method, step 2 includes: normalized time spectrum Dynamic energy thresholds are set based on statistical percentiles. The percentile setting achieves the optimal balance between detection sensitivity and false alarm rate: in, Indicates the quantile of all values ​​in the time-series spectrum; From the time spectrum, the retained energy is greater than The point is obtained as a significant energy point. : in, and For the frequency and time of significant energy points, The energy corresponding to the significant energy point. The number of significant energy points; From significant energy points , construct feature vectors.

[0011] As an improvement to the above method, step 3 includes: Using minimizing the sum of squared errors within a cluster as the objective function, the feature vector set is partitioned through iterative optimization. There are clusters, each cluster corresponding to a potential line spectral trajectory; the objective function is:

[0012] in, For clusters The center, For feature vectors, i Indicates the first i Clusters.

[0013] As an improvement to the above method, step 4 performs post-processing on the clusters obtained from clustering to extract line spectral feature parameters from the effective clusters, specifically including: Clusters with fewer than a preset threshold of samples are removed, while valid clusters are retained. For each valid cluster Calculate its center frequency Average energy ,bandwidth Start time and termination time , thus obtaining the corresponding line spectrum characteristic parameters; The line spectrum characteristic parameters of all valid clusters are combined to form the final line spectrum set. .

[0014] As an improvement to the above method, the specific calculation of the line spectrum characteristic parameters is as follows:

[0015]

[0016]

[0017] in, This is the frequency resolution, used to avoid situations where the bandwidth is zero;

[0018] Line spectrum collection for:

[0019] in, For the number of valid line spectra, , This indicates the total number of clusters.

[0020] On the other hand, the present invention provides a time-spectrum line spectrum extraction system based on K-means clustering, comprising: The preprocessing module is used to acquire the time spectrum of the underwater acoustic signal and perform preprocessing. The energy point extraction module is used to extract significant energy points based on statistical percentiles, and to construct a feature vector containing frequency, time and energy for each significant energy point; The clustering analysis module is used to cluster all feature vectors using the K-means clustering algorithm to obtain several clusters, each cluster corresponding to a potential line trajectory; The feature extraction module is used to post-process the clusters obtained by clustering, extract line spectrum feature parameters from the effective clusters, and output the line spectrum detection results.

[0021] Compared with the prior art, the advantages of the present invention are: 1. This invention utilizes the K-means clustering method, which can fully explore the similarities and differences between the energy sample points of different time spectral periods, and obtain more accurate clustering results on this basis; 2. This invention does not rely on manual annotation or prior training samples. It automatically completes clustering decisions directly based on sample features through unsupervised learning. 3. This invention adopts a processing method that combines iterative updates and center optimization, which effectively reduces the complexity of clustering operations and can meet the needs of large-scale data analysis and real-time processing. Attached Figure Description

[0022] Figure 1 This is a flowchart of the time-frequency line spectrum extraction method based on K-means clustering of the present invention; Figure 2 This is the line spectrum detection result of object 1 in Example 2; Figure 3 This is the line spectrum detection result of object 2 in Example 2; Figure 4 This is the line spectrum detection result of object 3 in Example 2. Detailed Implementation

[0023] To overcome the limitations of existing technologies, this invention employs a time-frequency line spectrum extraction method based on K-means clustering. K-means clustering, a classic and efficient partitioning clustering method, is introduced to solve this problem. Its core idea is to treat each significant time-frequency point (i.e., a pixel with energy above a certain threshold) in the time-frequency spectrum as a data sample. The attributes of this sample include its frequency value, timestamp, and normalized energy value. The K-means algorithm automatically clusters these sample points in the joint frequency-time domain, grouping points belonging to the same physical line spectrum into the same cluster. The result of each cluster represents a detected line spectrum. By calculating the statistical characteristics of the frequency, time, and energy of points within each cluster, key feature parameters such as the center frequency, average energy, bandwidth, and start and end times of the line spectrum can be effectively estimated.

[0024] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0025] Example 1 like Figure 1 As shown, Embodiment 1 of the present invention proposes a time-frequency line spectrum extraction method based on K-means clustering. The technical solution includes the following steps: (1) Calculate the time spectrum of the underwater acoustic signal, filter the time spectrum data by frequency range, focus on the effective frequency band that may exist in the target line spectrum, reduce the amount of calculation and irrelevant noise interference, and normalize the filtered time spectrum. (2) Extract significant energy points based on statistical percentiles; then combine the frequency, time and energy information of the significant points into a feature vector, and use the K-means clustering algorithm to perform cluster analysis on the feature vector; (3) Extract line spectrum feature parameters from the clustering results, including center frequency, average energy, bandwidth, start time and end time, and perform post-processing to filter invalid clusters.

[0026] The core innovation of this invention lies in transforming the time-spectrum line spectrum detection problem into a clustering problem in a three-dimensional feature space, automatically discovering and extracting continuous line spectrum patterns through unsupervised learning. This method does not require pre-defining the morphological features of the line spectrum, has inherent robustness to line spectrum breaks and undulations, and can effectively handle line spectrum detection tasks in complex environments.

[0027] The specific steps are as follows: (1) First, the time spectrum of the original underwater acoustic signal is calculated by short-time Fourier transform:

[0028] in For time frame indexing, For frequency index, For window functions, such as the Hamming window.

[0029] Power calculation and logarithmic transformation of the time spectrum: Converting from a linear to a logarithmic scale better aligns with the perceptual characteristics of the human ear and also helps enhance the visibility of weak signals. Logarithmic transformation can compress the dynamic range, allowing signal components of varying intensities to be observed and analyzed at the same scale.

[0030] Set effective frequency range The time spectrum is filtered by frequency range, retaining only data within a specified frequency range: .

[0031] Frequency range filtering is determined based on prior knowledge or signal characteristics. Typically, the line spectrum components of ship radiated noise are concentrated within a specific frequency range. By filtering out irrelevant frequency bands, not only is the computational load reduced, but the signal-to-noise ratio is also improved, which is helpful for subsequent line spectrum detection.

[0032] Normalize the time-frequency spectrum: in, To prevent division by zero of constants.

[0033] (2) Set a dynamic energy threshold for the normalized time spectrum based on statistical percentiles. : in This represents the quantile of all values ​​in the time-series spectrum. Setting a dynamic threshold avoids the limitations of a fixed threshold, allowing for adaptive adjustment of detection sensitivity. The choice of percentile can be adjusted based on specific application scenarios and signal characteristics, achieving an optimal balance between detection sensitivity and false alarm rate.

[0034] From the time-frequency spectrum, points with energy greater than a threshold are retained and denoted as the set of salient points. : in, and Represents the frequency and time of salient points. This represents the energy corresponding to the significant point. This represents the number of salient points. The extracted salient points are used for subsequent K-means clustering.

[0035] Each salient point is constructed as a three-dimensional feature vector, which is used as input for K-means clustering: (3) The optimization objective of the classic K-means is to optimize the set of salient points. Divided into Cluster To minimize the sum of squared errors within clusters, the objective function of K-means clustering is: in, For clusters The center of the cluster represents its average characteristics.

[0036] To solve the above optimization problem, the K-means algorithm employs an iterative optimization strategy: First, select randomly. Each point is used as the cluster center, and each sample point is... Assign to the nearest cluster:

[0037] For each cluster Recalculate its cluster center It is then updated and iterated continuously until the iteration stops.

[0038] In this invention, each sample point in the salient point set is composed of frequency, time, and energy. These points are divided into several clusters using K-means clustering, with each cluster corresponding to a potential spectral trajectory. Cluster centers are then defined. The frequency range and time span of the points within the cluster represent the characteristic mean of the spectrum, while the frequency range and time span of the points within the cluster characterize the bandwidth and duration of the spectrum.

[0039] (3) After completing the clustering, denote the clustering result as the cluster set. Each cluster Includes several salient point samples To avoid interference from noise points or small-scale clusters, this invention ignores clusters with fewer than a certain number of samples and extracts line spectral features only from valid clusters.

[0040] For each valid cluster Extract the following parameters: Center frequency:

[0041] The mean of the frequencies of all points within a cluster reflects the main frequency position of the line spectrum.

[0042] Average energy:

[0043] This indicates the average energy level of the line spectrum in the time spectrum.

[0044] bandwidth:

[0045] in This is the frequency resolution (equal to the interval between adjacent frequency sampling points), used to avoid cases where the bandwidth is zero.

[0046] Start time and end time: Describe the duration range of the spectrum corresponding to the earliest and latest times of its appearance in the time spectrum.

[0047] Finally, the set of line spectra can be represented as:

[0048] in This represents the number of valid line spectra.

[0049] Example 2 To verify the effectiveness of the method of the present invention, three ship radiated noise signals from the ShipsEar dataset were selected as experimental subjects.

[0050] First, a short-time Fourier transform is performed on any original time-domain signal with a window length of 2048 and a step size of 1024 to obtain the time spectrum, which is then further calculated. The power spectral intensity is compressed to the [0,1] interval by decibel normalization.

[0051] Secondly, the detection frequency range [0, 2000] was set to filter out irrelevant frequency bands. The 80th percentile was used as the energy threshold to extract the set of salient points.

[0052] Then, the salient points are constructed into three-dimensional feature vectors and input into a K-means clustering model, with the number of clusters set to 10. Through iterative optimization, several clusters are finally obtained, each cluster corresponding to a candidate line spectrum. The line spectrum results of the method of this invention on the experimental object are shown in Table 1, sorted from low to high according to the extracted line spectrum frequency. The line spectrum detection results are as follows: Figure 2 , Figure 3 and Figure 4 As shown.

[0053] Table 1. Line spectrum extraction results of this invention

[0054]

[0055] Experimental results show that the method of the present invention can accurately extract multiple stable line spectra from ship radiated noise, and the output line spectrum parameters are more complete, making it suitable for subsequent ship target identification and classification.

[0056] Example 3 Embodiment 3 of the present invention provides a time-spectrum line spectrum extraction system based on K-means clustering, implemented based on the method of Embodiment 1. The system includes: The preprocessing module is used to acquire the time spectrum of the underwater acoustic signal and perform preprocessing. The energy point extraction module is used to extract significant energy points based on statistical percentiles, and to construct a feature vector containing frequency, time and energy for each significant energy point; The clustering analysis module is used to cluster all feature vectors using the K-means clustering algorithm to obtain several clusters, each cluster corresponding to a potential line trajectory; The feature extraction module is used to post-process the clusters obtained from clustering, extract line spectrum feature parameters from the valid clusters, and output the line spectrum detection results. It is worth noting that in the embodiments of the above system, the modules included are divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional module are only for easy differentiation and are not used to limit the scope of protection of the present invention.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the embodiments, those skilled in the art should understand that modifications or equivalent substitutions to the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A time-spectral line spectrum extraction method based on K-means clustering, comprising: Step 1: Obtain the time spectrum of the underwater acoustic signal and perform preprocessing; Step 2: Extract significant energy points based on statistical percentiles, and construct a feature vector containing frequency, time and energy for each significant energy point; Step 3: Use the K-means clustering algorithm to cluster all feature vectors to obtain several clusters, each cluster corresponding to a potential line trajectory; Step 4: Post-process the clusters obtained from clustering, extract line spectrum feature parameters from the valid clusters, and output the line spectrum detection results.

2. The time-frequency line spectrum extraction method based on K-means clustering according to claim 1, characterized in that, The preprocessing in step 1 includes: Power calculations and logarithmic transformations are performed on the time-frequency spectrum to convert the linear scale to a logarithmic scale; The time spectrum is frequency filtered according to a preset effective frequency range, and data within the set frequency range is retained. The filtered time spectrum is normalized.

3. The time-frequency line spectrum extraction method based on K-means clustering according to claim 2, characterized in that, The normalization process is performed using the following formula: in, This is the normalized time-frequency spectrum. To prevent division by zero constants, This is the filtered time spectrum. and These represent taking the maximum and minimum values, respectively.

4. The time-frequency line spectrum extraction method based on K-means clustering according to claim 1, characterized in that, Step 2 includes: normalized time spectrum Dynamic energy thresholds are set based on statistical percentiles. The percentile setting achieves the optimal balance between detection sensitivity and false alarm rate: in, Indicates the quantile of all values ​​in the time-series spectrum; From the time spectrum, the retained energy is greater than The point is obtained as a significant energy point. : in, and For the frequency and time of significant energy points, The energy corresponding to the significant energy point. The number of significant energy points; From significant energy points , construct feature vectors.

5. The time-frequency line spectrum extraction method based on K-means clustering according to claim 1, characterized in that, Step 3 includes: Using minimizing the sum of squared errors within a cluster as the objective function, the feature vector set is partitioned through iterative optimization. There are clusters, each cluster corresponding to a potential line spectral trajectory; the objective function is: in, For clusters The center For feature vectors, i Indicates the first i Clusters.

6. The time-frequency line spectrum extraction method based on K-means clustering according to claim 4, characterized in that, Step 4 involves post-processing the clusters obtained from clustering to extract line spectral feature parameters from the effective clusters, specifically including: Clusters with fewer than a preset threshold of samples are removed, while valid clusters are retained. For each valid cluster Calculate its center frequency Average energy ,bandwidth Start time and termination time , thus obtaining the corresponding line spectrum characteristic parameters; The line spectrum characteristic parameters of all valid clusters are combined to form the final line spectrum set. .

7. The time-frequency line spectrum extraction method based on K-means clustering according to claim 6, characterized in that, The specific calculation of the line spectrum characteristic parameters is as follows: in, This is the frequency resolution, used to avoid situations where the bandwidth is zero; Line spectrum collection for: in, For the number of valid line spectra, , This indicates the total number of clusters.

8. A time-spectrum line spectrum extraction system based on K-means clustering, characterized in that, include: The preprocessing module is used to acquire the time spectrum of the underwater acoustic signal and perform preprocessing. The energy point extraction module is used to extract significant energy points based on statistical percentiles, and to construct a feature vector containing frequency, time and energy for each significant energy point; The clustering analysis module is used to cluster all feature vectors using the K-means clustering algorithm to obtain several clusters, each cluster corresponding to a potential line trajectory; and The feature extraction module is used to post-process the clusters obtained by clustering, extract line spectrum feature parameters from the effective clusters, and output the line spectrum detection results.