CN107294628A - A kind of frequency spectrum intelligent perception system and its method based on USRP - Google Patents
A kind of frequency spectrum intelligent perception system and its method based on USRP Download PDFInfo
- Publication number
- CN107294628A CN107294628A CN201710602195.0A CN201710602195A CN107294628A CN 107294628 A CN107294628 A CN 107294628A CN 201710602195 A CN201710602195 A CN 201710602195A CN 107294628 A CN107294628 A CN 107294628A
- Authority
- CN
- China
- Prior art keywords
- frequency
- signals
- data
- usrp
- signal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B17/00—Monitoring; Testing
- H04B17/30—Monitoring; Testing of propagation channels
- H04B17/382—Monitoring; Testing of propagation channels for resource allocation, admission control or handover
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B17/00—Monitoring; Testing
- H04B17/30—Monitoring; Testing of propagation channels
- H04B17/309—Measuring or estimating channel quality parameters
- H04B17/318—Received signal strength
- H04B17/327—Received signal code power [RSCP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B17/00—Monitoring; Testing
- H04B17/30—Monitoring; Testing of propagation channels
- H04B17/309—Measuring or estimating channel quality parameters
- H04B17/336—Signal-to-interference ratio [SIR] or carrier-to-interference ratio [CIR]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B17/00—Monitoring; Testing
- H04B17/30—Monitoring; Testing of propagation channels
- H04B17/309—Measuring or estimating channel quality parameters
- H04B17/345—Interference values
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Quality & Reliability (AREA)
- Transmitters (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
A kind of frequency spectrum intelligent perception system and its method based on USRP, USRP are connected by Ethernet with host computer PC;The host computer PC includes LabVIEW software platforms and NI USRP software suites, the program that the NI USRP software suites are added in LabVIEW in NI USRP drivers, the LabVIEW software platforms is interacted by NI USRP drivers with the USRP;Program in the LabVIEW software platforms includes frequency spectrum perception program, and the frequency spectrum perception program includes USRP frequency spectrum sensing modules.Effectively prevent a USRP in the prior art can not realize the defect that cognitive user SU can take authorized user PU mandate frequency range in the case of PU signals are non-existent and can actively be avoided in the presence of PU signals by detection program.
Description
Technical field
The present invention relates to frequency spectrum perception technical field, and in particular to a kind of frequency spectrum intelligent perception system based on USRP and its
Method.
Background technology
The planning of current radio spectrum resources and using being formulated by government, communication equipment to frequency spectrum using must government award
Power license, and the frequency spectrum static allocation mode that government is formulated can seriously reduce the utilization ratio of frequency spectrum.Such as distribute to honeybee
Excess load phenomenon often occurs in the band system band of cellular mobile communication, and the time of band sharing 85% is in idle condition.
And cognitive radio technology borrows the authorized frequency bands of free time in which can make cognitive user " seizing every opportunity ", so as to improve the utilization of frequency spectrum
Chance and utilization ratio.
The Hardware prototype of cognitive radio generally selects USRP Software Radio platform devices, and its front panel is generally two antennas
Interface, can be respectively intended to receive or transmission signal, and centre is furnished with ETHERNET interfaces and connects PC to pass through gigabit Ethernet, right
The POWER interfaces of lower section are used as power interface.
As noted earlier, a current USRP can be only done a receiving and transmitting signal equipped with two antennas.If transmission signal
Antenna be used for launch SU signals, then the presence or absence of PU signals can not be just controlled with transmitting antenna.Therefore, one
USRP can not realize that cognitive user SU can take authorized user PU's in the case of PU signals are non-existent by detection program
Authorize frequency range, in the presence of PU signals, the function that can actively avoid.
The content of the invention
To solve the above problems, the invention provides a kind of frequency spectrum intelligent perception system based on USRP and its method, keeping away
Having exempted from a USRP in the prior art can not realize that cognitive user SU can in the case of PU signals are non-existent by detection program
With the defect that takes authorized user PU mandate frequency range and can actively be avoided in the presence of PU signals.
In order to overcome deficiency of the prior art, the invention provides a kind of frequency spectrum intelligent perception system based on USRP and
The solution of its method, it is specific as follows:
A kind of frequency spectrum intelligent perception system based on USRP, including USRP, the USRP pass through Ethernet and Framework computing
Machine PC is connected;
The host computer PC includes LabVIEW software platforms and NI USRP software suites, and the NI USRP are soft
The program that part external member is added in LabVIEW in NI-USRP drivers, the LabVIEW software platforms passes through NI-USRP
Driver is interacted with the USRP;
Program in the LabVIEW software platforms includes frequency spectrum perception program, and the frequency spectrum perception program includes USRP
Frequency spectrum sensing module.
Further, the USRP is that NI USRP, the NI USRP pass through gigabit Ethernet and host computer PC phases
Connection.
Further, MATLAB script can also be quoted in the host computer PC realized with this LabVIEW with
MATLAB joint debugging.
Further, the NI-USRP drivers include eight functions, and eight functions are respectively
9.niUSRP opens Rx session VI, i.e. niUSRP Open Rx Session VI;
10.niUSRP configures signal VI, i.e. niUSRP Configure VI;
11.niUSRP initializes VI, i.e. niUSRP Initiate VI;
12.niUSRP opens Tx session VI, i.e. niUSRP Open Tx Session VI;
13.niUSRP, which is extracted, receives data VI, i.e. niUSRP Fetch Rx Data VI;
14.niUSRP launches data VI, i.e. niUSRP Write Tx Data VI);
15. terminate VI, i.e. niUSRP Abort VI;
16. close VI, i.e. niUSRP Close Session VI;VI in wherein 1-4 is realized in configuration feature, 5-6
VI realizes that the VI in read-write capability, 7-8 realizes end functions.
Further, the reception wireless signal and transmitting wireless signal module pass through the NI-USRP drivers
Eight functions receive the process of wireless signal and transmitting wireless signal to realize.
Further, the method for the frequency spectrum perception system based on USRP, including:Limiting feelings only with a USRP
Under condition, the USRP frequency spectrum perceptions in frequency spectrum perception program can be passed through with an antenna as reception antenna reception wireless signal
Module carries out frequency spectrum perception to the wireless signal of reception, finds after available frequency band, by another antenna on this available frequency band
Launch FM signals, at this moment terminate the energy measuring of the energy detection module for reception antenna, demodulated and launched using reception antenna
The FM signals that antenna is launched, and the USRP frequency spectrum sensing modules include audio signal memory module, calculate decision threshold mould
Block, energy detection module, transmitting FM signaling modules and demodulation FM signaling modules.
Further, the audio signal memory module includes the function of configuration audio input, reads the letter of audio input
Number, the function for writing and opening audio file, the function for writing audio file, the function of audio input clearing, closing audio text
Function and audio signal the storage front panel of part, the function of the configuration audio input are used for the feature for setting audio signal, institute
Stating the feature of audio signal is included per channel sample sum, sampling configuration, device id and audio format, and the reading audio is defeated
The function entered is used to read the audio signal recorded from the sound card of the host computer PC, and said write simultaneously opens sound
The function of frequency file is used for storage location of the specific audio frequency signal on disk, and the function of said write audio file is used for reading
The audio signal taken is written to the storage location for the audio signal specified, and the function that the audio input is reset is used to stop gathering
Data, removing caching, task are back to default conditions and the removing data related to task, the letter of the closing audio file
Number is used for the storage for stopping audio signal, so stores the storage road that front panel selects audio file by the audio signal
Footpath, input are per channel sample sum, sampling configuration, device id and audio format, and the device id is inputted when being audio operation
Or the mark of the equipment of output, its default value is 0, and the sum per channel sample reads to specify from sample buffer
The speed of sample, the sampling configuration is to specify VI to carry out limited sampling or continuous sampling, and the audio format is setting audio
Acquisition rate, number of channels and the number of bits each sampled of operation;Then audio signal storage front panel shown in clicking on
Stop button, is transferred to the store path of the audio file of selection the function for writing and opening audio file, and input is every
Channel sample sum, sampling configuration, device id and audio format are transferred to the function of configuration audio input, then described to read
The function of audio input according to be transferred to described in the function of configuration audio input per channel sample sum, sampling configuration, set
Standby ID and audio format are used to read the audio signal recorded from the sound card of the host computer PC, then described
Write the function of audio file according to be transferred to write-in and open the selection in the function of audio file audio file storage
Path is used for the store path for the audio signal of reading being written to the audio file of selection, and write-in finishes the rear audio input
The function of clearing, which just stops data collection, remove caching, task is back to default conditions and the removing data related to task,
And the function for closing audio file stops the storage of audio signal.
Further, the calculating decision threshold module is according to formula (1)
To derive threshold value, Q () is normal distribution tail probability function, and the calculating decision threshold module includes meter
Sub- VI, the program for sub- VI, MATLAB node for calculating decision threshold and the peripheral routine for calculating thresholding configuration information, the calculating door
The sub- VI for limiting configuration information carries out 10 sub-samplings to the frequency spectrum data of the same band, by the median of this 10 groups of sampling results
As output, the sub- VI of calculating thresholding configuration information input has three parameters, and three parameters are respectively to wait to locate
The Wave data of the power density spectrum of reason, the initial frequency of data to be tested and the cut-off frequency of data to be tested, and the meter
The output end for calculating the sub- VI of thresholding configuration information is that a gathering is closed, including two parameters, and two parameters are whole ripple respectively
The half N/2 and false-alarm probability p of the array length of graphic dataf, two parameters are substituted into formula (1) and corresponded to regard to that can calculate
The threshold value λ of false-alarm probabilityf, and in peripheral routine, there is provided 1 global variable cishu, also 2 local variable Pnz and
Thresholding configuration information;Cishu is used for the number of times for recording the sub- VI operations of the calculating thresholding configuration information;Thresholding configuration information is
The median of preceding 10 sub-sampling result of calculation, if sampling number of times is less than 10 times, thresholding configuration information is the meter after every sub-sampling
Calculate result;If sampling number of times more than 10 times, 10 thresholding configuration informations of thresholding configuration information and sampling are identical, also set up in addition
The variable Pnz of local variable array form, Pnz is responsible for the operation result of each peripheral routine to store, when to frequency
When modal data is sampled 10 times, peripheral routine calculates the median of data in Pnz arrays, and the idiographic flow of the peripheral routine is such as
Under:
Step 1-1:Obtain global variable cishu value.When the peripheral routine just starts, cishu is arranged to 1;
Step 1-2:Judge whether cishu is less than 11, if less than 11, perform step 1-3;If not less than 11, performed
Step 1-5;
Step 1-3:The data of frequency spectrum data section are sent into MATLAB nodes, using MATLAB instrument processing datas, one
The result of secondary computing is stored in local variable array Pnz successively, in MATLAB nodes, and program determines whether that program has been held
Go 10 times, can be using the medians of 10 data as the local variable of thresholding configuration information if performing 10 times, and will
The local variable is used as program output valve;
Step 1-4:Certainly Jia 1 is assigned to global variable cishu to global variable cishu;
Step 1-5:Thresholding configuration information in obtaining step 1-3, and as program output valve;
The program of the MATLAB nodes calculates the one of the noise power in designated spectrum and the length of whole Wave data
Half, take the median of 10 result of calculation as output result, the input parameter of the MATLAB nodes and effect are as follows:
The input parameter of the MATLAB nodes includes:
Initial frequency f1 and cut-off frequency f2, for determining spectral range;
Global variable cishu, the number of times of the sub- VI operations for recording the calculating thresholding configuration information;
Local variable Pnz, the result of calculation for storing first 10 times;
Power spectral density, the power spectral density is Waveform data format, including three parameters f0, df, magnitude,
The power density of initial frequency, frequency interval and the respective frequencies point of waveform is represented respectively;
The parameter and its implication of the output end of the MATLAB nodes are as follows:
Pn is the median that program runs the noise power obtained for 10 times;
M is the half of Wave data length;
Local variable Pnz is used to result of calculation write array, can be with when being run again with the program whne MATLAB nodes
Therefrom read data;
The flow of the program of the MATLAB nodes is as follows:
Step 2-1:Correspondence in initial frequency and each comfortable array magnitude of cut-off frequency is calculated according to formula (2)
Subscript n 1 and n2, in order to ensure n1 and n2 is integer, use round (n) function pairs formula (2) computing result carry out four give up
Five enter processing, and wherein n is n1 or n2, f are f1 or f2:
N=(f-f0)/df (2)
Step 2-2:Set when corresponding subscript n 1 is 0 to initial frequency in array magnitude, force the n1's
Value is adjusted to 1;
Step 2-3:The number N of n1 to n2 data point is calculated, the length of assigned frequency hop count group is used as;Calculate input
The half of array magnitude length value is assigned to M as output;
Step 2-4:Element value of the subscript from n1 to n2 in wave-shape amplitude information S, calculated with formula (3), and handle
As a result new array x is assigned to, wherein array x subscript is since 1, and length is N:
Pn=10^ (Pn (dB)/10) (3)
The noise power that wherein Pn (dB) expression decibel dB values are represented;
Step 2-5:Expression formula of the energy of Gaussian noise signal in frequency domain is shown in formula (4):
It is a fixed value using the power spectrum average P (f) of Gaussian noise signal, first seeks the average P (f) of special frequency channel
Df, the points of spectrogram data are then multiplied by with this average P (f) df, the noise power P (t) of whole frequency range is asked for;
Step 2-6:Pn is assigned to array local variable Pnz, the subscript of array is set to the number of times of program operation, also
It is global variable cishu;
Step 2-7:Judge whether the program of the MATLAB nodes has been run 10 times according to global variable cishu, if
Global variable cishu is equal to 10, performs step 2-8, otherwise performs step 2-9;
Step 2-8:Array local variable Pnz median is asked for, result is assigned to array local variable Pnz, and handle
Pnz performs step 2-9 as output;
Step 2-9:Global variable cishu is from Jia 1, and representation program, which has been completed, once calculates Pn, and cishu is one complete
Office's variable, in main program initial launch, default value is 1;
Recycle formula (1) to calculate decision threshold T, the sub- VI of the calculating decision threshold and energy is calculated according to input parameter
The threshold value of detection is measured, and its input parameter includes thresholding configuration information and false-alarm probability, the thresholding configuration information is from calculating
Obtained in the sub- VI of thresholding configuration information, false-alarm probability represents the probability for noise signal being mistakened as making PU signals, can set manually
Put, be 0.1 under default situations, the output result of the sub- VI for calculating decision threshold is detection threshold value T;And the calculating is sentenced
Certainly the sub- VI of thresholding is included at the data processor of MATLAB nodes, the data of the data processor of the MATLAB nodes
Manage flow as follows:
Step 3-1:False-alarm probability p can be calculated according to formula (1)fCorresponding threshold T n, that is, λf,
The data processor of MATLAB nodes includes qfuncinv () function, and it is the encapsulation function in MATLAB, can be realized
Q-1The function of ();
Step 3-2:Because the unit of the data of power spectral density is decibel, also need to Tn Conversion of measurement unit into
DB, conversion formula is that shown in formula (5), the T (dB) in formula (5) represents the detection threshold value that unit is dB:
T (dB)=10lg (Tn) (5)
Step 3-3:Result T (dB) is exported as decision threshold;
Further, the energy detection module be according to the value on this section of frequency spectrum whether there is more than detection threshold value come
Make decisions, if the value on this section of frequency spectrum is more than detection threshold value, PU signals are there is, if the value on this section of frequency spectrum is not
More than detection threshold value, PU signals are just not present, the detection threshold value is exactly the decision threshold;
The other energy detection module includes the VI for frequency spectrum perception, and the VI for frequency spectrum perception is from input
In the data of power density spectrum, according to the size of threshold value, to judge which frequency range has PU signals in power density spectrum, may be used also
With the size according to testing result, and FM frequency deviations, the carrier frequency of FM transmission signals is calculated, finally, according to PU range of signals
In initial frequency and terminate frequency, the VI for being used for frequency spectrum perception can calculate the power of this frequency range PU signals;
Include the MATLAB nodes for frequency spectrum perception in the VI for frequency spectrum perception, be used for frequency spectrum sense described
The input for the MATLAB nodes known includes a global variable suf, the output of the MATLAB nodes for frequency spectrum perception
End includes another global variable suf and global variable lastpower, and wherein suf is the subscript of magnitude arrays,
I.e. magnitude array array S, using formula (6), can calculate tranmitting frequency fw, if to a certain according to suf
Carrier signal is analyzed, then needs to add carrier frequency fz on the basis of acquired results, shown in such as formula (7):
Fw=f0+df*suf (6)
Fw=fz+f0+df*suf (7)
Include two parameters f1 and f2 of PU range of signals in the input of the MATLAB nodes for frequency spectrum perception,
When f1 and f2 represent estimation PU signal powers respectively, the initial frequency and cut-off frequency of computer capacity;
The program of the MATLAB nodes for frequency spectrum perception is divided into three program parts that order is performed, described three
Program part includes:
A. found in frequency spectrum array it is all can as SU tranmitting frequencies subscript;
B. the corresponding subscript suf of tranmitting frequency of SU signals is calculated;
C. the power of designated frequency band PU signals is calculated;
Found in the frequency spectrum array it is all can be from spectrum number as the lower target program part of SU tranmitting frequencies
Found in group it is all can as cognitive user SU tranmitting frequency subscript, find in the frequency spectrum array it is all can conduct
The lower target program part of SU tranmitting frequencies judge subscript in frequency spectrum array whether can for cognitive user SU tranmitting frequency
Lower target standard be:The SU signals of transmitting can not be interfered to PU signals, and being found in the frequency spectrum array all can make
Flow for the lower target program part of SU tranmitting frequencies is as follows:
Step 4-1:Array S length N, and the corresponding data points n of frequency deviation w are calculated, and defines one and S length phases
Together, initial value is 0 array X;
Step 4-2:The element in array S is traveled through successively, if element value is more than threshold value T, i.e. the threshold value T thresholdings
Value, then X element value is 1 at this element correspondence subscript, thus have found all points more than threshold value in S, also just can be with
It is there is PU signals at 1 to think the array element value at subscript corresponding to X;
Step 4-3:Make Y be equal to X, wherein Y be used for record it is all can as tranmitting frequency data point position, make Y etc.
In X, ensure that and be equal in X (i) at 1, that is, there is the place of PU signals, it is impossible to be used as the corresponding subscript of tranmitting frequency;
Step 4-4:Travel through X in each element, judge X (i) whether with X (i) before three numbers value whether
Difference, by this method, finds the border of PU signals, the border of the PU signals includes border and PU letters that PU signals rise
Number border declined, if it is determined that result it is different, perform step 4-5;If it is determined that result it is identical, perform step 4-10, i
For integer variable;
Step 4-5:Judge whether i-n is less than 1, that is, judge whether i-n overflows, if overflowed, k1=1 is made, if i-n does not have
Have spilling, make k1=i-n, at this moment k1 effect be intended for finding can as the frequency range of tranmitting frequency beginning boundary,
Similarly, in addition to a termination border, it is defined as k2, the k1 and k2 are integer variable;
Step 4-6:Judge whether i+n is more than N, also judge whether i+n overflows, if overflowed, make k2=N;Such as
Fruit is not overflowed, and makes k2=i+n;
Step 4-7:By step 4-5 and step 4-6, the authorized user PU boundaries left side and the right n has been found
The position of point is k1 to k2, and ensure that k1, k2 do not overflow, in this step, makes the subscript correspondence between k1 and k2 in Y
Element value be 1;
Step 4-8:If when traversal, during the subscript i=1 of Y array elements, i.e. the beginning in Y arrays, and
I+n does not overflow, then it is 1 to make the element value at the subscript 1 to 1+n of Y arrays;
Step 4-9:If when traversal, during the subscript i=N of Y array elements, i.e. the termination in Y arrays, and
I-n does not overflow, then the element value for making Y array indexs N-n to N locate is 1;
Step 4-10:Terminate;
The flow of the corresponding subscript suf of the tranmitting frequency for calculating SU signals program part is as follows:
Step 5-1:The important parameter of subscript suf corresponding to the tranmitting frequency for calculating SU signals program part
Initialization, makes i=1 and power=0, wherein i represents target initial value under tranmitting frequency, and power represents the initial energy of PU signals
Value;
Step 5-2:Whether be 1, if Y (i) is 1, i certainly add if judging Y (i) one by one in the way of while is circulated
Computing, otherwise the corresponding subscript suf of the tranmitting frequency for calculating SU signals program part jump out while circulation, pass through
This method finds the subscript i that first its value in Y (i) is not 1, it is known that the value of the Y (i) is 0, represents at subscript i pair
The frequency answered can be as tranmitting frequency, and thus have found first can be as target value under the correspondence of SU tranmitting frequencies;
Step 5-3:Judge that suf adds n and subtracted after n whether in the range of 1 to N respectively, if in 1 to N, illustrating suf values
It is the corresponding subscript of last time tranmitting frequency it is necessary to the energy for the n data point that its left side and the right are calculated according to suf values, tying
Fruit is assigned to power, then performs step 5-4, if n is not in 1 to N, it is not that last time tranmitting frequency is corresponding to illustrate suf
Subscript, directly performs step 5-4;
Step 5-4:Judge whether i+10 is less than N, if it is, explanation has the subscript of suitable tranmitting frequency, perform step
Rapid 5-5;If it is not, the frequency index that explanation is detected cannot function as the subscript of tranmitting frequency, step 5-7 is performed;
Step 5-5:Judge whether meet three conditions, three conditions be suf be equal to 1, | suf-i | more than 10 Hes
Power is smaller than 0.7*lastpower, and these three conditions are satisfied by performing step 5-6;
Step 5-6:I is assigned to global variable suf, represents to have found the subscript of new tranmitting frequency, performs step 5-
8;
Step 5-7:Global variable suf is assigned to by 1, expression is not found and can held as target value under tranmitting frequency
Row step 5-8;
Step 5-8:The power values of calculating are assigned to global variable lastpower, are to judge whether SU signals need next time
PU signals are avoided to prepare;
Step 5-9:Terminate;
The flow for calculating the power of designated frequency band PU signals is as follows:
Step 6-1:The energy of PU signals is initialized as 0, and border f1 and the f2 profit of the detection frequency range setting
Corresponding subscript fn1 and fn2 is converted into formula (27);
Step 6-2:Judge whether fn1 and fn2 is less than or equal to 0, if less than equal to 0, illustrating that fn1 or fn2 are illegal, just
Their value is changed to 1, otherwise, step 6-3 is directly performed;
Step 6-3:Judge whether fn1 is less than fn2, if it is, performing step 6-4;Otherwise step 6-5 is performed, herein,
Fn1 correspondence initial frequencies, fn2 correspondence cut-off frequencies;
Step 6-4;In array S, the element for being more than threshold T in corresponding element, first are found from subscript fn1 to fn2
This element removes dB units by formula (8), and wherein Ps (dB) is the power for the PU signals that unit is dB, then after conversion
Result progressively increase into the power P s of PU signals, so, the energy Ps of PU signals present in f1 to f2 can be obtained;
Ps=10^ (Ps (dB)/10) (8)
Step 6-5:Terminate.
Further, the transmitting FM signaling modules are included before the sub- VI and transmitting FM ripples for launching FM signals
Plate, the transmitting FM signaling modules according to the obtained cognitive user SU tranmitting frequency, appropriate IQ speed and frequency deviation this
The parameter of sample, the operation sub- VI for being used for launching FM signals can launch the operation of FM signals using USRP transmitting terminal, described
There are three inputs for launching the sub- VI of FM signals, three inputs are respectively carrier frequency, IQ speed and FM frequency deviations, institute
The tranmitting frequency for stating cognitive user SU is exactly FM carrier frequencies, is used for launching by the way that the front panel input of the transmitting FM ripples is described
The numerical value of carrier frequency, IQ speed and FM frequency deviations needed for the sub- VI of FM signals, by the front panels of the transmitting FM ripples also
The niUSRP configurations signal VI, that is, niUSRP Configure functions, required configuration parameter, by described can be inputted
The configuration parameter of the front panel input of transmitting FM ripples is used for the transmitting for setting USRP signals, the sub- VI for being used for launching FM signals
Include waveform resampling function and FM modulation functions;
In the front panel input of the transmitting FM ripples carrier frequency being used for launching needed for the sub- VI of FM signals, IQ speed
It is described to be used for launching FM signals after configuration parameter needed for rate, the numerical value of FM frequency deviations and niUSRP configuration signals VI
IQ speed is sent to the waveform resampling function by sub- VI, and the input of the waveform resampling function gets the IQ speed
After the data message of rate and the audio signal of audio signal memory module write-in, according to the two parameters, the waveform weight
Sampling function can control each data point of audio signal to form the hair of the Wave data after resampling every time interval Δ t
Send, be achieved in the function that the bit rate of audio signal and the IQ speed of USRP signals transmitting match;
Then the FM modulation functions are realized modulates to the FM of signal, and the FM modulation functions have two input parameters, one
Individual is the Wave data after resampling, one be FM signals frequency deviation, the Wave data after sampling obtains from waveform resampling function
, the frequency deviation of FM signals is constant;
Finally realize after the FM modulation to signal, the signal after modulation is just by the NI-USRP drivers described
Launch under FM carrier frequencies.
Further, the signal that USRP is received is handled, is to realize that USRP can be continuous in the way of while is circulated
Reception signal under conditions of FM processing is carried out to the data that receive by the demodulation FM signaling modules, FM processing is only needed
The output result of niUSRP Fetch RX Date drivers is handled, the demodulation FM signaling modules include using
Carry out the front panel and the function of process signal of sub- VI, FM demodulated audio signals of Simple Sound of playing audio signal, it is described
Branches of the sub- VI of Simple Sound in variables A ction value alternative condition sentences, if variables A ction values are " Open ",
It is to play audio to prepare that sound card is just configured with Sound Output Configure functions;If variables A ction values are
" Write ", is first normalized with a Normalize Waveform function pair Wave data, then the data after processing are used
The sound card of Sound Output Write functions feeding computer is played out;If variables A ction values are " Close ", just use
Sound Output Clear functions, which are removed, gives the data cached of sound card, terminates the broadcasting of audio, the FM demodulation audio letter
Number front panel left part be for typing niUSRP functions configuration parameter part, wherein number of
Samples configuration parameters represent the sample number received every time from data receiver channel, number of samples and IQ speed
Rate IQrate has following relation:
Fetch time are the time of data acquisition of completion in time domain, and resolution bandwidth is in frequency domains
Frequency resolution, i.e., the frequency interval between each adjacent data;The right part of the front panel of the FM demodulated audio signals
For for the waveform signal figure and the waveform display portion of power spectrum figure after display demodulation, specific processing mode is as follows;
The continuous signal that the function pair USRP of the process signal is received is handled in While Loop, if
Join under the conditions of data signal reception is normal according to the configuration of the niUSRP functions of typing in the front panel of FM demodulated audio signals
Count persistently to receive data, the data of reception are converted to polar form, the phase signal in polar coordinates is deployed, expansion
Afterwards to data progress differential, USRP sample rates are matched with the sample rate of sound card information respectively after differential, data real part
The power density values of signal are separated and asked with imaginary part, and data real part and imaginary part are then separated and asked signal
Data after power density values are shown and then terminated the operation of the function of the process signal respectively, and USRP sample rates with
Data after the sample rate matching of sound card information are sent to sound card in the sub- VI of Simple Sound for playing audio signal
Action values be changed into broadcasting under conditions of " Write ", terminate the operation of the function of the process signal, described after finishing playing
Phase unwrapping in polar coordinates is realized by unwrap functions.
The present invention technique effect be:In the case where restriction is with a USRP, reception can be used as with an antenna
Antenna receives wireless signal, and frequency spectrum is carried out to the wireless signal of reception by the USRP frequency spectrum sensing modules in frequency spectrum perception program
Perceive, find after available frequency band, FM signals are launched on this available frequency band by another antenna.
Brief description of the drawings
Fig. 1 is the composition schematic diagram of the USRP frequency spectrum sensing modules of the present invention.
Fig. 2 stores the schematic diagram of front panel for the audio signal of the present invention.
Fig. 3 is the flow chart of the peripheral routine of the present invention.
Fig. 4 is the program flow diagram of the MATLAB nodes of the present invention.
Fig. 5 is the flow chart of a part of the program of the MATLAB nodes for frequency spectrum perception of the present invention.
Fig. 6 is the flow chart of another part of the program of the MATLAB nodes for frequency spectrum perception of the present invention.
Fig. 7 is the flow of one part of residue of the program of the MATLAB nodes for frequency spectrum perception of the present invention
Figure.
Fig. 8 is the schematic diagram of the front panel of the transmitting FM ripples of the present invention.
Fig. 9 is the flow chart of the While cyclic parts of the FM demodulated audio signals of the present invention.
Figure 10 is the schematic diagram of the front panel of the FM demodulated audio signals of the present invention.
Figure 11 is the operation front panel schematic diagram of the frequency spectrum perception program based on USRP that embodiments of the invention are detected.
Figure 12 is the testing result figure to energy density spectrum in Figure 11.
Figure 13 is the demodulation result figure in embodiment.
Embodiment
The present invention is described further below in conjunction with embodiment.
As shown in Fig. 1-Figure 10, the frequency spectrum perception system based on USRP of the present embodiment, including USRP, the USRP pass through
Ethernet is connected with host computer PC;So when receiving signal, USRP is responsible for the wireless signal in space to be converted into number
Word signal is transferred to host computer PC, and then host computer PC is responsible for handling these data signals, handles these numeral letters
Number mode can be demodulated or decoded;When sending signal, host computer PC is first handled data signal, processing
The mode of these data signals can for coding or modulate, then the digital data transmission handled well to USRP, USRP again
These data signals are converted into analog signal, are sent to by antenna in space.
The host computer PC includes LabVIEW software platforms and NI USRP software suites, and the NI USRP are soft
The program that part external member is added in LabVIEW in NI-USRP drivers, the LabVIEW software platforms passes through NI-USRP
Driver is interacted with the USRP;
Program in the LabVIEW software platforms includes frequency spectrum perception program, and the frequency spectrum perception program includes USRP
Frequency spectrum sensing module.
The USRP is NI USRP, and the NI USRP are connected by gigabit Ethernet with host computer PC.
MATLAB script, which can also be quoted, in the host computer PC realizes LabVIEW's and MATLAB with this
Joint debugging.If data are more complicated in LabVIEW programmings, it can be given MATLAB to handle.
The NI-USRP drivers include eight functions, and eight functions are respectively
17.niUSRP opens Rx session VI, i.e. niUSRP Open Rx Session VI;
18.niUSRP configures signal VI, i.e. niUSRP Configure VI;
19.niUSRP initializes VI, i.e. niUSRP Initiate VI;
20.niUSRP opens Tx session VI, i.e. niUSRP Open Tx Session VI;
21.niUSRP, which is extracted, receives data VI, i.e. niUSRP Fetch Rx Data VI;
22.niUSRP launches data VI, i.e. niUSRP Write Tx Data VI);
23. terminate VI, i.e. niUSRP Abort VI;
24. close VI, i.e. niUSRP Close Session VI;VI in wherein 1-4 is realized in configuration feature, 5-6
VI realizes that the VI in read-write capability, 7-8 realizes end functions.
The niUSRP Open Rx Session VI are used for starting reception radiofrequency signal.
The niUSRP Configure VI are used for being used together with receiving session Rx or sending session Tx.By this
VI, the IQ rates for sending or receiving data, carrier frequency, information as gain can be set manually.But, it is not all to set manually
IQ rates, frequency and the gain put all are effective.If the parameter value of input is simultaneously non-effective, function can force input value to turn
It is melted into a virtual value.
The niUSRP Initiate VI are used for using after niUSRP configurations VI, and it can tell USRP parameters to match somebody with somebody
Put and completed, data can be received.
The niUSRP Open Tx Session VI are used for starting USRP transmitting radiofrequency signals.
The niUSRP Fetch Rx Data VI are used for the data for extracting USRP receptions.It can be the data of extraction
Such digitized processing is demodulated or decoded.
The niUSRP Write Tx Data VI are used for controlling USRP to send I/Q data.
The niUSRP Abort VI cease and desist order to USRP transmission.USRP receive cease and desist order after, no longer receive or
Send data.
The niUSRP Close Session VI are used for closing Rx the or Tx parts being currently running, and discharge them
Internal memory used.NiUSRP Close Session VI and niUSRP Abort VI differences are:If before have invoked
Person, will such as reuse USRP, it is necessary to rerun routine;If have invoked the latter, can not rerun routine feelings
Under condition, USRP is reused.
The reception wireless signal and transmitting eight letter of the wireless signal module by the NI-USRP drivers
Number receives the process of wireless signal and transmitting wireless signal to realize.
The method of the frequency spectrum perception system based on USRP, including:Limit only with a USRP in the case of, can be with
Wireless signal is received as reception antenna with an antenna, by the USRP frequency spectrum sensing modules in frequency spectrum perception program to receiving
Wireless signal carry out frequency spectrum perception, find after available frequency band, FM signals launched on this available frequency band by another antenna,
At this moment the energy measuring of the energy detection module for reception antenna is terminated, demodulates what transmitting antenna was launched using reception antenna
FM signals, and the USRP frequency spectrum sensing modules include audio signal memory module, calculate decision threshold module, energy measuring mould
Block, transmitting FM signaling modules and demodulation FM signaling modules.The composition of the USRP frequency spectrum sensing modules is as shown in Figure 1.
The basis of the USRP frequency spectrum sensing modules is for FM audio signal modulations are launched and received, so sound
The problem of frequency signal memory module first has to and solved is exactly that audio signal carrys out source problem.It is related to handle audio in LabVIEW
The function of signal, is described below the storage of audio signal.It is noted that when LabVIEW carries out Audio Signal Processing, Zhi Nengshi
The file of other .wav forms.
The audio signal memory module includes the function of configuration audio input, the function for reading audio input, write simultaneously
Open the function of audio file, write function that the function of audio file, audio input reset, close audio file function and
Audio signal storage front panel as shown in Figure 4, the function of the configuration audio input is used for the feature for setting audio signal, one
As used in the beginning of USRP frequency spectrum sensing modules, the feature of the audio signal is included per channel sample sum, sampling configuration, set
Standby ID and audio format, the function of the reading audio input are used to read from the sound card of the host computer PC
The audio signal of recording, said write simultaneously opens storage position of the function of audio file for specific audio frequency signal on disk
Put, the function of said write audio file is used for the storage location for the audio signal of reading being written to the audio signal specified,
The function that the audio input is reset is used to stopping data collection, removes caching, task be back to default conditions and removing and
The related data of task, the function of the closing audio file is used for the storage for stopping audio signal, shows that audio signal is stored
Complete;So storing front panel by the audio signal selects the store path of audio file (in example in fig. 2, to select
The store path for the audio file selected is E:Test.wav), input per channel sample sum, sampling configuration, device id and sound
Sound form, the mark for the equipment for inputting or exporting when the device id is audio operation, its default value is 0, typically need not
Change, every channel sample sum is the speed that sample is read from sample buffer specified, and the sampling configuration is finger
Determine VI and carry out limited sampling or continuous sampling, the audio format is sets the acquisition rate of audio operation, number of channels and every
The number of bits of individual sampling;Then audio signal shown in clicking on stores the stop button of front panel, thus finishes typing simultaneously
The store path of the audio file of selection is transferred to the function for writing and opening audio file, and the every channel sample inputted is total
Number, sampling configuration, device id and audio format are transferred to the function of configuration audio input, then described to read audio input
Function is described per channel sample sum, sampling configuration, device id and sound in the function of configuration audio input according to being transferred to
Sound form is used to read the audio signal recorded from the sound card of the host computer PC, then said write audio text
The store path for the audio file that the function of part write and opened the selection in the function of audio file according to being transferred to is used for handle
The audio signal of reading is written to the store path (storage location for the audio signal namely specified) of the audio file of selection,
Write-in finish the function that the rear audio input resets just stop data collection, remove caching, task be back to default conditions with
And the data related to task are removed, and the function for closing audio file stops the storage of audio signal.
The calculating decision threshold module is before operation energy detection module carries out energy measuring, according to formula (1)
To derive that threshold value needs length, signal to noise ratio and the noise power of a segment signal.These information can be from
Obtained on reference spectrum, determine how to obtain these necessary informations for calculating decision threshold, Q from one section of reference spectrum below
() is normal distribution tail probability function, and the calculating decision threshold module includes calculating sub- VI, the calculating of thresholding configuration information
The program and peripheral routine of sub- VI, MATLAB node of decision threshold, in order to ensure the reliability of result of calculation, the calculating door
The sub- VI for limiting configuration information carries out 10 sub-samplings to the frequency spectrum data of the same band, by the median of this 10 groups of sampling results
As output, the sub- VI of calculating thresholding configuration information input has three parameters, and three parameters are respectively to wait to locate
The Wave data of the power density spectrum of reason, the initial frequency of data to be tested and the cut-off frequency of data to be tested, and the meter
The output end for calculating the sub- VI of thresholding configuration information is that a gathering is closed, including two parameters, and two parameters are whole ripple respectively
The half N/2 and false-alarm probability p of the array length of graphic dataf, two parameters are substituted into formula (1) and corresponded to regard to that can calculate
The threshold value λ of false-alarm probabilityf, and in peripheral routine, there is provided 1 global variable cishu, also 2 local variable Pnz and
Thresholding configuration information;Cishu is used for the number of times for recording the sub- VI operations of the calculating thresholding configuration information;Thresholding configuration information is
The median of preceding 10 sub-sampling result of calculation, if sampling number of times is less than 10 times, thresholding configuration information is the meter after every sub-sampling
Calculate result;If sampling number of times more than 10 times, 10 thresholding configuration informations of thresholding configuration information and sampling are identical, also set up in addition
The variable Pnz of local variable array form, Pnz is responsible for the operation result of each peripheral routine to store, when to frequency
When modal data is sampled 10 times, peripheral routine calculates the median of data in Pnz arrays, as shown in figure 3, the tool of the peripheral routine
Body flow is as follows:
Step 1-1:Obtain global variable cishu value.When the peripheral routine just starts, cishu is arranged to 1;
Step 1-2:Judge whether cishu is less than 11, if less than 11, perform step 1-3;If not less than 11, performed
Step 1-5;
Step 1-3:The data of frequency spectrum data section are sent into MATLAB nodes, using MATLAB instrument processing datas, one
The result of secondary computing is stored in local variable array Pnz successively, in MATLAB nodes, and program determines whether that program has been held
Go 10 times, can be using the medians of 10 data as the local variable of thresholding configuration information if performing 10 times, and will
The local variable is used as program output valve;
Step 1-4:Certainly Jia 1 is assigned to global variable cishu to global variable cishu;
Step 1-5:Thresholding configuration information in obtaining step 1-3, and as program output valve;
The program of the MATLAB nodes calculates the one of the noise power in designated spectrum and the length of whole Wave data
Half, take the median of 10 result of calculation as output result, the input parameter of the MATLAB nodes and effect are as follows:
The input parameter of the MATLAB nodes includes:
Initial frequency f1 and cut-off frequency f2, for determining spectral range;
Global variable cishu, the number of times of the sub- VI operations for recording the calculating thresholding configuration information;
Local variable Pnz, the result of calculation for storing first 10 times;
Power spectral density, the power spectral density is Waveform data format, including three parameters f0, df, magnitude,
The power density of initial frequency, frequency interval and the respective frequencies point of waveform is represented respectively;
The parameter and its implication of the output end of the MATLAB nodes are as follows:
Pn is the median that program runs the noise power obtained for 10 times;
M is the half of Wave data length;
Local variable Pnz is used to result of calculation write array, can be with when being run again with the program whne MATLAB nodes
Therefrom read data;
As shown in figure 4, the flow of the program of the MATLAB nodes is as follows:
Step 2-1:Correspondence in initial frequency and each comfortable array magnitude of cut-off frequency is calculated according to formula (2)
Subscript n 1 and n2, in order to ensure n1 and n2 is integer, use round (n) function pairs formula (2) computing result carry out four give up
Five enter processing, and wherein n is n1 or n2, f are f1 or f2:
N=(f-f0)/df (2)
Step 2-2:In order to prevent initial frequency in array magnitude corresponding subscript n 1 be 0 when, program error,
Set when corresponding subscript n 1 is 0 to initial frequency in array magnitude, the value of the n1 is adjusted to 1 by pressure;
Step 2-3:The number N of n1 to n2 data point is calculated, the length of assigned frequency hop count group is used as;Calculate input
The half of array magnitude length value is assigned to M as output;
Step 2-4:Element value of the subscript from n1 to n2 in wave-shape amplitude information S, calculated with formula (3), and handle
As a result new array x is assigned to, wherein array x subscript is since 1, and length is N:
Pn=10^ (Pn (dB)/10) (3)
The noise power that wherein Pn (dB) expression decibel dB values are represented;In the program for calculating detection threshold, to use
Decibel value, can be converted to actual value by noise power Pn actual value with formula (3).
Step 2-5:Expression formula of the energy of Gaussian noise signal in frequency domain is shown in formula (4):
Due to there is PU signals in some frequency range, it is impossible to seek noise power to the performance number superposition of whole frequency range.Profit
It is a fixed value with the power spectrum average P (f) of Gaussian noise signal, can first seeks average P (f) df of special frequency channel, then
The points of spectrogram data are multiplied by with this average P (f) df, the noise power P (t) of whole frequency range is asked for;
Proceed to step 2-5, program is had been completed to required parameter M, Pn calculating, but it is accurate for data
Property, step below considers that median is calculated from multi-group data is used as output.
Step 2-6:Pn is assigned to array local variable Pnz, the subscript of array is set to the number of times of program operation, also
It is global variable cishu;
Step 2-7:Judge whether the program of the MATLAB nodes has been run 10 times according to global variable cishu, if
Global variable cishu is equal to 10, performs step 2-8, otherwise performs step 2-9;
Step 2-8:Array local variable Pnz median is asked for, result is assigned to array local variable Pnz, and handle
Pnz performs step 2-9 as output;
Step 2-9:Global variable cishu is from Jia 1, and representation program, which has been completed, once calculates Pn, and cishu is one complete
Office's variable, in main program initial launch, default value is 1;This ensure that the output of program with reference to many class values, it can reduce
Interference of the unexpected pulse to result.
Namely sub- VI is set to obtain two unknown parameter (PU in formula (1) on the right of equal sign by threshold parameter
The noise power Pn of the signal and half M of Wave data length value), recycling formula (1) calculating decision threshold T, described below
The threshold value of energy measuring can be calculated according to input parameter by calculating the sub- VI of decision threshold, and its input parameter includes thresholding
Configuration information and false-alarm probability, the thresholding configuration information can be obtained from the sub- VI for calculating thresholding configuration information, and false-alarm is general
Rate represents the probability for noise signal being mistakened as making PU signals, can set manually, is 0.1 under default situations, described to calculate judgement
The sub- VI of thresholding output result is detection threshold value T;Implement and data processing is mainly carried out by MATLAB nodes, under
The data processor of surface analysis MATLAB nodes.And the sub- VI for calculating decision threshold is included at the data of MATLAB nodes
Reason program, the flow chart of data processing of the data processor of the MATLAB nodes is as follows:
Step 3-1:False-alarm probability p can be calculated according to formula (1)fCorresponding threshold T n, that is, λf,
The data processor of MATLAB nodes includes qfuncinv () function, and it is the encapsulation function in MATLAB, can be realized
Q-1The function of ();
Step 3-2:Because the unit of the data of power spectral density is decibel, also need to Tn Conversion of measurement unit into
DB, conversion formula is that shown in formula (5), the T (dB) in formula (5) represents the detection threshold value that unit is dB:
T (dB)=10lg (Tn) (5)
Step 3-3:Result T (dB) is exported as decision threshold;
This completes the design for calculating decision threshold.
Further, the energy detection module be according to the value on this section of frequency spectrum whether there is more than detection threshold value come
Make decisions, if the value on this section of frequency spectrum is more than detection threshold value, PU signals are there is, if the value on this section of frequency spectrum is not
More than detection threshold value, PU signals are just not present, the detection threshold value is exactly the decision threshold;Thus say, find one
Suitable detection threshold, plays the role of very big to testing result.If threshold value is too low, false-alarm probability p will be madefIt is too big,
Noise signal is mistakenly considered PU signals;If threshold value is too high, detection probability P will be madedDiminish, accordingly even when existing on frequency spectrum
PU signals, also differ surely to rule out and, detection leakage phenomenon occur.Accordingly, it would be desirable to find an appropriate energy detection threshold value λ
(threshold value λ is represented with T or Tn in a program), so that detection probability is compromised with false-alarm probability.
The other energy detection module includes the VI for frequency spectrum perception, and the VI for frequency spectrum perception can be from defeated
In the data of the power density spectrum entered, according to the size of threshold value, to judge which frequency range has PU signals in power density spectrum,
According to the size of testing result, and FM frequency deviations, the carrier frequency of FM transmission signal can also be calculated, finally, according to PU signals
Initial frequency and termination frequency in scope, the VI for being used for frequency spectrum perception can calculate the power of this frequency range PU signals;
Include the MATLAB nodes for frequency spectrum perception in the VI for frequency spectrum perception, be used for frequency spectrum sense described
The input for the MATLAB nodes known includes a global variable suf, the output of the MATLAB nodes for frequency spectrum perception
End includes another global variable suf and global variable lastpower, and wherein suf is the subscript of magnitude arrays,
I.e. magnitude array array S, using formula (6), can be calculated according to suf tranmitting frequency fw (change an angle,
Suf can also be interpreted as tranmitting frequency fw subscripts corresponding in magnitude arrays), if believing a certain carrier wave
Number analyzed, then need to add carrier frequency fz on the basis of acquired results, shown in such as formula (7):
Fw=f0+df*suf (6)
Fw=fz+f0+df*suf (7)
Include two parameters f1 and f2 of PU range of signals in the input of the MATLAB nodes for frequency spectrum perception,
When f1 and f2 represent estimation PU signal powers respectively, the initial frequency and cut-off frequency of computer capacity;
The program of the MATLAB nodes for frequency spectrum perception is divided into three program parts that order is performed, described three
Program part includes:
A. found in frequency spectrum array it is all can as SU tranmitting frequencies subscript;
B. the corresponding subscript suf of tranmitting frequency of SU signals is calculated;
C. the power of designated frequency band PU signals is calculated;
Found in the frequency spectrum array it is all can be from spectrum number as the lower target program part of SU tranmitting frequencies
Found in group it is all can as cognitive user SU tranmitting frequency subscript, find in the frequency spectrum array it is all can conduct
The lower target program part of SU tranmitting frequencies judge subscript in frequency spectrum array whether can for cognitive user SU tranmitting frequency
Lower target standard be:The SU signals of transmitting can not be interfered to PU signals, and being found in the frequency spectrum array all can make
Flow for the lower target program part of SU tranmitting frequencies is as follows:
Step 4-1:Array S length N, and the corresponding data points n of frequency deviation w are calculated, and defines one and S length phases
Together, initial value is 0 array X;
Step 4-2:The element in array S is traveled through successively, if element value is more than threshold value T, i.e. the threshold value T thresholdings
Value, then X element value is 1 at this element correspondence subscript, thus have found all points more than threshold value in S, also just can be with
It is there is PU signals at 1 to think the array element value at subscript corresponding to X;
Step 4-3:Make Y be equal to X, wherein Y be used for record it is all can as tranmitting frequency data point position, make Y etc.
In X, ensure that and be equal in X (i) at 1, that is, there is the place of PU signals, it is impossible to as the corresponding subscript of tranmitting frequency, so,
As long as just consider at the n each points of PU borders or so with cannot be as the corresponding lower target of tranmitting frequency near array Y border
Situation;
Step 4-4:Travel through X in each element, judge X (i) whether with X (i) before three numbers value whether
Difference, by this method, finds the border of PU signals, the border of the PU signals includes border and PU letters that PU signals rise
Number border declined, if it is determined that result it is different, perform step 4-5;If it is determined that result it is identical, perform step 4-10, i
For integer variable;
Step 4-5:Judge whether i-n is less than 1, that is, judge whether i-n overflows, if overflowed, k1=1 is made, if i-n does not have
Have spilling, make k1=i-n, at this moment k1 effect be intended for finding can as the frequency range of tranmitting frequency beginning boundary,
Similarly, in addition to a termination border, it is defined as k2, the k1 and k2 are integer variable, the step of k2 is below occurs;
Step 4-6:Judge whether i+n is more than N, also judge whether i+n overflows, if overflowed, make k2=N;Such as
Fruit is not overflowed, and makes k2=i+n;
Step 4-7:By step 4-5 and step 4-6, the authorized user PU boundaries left side and the right n has been found
The position of point is k1 to k2, and ensure that k1, k2 do not overflow, in this step, makes the subscript correspondence between k1 and k2 in Y
Element value be 1;Ensure that the subscript of border or so n point cannot function as the subscript of tranmitting frequency.
Step 4-8:If when traversal, during the subscript i=1 of Y array elements, i.e. the beginning in Y arrays, and
I+n does not overflow, then it is 1 to make the element value at the subscript 1 to 1+n of Y arrays;
Step 4-9:If when traversal, during the subscript i=N of Y array elements, i.e. the termination in Y arrays, and
I-n does not overflow, then the element value for making Y array indexs N-n to N locate is 1;So also ensure that at array Y end points
It cannot function as the subscript of tranmitting frequency.After the processing to Y, the subscript of remaining Y (i)=0 can be used as tranmitting frequency
Subscript.
Step 4-10:Terminate;
Found in by the frequency spectrum array all can have found as the lower target program part of SU tranmitting frequencies
After the subscript of all cognitive user SU tranmitting frequency, it is necessary under the tranmitting frequency for therefrom selecting a cognitive user SU
Mark.At this moment, have need consideration at 2 points:Any be cognitive user SU tranmitting frequency change can not too frequently, if PU signals
Simply frequently shaken in boundary, it is not necessary to change the cognitive user SU corresponding subscript of tranmitting frequency;On the other hand, it is assumed that
The corresponding subscript of tranmitting frequency through have found cognitive user SU, and cognitive user SU according to this subscript change after
Frequency at transmission signal, unless occurred PU signals in the frequency range of cognitive user SU tranmitting frequency, otherwise can not change
The corresponding subscript of SU tranmitting frequencies.
The flow of the corresponding subscript suf of the tranmitting frequency for calculating SU signals program part is as follows:
Step 5-1:The important parameter of subscript suf corresponding to the tranmitting frequency for calculating SU signals program part
Initialization, makes i=1 and power=0, is that the energy of the corresponding subscript of calculating tranmitting frequency and PU signals below is prepared, its
Middle i represents target initial value under tranmitting frequency, and power represents the primary power value of PU signals;
Step 5-2:Whether be 1, if Y (i) is 1, i certainly add if judging Y (i) one by one in the way of while is circulated
Computing, otherwise the corresponding subscript suf of the tranmitting frequency for calculating SU signals program part jump out while circulation, pass through
This method finds the subscript i that first its value in Y (i) is not 1, it is known that the value of the Y (i) is 0, represents at subscript i pair
The frequency answered can be as tranmitting frequency, and thus have found first can be as target value under the correspondence of SU tranmitting frequencies;
Step 5-3:Pass through step 5-2, although have found the corresponding subscript value of SU tranmitting frequencies, but this value is not necessarily intended to
It is converted into tranmitting frequency.The step for, judge that suf adds respectively and n and subtract after n whether in the range of 1 to N, if in 1 to N,
Illustrate that suf values are last time tranmitting frequency corresponding subscript it is necessary to the n data point according to suf values its left side of calculating and the right
Result, is assigned to power by energy, then performs step 5-4, if n is not in 1 to N, and it is not last time transmitting to illustrate suf
The corresponding subscript of frequency, directly performs step 5-4;
Step 5-4:Judge whether i+10 is less than N, if it is, explanation has the subscript of suitable tranmitting frequency, perform step
Rapid 5-5;If it is not, the frequency index that explanation is detected cannot function as the subscript of tranmitting frequency, step 5-7 is performed;
Step 5-5:Judge whether meet three conditions, three conditions be suf be equal to 1, | suf-i | more than 10 Hes
Power is smaller than 0.7*lastpower, and these three conditions are satisfied by performing step 5-6;Wherein, first condition suf is equal to 1
Meaning is that the last suitable tranmitting frequency or last time of not finding does not have transmission signal;Second condition | suf-i | it is big
In 10 meaning be i values change compare suf for, exceeded 10 units, be so in order to detection 10 units of signal
Space is shaken, if the border subscript change of last time signal avoids the need for change no more than 10 units;3rd condition power
Meaning than 0.7*lastpower is, when a SU signal is emitted, if the now PU transmittings letter on the frequency band of SU signals
Number, whether SU signals are accomplished by avoiding, be actually to be uprushed to judge to authorize according to the signal energy in frequency range where SU signals
Whether user starts to take this frequency range.
Step 5-6:I is assigned to global variable suf, represents to have found the subscript of new tranmitting frequency, performs step 5-
8;
Step 5-7:Global variable suf is assigned to by 1, expression is not found and can held as target value under tranmitting frequency
Row step 5-8;
Step 5-8:The power values of calculating are assigned to global variable lastpower, are to judge whether SU signals need next time
PU signals are avoided to prepare;
Step 5-9:Terminate;
So far, the program part for calculating the corresponding subscript suf of tranmitting frequency of SU signals have found tranmitting frequency correspondence
Subscript.
The flow for calculating the power of designated frequency band PU signals is as follows:
Step 6-1:The energy of PU signals is initialized as 0, and border f1 and the f2 profit of the detection frequency range setting
Corresponding subscript fn1 and fn2 is converted into formula (27);
Step 6-2:Judge whether fn1 and fn2 is less than or equal to 0, if less than equal to 0, illustrating that fn1 or fn2 are illegal, just
Their value is changed to 1, otherwise, step 6-3 is directly performed;
Step 6-3:Judge whether fn1 is less than fn2, if it is, performing step 6-4;Otherwise step 6-5 is performed, herein,
Fn1 correspondence initial frequencies, fn2 correspondence cut-off frequencies, it is necessary to which it is just meaningful that fn1 is more than fn2;
Step 6-4;In array S, the element for being more than threshold T in corresponding element, first are found from subscript fn1 to fn2
This element removes dB units by formula (8), and wherein Ps (dB) is the power for the PU signals that unit is dB, then after conversion
Result progressively increase into the power P s of PU signals, so, the energy Ps of PU signals present in f1 to f2 can be obtained;
Ps=10^ (Ps (dB)/10) (8)
Step 6-5:Terminate.
Arrive here, program completes the estimation to PU signal powers, with reference to estimation above to noise power Pn, utilizes public affairs
Formula (9) can calculate the signal to noise ratio snr of PU signals.
SNR=10lg (Ps/Pn) (9)
The transmitting FM signaling modules include the front panel of the sub- VI and transmitting FM ripples for launching FM signals, the hair
FM signaling modules parameter according to as obtained cognitive user SU tranmitting frequency, appropriate IQ speed and frequency deviation is penetrated,
The operation sub- VI for being used for launching FM signals can launch the operation of FM signals using USRP transmitting terminal, described to be used for launching FM
The sub- VI of signal has three inputs, and three inputs are respectively carrier frequency, IQ speed and FM frequency deviations, the cognitive user
SU tranmitting frequency is exactly FM carrier frequencies, passes through the front panel input of the transmitting FM ripples for being used for launching FM signals
The numerical value of carrier frequency, IQ speed and FM frequency deviations needed for VI, can also be inputted described by the front panel of the transmitting FM ripples
NiUSRP configures signal VI, that is, niUSRP Configure functions, required configuration parameter, passes through the transmitting FM ripples
The configuration parameter of front panel input is used for the transmitting for setting USRP signals, and the sub- VI for being used for launching FM signals includes waveform
Resampling function and FM modulation functions;
In the front panel input of the transmitting FM ripples carrier frequency being used for launching needed for the sub- VI of FM signals, IQ speed
It is described to be used for launching FM signals after configuration parameter needed for rate, the numerical value of FM frequency deviations and niUSRP configuration signals VI
IQ speed is sent to the waveform resampling function by sub- VI, and the input of the waveform resampling function gets the IQ speed
After the data message of rate and the audio signal of audio signal memory module write-in, according to the two parameters, the waveform weight
Sampling function can control each data point of audio signal to form the hair of the Wave data after resampling every time interval Δ t
Send, be achieved in the function that the bit rate of audio signal and the IQ speed of USRP signals transmitting match;
Then the FM modulation functions be in LabVIEW softwares in RF Communications software kits IP encapsulate one
Individual function, it is possible to achieve modulated to the FM of signal, the FM modulation functions have two input parameters, and one is ripple after resampling
Graphic data, one be FM signals frequency deviation, the Wave data after sampling obtains from waveform resampling function, and the frequency deviation of FM signals is
Constant;
Finally realize after the FM modulation to signal, the signal after modulation is just by the NI-USRP drivers described
Launch under FM carrier frequencies.
If considering to demodulate continuous FM signals, it is necessary to assure USRP can continuously receive signal, and this problem can
Solved with being circulated by while.The signal that USRP is received is handled, is to realize USRP in the way of while is circulated
It can continuously receive under conditions of signal and the data received are carried out at FM processing, the FM by the demodulation FM signaling modules
Reason only needs to handle the output result of niUSRPFetch RXDate drivers, is wrapped in the demodulation FM signaling modules
The front panel and the function of process signal of sub- VI, FM demodulated audio signals of Simple Sound for playing audio signal are included,
Branches of the sub- VI of Simple Sound in variables A ction value alternative condition sentences, if variables A ction values are
" Open ", it is to play audio to prepare that sound card is just configured with Sound Output Configure functions;If variables A ction
It is worth for " Write ", is first normalized with a Normalize Waveform function pair Wave data, then the number after processing
Played out according to the sound card that computer is sent into Sound Output Write functions;If variables A ction values are " Close ", just
Removed with Sound Output Clear functions and give the data cached of sound card, terminate the broadcasting of audio, the FM demodulates audio
The left part of the front panel of signal is the part of the configuration parameter for typing niUSRP functions, wherein number of
Samples configuration parameters represent the sample number received every time from data receiver channel, number of samples and IQ speed
Rate IQrate has following relation:
Fetch time are the time of data acquisition of completion in time domain, and resolution bandwidth is in frequency domains
Frequency resolution, i.e., the frequency interval between each adjacent data;The right part of the front panel of the FM demodulated audio signals
For for the waveform signal figure and the waveform display portion of power spectrum figure after display demodulation, specific processing mode is as follows;
The continuous signal that the function pair USRP of the process signal is received is handled in While Loop, if
Join under the conditions of data signal reception is normal according to the configuration of the niUSRP functions of typing in the front panel of FM demodulated audio signals
Count persistently to receive data, the data of reception are converted to polar form, the phase signal in polar coordinates is deployed, expansion
Afterwards to data progress differential, USRP sample rates are matched with the sample rate of sound card information respectively after differential, data real part
The power density values of signal are separated and asked with imaginary part, and data real part and imaginary part are then separated and asked signal
Data after power density values are shown and then terminated the operation of the function of the process signal respectively, and USRP sample rates with
Data after the sample rate matching of sound card information are sent to sound card in the sub- VI of Simple Sound for playing audio signal
Action values be changed into broadcasting under conditions of " Write ", terminate the operation of the function of the process signal, described after finishing playing
Phase unwrapping in polar coordinates realizes that the unwrap functions can be discontinuous phase signal by unwrap functions
It is converted into continuous phase signal, it is to avoid the mutation of phase.
Next the effect for the wireless signal that this method and system are received is analyzed, first the parameter to each front panel is entered
Row is set, and is that later analysis program operational effect is prepared.Then the threshold value of acquisition is verified according to program operation result
Reasonability, and draw PU signals by the less feature of noise jamming.Afterwards, program analyzes the result of energy measuring, obtains
Program can preferably find out the conclusion of PU signals from frequency spectrum.Finally, the signal received from USRP reception antennas is solved
Adjust, whether the setting according to demodulation effect to verify SU signal tranmitting frequencies is proper, and detailed process is as follows:
, it is necessary to which host computer PC IP address is arranged to 192.168.10.1 before using USRP.In acquiescence feelings
Under condition, USRP IP is 192.168.10.2, and this address can only be matched with 192.168.10.1.If host computer PC
IP address be arranged to other addresses, even if being connected between USRP and host computer PC by netting twine, USRP also can not be real
Now with host computer PC communication.It is wireless signal to be carried out based on USRP before the program of frequency spectrum perception as shown in figure 11
Plate.IQ rate are set as 4M, carrier frequency are 91M.In energy measuring spectrum, the scope of abscissa is that -2M is arrived
2M, it is 4M to represent detection spectral bandwidth.It is at 0, to represent carrier frequency 91MHz energy in abscissa value.It is considered that detection
The scope of frequency spectrum is 89MHz~93MHz.In the parameter setting area of front panel lower left, signal can be received according to USRP
" energy density figure " sets noise detection frequency scope, and PU signal detection frequency ranges manually.Program can be by the two
Value range estimates the noise power and PU power for receiving signal.In the example shown in Figure 11, the detected noise signal of setting
Frequency range be that (it is 91MHz not account for carrier frequency to -1.9MHz~-1.6MHz, and actual detection frequency range is
(91-1.9=89.1) MHz~(91-1.6=89.4) MHz), it is 3.43 × 10 to estimate obtained noise power-11.This is made an uproar
The number (being tried to achieve in a program by length functions) of acoustical power and detection data point brings formula (3-11) into, so that it may in the hope of
Go out detection threshold value for -104.562dB.By inspection, it can be seen that this threshold value can be distinguished well in " energy density spectrum "
PU signals and noise signal.So, the threshold value that program is obtained is more reasonable.
The detection frequency range for setting PU signals is -1.2MHz~-0.5MHz.Within this range, if the letter detected
Number energy value is more than the performance number that threshold value is considered as PU signals, assign the average of performance number as output result " PU signal work(
Rate ".The PU signal powers obtained in Figure 11 are 1.968 × 10-7.Then according to noise power, and PU signal powers, utilize correspondence
Formula, can obtain and receive the signal to noise ratio of signal for 37.58dB.The value of this signal to noise ratio illustrates what USRP was received than larger
PU signals are affected by noise smaller.The threshold value obtained according to calculating, can carry out energy measuring to frequency spectrum, and Figure 12 is to figure
The testing result of energy density spectrum in 11.In fig. 12, range value is that 1 expression is PU signals at the frequency, and range value is 0 table
Show at the frequency to be noise signal.Figure 12, which is shown at 89.5MHz, 90MHz, 91MHz, has PU signals.In Figure 11 energy
Density spectra at this 3 frequencies near, the power of signal is substantially bigger than power at other frequencies, it is believed that this 3 frequencies
Signal near rate is PU signals.So, program relatively accurately completes frequency spectrum perception, have found PU signals in given frequency spectrum
Position.
According further to testing result, " tranmitting frequency " that program is calculated is 89MHz.Click in Figure 11 and " whether launch letter
Number " button, program is using 89MHz as carrier frequency, one FM ripple of transmitting.Then the carrier frequency for the program for receiving FM signals is set
For 89MHz, SU signals are received, Figure 13 demodulation result can be obtained.FM demodulation process can be to carrier frequency
FM signals are demodulated, the lower right in fig. 13 of the audio signal frequency spectrum figure after demodulation.Demodulation process can be played after demodulation
Although audio signal, have some noises, but can roughly recover unmodulated audio signal when playing audio.This
Illustrate, the SU signals after transmitting do not account for a certain section of frequency spectrum altogether with the PU signals on perceived spectral.So, program have found properly
SU tranmitting frequencies, and its frequency spectrum does not also produce aliasing with the frequency spectrums of PU signals.
The technique effect of the technical program is:In the case where restriction is with a USRP, an antenna conduct can be used
Reception antenna receives wireless signal, and the wireless signal of reception is carried out by the USRP frequency spectrum sensing modules in frequency spectrum perception program
Frequency spectrum perception, is found after available frequency band, and FM signals are launched on this available frequency band by another antenna.
The present invention is described by way of examples above, it will be understood by those of skill in the art that the disclosure is not
It is limited to embodiments described above, in the case of without departing from the scope of the present invention, can makes a variety of changes, changes and replace
Change.
Claims (10)
1. a kind of frequency spectrum intelligent perception system based on USRP, it is characterised in that including USRP, the USRP by Ethernet with
Host computer PC is connected;
The host computer PC includes LabVIEW software platforms and NI USRP software suites, the NI USRP software sets
The program that part is added in LabVIEW in NI-USRP drivers, the LabVIEW software platforms is driven by NI-USRP
Program is interacted with the USRP;
Program in the LabVIEW software platforms includes frequency spectrum perception program, and the frequency spectrum perception program includes USRP frequency spectrums
Sensing module.
2. the frequency spectrum perception system according to claim 1 based on USRP, it is characterised in that the USRP is NI USRP,
The NI USRP are connected by gigabit Ethernet with host computer PC.
3. the frequency spectrum perception system according to claim 1 based on USRP, it is characterised in that in the host computer PC
MATLAB script can also be quoted realized with this LabVIEW and MATLAB joint debugging.
4. the frequency spectrum perception system according to claim 1 based on USRP, it is characterised in that the NI-USRP drives journey
Sequence includes eight functions, and eight functions are respectively
1.niUSRP opens Rx session VI, i.e. niUSRP Open Rx Session VI;
2.niUSRP configures signal VI, i.e. niUSRP Configure VI;
3.niUSRP initializes VI, i.e. niUSRP Initiate VI;
4.niUSRP opens Tx session VI, i.e. niUSRP Open Tx Session VI;
5.niUSRP, which is extracted, receives data VI, i.e. niUSRP Fetch Rx Data VI;
6.niUSRP launches data VI, i.e. niUSRP Write Tx Data VI);
7. terminate VI, i.e. niUSRP Abort VI;
8. close VI, i.e. niUSRP Close Session VI;VI in wherein 1-4 realizes that the VI in configuration feature, 5-6 is real
VI in existing read-write capability, 7-8 realizes end functions.
5. the frequency spectrum perception system according to claim 1 based on USRP, it is characterised in that the reception wireless signal and
Transmitting wireless signal module realizes reception wireless signal and transmitting by eight functions of the NI-USRP drivers
The process of wireless signal.
6. the method for the frequency spectrum perception system according to claim 1 based on USRP, it is characterised in that including:Limiting
Only with one USRP in the case of, can with an antenna as reception antenna reception wireless signal, pass through frequency spectrum perception program
In USRP frequency spectrum sensing modules frequency spectrum perception is carried out to the wireless signal of reception, find after available frequency band, pass through another day
Line launches FM signals on this available frequency band, at this moment terminates the energy measuring of the energy detection module for reception antenna, utilizes
The FM signals that reception antenna demodulation transmitting antenna is launched, and the USRP frequency spectrum sensing modules include audio signal and store mould
Block, calculating decision threshold module, energy detection module, transmitting FM signaling modules and demodulation FM signaling modules.
7. the method for the frequency spectrum perception system according to claim 6 based on USRP, it is characterised in that the audio signal
Memory module include configuration audio input function, read audio input function, write and open audio file function, write
Enter the function of audio file, the function that audio input is reset, the function for closing audio file and audio signal storage front panel, institute
The feature that the function of configuration audio input is used to set audio signal is stated, the feature of the audio signal is including total per channel sample
Number, sampling configuration, device id and audio format, the function of the reading audio input are used for from the host computer PC's
Read the audio signal recorded in sound card, said write simultaneously opens the function of audio file and is used for specific audio frequency signal in magnetic
Storage location on disk, the function of said write audio file is used to the audio signal of reading be written to the audio signal specified
Storage location, the function that the audio input is reset, which is used to stopping data collection, remove caching, task is back to default conditions
And the data related to task are removed, the function of the closing audio file is used for the storage for stopping audio signal, so led to
The store path of the audio signal storage front panel selection audio file is crossed, every channel sample sum, sampling configuration is inputted, sets
Standby ID and audio format, the mark for the equipment for inputting or exporting when the device id is audio operation, its default value is 0,
The sum per channel sample is the speed that sample is read from sample buffer specified, and the sampling configuration is to specify VI to enter
Row limited sampling or continuous sampling, the audio format are the acquisition rate, number of channels and each sampling for setting audio operation
Number of bits;Then audio signal shown in clicking on stores the stop button of front panel, the storage road of the audio file of selection
Footpath is transferred to write-in and opens the function of audio file, and every channel sample sum, sampling configuration, device id and the sound inputted
Sound format transmission is to the function of configuration audio input, and then the function for reading audio input is defeated according to configuration audio is transferred to
Every channel sample sum, sampling configuration, device id and audio format in the function entered are used for from the Framework computing
The audio signal recorded is read in machine PC sound card, then the function of said write audio file according to be transferred to write-in simultaneously
Opening the store path of the audio file of the selection in the function of audio file is used to the audio signal of reading be written to selection
Audio file store path, write-in finish the function that the rear audio input resets just stop data collection, remove caching,
Task is back to default conditions and the removing data related to task, and the function for closing audio file stops audio letter
Number storage.
8. the method for the frequency spectrum perception system according to claim 6 based on USRP, it is characterised in that the calculating judgement
Threshold module is according to formula (1)
To derive threshold value, Q () is normal distribution tail probability function, and the calculating decision threshold module includes calculating door
Sub- VI, the program for sub- VI, MATLAB node for calculating decision threshold and the peripheral routine for limiting configuration information, the calculating thresholding are set
The sub- VI of confidence breath carries out 10 sub-samplings to the frequency spectrum data of the same band, using the median of this 10 groups of sampling results as
Output, the input of the sub- VI for calculating thresholding configuration information has three parameters, and three parameters are respectively pending
The Wave data of power density spectrum, the initial frequency of data to be tested and the cut-off frequency of data to be tested, and the calculating door
The output end for limiting the sub- VI of configuration information is that a gathering is closed, including two parameters, and two parameters are whole waveform number respectively
According to array length half N/2 and false-alarm probability pf, two parameters are substituted into formula (1) with regard to that can calculate corresponding to false-alarm
The threshold value λ of probabilityf, and in peripheral routine, there is provided 1 global variable cishu, also 2 local variable Pnz and thresholding
Configuration information;Cishu is used for the number of times for recording the sub- VI operations of the calculating thresholding configuration information;Thresholding configuration information is preceding 10
The median of sub-sampling result of calculation, if sampling number of times is less than 10 times, thresholding configuration information is the calculating knot after every sub-sampling
Really;If sampling number of times more than 10 times, 10 thresholding configuration informations of thresholding configuration information and sampling are identical, and office is also provided with addition
The variable Pnz of portion's variable array form, Pnz is responsible for the operation result of each peripheral routine to store, when to spectrum number
During according to sampling 10 times, peripheral routine calculates the median of data in Pnz arrays, and the idiographic flow of the peripheral routine is as follows:
Step 1-1:Obtain global variable cishu value.When the peripheral routine just starts, cishu is arranged to 1;
Step 1-2:Judge whether cishu is less than 11, if less than 11, perform step 1-3;If not less than 11, performing step
1-5;
Step 1-3:The data of frequency spectrum data section are sent into MATLAB nodes, using MATLAB instrument processing datas, once transporting
The result of calculation is stored in local variable array Pnz successively, in MATLAB nodes, and program determines whether that program has been carried out
10 times, if performing 10 times, can using the medians of 10 data as thresholding configuration information local variable, and by the office
Portion's variable is used as program output valve;
Step 1-4:Certainly Jia 1 is assigned to global variable cishu to global variable cishu;
Step 1-5:Thresholding configuration information in obtaining step 1-3, and as program output valve;
The program of the MATLAB nodes calculates the half of the noise power in designated spectrum and the length of whole Wave data, takes
The median of 10 result of calculation is as output result, and the input parameter of the MATLAB nodes and effect are as follows:
The input parameter of the MATLAB nodes includes:
Initial frequency f1 and cut-off frequency f2, for determining spectral range;
Global variable cishu, the number of times of the sub- VI operations for recording the calculating thresholding configuration information;
Local variable Pnz, the result of calculation for storing first 10 times;
Power spectral density, the power spectral density is Waveform data format, including three parameters f0, df, magnitude, respectively
Represent the power density of initial frequency, frequency interval and the respective frequencies point of waveform;
The parameter and its implication of the output end of the MATLAB nodes are as follows:
Pn is the median that program runs the noise power obtained for 10 times;
M is the half of Wave data length;
Local variable Pnz is used to result of calculation write array, can be therefrom when being run again with the program whne MATLAB nodes
Read data;
The flow of the program of the MATLAB nodes is as follows:
Step 2-1:According to formula (2) calculate in initial frequency and each comfortable array magnitude of cut-off frequency it is corresponding under
N1 and n2 is marked, in order to ensure n1 and n2 is integer, is rounded up using the result of round (n) function pairs formula (2) computing
Processing, wherein n is n1 or n2, f are f1 or f2:
N=(f-f0)/df (2)
Step 2-2:Set when corresponding subscript n 1 is 0 to initial frequency in array magnitude, force the value of the n1 to be adjusted
Whole is 1;
Step 2-3:The number N of n1 to n2 data point is calculated, the length of assigned frequency hop count group is used as;Calculate input array
The half of magnitude length value is assigned to M as output;
Step 2-4:Element value of the subscript from n1 to n2 in wave-shape amplitude information S, calculated with formula (3), and result
New array x is assigned to, wherein array x subscript is since 1, and length is N:
Pn=10^ (Pn (dB)/10) (3)
The noise power that wherein Pn (dB) expression decibel dB values are represented;
Step 2-5:Expression formula of the energy of Gaussian noise signal in frequency domain is shown in formula (4):
It is a fixed value using the power spectrum average P (f) of Gaussian noise signal, first seeks average P (f) df of special frequency channel, so
The points of spectrogram data are multiplied by with this average P (f) df afterwards, the noise power P (t) of whole frequency range is asked for;
Step 2-6:Pn is assigned to array local variable Pnz, the subscript of array is set to the number of times of program operation, that is, entirely
Office variable cishu;
Step 2-7:Judge whether the program of the MATLAB nodes has been run 10 times according to global variable cishu, if global
Variable cishu is equal to 10, performs step 2-8, otherwise performs step 2-9;
Step 2-8:Array local variable Pnz median is asked for, result array local variable Pnz is assigned to, and Pnz is made
For output, step 2-9 is performed;
Step 2-9:Global variable cishu is from Jia 1, and representation program, which has been completed, once calculates Pn, and cishu is a global change
Amount, in main program initial launch, default value is 1;
Formula (1) is recycled to calculate decision threshold T, the sub- VI of the calculating decision threshold calculates energy inspection according to input parameter
The threshold value of survey, and its input parameter include thresholding configuration information and false-alarm probability, the thresholding configuration information from calculate thresholding
Obtain, false-alarm probability represents the probability for noise signal being mistakened as making PU signals, can set manually, write from memory in the sub- VI of configuration information
It is 0.1 in the case of recognizing, the output result of the sub- VI for calculating decision threshold is detection threshold value T;And the calculating decision gate
The sub- VI of limit includes the data processor of MATLAB nodes, the data processing stream of the data processor of the MATLAB nodes
Journey is as follows:
Step 3-1:Threshold T n according to corresponding to formula (1) can calculate false-alarm probability Pf, that is, λf, MATLAB sections
The data processor of point includes qfuncinv () function, and it is the encapsulation function in MATLAB, can realize Q-1The work(of ()
Energy;
Step 3-2:Because the unit of the data of power spectral density is decibel, the Conversion of measurement unit Tn is also needed into dB, is turned
Formula is changed for shown in formula (5), the T (dB) in formula (5) represents the detection threshold value that unit is dB:
T (dB)=10lg (Tn) (5)
Step 3-3:Result T (dB) is exported as decision threshold.
9. the method for the frequency spectrum perception system according to claim 6 based on USRP, it is characterised in that the energy measuring
Module is to whether there is to be more than detection threshold value to make decisions according to the value on this section of frequency spectrum, if the value on this section of frequency spectrum
More than detection threshold value, PU signals are there is, if the value on this section of frequency spectrum is not more than detection threshold value, PU letters are just not present
Number, the detection threshold value is exactly the decision threshold;
The other energy detection module includes the VI for frequency spectrum perception, power of the VI for frequency spectrum perception from input
,, can be with root to judge which frequency range has PU signals in power density spectrum according to the size of threshold value in the data of density spectra
According to the size of testing result, and FM frequency deviations, the carrier frequency of FM transmission signals is calculated, finally, according in PU range of signals
Initial frequency and termination frequency, the VI for being used for frequency spectrum perception can calculate the power of this frequency range PU signals;
Include the MATLAB nodes for frequency spectrum perception in the VI for frequency spectrum perception, described for frequency spectrum perception
The input of MATLAB nodes includes a global variable suf, the output end bag of the MATLAB nodes for frequency spectrum perception
Another global variable suf and global variable lastpower are included, wherein suf is the subscript of magnitude arrays, magnitude
I.e. array array S, using formula (6), can calculate tranmitting frequency fw, if to a certain carrier signal according to suf
Analyzed, then need to add carrier frequency fz on the basis of acquired results, shown in such as formula (7):
Fw=f0+df*suf (6)
Fw=fz+f0+df*suf (7)
The input including PU range of signals of the MATLAB nodes for frequency spectrum perception two parameter f1 and f2, f1 and
When f2 represents estimation PU signal powers respectively, the initial frequency and cut-off frequency of computer capacity;
The program of the MATLAB nodes for frequency spectrum perception is divided into three program parts that order is performed, three programs
Part includes:
A. found in frequency spectrum array it is all can as SU tranmitting frequencies subscript;
B. the corresponding subscript suf of tranmitting frequency of SU signals is calculated;
C. the power of designated frequency band PU signals is calculated;
Found in the frequency spectrum array it is all can be from frequency spectrum array as the lower target program part of SU tranmitting frequencies
Find it is all can as cognitive user SU tranmitting frequency subscript, find in the frequency spectrum array all can send out as SU
The lower target program part of radio frequency rate, judges whether the subscript in frequency spectrum array can be under cognitive user SU tranmitting frequency
Target standard is:The SU signals of transmitting can not be interfered to PU signals, found in the frequency spectrum array it is all can be as SU
The flow of the lower target program part of tranmitting frequency is as follows:
Step 4-1:Array S length N, and the corresponding data points n of frequency deviation w are calculated, and definition one is identical with S length,
Initial value is 0 array X;
Step 4-2:The element in array S is traveled through successively, if element value is more than threshold value T, i.e. the threshold value T threshold values,
So X element value is 1 at this element correspondence subscript, thus have found all points more than threshold value in S, also just can consider
Array element value at subscript corresponding to X is there is PU signals at 1;
Step 4-3:Make Y be equal to X, wherein Y be used for record it is all can as tranmitting frequency data point position, make Y be equal to X,
Ensure that and be equal in X (i) at 1, that is, there is the place of PU signals, it is impossible to be used as the corresponding subscript of tranmitting frequency;
Step 4-4:Each element in X is traveled through, judges whether whether different from the value of three numbers before X (i) in X (i),
By this method, the border of PU signals is found, the border of the PU signals is included under border and PU signals that PU signals rise
The border of drop, if it is determined that result it is different, perform step 4-5;If it is determined that result it is identical, perform step 4-10, i is whole
Type variable;
Step 4-5:Judge whether i-n is less than 1, that is, judge whether i-n overflows, if overflowed, k1=1 is made, if i-n does not overflow
Go out, make k1=i-n, at this moment k1 effect be intended for finding can as the frequency range of tranmitting frequency beginning boundary, equally
Ground, in addition to a termination border, are defined as k2, and the k1 and k2 are integer variable;
Step 4-6:Judge whether i+n is more than N, also judge whether i+n overflows, if overflowed, make k2=N;If not yet
There is spilling, make k2=i+n;
Step 4-7:By step 4-5 and step 4-6, the authorized user PU boundaries left side and n, the right point has been found
Position is k1 to k2, and ensure that k1, k2 do not overflow, in this step, makes the corresponding member of subscript in Y between k1 and k2
Element value is 1;
Step 4-8:If when traversal, during the subscript i=1 of Y array elements, i.e. the beginning in Y arrays, and i+n
Do not overflow, then it is 1 to make the element value at the subscript 1 to 1+n of Y arrays;
Step 4-9:If when traversal, during the subscript i=N of Y array elements, i.e. the termination in Y arrays, and i-n
Do not overflow, then the element value for making Y array indexs N-n to N locate is 1;
Step 4-10:Terminate;
The flow of the corresponding subscript suf of the tranmitting frequency for calculating SU signals program part is as follows:
Step 5-1:The important parameter of subscript suf corresponding to the tranmitting frequency for calculating SU signals program part is initial
Change, make i=1 and power=0, wherein i represents target initial value under tranmitting frequency, and power represents the primary power of PU signals
Value;
Step 5-2:Whether be 1, carry out adding computing certainly if Y (i) is 1, i if judging Y (i) one by one in the way of while is circulated,
Otherwise the corresponding subscript suf of the tranmitting frequency for calculating SU signals program part jumps out while circulations, is done by this
Method finds the subscript i that first its value in Y (i) is not 1, it is known that the value of the Y (i) is 0, represents corresponding frequency at subscript i
Rate can be as tranmitting frequency, and thus have found first can be as target value under the correspondence of SU tranmitting frequencies;
Step 5-3:Judge that suf adds n and subtracted after n whether in the range of 1 to N respectively, if in 1 to N, it is upper to illustrate suf values
The corresponding subscript of secondary tranmitting frequency assigns result it is necessary to calculate the energy of the n data point on its left side and the right according to suf values
Be worth to power, then perform step 5-4, if n is not in 1 to N, illustrate suf be not last time tranmitting frequency it is corresponding under
Mark, directly performs step 5-4;
Step 5-4:Judge whether i+10 is less than N, if it is, explanation has the subscript of suitable tranmitting frequency, perform step 5-
5;If it is not, the frequency index that explanation is detected cannot function as the subscript of tranmitting frequency, step 5-7 is performed;
Step 5-5:Judge whether meet three conditions, three conditions be suf be equal to 1, | suf-i | more than 10 and power
Smaller than 0.7*lastpower, these three conditions are satisfied by performing step 5-6;
Step 5-6:I is assigned to global variable suf, represents to have found the subscript of new tranmitting frequency, performs step 5-8;
Step 5-7:Global variable suf is assigned to by 1, expression is not found and can perform step as target value under tranmitting frequency
Rapid 5-8;
Step 5-8:The power values of calculating are assigned to global variable lastpower, are to judge whether SU signals need to keep away next time
PU signals are allowed to prepare;
Step 5-9:Terminate;
The flow for calculating the power of designated frequency band PU signals is as follows:
Step 6-1:The energy of PU signals is initialized as 0, and the border f1 and f2 of the detection frequency range of setting are utilized public affairs
Formula (27) is converted into corresponding subscript fn1 and fn2;
Step 6-2:Judge whether fn1 and fn2 is less than or equal to 0, if less than equal to 0, illustrating that fn1 or fn2 are illegal, just it
Value be changed to 1, otherwise, directly perform step 6-3;
Step 6-3:Judge whether fn1 is less than fn2, if it is, performing step 6-4;Otherwise step 6-5, herein, fn1 are performed
Correspondence initial frequency, fn2 correspondence cut-off frequencies;
Step 6-4;In array S, the element for being more than threshold T in corresponding element is found from subscript fn1 to fn2, first this
Element removes dB units by formula (8), and wherein Ps (dB) is the power for the PU signals that unit is dB, then the knot after conversion
Fruit is progressively increased into the power P s of PU signals, so, can obtain the energy Ps of PU signals present in f1 to f2;
Ps=10^ (Ps (dB)/10) (8)
Step 6-5:Terminate.
10. the method for the frequency spectrum perception system according to claim 6 based on USRP, it is characterised in that the transmitting FM
Signaling module includes the front panel for the sub- VI that launches FM signals and transmitting FM ripples, and the transmitting FM signaling modules are according to must
The cognitive user SU arrived tranmitting frequency, appropriate IQ speed and parameter as frequency deviation, operation is described to be used for launching FM
The sub- VI of signal can using USRP transmitting terminal transmitting FM signals operation, the sub- VI for being used for launching FM signals have three it is defeated
Enter, three inputs are respectively carrier frequency, IQ speed and FM frequency deviations, and the tranmitting frequency of the cognitive user SU is exactly FM
Carrier frequency, by the front panels of the transmitting FM ripples input carrier frequency being used for launching needed for the sub- VI of FM signals,
The numerical value of IQ speed and FM frequency deviations, can also input the niUSRP by the front panel of the transmitting FM ripples and configure signal VI,
Namely niUSRP Configure functions, required configuration parameter, pass through the configuration of the front panel input of the transmitting FM ripples
Parameter is used for the transmitting for setting USRP signals, and the sub- VI for being used for launching FM signals includes waveform resampling function and FM tune
Function processed;
The front panel input of the transmitting FM ripples carrier frequency being used for launching needed for the sub- VI of FM signals, IQ speed,
After the numerical value of FM frequency deviations and configuration parameter needed for niUSRP configurations signal VI, the sub- VI for being used for launching FM signals
IQ speed is sent to the waveform resampling function, the input of the waveform resampling function get the IQ speed and
After the data message of the audio signal of the audio signal memory module write-in, according to the two parameters, the waveform resampling
Function can control each data point of audio signal to form the transmission of the Wave data after resampling every time interval Δ t,
It is achieved in the function that the bit rate of audio signal and the IQ speed of USRP signals transmitting match;
Then the FM modulation functions are realized modulates to the FM of signal, and the FM modulation functions have two input parameters, and one is
Wave data after resampling, one be FM signals frequency deviation, the Wave data after sampling obtains from waveform resampling function, FM
The frequency deviation of signal is constant;
Finally realize after the FM modulation to signal, the signal after modulation is just carried by the NI-USRP drivers in the FM
Launch under wave frequency rate;
The signal that USRP is received is handled, is to realize that USRP can continuously receive signal in the way of while is circulated
Under the conditions of FM processing is carried out to the data that receive by the demodulation FM signaling modules, the FM processing is only needed to niUSRP
The output result of Fetch RX Date drivers is handled, and the demodulation FM signaling modules are included for playing audio
The front panel and the function of process signal of sub- VI, FM demodulated audio signals of Simple Sound of signal, the Simple
Branches of the sub- VI of Sound in variables A ction value alternative condition sentences, if variables A ction values are " Open ", just uses
Sound Output Configure functions are prepared to configure sound card to play audio;If variables A ction values are " Write ",
First it is normalized with a Normalize Waveform function pair Wave data, then the data Sound after processing
The sound card of Output Write functions feeding computer is played out;If variables A ction values are " Close ", Sound is just used
Output Clear functions, which are removed, gives the data cached of sound card, terminates before the broadcasting of audio, the FM demodulated audio signals
The left part of panel is the part of the configuration parameter for typing niUSRP functions, wherein number of samples configurations
Parameter represents the sample number received every time from data receiver channel, and number of samples and IQ speed IQrate has
Following relation:
Fetch time are the time of data acquisition of completion in time domain, and resolution bandwidth are the frequency in frequency domain
Frequency interval between rate resolution ratio, i.e., each adjacent data;The right part of the front panel of the FM demodulated audio signals is use
In waveform signal figure and the waveform display portion of power spectrum figure after display demodulation, specific processing mode is as follows;
The continuous signal that the function pair USRP of the process signal is received is handled in While Loop, if in data
Signal comes under the conditions of receiving normally according to the configuration parameter of the niUSRP functions of typing in the front panel of FM demodulated audio signals
Data are persistently received, the data of reception are converted to polar form, the phase signal in polar coordinates is deployed, it is right after expansion
USRP sample rates are matched with the sample rate of sound card information respectively after data progress differential, differential, data real part and void
Number part separates and asked the power density values of signal, then data real part and imaginary part is separated and asked the power of signal
Data after density value are shown and then terminated the operation of the function of the process signal respectively, and USRP sample rates and sound card
Data after the sample rate matching of information are sent to sound card in the sub- VI of Simple Sound for playing audio signal
Action values are changed into broadcasting under conditions of " Write ", terminate the operation of the function of the process signal after finishing playing, described pole
Phase unwrapping in coordinate is realized by unwrap functions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710602195.0A CN107294628B (en) | 2017-07-21 | 2017-07-21 | Intelligent spectrum sensing system and method based on USRP |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710602195.0A CN107294628B (en) | 2017-07-21 | 2017-07-21 | Intelligent spectrum sensing system and method based on USRP |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107294628A true CN107294628A (en) | 2017-10-24 |
CN107294628B CN107294628B (en) | 2021-06-01 |
Family
ID=60102933
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710602195.0A Active CN107294628B (en) | 2017-07-21 | 2017-07-21 | Intelligent spectrum sensing system and method based on USRP |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107294628B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107437970A (en) * | 2017-07-22 | 2017-12-05 | 常州工学院 | A kind of dummy emulation system and its method based on USRP |
CN110380801A (en) * | 2019-06-04 | 2019-10-25 | 杭州电子科技大学 | The method that collaborative sensing algorithm and more USRP based on LSTM are realized |
CN114095967A (en) * | 2021-11-19 | 2022-02-25 | 电子科技大学 | Method for evaluating out-of-band interference of ultra-wideband signal |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104363596A (en) * | 2014-11-20 | 2015-02-18 | 中国人民解放军总参谋部第六十三研究所 | Dynamic spectrum management semi-physical simulation experiment system and method based on USRP |
CN104994045A (en) * | 2015-06-26 | 2015-10-21 | 北京航空航天大学 | Platform and method for automatically identifying digital modulation mode based on USRP platform |
CN107592173A (en) * | 2017-07-19 | 2018-01-16 | 常州工学院 | A kind of 5G cognition networks system architecture and its method based on USRP |
-
2017
- 2017-07-21 CN CN201710602195.0A patent/CN107294628B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104363596A (en) * | 2014-11-20 | 2015-02-18 | 中国人民解放军总参谋部第六十三研究所 | Dynamic spectrum management semi-physical simulation experiment system and method based on USRP |
CN104994045A (en) * | 2015-06-26 | 2015-10-21 | 北京航空航天大学 | Platform and method for automatically identifying digital modulation mode based on USRP platform |
CN107592173A (en) * | 2017-07-19 | 2018-01-16 | 常州工学院 | A kind of 5G cognition networks system architecture and its method based on USRP |
Non-Patent Citations (2)
Title |
---|
木树娟: "基于LabVIEW的无线电频谱监测模型与实现", 《CNKI优秀硕士学位论文全文库 信息科技辑》 * |
马振华: "基于USRP平台的频谱监测系统设计与实现", 《CNKI优秀硕士学位论文全文库 信息科技辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107437970A (en) * | 2017-07-22 | 2017-12-05 | 常州工学院 | A kind of dummy emulation system and its method based on USRP |
CN107437970B (en) * | 2017-07-22 | 2020-11-17 | 常州工学院 | Virtual simulation system and method based on USRP |
CN110380801A (en) * | 2019-06-04 | 2019-10-25 | 杭州电子科技大学 | The method that collaborative sensing algorithm and more USRP based on LSTM are realized |
CN110380801B (en) * | 2019-06-04 | 2021-06-08 | 杭州电子科技大学 | LSTM-based cooperative perception algorithm and multi-USRP realization method |
CN114095967A (en) * | 2021-11-19 | 2022-02-25 | 电子科技大学 | Method for evaluating out-of-band interference of ultra-wideband signal |
CN114095967B (en) * | 2021-11-19 | 2023-03-31 | 电子科技大学 | Method for evaluating out-of-band interference of ultra-wideband signal |
Also Published As
Publication number | Publication date |
---|---|
CN107294628B (en) | 2021-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109274621B (en) | Communication protocol signal identification method based on depth residual error network | |
CN107294628A (en) | A kind of frequency spectrum intelligent perception system and its method based on USRP | |
CN105353360B (en) | A kind of radar seeker simulation of Signal Processing analysis method and system | |
CN201765324U (en) | Automatic tester of phased-array antenna | |
CN108834159A (en) | Intelligent antijam wireless communication method, system, server and storage medium | |
CN104977592B (en) | A kind of navigation satellite signal interference simulation and Performance Analysis Platform and its method based on PXI buses | |
CN107317778A (en) | BPSK modulating signal phase transition detection methods based on 1D CNN | |
CN114624658A (en) | Software reconfigurable jammer system and signal generation method | |
CN108055063A (en) | A kind of restructural Flexible Node and node reconstructing method | |
CN102075202B (en) | Characteristic value-based passive channel interference detection method | |
CN110991378B (en) | Individual identification method and device for power amplifier | |
CN107437970A (en) | A kind of dummy emulation system and its method based on USRP | |
CN102901953B (en) | A kind of relevant peaks sharpening method and device | |
CN111092632B (en) | Interference suppression method and interference suppressor | |
Hu et al. | Signal Classification in Real-time Based on SDR using Convolutional Neural Network | |
CN106603164A (en) | Testing system and method for short wave communication software communication performances | |
CN113242201A (en) | Wireless signal enhanced demodulation method and system based on generation classification network | |
CN106533586B (en) | A kind of method and apparatus of the anti-interference ability of measuring receiver | |
CN103906126B (en) | The pre-judging method and device of interference | |
Barnes et al. | The Instagram: A novel sounding technique for enhanced HF propagation advice | |
CN104993885B (en) | Radio communication channel parameter estimation algorithm test system based on FPGA and Matlab | |
Kang et al. | Joint Detection and Classification of Communication and Radar Signals in Congested RF Environments Using YOLOv8 | |
US11177852B1 (en) | Digital detection and tracking of signals over multiple frequency bins | |
CN107517471A (en) | A kind of the network field strength method of sampling and system | |
US20220123844A1 (en) | Method and apparatus for signal regeneration |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |