error while using comm.QPSKModulator object

조회 수: 5 (최근 30일)
Franklin
Franklin 2014년 10월 17일
댓글: Franklin 2014년 10월 25일
I am working on simulation a Tx-Rx system with BPSK and QBPSK. Input is a .wav file of a 3 musical notes for a duration of 6 minutes.
No problem getting it to work for BPSK (using pskmod function).
However, I am struggling with QBPSK using the comm.QPSKModulator object.
The error message I'm getting is not descriptive so it's not helpful. It simply says: "Error in transmitter (line 56) modData = step(hModulator, adjustedIndex);"
I suspect it is related to the coded signal format.
Attached are all files used (program is ran from main.m, comm.QPSKModulator is in transmitter.m file).
Any assistance will be greatly appreciated.
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2014년 10월 17일
Franklin - your attached files didn't come through. Once you choose the file, you have to press the Attach File button.
Franklin
Franklin 2014년 10월 24일
Ooops. Good catch, Geoff.
Did not see your comment until today. Trying again. Let me know if they don't come thru again.

댓글을 달려면 로그인하십시오.

채택된 답변

Geoff Hayes
Geoff Hayes 2014년 10월 24일
Franklin - I suspect a problem with the line 56 of transmitter.m
modData = step(hModulator, adjustedIndex);
is that you are trying to use the step function in the same body of code where there is a global variable declared as step
global step;
This appears to be a scalar based on how it is initialized (assuming that maxValue, minValue, and quantBits are all scalars) and so is probably creating a conflict between it and the function that you want to call. It is unfortunate that the more of the error message isn't provided as that might give more of a clue (I can't run your code since I don't have the Communications System Toolbox).
I recommend that you rename the global variable step to something that won't conflict with this function, and then try again. As an aside, is there a reason why so many global variables are used? An alternative might be to create a struct with fields matching these global variables, initializing it, and then passing around between the functions.
  댓글 수: 1
Franklin
Franklin 2014년 10월 25일
Yep, that was it.
Made the QPSK modulator and awgn channel to work. Haven't tested the receiver side yet, but making progress.
Thanks for your help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 QPSK에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by