Disclosure of Invention
The purpose of the invention is as follows: aiming at the problems and the defects of the existing method, the invention provides the pulse signal type automatic judging method based on the spectral feature extraction, the method can meet the requirements of radar and sonar signal processing, can realize the automatic judgment of single frequency and frequency modulation pulse signals with high accuracy rate by very small computation amount under the condition of lower signal to noise ratio, and has strong engineering practicability.
The technical scheme is as follows: in order to achieve the purpose, the invention adopts the following technical scheme: a pulse signal type automatic discrimination method based on spectral feature extraction comprises the following steps:
(1) acquiring a pulse signal sampling data sequence to be distinguished: receiving real-time acquisition data of N sampling points from a sensor as a data sequence x (N) to be distinguished, wherein N is 0,1, …, N-1, or extracting N sampling point data containing the whole pulse signal from a memory as the data sequence x (N) to be distinguished, N is 0,1, …, N-1, wherein N is the number of sampling points containing the whole pulse signal and is an integer power of 2;
(2) initializing parameters related to iterative smoothing and pulse signal type judgment: setting a maximum iteration number threshold I and a precision control threshold epsilon of iterative smoothing, setting an iterative smoothing window length M, and judging a single frequency and frequency modulation pulse signal-to-noise ratio threshold eta;
(3) calculating a pulse signal amplitude spectrum P (k) according to the data sequence x (n);
(4) carrying out iterative smoothing processing on the P (k) to obtain a smoothed magnitude spectrum S (k);
(5) search for S (k) maximum valueCorresponding discrete frequency index kMAnd the start and end discrete frequency indices k corresponding to the main lobe half-amplitudeLAnd kR;
(6) Respectively calculating the SNR of the peak main lobe of the original amplitude spectrum and the SNR of the smooth amplitude spectrumpAnd SNRS;
(7) According to SNRpAnd SNRSAnd judging the type of the pulse signal.
Preferably, in the step (2), a maximum iteration number threshold I and a precision control threshold epsilon of iterative smoothing are set, a length M of an iterative smoothing window is determined, and a single-frequency and frequency modulation pulse signal-to-noise ratio threshold eta is determined, wherein the value of I is a positive integer greater than 2, epsilon is a positive number less than 1, the length of the iterative smoothing window is an odd number with M being greater than or equal to 3 and less than or equal to N/2-3, and eta is an arbitrary number with eta being greater than or equal to 1.5 and less than or equal to 2.5. Preferably, I is 10, ε is 0.01, M is 5, and η is 2.0.
Preferably, in the step (3), fast fourier transform is performed on the data sequence x (n), and discrete fourier transform x (l) and magnitude spectrum p (k) of the data sequence are obtained through calculation, specifically including the following steps:
(3-1) calculating the discrete Fourier transform of x (n)
Where I is the discrete frequency index of X (l) and j represents an imaginary unit, i.e.
This equation can be implemented by fast fourier transform.
(3-2) calculating the amplitude spectrum of x (n) according to X (l)
Where k is the discrete frequency index of P (k), and | represents the modulo operation.
Preferably, in the step (3), the discrete fourier transform x (l) of the step (3-1) of calculating x (n) can be realized by fast fourier transform;
preferably, in the step (4), the iterative smoothing processing is performed on p (k) to obtain a smoothed magnitude spectrum s (k), and the method specifically includes the following steps:
(4-1) initializing the iteration number i as 0, and smoothing the result S by the first iteration0(k) Is composed of
S0(k)=P(k),k=0,1,2…,N/2-1
(4-2) let the iteration number i be i +1, and smooth the result S for the last iterationi-1(k) Performing smoothing to obtain current smoothing result Si(k)
(4-3) judging whether the maximum iterative smoothing times is reached, namely judging whether I is less than or equal to I, if so, entering the step (4-4), and otherwise, jumping to the step (4-6);
(4-4) calculating last smoothing results S, respectivelyi-1(k) And current smoothing result Si(k) Sum of squares J of residuals from original amplitude spectrum p (k)i-1And JiAre respectively as
(4-5) judgment of | Ji-1-Ji|≤εJiIf yes, entering the step (4-6), otherwise, returning to the step (4-2);
(4-6) let S (k) be Si(k) And k is 0,1,2 …, N/2-1, and a smoothed amplitude spectrum s (k) is obtained.
Preferably, in step (5), the discrete frequency index k corresponding to the maximum value of s (k) is searchedMAnd the start and end discrete frequency indices k corresponding to the main lobe half-amplitudeLAnd kRThe method specifically comprises the following steps:
(5-1) searching a discrete frequency index k corresponding to the maximum value of S (k)M
Wherein
Representing that the discrete frequency index corresponding to the maximum value of S (k) is searched within the range of 1 ≦ k ≦ N/2-1;
(5-2) performing maximum value normalization processing on the S (k) to obtain a normalized smooth amplitude spectrum Z (k):
Z(k)=S(k)/S(kM),k=0,1,2…,N/2-1
(5-3) searching S (k) initial discrete frequency index k corresponding to main lobe half amplitudeLThe searching process comprises the following steps:
(5-3-1) initializing initial search discrete frequency index kl=1;
(5-3-2) judgment of kM-k l0 or Z (k)M-kl) -0.5 < 0, if yes, jump to (5-3-4), otherwise go to (5-3-3);
(5-3-3) order kl=kl+1, and back (5-3-2);
(5-3-4) order kL=kM-klObtaining the initial discrete frequency index k corresponding to the half amplitude of the main lobeL。
(5-4) searching S (k) termination discrete frequency index k corresponding to main lobe half amplitudeRThe searching process comprises the following steps:
(5-4-1) initial termination of search for discrete frequency index kr=1;
(5-4-2) judgment of kM+krN/2-1 or Z (k)M+kr) -0.5 < 0, if yes, jump to (5-4-4), otherwise go to (5-4-3);
(5-4-3) order kr=kr+1, and back (5-4-2);
(5-4-4) order kR=kM-krObtaining the final discrete frequency index k corresponding to the main lobe half amplitudeR。
Preferably, in step (6), the raw materials are calculated separatelyPeak mainlobe signal-to-noise ratio SNR of amplitude spectrum and smooth amplitude spectrumpAnd SNRS:
Preferably, in step (7), the SNR is determinedpAnd SNRSThe method for judging the pulse signal type comprises the following steps:
(7-1) calculating the ratio SNRR of the signal-to-noise ratio of the peak main lobe before and after smoothing of the magnitude spectrum
(7-2) judging whether the SNRR < eta is satisfied, if so, judging the signal to be a frequency modulation pulse signal, otherwise, judging the signal to be a single-frequency pulse signal.
Has the advantages that: compared with the prior art, the method has the following beneficial effects:
(1) when the amplitude spectrum of the signal is obtained by the estimation method, the whole pulse signal is utilized, the signal processing gain of approximate matched filtering can be obtained, the lower limit of the applicable signal-to-noise ratio is low, the estimation method can be realized by fast Fourier transform, and the calculation amount is small;
(2) according to the estimation method, after the amplitude spectrum of the pulse signal is obtained by utilizing Fourier transform, iterative smoothing processing is carried out on the amplitude spectrum of the signal, the requirement of pulse signal half-amplitude bandwidth estimation on the signal-to-noise ratio can be reduced, and a precondition is provided for further accurately estimating the peak value main lobe signal-to-noise ratio;
(3) the estimation method defines the ratio of the signal-to-noise ratio of the main lobe of the front peak value and the back peak value of the amplitude spectrum before smoothing as the characteristic quantity parameter of the automatic judgment of the signal type, the characteristic parameter has better discrimination on the single frequency and the frequency modulation pulse signal, and the high-accuracy automatic judgment of the single frequency and the frequency modulation pulse signal can be realized with very small operation amount under the lower signal-to-noise ratio.
Detailed Description
The invention is further described with reference to the following figures and examples:
as shown in fig. 1, an automatic pulse signal type discrimination method based on spectral feature extraction includes the following steps:
(1) acquiring a pulse signal sampling data sequence to be distinguished: the method comprises the steps of receiving real-time acquisition data of N sampling points from a sensor as a data sequence x (N) to be distinguished, wherein N is 0,1, … and N-1, or extracting N sampling point data containing the whole pulse signal from a memory as the data sequence x (N) to be distinguished, N is 0,1, … and N-1, wherein N is the number of sampling points containing the whole pulse signal and is an integer power of 2.
(2) Initializing parameters related to iterative smoothing and pulse signal type judgment: setting a maximum iteration number threshold I and a precision control threshold epsilon of iterative smoothing, and determining a single-frequency and frequency modulation pulse signal-to-noise ratio threshold eta by the length M of an iterative smoothing window, wherein the value of I is a positive integer larger than 2, the value of epsilon is a positive number smaller than 1, the length of the iterative smoothing window is an odd number with the length M larger than or equal to 3 and smaller than or equal to N/2-3, and the value range of eta is an arbitrary number with the length eta larger than or equal to 1.5 and smaller than or equal to 2.5.
In the step (2), in order to take account of the calculation amount and the estimation accuracy of the present invention, the preferred value of I is 10, the value of epsilon is 0.01, the value of M is 5, and the value of eta is 2.0.
(3) Calculating a pulse signal amplitude spectrum P (k) from the data sequence x (n): performing fast Fourier transform on the data sequence x (n), and calculating to obtain discrete Fourier transform X (l) and a magnitude spectrum P (k) of the data sequence, wherein the method specifically comprises the following two steps:
(3-1) calculating the discrete Fourier transform of x (n)
Where l is the discrete frequency index of X (l), and j represents an imaginary unit, i.e.
This equation can be implemented by fast fourier transform.
(3-2) calculating the amplitude spectrum of x (n) according to X (l)
Where k is the discrete frequency index of P (k), and | represents the modulo operation.
In the step (3), the discrete fourier transform x (l) for calculating x (n) in the step (3-1) can be realized by fast fourier transform, so that the calculation efficiency of the algorithm is improved.
(4) Performing iterative smoothing processing on the P (k) to obtain a smoothed magnitude spectrum S (k), and specifically comprising the following steps:
(4-1) initializing the iteration number i as 0, and smoothing the result S by the first iteration0(k) Is composed of
S0(k)=P(k),k=0,1,2…,N/2-1
(4-2) let the iteration number i be i +1, and smooth the result S for the last iterationi-1(k) Performing smoothing to obtain current smoothing result Si(k)
(4-3) judging whether the maximum iterative smoothing times is reached, namely judging whether I is less than or equal to I, if so, entering the step (4-4), and otherwise, jumping to the step (4-6);
(4-4) calculating last smoothing results S, respectivelyi-1(k) And current smoothing result Si(k) Sum of squares J of residuals from original amplitude spectrum p (k)i-1And JiAre respectively as
(4-5) judgment of | Ji-1-Ji|≤εJiIf yes, entering the step (4-6), otherwise, returning to the step (4-2);
(4-6) let S (k) be Si(k) And k is 0,1,2 …, N/2-1, and a smoothed amplitude spectrum s (k) is obtained.
(5) Searching for a discrete frequency index k corresponding to the maximum value of S (k)MAnd the start and end discrete frequency indices k corresponding to the main lobe half-amplitudeLAnd kRThe method specifically comprises the following steps:
(5-1) searching a discrete frequency index k corresponding to the maximum value of S (k)M
Wherein
Representing that the discrete frequency index corresponding to the maximum value of S (k) is searched within the range of 1 ≦ k ≦ N/2-1;
(5-2) performing maximum value normalization processing on the S (k) to obtain a normalized smooth amplitude spectrum Z (k):
Z(k)=S(k)/S(kM),k=0,1,2…,N/2-1
(5-3) searching S (k) initial discrete frequency index k corresponding to main lobe half amplitudeLThe searching process comprises the following steps:
(5-3-1) initializing initial search discrete frequency index kl=1;
(5-3-2) judgment of kM-k l0 or Z (k)M-kl) -0.5 < 0, if yes, jump to (5-3-4), otherwise go to (5-3-3);
(5-3-3) order kl=kl+1, and back (5-3-2);
(5-3-4) order kL=kM-klTo obtain the initial discrete frequency corresponding to the half amplitude of the main lobeIndex kL。
(5-4) searching S (k) termination discrete frequency index k corresponding to main lobe half amplitudeRThe searching process comprises the following steps:
(5-4-1) initial termination of search for discrete frequency index kr=1;
(5-4-2) judgment of kM+krN/2-1 or Z (k)M+kr) -0.5 < 0, if yes jump to (5-4-4), otherwise go into (5-4-3):
(5-4-3) order kr=kr+1, and back (5-4-2);
(5-4-4) order kR=kM-krObtaining the final discrete frequency index k corresponding to the main lobe half amplitudeR。
(6) Respectively calculating the SNR of the peak main lobe of the original amplitude spectrum and the SNR of the smooth amplitude spectrumpAnd SNRS:
(7) According to SNRpAnd SNRSThe method for judging the pulse signal type comprises the following steps:
(7-1) calculating the ratio SNRRR of the signal-to-noise ratio of the peak main lobe before and after smoothing of the amplitude spectrum
(7-2) judging whether the SNRR < eta is satisfied, if so, judging the signal to be a frequency modulation pulse signal, otherwise, judging the signal to be a single-frequency pulse signal.
In the embodiment of the invention, the simulation received pulse signal model is as follows:
where a is the amplitude of the signal and,
for the initial phase, τ is the pulse width, f
1For signal start frequency, μ ═ f
2-f
1) τ is the frequency modulation rate, f
2For signal termination frequency, when f
2=f
1When mu is 0, the signal is a single-frequency pulse signal, otherwise, the signal is a frequency modulation pulse signal. w (t) is mean 0 and variance σ
2White Gaussian noise, variance σ
2Is determined by the signal-to-noise ratio SNR: SNR is 10log (A)
2/2σ
2)。
At a sampling frequency fsThe pulse signal is subjected to discrete sampling to obtain a pulse signal sampling data sequence:
wherein N isτ=int(fsτ), int () represents the rounding operation.
Example 1:
the simulation signal parameters are respectively set as: signal amplitude a 2, initial phase
Pulse width τ of 0.512s, signal start frequency f
1300Hz, signal termination frequency f
2300Hz, the frequency modulation rate mu is 0Hz/s, i.e. the simulation signal is a single-frequency pulse signal, the sampling frequency f
s2000Hz, 1024 points of observation data sequence, and 0dB SNR.
In the step (2), a maximum iteration time threshold I is set to be 10, a precision control threshold epsilon is 0.01, an iteration smoothing window length M is set to be 5, and a ratio threshold eta of a single frequency and a frequency modulation pulse signal-to-noise ratio is determined to be 2.
According to step (3), calculating the amplitude spectrum P (k) of the data sequence x (n), as shown in FIG. 2.
According to the step (4), performing iterative smoothing processing on p (k) to obtain a smoothed magnitude spectrum s (k), as shown in fig. 3, as can be seen by comparing fig. 2 and fig. 3: after iterative smoothing processing, the main lobe of the single-frequency pulse signal is obviously widened, and the whole frequency band spectrum is smoother.
According to the step (5), searching the discrete frequency index corresponding to the maximum value of S (k) and the initial and final discrete frequency indexes corresponding to the half-amplitude of the main lobe respectively
kM=155,kL=148,kR=162。
According to the step (6), respectively calculating the ratio of the peak main lobe signal-to-noise ratio of the original amplitude spectrum and the smooth amplitude spectrum
SNRp=8.1592,SNRS=1.3991。
According to the step (7), calculating the ratio of the signal-to-noise ratio of the peak main lobe before and after the smoothing of the amplitude spectrum
SNRR=8.9152/1.3991=6.3719。
Therefore, the SNRR & gteta is known, the pulse signal is judged to be a single-frequency pulse signal, and the signal type is consistent with the set signal type.
Example 2:
the simulation signal parameters are respectively set as: signal amplitude a 1, initial phase
Pulse width τ of 0.512s, signal start frequency f
1400Hz, signal termination frequency f
2460Hz and 117.19Hz/s, i.e. the simulation signal is a frequency modulated pulse signal, the sampling frequency f
s2000Hz, 1024 points of observation data sequence, and 3dB SNR.
In the step (2), a maximum iteration time threshold I is set to be 8, a precision control threshold epsilon is set to be 0.005, an iteration smoothing window length M is set to be 7, and a ratio threshold eta of a single frequency and a frequency modulation pulse signal-to-noise ratio is judged to be 1.9.
According to step (3), calculating the amplitude spectrum P (k) of the data sequence x (n), as shown in FIG. 4.
According to the step (4), performing iterative smoothing processing on p (k) to obtain a smoothed magnitude spectrum s (k), as shown in fig. 5, comparing fig. 4 and fig. 5, it can be seen that: after iterative smoothing processing, the width of the main lobe of the frequency modulation pulse signal is basically unchanged, and the whole frequency band spectrum is smoother.
According to the step (5), searching the discrete frequency index corresponding to the maximum value of S (k) and the initial and final discrete frequency indexes corresponding to the half-amplitude of the main lobe respectively
kM=217,kL=204,kR=237。
According to the step (6), respectively calculating the ratio of the peak main lobe signal-to-noise ratio of the original amplitude spectrum and the smooth amplitude spectrum
SNRp=1.2851,SNRS=1.218。
According to the step (7), calculating the ratio of the signal-to-noise ratio of the peak main lobe before and after the smoothing of the amplitude spectrum
SNRR=1.2851/1.218=1.055。
Therefore, the SNRR < eta is known, and the pulse signal is judged to be a frequency modulation pulse signal and is consistent with the set signal type.