Matlab simulation of communication link based on OFDM+16QAM

Table of contents

1. Theoretical basis

2. Core program

3. Simulation conclusion


1. Theoretical basis

       In a communication system, the bandwidth provided by the channel is usually much wider than the bandwidth required to transmit a signal. If a channel only transmits one signal, it is very wasteful. In order to make full use of the bandwidth of the channel, frequency division multiplexing can be used.
The main idea of ​​OFDM is to divide the channel into several orthogonal sub-channels, convert high-speed data signals into parallel low-speed sub-data streams, and modulate them for transmission on each sub-channel. Orthogonal signals can be separated by using correlation techniques at the receiver, which can reduce the mutual interference (ISI) between subchannels. The signal bandwidth on each sub-channel is smaller than the relevant bandwidth of the channel, so each sub-channel can be regarded as flat fading, so that intersymbol interference can be eliminated, and since the bandwidth of each sub-channel is only a small part of the original channel bandwidth, the channel Equilibrium becomes relatively easy. During the evolution to B3G/4G, OFDM is one of the key technologies, which can combine diversity, space-time coding, interference and inter-channel interference suppression, and smart antenna technology to maximize system performance. Including the following types: V-OFDM, W-OFDM, F-OFDM, MIMO-OFDM, multi-band-OFDM.
        Each carrier in OFDM is orthogonal to each other, each carrier has an integer number of carrier cycles in one symbol time, and the spectrum zero point of each carrier overlaps with the zero point of adjacent carriers, thus reducing the interference between carriers. Because there is partial overlap between carriers, it improves the frequency band utilization rate compared with traditional FDMA.
        In the process of OFDM propagation, the high-speed information data stream is allocated to several sub-channels with a relatively low rate for transmission through serial-to-parallel conversion, and the symbol period in each sub-channel is relatively increased, which can reduce the delay caused by the multipath delay of the wireless channel. The resulting time dispersion causes intersymbol interference to the system. In addition, due to the introduction of the guard interval, when the guard interval is greater than the maximum multipath delay extension, the intersymbol interference caused by multipath can be eliminated to the greatest extent. If the cyclic prefix is ​​used as the guard interval, the inter-channel interference caused by multipath can also be avoided.
        Adding a guard interval at the transmitting end of the OFDM system is mainly to eliminate ISI caused by multipath. The method is to fill in the cyclic prefix in the guard interval of the OFDM symbol, so as to ensure that the number of waveform periods contained in the delayed copy of the OFDM symbol in the FFT period is also an integer. In this way, signals with a time delay shorter than the guard interval will not generate ISI during demodulation. Because OFDM technology has strong anti-ISI ability and high spectral efficiency, it was applied in optical communication in 2001, and quite a few studies have shown the feasibility of this technology in optical communication.

        IEEE 802.11a, or IEEE 802.11a-1999 as the standard is known, is a revision of the original 802.11 standard, which was ratified in 1999. The transmission technology of 802.11a is a multi-carrier modulation technology. The 802.11a standard is the follow-up standard of the 802.11b wireless networking standard that has been widely used in offices, homes, hotels, airports and many other occasions. It works in the 5GHzU-NII frequency band, the physical layer speed can reach 54Mb/s, and the transmission layer can reach 25Mbps. It can provide 25Mbps wireless ATM interface, 10Mbps Ethernet wireless frame structure interface, and TDD/TDMA air interface; support voice, data, image services; one sector can access multiple users, and each user can carry multiple user terminal. IEEE wireless networking standard specifying a maximum data transfer rate of 54Mbps and an operating frequency band of 5GHz.

        OFDM (Orthogonal Frequency Division Multiplexing) is Orthogonal Frequency Division Multiplexing technology. In fact, OFDM is MCM (Multi Carrier Modulation), a type of multi-carrier modulation. The parallel transmission of high-speed serial data is realized through frequency division multiplexing, it has better anti-multipath fading ability, and can support multi-user access. OFDM technology is developed from MCM (Multi-Carrier Modulation, multi-carrier modulation). OFDM technology is one of the implementation methods of multi-carrier transmission schemes. Its modulation and demodulation are realized based on IFFT and FFT respectively. It is a multi-carrier transmission scheme with the lowest implementation complexity and the most widely used.

      The main idea of ​​OFDM is: divide the channel into several orthogonal sub-channels, convert high-speed data signals into parallel low-speed sub-data streams, and modulate them for transmission on each sub-channel. Orthogonal signals can be separated by using correlation techniques at the receiver, which can reduce the mutual interference (ISI) between subchannels. The signal bandwidth on each sub-channel is smaller than the relevant bandwidth of the channel, so each sub-channel can be regarded as flat fading, which can eliminate intersymbol interference, and because the bandwidth of each sub-channel is only a small part of the original channel bandwidth, the channel Equilibrium becomes relatively easy.

       OFDM is a special multi-carrier transmission scheme. OFDM uses DFT and its inverse transformation IDFT method to solve the problem of generating multiple mutually orthogonal subcarriers and recovering the original signal from the subcarriers. This solves the problem of sending and transmitting in a multi-carrier transmission system. The application of fast Fourier transform makes the complexity of the multi-carrier transmission system greatly reduced. From then on, OFDM technology began to be practical. However, the application of the OFDM system still requires a large number of complex digital signal processing processes, and at that time there was a lack of components with powerful digital processing functions, so the OFDM technology has not been developed rapidly.

        OFDM uses BPSK, QPSK, 16QAM, 64QAM four kinds of modulation methods. According to the constellation diagram, the data on each sub-channel is mapped to the complex number representation of the constellation diagram points, and converted into an in-phase Ich and a quadrature component Qch. Taking the 16QAM constellation as an example, if bits_per_symbol=4, there are 4 binary numbers {d1, d2, d3, d4} on each subchannel of each OFDM symbol, and there are 16 values ​​in total, corresponding to 16 points on the constellation diagram, each The real part of a point is denoted as Qch. In order for all mapping points to have the same high average power, the output must be normalized, so corresponding to BPSK, PQSK, 16QAM, 64QAM, respectively multiplied by the normalization coefficient coefficient 1, , , . The output complex sequence is the mapped modulation result.

        Perform IFFT operation on the same component and orthogonal component obtained in the previous step according to (Ich+Qch*i). And the real part of the obtained complex number is used as a new Ich, and the imaginary part is used as a new Qch.

         In practical application, the generation and demodulation of the signal are realized by the method of digital signal processing. At this time, the signal should be sampled to form a discrete-time signal. Since the bandwidth of the OFDM signal is B=N·Δf, the signal must be sampled at a time interval of Δt=1/B=1/(N·Δf). The sampled signal is represented by sn,i

       The time interval of t=1/B=1/(N·Δf) is sampled. The sampled signal is represented by sn,i, i = 0, 1, …, N-1, then there is

       

        It can be seen from this formula that it is a strict expression of the discrete inverse Fourier transform (IDFT). IDFT can be implemented using Fast Inverse Fourier Transform (IFFT) 

         The in-phase component and quadrature component of each symbol after the IFFT operation are respectively converted into serial data, and the data of G length at the end of the symbol is added to the head to form a cyclic prefix. If an empty interval is added, under the influence of multipath propagation, it will cause inter-carrier interference ICI. The length G of the protection section should be greater than the maximum value of the expansion during multipath.

