Spectrum analysis method, device and signal processing device
By introducing convolutional neural networks into spectrum analysis and using the frequency domain feature map of the window function for convolution operations, the problems of spectrum leakage and fence loss are solved, and the accuracy of spectrum analysis is improved.
Patent Information
- Application Number
- CN202211475658.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-11-23
AI Technical Summary
Existing spectrum analysis methods suffer from frequency domain distortion problems such as spectrum leakage and fence loss, resulting in poor accuracy of spectrum analysis results.
A convolutional neural network is used to process the discrete real and imaginary signals in the frequency domain. The frequency domain correlation feature map of the window function is used as the convolution kernel, and the negative impact of the window function in the frequency domain is compensated by the pre-trained convolutional neural network.
It effectively eliminates frequency domain distortions such as spectral leakage and fence loss, improving the accuracy of spectral analysis.
Smart Images

Figure CN116150583B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of signal processing, in particular to a spectrum analysis method and device and a signal processing device. BACKGROUND
[0002] Spectrum refers to a representation of a time-domain signal in a frequency domain. Spectrum analysis is a process of analyzing a time-domain signal to obtain information (such as amplitude, power, intensity or phase) at different frequencies or frequency bands. Spectrum analysis can be used for signal detection in a communication field under wideband noise, and can also be used for audio signal processing. At present, there are different methods for spectrum analysis, but these methods have problems such as spectral leakage, scalloping loss and other frequency domain distortions, resulting in poor accuracy of spectrum analysis results. SUMMARY
[0003] Therefore, the embodiments of the present application aim to provide a spectrum analysis method and device and a signal processing device using the method to improve the accuracy of spectrum analysis.
[0004] In a first aspect, the embodiments of the present application provide a spectrum analysis method, which comprises:
[0005] determining a first discrete time-domain signal corresponding to an input signal;
[0006] performing windowing processing on the first discrete time-domain signal using at least one window function to determine at least one second discrete time-domain signal after windowing processing;
[0007] converting the second discrete time-domain signal to a frequency domain to determine a corresponding discrete frequency-domain signal, the discrete frequency-domain signal comprising a real part signal and an imaginary part signal;
[0008] mapping the real part signal and the imaginary part signal of each discrete frequency-domain signal into a real part hidden layer signal and an imaginary part hidden layer signal respectively based on a convolutional neural network, and then determining a spectrum distribution of the input signal according to the real part hidden layer signal and the imaginary part hidden layer signal;
[0009] wherein the convolutional neural network is pre-trained, and the convolutional neural network uses a plurality of feature maps associated with the window function as convolution kernels.
[0010] Further, the plurality of feature maps associated with the window function are respectively a convolution of a discrete frequency-domain transform of the window function and a characteristic frequency.
[0011] Further, the characteristic frequency comprises a plurality of discrete frequencies.
[0012] Further, the plurality of discrete frequencies includes at least a zero frequency.
[0013] Further, mapping the real part signal and the imaginary part signal into a real part hidden layer signal and an imaginary part hidden layer signal based on the convolutional neural network respectively comprises:
[0014] inputting the real part signal into neurons corresponding to each feature map to determine a first hidden layer signal corresponding to each feature map;
[0015] inputting the imaginary part signal into neurons corresponding to each feature map to determine a second hidden layer signal corresponding to each feature map;
[0016] performing a pooling operation on the plurality of first hidden layer signals and performing a pooling operation on the second hidden layer signals through a pooling layer to determine the real part hidden layer signal and the imaginary part hidden layer signal;
[0017] wherein the neurons perform a convolution operation on the input according to the corresponding feature map and perform an activation operation on the convolution result according to a predetermined activation function.
[0018] Further, the activation function is a square function, a ReLu function or a Sigmoid function.
[0019] Further, the pooling operation is a cascaded pooling, a maximum pooling or a random pooling.
[0020] Further, the window function is a Hann window function.
[0021] Further, the windowing processing of the first discrete time domain signal using at least one window function to determine at least one second discrete time domain signal after the windowing processing comprises:
[0022] performing windowing processing of the first discrete time domain signal using a plurality of different window functions to determine a plurality of second discrete time domain signals.
[0023] Further, the plurality of window functions define windows arranged in sequence in the time domain; or
[0024] the plurality of window functions define windows overlapping with each other in the time domain.
[0025] Further, determining the frequency spectrum distribution of the input signal according to the real part hidden layer signal and the imaginary part hidden layer signal comprises:
[0026] converting the real part hidden layer signal and the imaginary part hidden layer signal into the frequency spectrum distribution of the input signal using a fully connected layer.
[0027] Further, the fully connected layer is obtained through training, wherein a weight matrix of the fully connected layer is initialized using an inverse of a cross-correlation matrix of each feature map.
[0028] In a second aspect, an embodiment of the present application provides a spectrum analysis device, comprising:
[0029] a sampling unit configured to determine a first discrete time domain signal corresponding to an input signal;
[0030] a windowing unit configured to perform windowing processing on the first discrete time domain signal using at least one window function to determine at least one second discrete time domain signal after windowing processing;
[0031] a frequency domain conversion unit configured to convert the second discrete time domain signal to a frequency domain to determine a corresponding discrete frequency domain signal, the discrete frequency domain signal comprising a real part signal and an imaginary part signal;
[0032] a convolutional neural network configured to respectively map the real part signal and the imaginary part signal of each discrete frequency domain signal to a real part hidden layer signal and an imaginary part hidden layer signal, and further perform classification according to the real part hidden layer signal and the imaginary part hidden layer signal to determine a spectrum distribution of the input signal;
[0033] wherein the convolutional neural network is determined through pre-training, and the convolutional neural network uses a plurality of feature maps associated with the window function as convolution kernels.
[0034] Further, the plurality of feature maps associated with the window function are respectively convolutions of a discrete frequency domain transformation of the window function and a characteristic frequency.
[0035] Further, the characteristic frequency comprises a plurality of discrete frequencies.
[0036] Further, the plurality of discrete frequencies at least comprises a zero frequency.
[0037] Further, the convolutional neural network comprises:
[0038] neurons corresponding to each feature map, configured to receive the real part signal to determine a first hidden layer signal corresponding to each feature map, and receive the imaginary part signal to determine a second hidden layer signal corresponding to each feature map, wherein the neurons perform convolution operation on input according to the corresponding feature map, and perform activation operation on the convolution result according to a predetermined activation function.
[0039] a pooling layer configured to respectively perform pooling operation on a plurality of first hidden layer signals and perform pooling operation on second hidden layer signals to determine a real part hidden layer signal and an imaginary part hidden layer signal.
[0040] Further, the activation function is a square function, a ReLu function or a Sigmoid function.
[0041] Further, the pooling operation is cascade pooling, maximum pooling or random pooling.
[0042] Further, the window function is a Hann window.
[0043] Further, the windowing unit is configured to window the first discrete time domain signal using a plurality of different window functions to determine a plurality of second discrete time domain signals.
[0044] Further, the plurality of window functions define windows in time domain that are arranged in sequence; or
[0045] The plurality of window functions define windows in time domain that overlap with each other.
[0046] Further, the convolutional neural network further comprises a fully connected layer configured to convert the real part hidden layer signal and the imaginary part hidden layer signal into a frequency spectrum distribution of the input signal.
[0047] Further, the fully connected layer is obtained by training, wherein a weight matrix of the fully connected layer is initialized using an inverse of a cross-correlation matrix of each feature map.
[0048] In a third aspect, an embodiment of the present application provides a signal processing apparatus, comprising a memory and a processor, the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method of the first aspect.
[0049] The embodiment of the present application introduces a convolutional neural network to process the discrete real part signal and the discrete imaginary part signal in the frequency domain on the basis of the existing periodogram spectrum analysis method, and performs convolution operation in the convolutional neural network by using the frequency domain correlation characteristics of the window function used in the time domain, so that the problems of frequency domain distortion such as spectrum leakage and fence loss caused by the time domain processing of the window function in the frequency domain can be eliminated to a certain extent. Meanwhile, in combination with the trained convolutional neural network, the accuracy of spectrum analysis can be effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0050] The above and other objects, features and advantages of the present application will become more apparent from the following description of embodiments of the present application taken in conjunction with the accompanying drawings, in which:
[0051] Figure 1 is a data processing flow chart of the prior art based on the periodogram spectrum analysis method;
[0052] Figure 2 is a data processing flow chart of the prior art based on the maximum entropy spectrum analysis method;
[0053] Figure 3 is a flow chart of the spectrum analysis method of the embodiment of the present application;
[0054] Figure 4 is a data flow diagram of a spectrum analysis method according to an embodiment of the present application;
[0055] Figure 5 is a data flow diagram of a spectrum analysis method according to an embodiment of the present application;
[0056] Figure 6 is a data flow diagram of a spectrum analysis method according to another embodiment of the present application;
[0057] Figure 7 is a spectrum distribution result diagram of a spectrum analysis method according to an embodiment of the present application and other spectrum analysis methods;
[0058] Figure 8 is a schematic diagram of a spectrum analysis apparatus according to an embodiment of the present application;
[0059] Figure 9 is a schematic diagram of a signal processing apparatus according to an embodiment of the present application. DETAILED DESCRIPTION
[0060] The present application is described in detail below based on embodiments, but the present application is not limited to only these embodiments. In the following detailed description of the present application, some specific details are described in detail. The present application can also be fully understood without the description of these details by those skilled in the art. In order to avoid confusion of the essence of the present application, well-known methods, processes, procedures, elements and circuits are not described in detail.
[0061] In addition, those of ordinary skill in the art should understand that the drawings provided herein are for illustrative purposes only and are not necessarily drawn to scale.
[0062] In the description of the present application, it should be understood that the terms "first", "second", etc. are only for the purpose of description, and cannot be understood as indicating or implying relative importance. In addition, in the description of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0063] Figure 1 is a data processing flow diagram of a periodogram-based spectrum analysis method according to the prior art. The periodogram-based spectrum analysis method is also called periodogram method, which is commonly used for signal power spectrum density estimation. The principle of the periodogram method is that since the discrete Fourier transform of a discrete-time signal has periodicity, its power spectrum also has periodicity, which can be called periodogram. A classical periodogram-based spectrum analysis method is as follows: Figure 1As shown, for the input analog signal IN (also referred to as continuous time signal) is converted into discrete time signal DIN by analog-digital converter 11 (ADC). The discrete time signal DIN is multiplied by window function f(t) (in Figure 1 the middle, the discrete time signal DIN is input to multiplier 12) so that it is windowed to obtain windowed discrete time signal WIN. The signal WIN is converted into frequency domain by discrete Fourier transform 13 to obtain real part signal RC and imaginary part signal IC. Then, the real part signal and the imaginary part signal are respectively processed by square function X 2 and output to adder 14 for addition to obtain power spectrum PS. The advantage of periodogram method is that fast algorithm of discrete Fourier transform can be applied to estimate. However, the introduction of window function can cause frequency domain distortion problems such as spectrum leakage, fence loss, etc.
[0064] Figure 2 is the data processing flow chart of maximum entropy spectrum analysis method of prior art. The principle of maximum entropy spectrum analysis method is to take a set of discrete time series, make its autocorrelation function same as the autocorrelation function of a set of known data, and make the randomness of the part other than the known autocorrelation function strongest, so as to take the spectrum of the taken time series as the spectrum estimation of the known data. It is equivalent to obtaining power spectrum by extrapolating other unknown autocorrelation function values according to the principle of making the entropy of random process maximum, using N known autocorrelation function values. The maximum entropy method power spectrum estimation is a non-linear spectrum estimation method which can obtain high resolution, and is particularly suitable for short data length. As shown in Figure 2 the middle, the discrete time signal DIN is input to multiplier 12) so that it is windowed to obtain windowed discrete time signal WIN. The signal WIN is converted into frequency domain by discrete Fourier transform 13 to obtain real part signal RC and imaginary part signal IC. Then, the real part signal and the imaginary part signal are respectively processed by square function X 2 and output to adder 14 for addition to obtain power spectrum PS. The maximum entropy spectrum analysis method needs prior information about the expected spectrum of the input signal, and if the actual spectrum or time domain signal does not conform to the prior information, the result will be wrong.
[0065] In view of the above defects of prior art, the embodiment of the present application provides a spectrum analysis method to improve the accuracy of spectrum analysis. Figure 3 is the flow chart of spectrum analysis method of the embodiment of the present application. As shown in Figure 3 the middle, the discrete time signal DIN is input to multiplier 12) so that it is windowed to obtain windowed discrete time signal WIN. The signal WIN is converted into frequency domain by discrete Fourier transform 13 to obtain real part signal RC and imaginary part signal IC. Then, the real part signal and the imaginary part signal are respectively processed by square function X
[0066] At step S310, a first discrete time domain signal corresponding to the input signal is determined.
[0067] In the embodiment, the input signal is an analog signal, i.e., a continuous time domain signal. Specifically, the input time domain analog signal can be converted into a discrete time domain signal or a digital time domain signal by a hardware analog-digital converter. Alternatively, a software processing module can be set up to convert the input signal into the first discrete time domain signal based on general computing hardware.
[0068] At step S320, at least one window function is used to perform windowing processing on the first discrete time domain signal to determine at least one second discrete time domain signal after windowing processing.
[0069] In the description herein, the windowing processing refers to multiplying the window function with the first discrete time domain signal to obtain the second discrete time domain signal after windowing processing. Since the discrete Fourier transform (DFT) can only transform a finite length of time domain data, the time domain signal needs to be truncated. Even if the signal is a periodic signal, if the truncated time length is not an integer multiple of the period (periodic truncation), the truncated signal will have leakage. In order to minimize this leakage error, the window function is used to process the time domain signal so that the time domain signal better meets the periodicity requirement of the discrete Fourier transform processing.
[0070] In one embodiment, the windowing processing is performed using a Hann window function at step S320. The Hann window function w(t) can be represented by the following formula:
[0071]
[0072] where t is the time variable, T is the length of the preset Hann window, t is greater than or equal to 0 and less than or equal to T.
[0073] In other optional implementations, other types of window functions can also be used, such as a rectangular window function, a flat-top window function, or a Hamming window function, etc.
[0074] In one optional implementation, only one window function is used to perform windowing processing on the first discrete time domain signal to obtain one second discrete time domain signal for subsequent processing.
[0075] In another optional implementation, multiple different window functions are used to perform windowing processing on the first discrete time domain signal respectively to determine multiple second discrete time domain signals, which are processed in parallel, as described in detail in the subsequent figures.
[0076] At step S330, the second discrete time domain signal is converted to a frequency domain to determine a corresponding discrete frequency domain signal. The discrete frequency domain signal includes a real part signal and an imaginary part signal.
[0077] Specifically, the conversion of the discrete time domain signal to the discrete frequency domain signal can be completed by a Discrete Fourier Transform (DFT). The discrete frequency domain signal obtained by the Discrete Fourier Transform is a complex number. In engineering practice, when outputting, a sequence of discrete signals of the real part can be taken as the real part signal, and a sequence composed of the imaginary parts of the complex numbers corresponding to each frequency can be taken as the imaginary part signal. Thus, the real part signal and the imaginary part signal are two discrete signal sequences, which can effectively represent the discrete frequency domain signal after the Discrete Fourier Transform.
[0078] Specifically, the Discrete Fourier Transform operation can be performed by using various optimized algorithms or hardware that implements the functions of the related algorithms, for example, a Fast Fourier Transform (FFT) algorithm or a chip or other hardware that solidifies the FFT algorithm is used to convert the time domain signal to the frequency domain signal.
[0079] Due to the windowing processing of the window function on the discrete time domain signal, negative effects are introduced in the converted frequency domain signal, which affects the accuracy of the spectrum analysis. In order to overcome the above negative effects, the convolutional neural network is introduced to compensate for the above negative effects.
[0080] At step S340, the real part signal and the imaginary part signal of each discrete frequency domain signal are respectively mapped to a real part hidden layer signal and an imaginary part hidden layer signal based on the convolutional neural network, and then the spectrum distribution of the input signal is determined according to the real part hidden layer signal and the imaginary part hidden layer signal.
[0081] In the embodiment, the convolutional neural network is determined by pre-training. The convolutional neural network uses a plurality of feature maps associated with the window function as convolution kernels.
[0082] After introducing the convolutional neural network, the converted frequency domain signal can be processed by the convolutional neural network in a nonlinear manner. Meanwhile, a plurality of feature maps associated with the window function are used as convolution kernels in the convolutional neural network, and the information of the window function is brought into the convolutional neural network. Thus, the pre-trained convolutional neural network can effectively compensate for the negative effects introduced by the windowing processing of the window function in the frequency domain, and improve the accuracy of the spectrum analysis.
[0083] Figure 4 is a data flow diagram of the spectrum analysis method of the embodiment of the application. As Figure 4As shown, the input signal IN1 is converted into a first discrete time domain signal DIN1 by the sampling unit 41. Then, the window function W(t) is multiplied with the first discrete time domain signal DIN1 by the multiplier 42 to perform a windowing operation. The multiplier 42 outputs at least one second discrete time domain signal DIN2 after the windowing processing. The second discrete time domain signal DIN2 is further transformed into a discrete frequency domain signal by the frequency domain transformation unit 43, which includes a real part signal RC (i.e., a discrete sequence representing the real part of the frequency domain signal) and an imaginary part signal IC (i.e., a discrete sequence representing the imaginary part of the frequency domain signal). The real part signal RC and the imaginary part signal IC are input as input vectors to the pre-trained convolutional neural network 44. The convolutional neural network 44 can include a convolutional layer 44a, an activation layer 44b, a pooling layer 44c, and a fully connected layer 44d. The convolutional layer 44a is configured to perform a convolution operation on the input vectors based on a convolution kernel to expand the input vectors to a higher dimension. The activation layer 44b is configured to process the hidden layer vectors after the convolution based on a predetermined activation function. The convolutional layer and the activation layer are connected in series, and the convolution kernel corresponding to the convolutional layer has a plurality of parallel data processing branches. Therefore, in the description of the present application, each branch performing the convolution and the activation operation is also referred to as a neuron of the convolutional neural network. The pooling layer 44c is configured to perform a pooling operation on the hidden layer vectors after the activation function processing to select and merge the vector information. The fully connected layer 44d is actually a classifier, which classifies the hidden layer vectors to different frequencies corresponding to the different frequency distributions of the input signal by processing the pooled information, i.e., obtains the frequency spectrum PS1. In some application scenarios, the frequency spectrum can be an amplitude spectrum, i.e., the amplitude distribution of the input signal in the frequency domain. In some application scenarios, the frequency spectrum can also be a power spectrum, i.e., the power distribution of the input signal in the frequency domain. In order to obtain the power spectrum, a square function f(x) = X 2 As the activation function. In the convolutional neural network 44 of the present embodiment, the convolutional layer 44a performs a convolution operation by using a plurality of feature maps FM associated with the window function as the convolution kernel, so that the frequency domain information of the window function can be introduced into the convolutional neural network 44, thereby eliminating the negative effects of the window function in the frequency domain during the processing of the real part signal RC and the imaginary part signal IC, and improving the accuracy of the frequency spectrum analysis.
[0084] Specifically, the convolution kernel of the convolutional layer can be obtained by convolving the discrete frequency domain transform of the window function with the characteristic frequency. As described above, the window function is a time discrete sequence in the time domain. As Figure 5As shown, in one optional implementation, performing a Discrete Fourier Transform (DFT) on the signal using the Discrete Fourier Transform (DFT) unit 44e yields two discrete frequency domain sequences with frequency as the horizontal axis (i.e., the sequence corresponding to the real part and the sequence corresponding to the imaginary part of the discrete frequency domain signal). Then, multiple pre-selected discrete, different feature frequencies are convolved with the matrix composed of the two discrete frequency domain sequences, resulting in multiple different matrices (i.e., the feature maps mentioned earlier). These matrices can serve as convolution kernels, which the convolutional layer 44a uses to perform convolution operations with either the input real or imaginary part of the signal. When a zero-phase-shift Hanning window is selected, the imaginary part of the frequency domain signal after transformation is a zero vector. In this case, only the real part of the signal can be used as the convolution kernel. In the convolutional layer 44a, multiple parallel multipliers can perform convolution operations on the input real part signal RC with one of the convolution kernels, respectively. In one optional implementation, n discrete and different feature frequencies f1, f2, ..., fn are selected to obtain the feature maps FM1, FM2, ..., FMn. n is an integer greater than or equal to 2. In another implementation, n can be 8. At least one frequency is 0. Selecting a zero frequency allows the influence of the window function on the DC component of the input signal to be considered in the convolutional neural network, thus making the spectrum obtained by the convolutional neural network analysis more accurate. Optionally, the discrete frequencies can be uniformly selected at predetermined intervals or in the required number within the frequency range to be analyzed, or they can be non-uniformly determined (e.g., determined according to a specific function or randomly). In another optional implementation, for example, 12, 16, or more discrete frequency points can be selected to obtain a corresponding number of feature maps as convolutional kernels. The number of frequency points can be determined based on computational complexity and the difficulty of model training. It should be understood that the feature maps are actually determined during the training phase of the convolutional neural network and do not change during subsequent training evolution.
[0085] like Figure 5 As shown, after convolution is completed in convolutional layer 44a, activation layer 44b activates the hidden layer vectors after convolution based on the activation function. As mentioned above, the activation function can be a squared function. In some alternative implementations, the activation function can also be other functions that can be used in convolutional neural networks, such as the ReLU function or the sigmoid function. In one alternative implementation, the same activation function is used for different branches, as well as for the real and imaginary parts of the signal.
[0086] In this embodiment, since the number of convolutional units in convolutional layer 44a and activation units in activation layer 44b correspond one-to-one with the number of feature maps, each convolutional unit and activation unit can be used as a neuron in a convolutional neural network.
[0087] The processed hidden layer signals are input to the pooling layer 44c. In the pooling layer 44c, the hidden layer signals are subjected to a pooling operation. In an optional implementation, the real part hidden layer signals RCP are obtained by performing the pooling operation on the parallel multi-path signals obtained by respectively performing convolution and activation on the real part signals and the plurality of convolution kernels, and the imaginary part hidden layer signals ICP are obtained by performing the pooling operation on the parallel multi-path signals obtained by respectively performing convolution and activation on the imaginary part signals and the plurality of convolution kernels. In an optional implementation, concatenation pooling can be used. The concatenation pooling operation is to concatenate the input vectors to form a vector with a larger dimension. It can be understood that in other optional implementations, other pooling methods such as max pooling or stochastic pooling can also be used. Thus, the pooling layer 44c outputs the real part hidden layer signals RCP corresponding to the real part signals and the imaginary part hidden layer signals ICP corresponding to the imaginary part signals.
[0088] The signals are input to the full connection layer 44d. The full connection layer 44d is configured to combine / divide the values in the two discrete sequences of the real part pooling signals RCP and the imaginary part pooling signals ICP to different frequencies, so as to output the final frequency domain distribution PS1 of the input signal.
[0089] In order to enable the convolutional neural network to accurately output the frequency spectrum signal, it needs to be pre-trained. That is, by using known input signals and known corresponding frequency spectrum distributions as samples, the convolutional neural network searches for a parameter set that minimizes a predefined loss function according to a predetermined optimization method, so as to obtain a trained convolutional neural network.
[0090] In the present embodiment, the convolutional neural network can be trained by using a back propagation algorithm and a gradient descent algorithm. In the back propagation algorithm, the training sample data (i.e., the input signals and the known frequency spectrum distribution results) are input to the input layer of the convolutional neural network, and then pass through each hidden layer, finally reach the output layer and output the results, which is the forward propagation process. Since there is an error between the output results of the convolutional neural network and the actual results, the error between the frequency spectrum distribution estimation value and the frequency spectrum distribution actual value is calculated first, and then the error is propagated from the output layer to the hidden layer until it reaches the input layer. In the process of back propagation, the values of various parameters are adjusted according to the error. The above process is iterated until convergence.
[0091] Gradient descent algorithm, a method for determining the weights of a learning model when backpropagation. The purpose is to find the weights that minimize the difference between the output value of the feedforward function value including the weights and the actual value with labels, and the gradient descent algorithm finds the weights that minimize the difference by a certain step, so as to achieve optimization.
[0092] In the embodiment, the mean squared error (Mean Squared Error) between the sample output (actual frequency spectrum distribution) and the convolutional neural network output can be selected as the loss function, and other commonly used loss error functions can also be used as the loss function.
[0093] Meanwhile, in order to make the convergence of training faster, in an optional implementation, the inverse of the cross-correlation matrix of each feature map can be selected as the initial value of the weight matrix of the full connection layer.
[0094] The embodiment introduces a convolutional neural network to process the discrete real part signal and the discrete imaginary part signal in the frequency domain on the basis of the existing periodic graph spectrum analysis method. In the convolutional neural network, the frequency domain correlation characteristics of the window function used in the time domain are used for convolution operation, so that the problems of frequency domain distortion such as spectrum leakage, fence loss and the like caused by the time domain processing of the window function in the frequency domain can be eliminated to a certain extent. Meanwhile, in combination with the trained convolutional neural network, the accuracy of spectrum analysis can be effectively improved.
[0095] In the above described method, the embodiment of the present application uses a single window function to perform windowing processing on the discrete time domain signal corresponding to the input signal. Alternatively, the embodiment of the present application can also use multiple different window functions to perform windowing processing on the discrete time domain signal in parallel. By using multiple different window functions, the characteristics of different parameters or different types of window functions can be integrated to further improve the accuracy of spectrum analysis.
[0096] Figure 6 is the data flow diagram of the spectrum analysis method of another implementation of the embodiment of the present application. As shown in Figure 6 The input signal IN2 is converted into the first discrete time domain signal DIN61 by the sampling unit 61. Then, multiple window functions W1(t)-W n(t) The first discrete-time domain signal DIN61 is multiplied by a multi-parallel multiplier 62 to perform multi-channel windowing operations, and the multiplier 62 outputs n windowed second discrete-time domain signals DIN62. Here, n is an integer greater than or equal to 2. The second discrete-time domain signal DIN62 is then subjected to a discrete Fourier transform in the frequency domain transformation unit 63, converting it into n discrete frequency domain signals. These signals include real part signals RC1-RCn (i.e., discrete sequences representing the real part of the frequency domain signal) and imaginary part signals IC1-ICn (i.e., discrete sequences representing the imaginary part of the frequency domain signal). Each real part signal RCI and imaginary part signal ICI (i = 1, 2, ..., n) is input as an input vector to a pre-trained convolutional neural network 64. The structure of the convolutional neural network 64 is similar to... Figure 4 The convolutional neural network 44 shown is similar, including convolutional layers 64a, activation layers 64b, pooling layers 64c, and fully connected layers 64d. Convolutional layer 64a is used to perform convolution operations on the input vector based on convolutional kernel pairs, thereby expanding the input vector to a higher dimension. Figure 6 In the implementation shown, for 2n input signals, m*n convolutions are performed based on m convolution kernels to obtain m*n convolutional hidden layer signals. Activation layer 64b processes the convolutional hidden layer vectors based on a predetermined activation function. Pooling layer 64c performs pooling operations on the processed hidden layer vectors, selecting and merging vector information. Specifically, pooling layer 64c performs separate pooling operations on each real part signal and each imaginary part signal, thus obtaining n real part hidden layer signals RCP1-RCPn and n imaginary part hidden layer signals ICP1-ICPn. Fully connected layer 64d processes the pooled real and imaginary hidden layer information, classifying the hidden layer vectors to corresponding frequencies, thereby obtaining the frequency distribution of the input signal, i.e., the spectral distribution PS2. In this implementation, the spectral distribution can be a power spectrum or an amplitude spectrum. To obtain the power spectrum, a square function f(x) = X can be used. 2 As the activation function. To obtain the amplitude spectrum, if a square function f(x) = X is chosen beforehand. 2 As an activation function, the output power spectrum can be square-rooted to determine the desired amplitude spectrum. Figure 5 Similarly, in the convolutional neural network 64 of this embodiment, the convolutional layer 64a uses multiple feature maps associated with the window function as convolution kernels to perform convolution operations. As a result, the frequency domain information of the window function can be introduced into the convolutional neural network 64, thereby enabling the convolutional neural network 64 to eliminate the negative impact of the window function in the frequency domain during the processing of the real part signal RC1-RCn and the imaginary part signal IC1-ICn, and improve the accuracy of spectrum analysis.
[0097] In the present implementation, the multiple window functions can be selected such that they define multiple windows in time domain arranged in sequence, so that different parts of the discrete time domain signal are cut out for subsequent processing. Alternatively, the multiple window functions define windows in time domain that overlap with each other, i.e. the time regions covered by the windows overlap to some extent, so that different parts of the discrete time domain signal are cut out for subsequent processing, with the different parts overlapping.
[0098] The use of multiple window functions for windowing can introduce the characteristics of different parameters or types of window functions, thereby improving the possible defects of using a single window function.
[0099] Figure 7 is a schematic diagram of the spectral distribution results of a spectrum analysis method according to an implementation of an embodiment of the present application and other spectrum analysis methods. As shown in Figure 7 for the same input signal, the spectrum 71 is the amplitude spectrum obtained by performing a discrete Fourier transform after a rectangular windowing process using the existing periodogram method. The spectrum 72 is the amplitude spectrum obtained by performing spectrum analysis using the method of the present embodiment. Among them, the rectangular window is selected as the window function, and 16 evenly distributed characteristic frequencies are selected. The convolutional neural network is trained using the stochastic gradient descent method. The spectrum 73 is the actual amplitude spectrum of the input signal. By comparing the above spectra, it can be seen that the spectrum distribution obtained by the method of the present embodiment is closer to the actual spectrum distribution, has better accuracy and higher resolution.
[0100] Figure 8 is a schematic diagram of a spectrum analysis device according to an embodiment of the present application. As shown in Figure 8 The spectrum analysis device 8 of the present embodiment includes a sampling unit 81, a windowing unit 82, a frequency domain conversion unit 83, and a convolutional neural network 84. Among them, the sampling unit 81 is used to determine a first discrete time domain signal corresponding to an input signal. The windowing unit 82 performs windowing processing on the first discrete time domain signal using at least one window function to determine at least one second discrete time domain signal after windowing processing. The frequency domain conversion unit 83 is used to convert the second discrete time domain signal to the frequency domain to determine a corresponding discrete frequency domain signal, which includes a real part signal and an imaginary part signal. The convolutional neural network 84 is used to map the real part signal and the imaginary part signal of each discrete frequency domain signal to a real part hidden layer signal and an imaginary part hidden layer signal, respectively, and then classify according to the real part hidden layer signal and the imaginary part hidden layer signal to determine the spectrum distribution of the input signal. The convolutional neural network is determined by pre-training, and the convolutional neural network uses multiple feature maps associated with the window function as convolution kernels.
[0101] In some implementations, the multiple feature maps associated with the window function are respectively the convolution of the discrete frequency domain transform of the window function and the characteristic frequency.
[0102] Further, the characteristic frequency includes a plurality of discrete frequencies. Further, the plurality of discrete frequencies includes at least a zero frequency.
[0103] In some implementations, the convolutional neural network includes:
[0104] neurons corresponding to each feature map, configured to receive the real part signals to determine a first hidden layer signal corresponding to each feature map, and receive the imaginary part signals to determine a second hidden layer signal corresponding to each feature map, wherein the neurons perform a convolution operation on the input according to the corresponding feature map, and perform an activation operation on the convolution result according to a predetermined activation function;
[0105] a pooling layer configured to perform a pooling operation on the plurality of first hidden layer signals and a pooling operation on the second hidden layer signals respectively, to determine a real part hidden layer signal and an imaginary part hidden layer signal.
[0106] wherein the activation function is a square function, a ReLu function, or a Sigmoid function, etc.
[0107] wherein the pooling operation is a cascade pooling, a maximum pooling, or a random pooling.
[0108] wherein the window function is a Hann window function.
[0109] In some implementations, the windowing unit is configured to perform windowing processing on the first discrete time domain signal using a plurality of different window functions respectively, to determine a plurality of second discrete time domain signals.
[0110] wherein the plurality of window functions define windows arranged in sequence in the time domain; or the plurality of window functions define windows overlapping with each other in the time domain.
[0111] In some implementations, the convolutional neural network further includes a fully connected layer, configured to convert the real part hidden layer signal and the imaginary part hidden layer signal into a frequency spectrum distribution of the input signal.
[0112] wherein the fully connected layer is obtained by training, and wherein a weight matrix of the fully connected layer is initialized using an inverse of a cross-correlation matrix of each feature map.
[0113] It should be understood that each module of the embodiments can be implemented by a computer program, and can be a software module or a hardware module implemented by a logic circuit, or a part of the computer program and a part of the hardware unit.
[0114] The embodiment introduces a convolutional neural network to process the discrete real part signal and the discrete imaginary part signal in the frequency domain, and performs convolution operation on the frequency domain correlation characteristics of the window function used in the time domain, so that the frequency domain distortion problems such as frequency spectrum leakage and fence loss caused by the time domain processing of the window function can be eliminated to a certain extent, and the accuracy of the spectrum analysis can be effectively improved by combining the trained convolutional neural network.
[0115] Figure 9 is a schematic diagram of a signal processing device according to an embodiment of the present application. In the embodiment, the signal processing device can be a terminal data processing device or an integrated circuit, etc. As shown in the figure, the signal processing device at least includes a processor 91 (or a processing core); and a memory 92 in communication connection with the at least one processor 91; and a communication component 93 in communication connection with a scanning device, the communication component 203 receives and sends data under the control of the processor 91; wherein the memory 92 stores instructions executable by the at least one processor 91, and the instructions are executed by the at least one processor 91 to implement the above method. Figure 9
[0116] Specifically, the electronic device includes one or more processors 91 and a memory 92, Figure 9 In the embodiment, the processor 91 is taken as an example. The processor 91 and the memory 92 can be connected through a bus or other means, Figure 9 In the embodiment, the connection through the bus is taken as an example. The memory 92 is a kind of non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 91 performs various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 92, that is, implements the above spectrum analysis method.
[0117] The memory 92 can include a program storage area and a data storage area, wherein the program storage area can store an operating system and application programs required by at least one function; the data storage area can store option lists, etc. In addition, the memory 92 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 92 can optionally include a memory remotely arranged with respect to the processor 91, and these remote memories can be connected to the external device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0118] One or more modules are stored in the memory 92, and when executed by the one or more processors 91, the information interaction method in any method embodiment described above is executed.
[0119] The product can execute the method provided by the embodiments of the present application, has the corresponding function modules and beneficial effects of executing the method, and the technical details not described in the embodiments can be referred to the method provided by the embodiments of the present application.
[0120] Another embodiment of the present application relates to a non-volatile storage medium for storing a computer readable program for executing some or all of the method embodiments described above by a computer.
[0121] That is, those skilled in the art can understand that all or part of the steps of the above-mentioned embodiment methods can be completed by programs instructing related hardware, the programs are stored in a storage medium, and the programs include a plurality of instructions for making a device (which can be a single-chip microcomputer, a chip, etc.) or a processor execute all or part of the steps of the method described in the embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage medium capable of storing program codes.
[0122] The above only describes the preferred embodiments of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A spectrum analysis method, characterized in that, The method includes: Determine the first discrete-time domain signal corresponding to the input signal; The first discrete-time domain signal is windowed using at least one window function to determine at least one windowed second discrete-time domain signal. The second discrete time-domain signal is converted to the frequency domain to determine the corresponding discrete frequency-domain signal, wherein the discrete frequency-domain signal includes a real part signal and an imaginary part signal; Based on the convolutional neural network, the real part and imaginary part of each discrete frequency domain signal are mapped to real part hidden layer signal and imaginary part hidden layer signal respectively, and then the spectral distribution of the input signal is determined according to the real part hidden layer signal and the imaginary part hidden layer signal; The convolutional neural network is pre-trained and uses multiple feature maps associated with the window function as convolutional kernels. The plurality of feature maps associated with the window function are respectively the discrete frequency domain transformation of the window function and the convolution of the feature frequencies.
2. The method according to claim 1, characterized in that, The characteristic frequency includes multiple discrete frequencies.
3. The method according to claim 2, characterized in that, The plurality of discrete frequencies include at least the zero frequency.
4. The method according to claim 1, characterized in that, Mapping the real and imaginary signals into real hidden layer signals and imaginary hidden layer signals respectively based on a convolutional neural network includes: The real part signal is input into the neuron corresponding to each feature map to determine the first hidden layer signal corresponding to each feature map; The imaginary part signal is input into the neuron corresponding to each feature map to determine the second hidden layer signal corresponding to each feature map; The real part hidden layer signal and the imaginary part hidden layer signal are determined by performing pooling operations on multiple first hidden layer signals and second hidden layer signals respectively through pooling layers. The neurons perform convolution operations on the input based on the corresponding feature maps, and activate the convolution results according to a predetermined activation function.
5. The method according to claim 4, characterized in that, The activation function is a square function, a ReLU function, or a Sigmoid function.
6. The method according to claim 4, characterized in that, The pooling operation is cascaded pooling, max pooling, or random pooling.
7. The method according to claim 1, characterized in that, The window function mentioned is the Hann window.
8. The method according to claim 1, characterized in that, The first discrete-time signal is windowed using at least one window function, and the resulting second discrete-time signal after at least one windowed process includes: The first discrete-time domain signal is windowed using multiple different window functions to determine multiple second discrete-time domain signals.
9. The method according to claim 8, characterized in that, The multiple different window functions define windows arranged sequentially in the time domain; or The multiple different window functions define overlapping windows in the time domain.
10. The method according to claim 1, characterized in that, Determining the spectral distribution of the input signal based on the real part hidden layer signal and the imaginary part hidden layer signal includes: The real part hidden layer signal and the imaginary part hidden layer signal are converted into the spectral distribution of the input signal using a fully connected layer.
11. The method according to claim 10, characterized in that, The fully connected layer is obtained through training, wherein the weight matrix of the fully connected layer is initialized using the inverse of the cross-correlation matrix of each feature map.
12. A spectrum analysis device, characterized in that, include: The sampling unit is used to determine the first discrete-time domain signal corresponding to the input signal; A windowing unit uses at least one window function to window the first discrete-time domain signal and determines at least one windowed second discrete-time domain signal. A frequency domain transformation unit is used to transform the second discrete time domain signal into a discrete frequency domain signal corresponding to the frequency domain, wherein the discrete frequency domain signal includes a real part signal and an imaginary part signal; A convolutional neural network is used to map the real and imaginary parts of each discrete frequency domain signal into real and imaginary hidden layer signals, respectively, and then classify the input signal according to the real and imaginary hidden layer signals to determine the spectral distribution of the input signal. The convolutional neural network is pre-trained and determined, and it uses multiple feature maps associated with the window function as convolution kernels. The plurality of feature maps associated with the window function are respectively the discrete frequency domain transformation of the window function and the convolution of the feature frequencies.
13. The apparatus according to claim 12, characterized in that, The characteristic frequency includes multiple discrete frequencies.
14. The apparatus according to claim 13, characterized in that, The plurality of discrete frequencies include at least the zero frequency.
15. The apparatus according to claim 12, characterized in that, The convolutional neural network includes: The neurons corresponding to each feature map are used to receive the real part signal to determine the first hidden layer signal corresponding to each feature map, and to receive the imaginary part signal to determine the second hidden layer signal corresponding to each feature map. The neurons perform convolution operation on the input according to the corresponding feature map and activate the convolution result according to a predetermined activation function. The pooling layer is used to perform pooling operations on multiple first hidden layer signals and second hidden layer signals respectively, to determine the real part hidden layer signal and the imaginary part hidden layer signal.
16. The apparatus according to claim 15, characterized in that, The activation function is a square function, a ReLU function, or a Sigmoid function.
17. The apparatus according to claim 15, characterized in that, The pooling operation is cascaded pooling, max pooling, or random pooling.
18. The apparatus according to claim 12, characterized in that, The window function mentioned is the Hannwindow function.
19. The apparatus according to claim 12, characterized in that, The windowing unit is used to perform windowing processing on the first discrete-time domain signal using multiple different window functions to determine multiple second discrete-time domain signals.
20. The apparatus according to claim 19, characterized in that, The multiple different window functions define windows arranged sequentially in the time domain; or The multiple different window functions define overlapping windows in the time domain.
21. The apparatus according to claim 12, characterized in that, The convolutional neural network further includes a fully connected layer, which is used to convert the real part hidden layer signal and the imaginary part hidden layer signal into the spectral distribution of the input signal.
22. The apparatus according to claim 21, characterized in that, The fully connected layer is obtained through training, wherein the weight matrix of the fully connected layer is initialized using the inverse of the cross-correlation matrix of each feature map.
23. A signal processing apparatus, comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1-11.
Citation Information
Patent Citations
Voice enhancement method and device based on deep circulation neural network
CN110164465A
Defect detection method and system for longitudinal welded pipe and readable medium
CN113269720A