SDR game follow-up

First of all, I would like to thank the organizing committee for their kindness and giving me a third prize. Although it didn't come out, maybe the experimental report got some points.

My thinking is wrong. I input a center spectrum and observe the values ​​around it, but the main committee hopes to output all the spectrum of the input signal through frequency sweep.

This competition, for me, has learned a lot, and I am very grateful to the instructor for his guidance. Thanks to the organizers for their support.

In addition, the website resources have given me Evergrande's help. But I have to complain about the backwardness of the instruments of some disadvantaged majors in this school, and the huge school does not even have a spectrum analyzer. It's not that I can't read the communication anymore, I have nothing.

Here is my report:

Simple Spectrum Analyzer System Design

        

1. Design objectives and requirements of simple spectrum analyzer

1.1   Design goals

It is planned to implement a simple spectrum analyzer on the PLUTO software radio platform. Support spectrum display spectrum scan, peak capture and other functions.

AD

mixing

Honshin LO

FFT

Figure 1 Block diagram of a simple spectrum analyzer

1.2   Basic requirements

1. Input impedance: 50 ohms      

2. Test frequency range: 325MHz to 3 GHz    

3. Resolution bandwidth (RBW): 100Hz, 300Hz, 1KHz, 3KHz, 10KHz, 30KHz, 100KHz, 300KHz, 1 MHz, 3MHz, 10MHz optional   

4. Dynamic range: when RBW=100Hz, greater than 60dB; when RBW=10MHz, greater than 30dB 

5. Test amplitude error: less than 1dB                    

6. Test frequency error: when testing with different RBW settings, it is less than 1% of the corresponding RBW

1.3 Extended requirements

1. Frequency extension range: 70MHz to 6GHz                      

2. AM, FM, ASK, FSK, BPSK modulation recognition              

Carrier frequency: 433MHz Modulation signal: voice signal

3. Measurement of modulation degree and intermodulation distortion of AM modulated signal                

Carrier frequency: 433MHz Modulation signal: single tone signal

  • Demonstration of Design Scheme of Simple Spectrum Analyzer

2.1 Overall system block diagram and module description

       ADALM-PLUTO radio Receiver blocker signal receiving module is a very powerful tool. Through this module, the specified center signal frequency can be picked up, and the frequency mixing function of the mixer and the local oscillator can be realized. You can control its center signal frequency ( centerfrequency ) through the main interface code to ensure correct RBW output. Control the baseband sample rate ( Baseband sample rate ) to get enough data. It can realize the function of direct frequency conversion, so that the high-frequency signal becomes a broadband low-frequency signal, and becomes a digital signal after AD conversion.

The DC-Blocker is an indispensable tool in intrinsic waveguide modeling and other applications. It is often necessary to remove the DC component in the signal loop. The dc block is a small recursive filter specified by a differential equation.

y n =x n -x n-1 +Ry(n-1)

where R is a parameter, usually between 0.9 and 1 (for 44.1kHz sampling rate, R=0.995 is suitable). The transfer function is

Hz=1-z-11-Rz-1

Therefore, there is a zero at dc ( z = 1 ) and a lensless dc at z = R . Far from DC, the poles and zeros roughly cancel each other out, so we can remove the DC component using

Buffer blocks always perform frame-based processing. This block redistributes the data in each column of the input to produce output with a different frame size. Buffering the signal into a larger frame size produces an output with a slower frame rate than the input. Buffering the signal into smaller frames , the frame size produces a faster frame rate output than the input . This block coordinates the output frame size and frame rate of the non-overlapping buffers so that the sampling period of the signal is the same at both input and output: Tso = Tsi . Through this we can control the number of sampling points and control RBW .

The MATLAB Function2 self-defined function implements windowing by setting the function by itself, and then averages the sampled data, performs FFT ( Fourier transform ) , and outputs the logarithm of the power spectrum.

Figure 2   Block Diagram of MATLAB Function2 Program Submodule

Spectrum Analyzer block The Spectrum Analyzer block (referred to here as an oscilloscope) displays the spectrum of a signal. But here we don't simply use its time-frequency signal ( Time ) input to display the spectrum function, we use the spectrum input display function ( Frequency ). We can control its sampling frequency ( Sample Rate ) through the main interface code to ensure correct RBW output.

Use the frequency conversion function of pluto , use FFT to do spectrum analysis, and realize wide-band frequency sweep by changing the frequency of the local oscillator. Intercept a segment of the signal from the frame of the long segment signal and sum.

Windowing is performed. Windowing is essentially a convolution operation between the window spectrum and the original spectrum, resulting in the leakage of the original spectrum spectrum. After the infinitely long signal is truncated, the spectrum is distorted. The selection of the type of window function has two effects: 1. The resolution of the main lobe frequency of the window. 2. The type of window and the width of the spectrum in time to control RBW . It can be known from Table 2-1 that different window functions have different bandwidths and attenuations. And we hope that the main lobe can be as narrow as possible, and the relative amplitude of the side lobes should be as small as possible, so as to prevent the measured signal strength from being less than the side lobe strength , which cannot be detected, thereby affecting the dynamic range. After many considerations, the nuttallwin window was finally chosen.

And the control of RBW follows the following formula
Nsample = NENBW * Fs RBW

Spectrum analyzers require a minimum number of samples to compute a spectrum estimate. The number of input samples required to compute a spectral update is shown as samples / update in the main options pane . This value is directly related to the resolution bandwidth, RBW, by the equation , while the normalized effective noise bandwidth, NENBW , is a factor that depends on the windowing method. The spectrum analyzer displays the value of NENBW in the "Window Options" pane of the "Spectrum Settings" pane (refer to the parameter of nuttallwin is 1.96 ). Fs is the sampling rate of the input signal. The Spectrum Analyzer displays the sample rate in the main options pane of the Spectrum Settings pane. And we control RBW by debugging sampling frequency (Fs) and buffer block frame rate ( Nsample ) . The actual operation is adjustable in ( 3.2.RBW range).

Dynamic range is generally considered to be the ability of a spectrum analyzer to measure harmonically related signals and signals generated by the interaction of two or more signals. Depends on the ratio of the main lobe and side lobe amplitudes. When processing measurements, a spectrum analyzer's input mixer is a nonlinear device, so the spectrum analyzer itself will always introduce distortion.

Dynamic range: The ratio ( dB ) of the maximum signal to the minimum signal that can be measured simultaneously at the input end of the spectrum analyzer , and allows measurement with a given uncertainty for smaller signals. It is customary to not add a window to make the signal pass through the rectangular window. The advantage of this kind of window is that the main lobe is relatively concentrated, and the disadvantage is that the side lobes are high and have negative side lobes, which leads to high-frequency interference and leakage in the conversion, and even negative spectrum phenomena. The main lobe of the rectangular window is narrow, the side lobe is large, the frequency identification accuracy is the highest, and the amplitude identification accuracy is the lowest. The Nuttall window can effectively reduce the effect of spectrum omission on harmonic calculation, and our windowing is beneficial to ensure a suitable dynamic range and a more stable waveform.

Since Plutosdr itself has a noise figure of 3dB , in order to reduce the error, we performed zero padding operation, and made a difference in the frequency domain, and a zero padding operation in the time domain, and the difference became 100 times the original value. It is caused by increasing the sampling frequency.

Therefore, taking the average value of n times can reduce the measurement error to the original -n times.

three. Main function realization

Figure 3       Spectrum Analyzer Simulation Diagram

3.1. Basic conditions:

Consult the data sheet to know :

The input impedance is 50 ohms

Pluto precision 12bits ADC/DAC

▪Sampling rate   65.1KSPS to 61.44MSPS

▪Bandwidth 200KHz       to 20MHz

▪Local oscillator       325MHz to 3.8GHz ( guaranteed index )

70MHz to 6GHz (frequency / bandwidth extension)

3.2. RBW range is adjustable :

Main interface code :

Example : Set RBW to 100HZ (other necessary parameter settings)

  1. load_system('produce');
  2. open_system('producea/Spectrum Analyzer1','OpenFcn')
  3. open_system('producea/Spectrum Analyzer1','window')% Open the spectrum analyzer interface.
  4. Main interface input config = get_param([' producea ','/Spectrum Analyzer1'],'ScopeConfiguration')
  5. Enter config.SampleRateSource='Property' in the main interface
  6. Enter config.SampleRate='1e6'%100HZ setting in the main interface
  7. Enter set_param('producea/ADALM-Pluto Radio Receiver',' BasebandSampleRate',1e4')%100Hz to set the sampling frequency on the main interface

  1. Enter set_param('producea/Constant1','Value','100')%100HZ on the main interface to set the correct input frequency

  1. Enter set_param('producea/Constant','Value','100')%100HZ on the main interface to set the correct RBW
  2. main interface input    

set_param('producea/Buffer1','N','10000*5')%100HZBuffer setting

  1. After pressing the start button on the previous spectrum analyzer interface, wait for 5-10 seconds, and you can see that the RBW is displayed as 100HZ

% Each debugging needs to be closed and then opened again to use, and so on, you can get another RBW .

3.3 Corresponding data:

Output Buffer size

10000*5

5000*5

1000*5

500*5

800*5

RBW/ (Hz)

100

300

1.00E+03

3.00E+03

1.00E+04

Samplerate

506200

759000

5.06E+06

7.59E+05

4.05E+06

perframe

10000

50000

1000

500

800

Samplerate main function input

1.00E+06

1.00E+06

1.00E+06

1.00E+06

1.00E+06

Output Buffer size

400*5

800*5

400*5

80*5

40*5

12*5

RBW/ (Hz)

3.00E+04

1.00E+05

3.00E+05

1.00E+06

3.00E+06

1.00E+07

Samplerate

6.07E+06

40496000

6.07E+07

4.05E+07

6.07E+07

6.08E+07

perframe

400

800

400

80

40

18

Samplerate main function input

1.00E+06

1.00E+06

1.00E+06

1.00E+06

1.00E+06

1.00E+06

Table 1: Parameters of the corresponding RBW

Four. Instrument performance testing :

4.1 Dynamic Range

After many experiments, it can be determined that the experimental conditions are met:

Dynamic range: when RBW=100Hz, greater than 60dB; when RBW=10MHz, greater than 30dB.

After the operation, we adjusted the parameters and obtained the detection images of the spectrum analyzer at RBW=100Hz and 10MHz respectively.

Figure 4 RBW=100Hz range

Figure 5 RBW=10MHz range

Through multiple experiments to obtain the average, it can be obtained that when RBW=100Hz , the dynamic range is about 65dB ; when RBW=10MHz , the dynamic range is about 52dB

RBW

1

2

3

4

10MHZ

64.5

68.9

64.3

67.3

100Hz

50.9

51.3

53.4

52.8

5

6

7

8

AVERAGE

61.3

63.4

64.5

65.6

64.975

53.6

53.8

51.4

51.2

52.3

Table 2: RBW dynamic range detection

4.2 Test amplitude error test:

The signal used in this experiment is a 50KHz sinusoidal signal added to the carrier frequency of 433e6, the plot is the actual test power spectral density (Power density), the displayed values ​​are -18.0104dbm and -18.0162dbm, and the power spectral density of this group are -18.0154 and -18.0587, the error is 0.014%.

In addition, 15 sets of data were made, divided into 3 groups, and the average of the data was taken to obtain error degrees of 0.9%, 0.6%, and 0.3%. meet the error requirements.

Different RBW setting error test

RBW

Actual measurement

experimental measurement

Error degree

780

-60.8

-60.25

0.009

390

-60.064

-60.102

0.006

1.95E+02

-60.214

-60.421

0.003

Table 3: Error Test

five. extension requirements

5.1 : Extended frequency range to 70MHz to 6GHz 

With a firmware update, it was successfully implemented.           

5.2 : Identification of AM , FM , ASK , FSK , BPSK modulation modes              

                                                                   Figure 6 Schematic diagram of signal modulation identification

By extracting the instantaneous parameter data of the target signal, the identification of the modulation mode is realized.

5.2.1 Modulation principle:

A general pattern recognition system consists of three parts: signal preprocessing, feature extraction and classification recognition. The following figure shows the general process of automatic modulation recognition:

In the field of communication, we divide signals into two types: analog modulation: AM, FM... digital modulation: 2ASK, 4ASK, 2PSK, 4PSK, 2FSK, 4FSK;

Suppose the variance of the code rate of the multi-segment signal is σ R S , the digital modulation signal has a constant code rate, but the analog modulation signal does not have this feature. Therefore, multi-segment signals can be intercepted and the code rate of each segment signal can be extracted.

The variance of the code rate sequence of the digital modulation signal is theoretically zero and the variance of the analog modulation signal is not zero, so the threshold t σ RS can be set to distinguish between two types of modulation signals. When σ Rs > t σ RS , it is judged as an analog modulation signal , otherwise it is judged as a digitally modulated signal.

Further, the analog modulation signal is divided into:

The maximum value of the instantaneous amplitude spectral density normalized at zero center γmax1

γmax1=max|FFT(acn(i))|2/Ns

In the formula, Ns is the number of sampling points, acn(i) is the zero center normalized instantaneous amplitude, acn(i)=a(i)/mean(a)-1. This parameter is mainly used to distinguish whether the signal has amplitude change or not. Among analog modulated signals, FM signals have no amplitude modulation, while AM ​​signals have amplitude modulation. Therefore, the threshold t γ max can be set to distinguish whether there is amplitude modulation or not. When γmax1>t(γmax1), it is judged as AM signal, otherwise it is judged as FM signal.

Further, the distinction of digitally modulated signals:

Maximum value of the instantaneous amplitude spectral density normalized at zero center γmax2

γmax2=max|FFT(acn(i))|2/Ns

 In the formula, Ns is the number of sampling points, acn(i) is the zero center normalized instantaneous amplitude, acn(i)=a(i)/mean(a)-1. This parameter is mainly used to distinguish whether the signal has amplitude change or not. Among digitally modulated signals, MPSK signals and MFSK signals have no amplitude modulation, while MASK signals and MQAM signals have amplitude modulation. Therefore, the threshold t(γmax2) can be set to distinguish whether there is amplitude modulation or not. When γmax2>t(γmax2), it is judged as MASK or MQAM signal, otherwise it is judged as MFSK or MPSK signal.

The compactness of the normalized zero center instantaneous frequency μ 42 f

This parameter is mainly used to distinguish MPSK signal or MFSK signal, because for MPSK signal, its instantaneous frequency is a constant value and has high compactness, that is, this parameter is relatively large, while MFSK signal has only two or four levels, Its compactness is poor. Therefore, the two types of signals can be distinguished by setting the threshold t( μ 42 f ) .

μ42f=E[fN2(i)]{E[fN2(i)]}2

When μ 42 f >When t ( μ 42 f ) , it is judged as MPSK signal, otherwise it is judged as MFSK signal.

Compactness of normalized zero-centered signal μ 42 s

μ42s=E[ScN2(i)]{E[ScN2(i)]}2

This parameter is mainly used to distinguish between MASK signal and MQAM signal. The definition of scn(i) is the same as that of acn(i). Therefore, the two types of signals can be distinguished by setting the threshold t( μ 42 s ) . whenμ42s >When t ( μ 42 s ) , it is judged as a MASK signal, otherwise it is judged as an MQAM signal.

Respective identification methods of MPSK\MFSK\MASK signals:

MPSK normalized two-phase characteristic parameter η 2f0 (f0)

Define the signal x circular correlation function as: R X α ( τ ) = lim 1 T T→∞ -T/2 T/2 x ( t+ τ 2 ) x * ( t- τ 2 ) e -j2παt dt its Fourier Transformed into the cyclic spectral density of the signal, also known as the spectral correlation density function. After the fourth power of the MPSK signal, the obtained spectral correlation function can identify signals of different modulation modes. Define the normalized biphasic eigenfunction:

η2f0f0=|S^f0(f0)S^0(0)|

Both S ^f0 (f0) and S^ 0 (0)  are the spectral correlation densities after the fourth power of the signal. The normalized two-phase characteristic parameter of BPSK signal is η 2f0 f0 =0.667  The normalized two-phase characteristic parameter of QPSK signal is η 2f0 f0 =0  , so BPSK and QPSK signals can be identified according to this.

The power spectrum of the 2FSK signal has two frequency components, so there are two peaks; the power spectrum of the 4FSK signal has four frequency components, so there are four peaks. In order to extract the number of spectral peaks accurately, the spectral density was estimated by autoregressive model (AR).

First, the smooth curve of the power spectrum is obtained through power spectrum estimation to accurately extract the peak formed by the sinusoidal component; secondly, the first-order difference sequence of the power spectrum sequence is obtained; finally, the number of spectral peaks is judged by judging the sign change of the difference sequence N.

Let the AR model be:

xn=-k=1pakxn-k+u(n)

 Where p is the order of the AR model, a k is the coefficient of the model, u(n) is a white noise sequence with mean value 0 and variance σ2. The estimate of the power spectrum obtained by the AR model is P(n).

With the power spectrum estimation sequence of the MFSK signal, the spectral peak can be detected by analyzing the sign change of its first-order difference sequence. Record the first-order difference sequence as d(n)=P(n+1)-P(n). If d(n)>0 and d(n+1)<2, the judgment is CW, 2≤NN<3, the judgment is 2FSK, and in other cases, the judgment is 4FSK.

Identification steps:

  1. Receive signal data s(n) to be processed;
  2. Extract the instantaneous characteristic parameters of the signal: instantaneous amplitude a(n), instantaneous phase and instantaneous frequency f(n);
  3. Intercept the signal into multiple segments, use the wavelet transform method to extract the code rate for each sub-signal, and calculate the variance of the code rate to determine whether the value is greater than the threshold, if it is greater than the threshold, then the data is an analog modulation signal, and enter step 4; if it is less than the threshold , then it is judged as a digital modulation signal, and proceed to step 7; (since the signal data is only intercepted into multiple segments at this step, the calculation of other parameters is calculated through the complete signal data);
  4. Calculate the γm ax 1 parameter for the signal instantaneous amplitude a (n), judge whether the value of the γm ax 1 parameter is greater than the threshold t (γmax1), if it is greater than the threshold, enter step 5, otherwise enter step 6;
  5. For the instantaneous nonlinear phase calculation parameter σdp, judge whether the σdp parameter is greater than the threshold t(σdp), if it is greater than the threshold value, it is judged as a DSB signal, otherwise it is judged as an AM signal;
  6. Calculate the symmetry parameter P of the signal s(n), judge whether the parameter P is greater than the threshold t(P), if greater than the threshold value, judge it as an SSB signal, otherwise judge it as an FM signal;
  7. Calculate the γmax 2 parameter for the signal instantaneous amplitude a (n), and judge whether the value of the γmax 2 parameter is greater than the threshold t (γmax2), if it is greater than the threshold, enter the 8th step, otherwise enter the 11th step;
  8. Calculate the parameter for the signal s(n), and judge whether the value of the parameter is greater than the threshold, if it is greater than the threshold, go to step 9, otherwise go to step 10;
  9. Calculate the number M of amplitude types of the instantaneous amplitude a(n) of the signal, if M≤3, the judgment is 2ASK; if 4≤M, the judgment is 4ASK;
  10. Calculate the parameter for the instantaneous frequency f(n) of the signal, and judge whether the value of the parameter is greater than the threshold, if it is greater than the threshold, go to step 12, otherwise go to step 13
  11. Calculate the two-phase characteristic parameter of the signal to determine whether the value of the parameter is greater than the threshold, if greater than the threshold, it is judged to be a 2PSK signal, otherwise it is judged to be a 4PSK signal;
  12. Calculate the peak number N of the signal power spectrum, if N<2, the judgment is CW, if 2≤N<3, the judgment is 2FSK, otherwise it is 4FSK;

Figure 8 Modulation recognition experiment image

5.3 Measurement of modulation degree and intermodulation distortion of AM modulated signal                

                     Experimental principle for measuring modulation degree:

In amplitude modulation, modulation depth refers to the amplitude ratio of the modulating signal to the carrier signal. With the help of fast Fourier transform, the modulation depth can be obtained by measuring the sideband amplitude and the carrier amplitude. In this application note we will show a convenient way to measure modulation depth using the new peak/marker functionality.

Amplitude modulation uses a sinusoidal signal (usually a sine wave with an audio frequency ranging from 10 Hz to 20 kHz) to control the amplitude of a high-frequency signal called a carrier.

here:

V(t)  

AM signal

Uc

The amplitude of the carrier signal

m

modulation depth

a(t)

Normalize the modulated signal

fc

carrier frequency

Sine modulation is the most commonly used type of modulation waveform. If we use a sine wave, the modulation signal can be expressed as

 at=cos2πfmt              (2)

According to formulas (1) and (2), we can get

U(t)=Uccos2πfct+m2Uccos(2πfc+2πfm)t+m2Uccos(2πfc-2πfm)t          (3)

Mathematically represent the carrier waveform, and represent the positive sideband (upper sideband) and negative sideband (lower sideband) of the modulated signal. The magnitudes of the upper and lower sidebands are both, if we set the magnitude of the sidebands as

 Us=m2Uc       (4)

Then,                                                       m 2 = U s U c           (5)

In the logarithmic case, if the difference between the carrier amplitude and the sideband amplitude is X,

X=20lgm2UcUc          (6)

Then the modulation depth can be expressed as

m=10x+6.0220         (7)

Figure 7

We see that the difference X between the sideband amplitude and the carrier amplitude can be easily measured, and then the modulation index can be easily calculated.

Experimental steps:

  1. By sweeping the signal, the upper and lower sidebands of the modulated signal are detected;
  2. Then calculate the corresponding signal sideband and carrier frequency density through the original signal, calculate the logarithm according to the formula, and calculate the modulation degree.

Figure 9 Experimental image of modulation degree

  • Summarize

The expected effect is to meet the requirements of spectrum measurement, with appropriate dynamic range, stable waveform, clear spectral lines, and frequency measurement range from 70MHz to 6GHz. The signal distortion is small, and the response rate is fast, which can meet the micro-delay display data. Controlling RBW is simple and efficient. The detection accuracy is high, which can basically meet the needs of use.

  • references

[1] Zheng Junli, Signal and System, Higher Education Press

[2] Digital Signal Processing

[3] MAtlab——simulink reference manual

[4] MAtlab file description

[5]Software_Defined_Radio_using_MATLAB_Simulink_and_the_RTL-SDR

[6]DC Blocker

[7] Dynamic Range - Spectrum Analysis Basics - Knowing

[8] An automatic identification method for common communication signal modulation methods without prior knowledge—Pang Yan, Han Siqi, Zhu Dalian University of Technology (patent)

[9] Wang Tianquan . Design and Implementation of Automatic Modulation Recognition of Digital Communication Signals and Full Digital Demodulation [D]. Southwest Jiaotong University , 2010.

[10] Automatic Modulation Recognition of 6 Signals Based on ANN

I am too lazy to take screenshots, the files need to be private or self-collected.

Guess you like

Origin blog.csdn.net/prouue/article/details/129598044