A problem with my digital communication code

I have a problem in writing in MATLAB a program that modulates data bits, adds noise, then demodulates it and calculates the bit error and the symbol error rate. The modulation used first should be QPSK. I have done the following:
N=100;
databits = randi([0 3],N,1);
hModulator = comm.QPSKModulator;
hModulator.PhaseOffset = pi/4;
txsig = step(hModulator, databits);
scatterplot(txsig)
grid on
SNRdB=-10
rxsig = awgn(txsig,SNRdB);
H = comm.QPSKDemodulator
hH.PhaseOffset = pi/4;
symdecoded=step(H,rxsig)
symerr(symdecoded,databits)
biterr(symdecoded, databits)
My first question is I don't think I am doing the bit error rate and symbol error rate correctly, can someone help me spot where the problem is? Where am I missing out?
I am then asked to repeat the same problem but make the changes needed to make it work with 16-QAM and 64-QAM by changing a parameter called CONSTELLATION.
I have tried using demod() and ddemodce() but these two functions have been removed from MATLAB? Does anyone know how to proceed?

 採用された回答

Rick Rosson
Rick Rosson 2014 年 10 月 19 日
編集済み: Rick Rosson 2014 年 10 月 19 日

1 投票

Please try using the General QAM Modulator and Demodulator system objects.

2 件のコメント

DM
DM 2014 年 10 月 19 日
Thank you very much, one more question, do you think the way I do my symbol error and bit error rate is correct? I am basically taking the error between the data bits and the decoded symbol for both types of errors, is that correct?
Rick Rosson
Rick Rosson 2014 年 10 月 19 日
Please try:
[ ~, SER ] = symerr(symdecoded,databits)
[ ~, BER ] = biterr(symdecoded, databits)

サインインしてコメントする。

その他の回答 (1 件)

Rick Rosson
Rick Rosson 2014 年 10 月 19 日

1 投票

Instead of
hH.PhaseOffset = pi/4;
please try
H.PhaseOffset = pi/4;

1 件のコメント

DM
DM 2014 年 10 月 19 日
Thanks I did, do you happen to know how to generalize such a program to the QAM case?

サインインしてコメントする。

タグ

質問済み:

DM
2014 年 10 月 19 日

コメント済み:

2014 年 10 月 19 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by