MATLAB implements the modulation and demodulation of the QPSK signal and calculate the code rate BER

tags: matlab  Digital communications  C language

Insert a clear all here;
clc ;
fc=1e8;fs=1e9;Band=1e8;M=4;T=2e-4;
%%
ts=1/fs;%time interval 
L=T*Band;
pskbit1 = randi([0,M-1],1,L);%Generate PSKL -mapping symbols (0-3)
pskbit1=pskbit1';%Converted to a column vector
txSig1 = pskmod(pskbit1,M,pi/M);%MPSK modulation 
   txSig1 = awgn(txSig1,10,'measured'); % Add AWGN
%%
%Surge
rolloff = .2; %  Rolling factor
span = 20 ; %  Cutting length
sps = 10;  % Samples per symbol
rrcFilter=rcosdesign(rolloff,span,sps,'sqrt'); 
upsam_sig = upfirdn(txSig1, rrcFilter, sps); 

%%
%The transmitting end 
%Frequency conversion
N=length(upsam_sig);
n = (0:ts:(N-1)*ts)';
waveform_fc_ref  = real(upsam_sig).*cos(2.*pi.*fc.*(n)) + imag(upsam_sig).*sin(2.*pi.*fc.*(n));%MP
%%
%Receiving end 
%Lower frequency conversion
 waveform_fc_ref = awgn(waveform_fc_ref,20,'measured'); % Add AWGN
I=waveform_fc_ref.*cos(2.*pi.*fc.*(n)) ;
Q=waveform_fc_ref.*sin(2.*pi.*fc.*(n));
IQ=I+1j*Q;
%%
%Reverse Filter (Sample Sample)
dowmsam_sig=upfirdn(IQ, rrcFilter, 1, sps);
dowmsam_sig=dowmsam_sig(span+1:end-span); %Go to the end
pskbit_demod=pskdemod(dowmsam_sig,4,pi/M);
 h=scatterplot(dowmsam_sig);%Drawing
 hold on 
 scatterplot(txSig1);
 hold off


%%
  err=biterr(pskbit_demod,pskbit1);%Number of mistakes, not the number of errors
 err1=err/L;%Coding rate%
%%
%  Turn the decomposition code into bit
hIntToBit = comm.IntegerToBit(log2(M));
Rx_bit = step(hIntToBit, pskbit_demod);%trainlen+1:end
Tx_bit = step(hIntToBit, pskbit1);%trainlen+1:end
berVec = step(comm.ErrorRate,Rx_bit,Tx_bit);
brate = berVec(1);%Coding rate
bnum = berVec(2);%Number of codes

Intelligent Recommendation

Modulation and demodulation of QPSK

Modulation and demodulation of QPSK Fundamental Source code Simulation results Fundamental Source code Simulation results...

Matlab-QPSK modulation and demodulation QPSK signal generated information, I channel, Q channel signal comparison chart and the receiving end demodulated I channel, Q channel, information recovery comparison chart

The environment of this blog is Matlab2018, and there may be some discrepancies in different software versions and need to be modified slightly. QPSK modulation and demodulation Simulation requirement...

Realization of Modulation and Demodulation Matlab of BPSK, QPSK, MPSK, QAM and 16QAM

1、BPSK table of Contents 1、BPSK 2、QPSK 3、MPSK 4、QAM Phase state table Table 1.1 BPSK Phase Status Table Data bit Phase change 0 0 1 BPSK can obtain the best bit error rate performance in AWGN channel,...

QPSK wireless modulation and demodulation system based on Pluto and MATLAB

** Experiment introduction: ** This experimental application software radio module Adalm-Pluto and MATLAB software, combined with modern wireless digital communication principles, use MATLAB to design...

More Recommendation

FM modulation and demodulation Matlab code

Problem description To be completed. . . . . It's too late, it's early in the morning, tomorrow will be the whole day....

Matlab DSB modulation and demodulation of the signal (simulation)

DSB (Suppress Carrier Double Band) The principle of the author is not much to elaborate, the communication principle textbook has a detailed introduction, directly on dry goods Subfunction Time domain...

Matlab AM modulation and demodulation of the signal (simulation)

Matlab AM modulation and demodulation of the signal (simulation) Using matlab to simulate AM analog modulation and demodulation process AM modulation and demodulation process Subfunction program T2F S...

Digital signal processing modulation and demodulation MATLAB simulation

First enter one in the command line As a header file Then write the modulation and demodulation function in the header file math.h. Here you do not explain the meaning of each line of code. If you hav...

[Digital signal modulation] Based on the Matlab QAM signal generation and demodulation [Matlab source code 1684]

1. Get the code method (with the instructions of the experimental topic) Obtain code method 1: The full code has uploaded my resources:[Digital signal modulation] Based on the Matlab QAM signal genera...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top