How can I change simulation parameters in example: "QPSK Transmitter/Receiver with USRP Hardware"?

10 views (last 30 days)
Hi, Im working on aplication in matlab's app designer concerning on QPSK/BPSK receiver and transmitter. Im using two USRP B200mini-i connected with usb to one laptop. The application is designed to test the quality of BPSK/QPSK trensmission when changing the values of parameters such as transmit/receive frequency, gain, content of message being sent. The problem is that i cannot change any simulation parameters - changing it doesn't work.
"The gain behavior of different USRP® daughter boards varies considerably. Thus, the gain setting in the transmitter and receiver defined in this example may not be well suited for your daughter boards. If the message is not properly decoded by the receiver object, you can vary the gain of the source signals in the SDRu Transmitter and SDRu Receiver System objects by changing the SimParams.USRPGain value in the transmitter initialization file and in the receiver initialization file."
Firstly, as in the example, I change the value of SimParams.USRPGain in sdruqpsktransmitter_init.m but it doesn't work at all. It doesn't metter what gain i set on the transmitter or receiver side, the transmission BER is always the same, transmission works perfectly - which means that changing it doesn't do anything.
SimParams.USRPCenterFrequency = 915e6;
SimParams.USRPGain = 25;
Secondly the example mention that you can change frequency value. It also don't work at all, even setting the value outside the operating frequency range of the radio on transmitter or receiver side leads to a perfect transmission - This mean that changing these values in code doesn't work at all.
"Also, a large relative frequency offset between the transmit and receive USRP® radios can prevent the receiver functions from properly decoding the message. If that happens, you can determine the offset by sending a tone at a known frequency from the transmitter to the receiver, then measuring the offset between the transmitted and received frequency, then applying that offset to the center frequency of the SDRu Receiver System object."
Thirdly, also in sdruqpsktransmitter_init.m there is:
SimParams.ModulationOrder = 4; % QPSK alphabet size
I tried to change this value to 2 to get BPSK modulation but that doesn't work either. Does anyone know why this is happening or do you know if there is a possibility to get BPSK transmission from this example?
Fourthly, I tried to change sending message. All my changed parameters are saved in prmQPSKTransmitter, prmQPSKReceiver structure but i see in receiver command window that received messages are always "Hello world" as in example.
Transmitter and receiver code:
SimParams.Message = 'test';
Transmitter command window during transmission:
Rsym: 200000
ModulationOrder: 4
Interpolation: 2
Decimation: 1
Tsym: 5.0000e-06
Fs: 400000
BarkerCode: [1 1 1 1 1 -1 -1 1 1 -1 1 -1 1]
BarkerLength: 13
HeaderLength: 26
Message: 'test'
MessageLength: 9
NumberOfMessage: 100
PayloadLength: 6300
FrameSize: 3163
FrameTime: 0.0158
RolloffFactor: 0.5000
ScramblerBase: 2
ScramblerPolynomial: [1 1 1 0 1]
ScramblerInitialConditions: [0 0 0 0]
RaisedCosineFilterSpan: 10
MessageBits: [6300×1 double]
MasterClockRate: 20000000
USRPCenterFrequency: 915000000
USRPGain: 25
USRPFrontEndSampleRate: 400000
USRPInterpolationFactor: 50
USRPFrameLength: 6326
USRPFrameTime: 0.0158
StopTime: 40
Receiver command window during and after transmission:
Hello world 096
Hello world 097
Hello world 098
Hello world 099
Error rate is = 0.067928.
Number of detected errors = 330567.
Total number of compared samples = 4866400.
The only parametr I use in the app that actually works is the transmit/receive time. It is also in the transmitter/receiver initialization file.
SimParams.StopTime = 40;
Is anyone able to help me solve at least some of these problems? This is very important to me. Thank you.

Accepted Answer

PIOTR WIECZOREK
PIOTR WIECZOREK on 19 Jan 2022
I installed Control system toolbox, matlab coder and hdl coder than i set "useCodegen" and "compilelt" on true.
Now changing gain and frequency between two radios are working properly.
compileIt = false; % true if code is to be compiled for accelerated execution
useCodegen = false; % true to run the latest generated mex file

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by