2. Core program

..............................................................
rand('state',sum(100*clock));%?
N_DBPS = 96;
N_SPF = 20;  % Number of OFDM symbols per fram 
frame_num = 10;
N_DBPF = N_DBPS * N_SPF - 6;   % Data bits per frame,minus the 6 tail bits to return the convolutional encoder to the "zero state"
fprintf('\nFrame size is %d OFDM symbols, and %d bits\n ',N_SPF, N_DBPF);
T_sym = 4 * 1e6;           % OFDM symbol period is 4us
fc = 5.2e9;                % Carrier frequency 5.2GHz
v = 2.7e3/3600;            % Vehicle speeed, 2.7km/h
f_max = v/3e8*fc;          % Maximum Dopper frequency, 13Hz 
T_start = rand(1) * 10^(-6);                    % A random starting time for simulation
channel_option = 1;
channel_response = channel_model(channel_option,f_max,frame_num,T_sym,T_start);   % Channel response of multipath Rayleigh fading channel during the simulation
                                                                                  % Assuming the channel response is invariant during one frame
pilot_sym = pilot_generator(128);               % Generate the pilot symbols, all in BPSK modulation
pilot_syms=pilot_sym';
pilot_syms=pilot_syms(:)';

for snr = 0:2:40
    nframe = 0;
    nerror = 0;
    while nframe < frame_num
        [nframe,snr,frame_num]
        %======================
        %      Transmitter
        %======================
        info_bits = round(rand(1, N_DBPF));     % Generate the information bites randomly
        tail = zeros(1,6);                      % Tail bits for convolutional encoder
        info_bits = [info_bits tail];           % Append the tail bits to the infomation bits
        trl = poly2trellis(7,[133 171]);        % Trellis structure of convolutional encoder,
                                                % Constraint length K = 7,generator polynomial in octal g0 = 133, g1 = 171
        code_bits = convenc(info_bits, trl);    % Convolutional encoder,rate R = 1/2
        TX = tx_16qam_mod(code_bits); % 16-QAM modulation
        if nframe==1
        figure(1)
        a=real(TX);
        b=imag(TX);
        plot(a,b,'bx')
        end
        pilot_num = 1;               % The start number of the cyclic pilot symbols 
        tx = tx_fre_to_time(TX,N_SPF,pilot_syms,pilot_num);    % Serial to parallel,Add pilot symbols, IFFT ( Oversampling),Add cyclic prefix                                      
        %======================
        %     Channel
        %======================
        temp_channel = channel_response(:,nframe+1).'; % Channel response at the current frame
        ry = channel_multipath(tx,temp_channel);      % Multi-path channel
        ry = awgn(ry,snr);                            % Add addictive white gaussian noise
        %======================
        %      Receiver
        %======================
        [RY,R_pilot] = ry_time_to_fre(ry,N_SPF,temp_channel); % Recover the time signal to frequency symbols of each subcarrier and Channel Equalization
        if nframe==1
        figure(2)
        a=real(RY);
        b=imag(RY);
        plot(a,b,'bx')
        axis([-2 2  -2 2]);
         end
        
        Rcode_bits = ry_16qam_demod(RY);                        % Demodulate the received symbols
        dec_bits = ry_sovadec(Rcode_bits, trl, N_DBPF,N_DBPF);  % Soft output viterbi decoding, out = ln( p(info_bits(i)=1)/p(info_bits(i)=0));
        %======================
        %   Error detection
        %======================      
        for i = 1:N_DBPF
            if dec_bits(i) >= 0
                hard_det(i) = 1;                                % hard_det refers to the hard decision   
            else 
                hard_det(i) = 0;
            end
            if hard_det(i) ~= info_bits(i)
                nerror = nerror+1;
            end
        end
        nframe = nframe + 1;
    end
    
    BER([snr/2+1]) = nerror/(frame_num * N_DBPF);
    fprintf('\nSNR is %1.2f dB, BER is %e\n ',snr,BER);
end

figure;
semilogy(0:2:40,BER,'b-o');
grid on

xlabel('SNR');
ylabel('error');
up136

3. Simulation conclusion

 

Guess you like

Origin blog.csdn.net/ccsss22/article/details/130170345