dqpsk matlab code
hey friend, i didn't realize myself this code just from this forum, so you will change apprapriative rules, just i will show you some examples, because nobody doesn't write full code gor you just they will show you way, sorry it is true.
this is channel but with DQPSK
change pls to QAM;
M = 4; % Use DQPSK in this example, so M is 4.
x = randint(50,1,M); % Random data
%len = length(x) %50 random sure
tx = dpskmod(x,M,pi/4); % Modulate using a nonzero initial phase.
%%Generate channel
chan=rayleighchan(1/10000,268.67,[0 10^-6],[0 1])
%%Pass signal on channel
y=filter(chan,tx);
%%Receive
SNR = 0:2:40; % Range of SNR values, in dB.
for n = 1:length(SNR);
rxSig = awgn(y,SNR
); % Add Gaussian noise.
end
rx = dpskdemod(rxSig,M);% Demodulate.
and put the RS encoder and decoder by position in code above
RS encoder
The example below encodes two message words using a (7,3) Reed-Solomon
encoder.m = 3; % Number of bits per symbol
n = 2^m-1; k = 3; % Word lengths for code
msg = gf([2 7 3; 4 0 6],m); % Two rows of m-bit symbols
code = rsenc(msg,n,k)The output is below.code = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
RS decoder
The example below encodes three message words using a (7,3) Reed-Solomon
encoder. It then corrupts the code by introducing one error in the first codeword,
two errors in the second codeword, and three errors in the third codeword.
Then rsdec tries to decode the corrupted code.m = 3; % Number of bits per symbol
n = 2^m-1; k = 3; % Word lengths for code
msg = gf([2 7 3; 4 0 6; 5 1 1],m); % Three rows of m-bit symbols
code = rsenc(msg,n,k);
errors = gf([2 0 0 0 0 0 0; 3 4 0 0 0 0 0; 5 6 7 0 0 0 0],m);
noisycode = code + errors;
[dec,cnumerr] = rsdec(noisycode,n,k)The output is below.dec = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
they are examples you can find out how to realize your asked code.
i hope it helps!
thnks!