WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2014-Oct-30 19:55:24

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

warplab_siso_example_Comm_WorkshopExercise.m

Hello Everyone,

I am trying to implement adaptive QAM on WARP Radios using a SISO Channel (2 antennas).

I have the code in ResearchApps/PHY/WARPLAB/WARPLab_v05_2/WorkshopExercises/warplab_siso_example_Comm_WorkshopExercise.m as a reference.

The code requires me to fill in some functions and then when I run in MATLAB I get the following error.

Undefined function 'pnet' for input arguments of type 'char'.

Error in warplab_siso_example_Comm_WorkshopExercise (line 595)
pnet('closeall');

Can someone explain what this is? I am running this MATLAB script from the folder M_Code_Examples.

Offline

 

#2 2014-Oct-30 22:42:30

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: warplab_siso_example_Comm_WorkshopExercise.m

That code was designed for WARPLab v5, a *very* old version of the WARPLab Reference Design. The pnet function was the IP/UDP package used by the old WARPLab designs and is no longer supported.

I would suggest starting with the examples for WARPLab 7, the latest (and much easier to use) version.

Offline

 

#3 2014-Nov-03 21:42:30

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hello Admin,

I tried to use the SISO OFDM Example.

https://warpproject.org/trac/wiki/WARPLab/Examples/OFDM

I get the following error on running with USE_WARPLAB_TXRX = 1

Too many OFDM symbols for TX_NUM_SAMPS!

Somehow TX_NUM_SAMPS is 16384instead of 32768.

Any help on this?

Offline

 

#4 2014-Nov-03 22:08:37

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Also are there more examples to practice? Especially something like warplab_siso_example_Comm_WorkshopExercise.m to transmit bits over a wireless channel for WARPLABv7 ??

Offline

 

#5 2014-Nov-04 08:32:15

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: warplab_siso_example_Comm_WorkshopExercise.m

krupeshved wrote:

Hello Admin,

I tried to use the SISO OFDM Example.

https://warpproject.org/trac/wiki/WARPLab/Examples/OFDM

I get the following error on running with USE_WARPLAB_TXRX = 1

Too many OFDM symbols for TX_NUM_SAMPS!

Somehow TX_NUM_SAMPS is 16384instead of 32768.

Any help on this?

That looks like an oversight on our part when we wrote the example while using WARPv3. As stated in the WARPLab documentation, the buffer size for WARPv3 hardware is 2^15 = 32768 samples while the WARPv2 hardware is limited to 2^14 = 16384 samples. The OFDM example is trying to pack 32768 samples into its transmissions and the framework is correctly complaining that WARPv2 can't store that many samples. To reduce the transmission size, try to cut the number of OFDM symbols in half. This number is specified as N_OFDM_SYMS at the top of the script.

Offline

 

#6 2014-Nov-04 21:08:51

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hi,

Changing N_OFDM_SYMS also gives the same problem. I made it half from 190 to 95 but getting same problem?

Is there any other changes to make? I want to try to get the plots with the WARP hardware and later on tweak by changing modulation format and also coding rates.

Thanks,
Krupesh

Offline

 

#7 2014-Nov-05 08:42:21

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: warplab_siso_example_Comm_WorkshopExercise.m

What is the value of "INTERP_RATE*((N_OFDM_SYMS * (N_SC + CP_LEN)) + length(preamble))" after you made the change? This is the argument of IF statement on line 107

Offline

 

#8 2014-Nov-06 16:58:01

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hi,

It is 16480 after changing

Individual values are:-
N_OFDM_SYMS to 95.
INTERP_RATE = 2
N_OFDM_SYMS 95
TX_NUM_SAMPS 16384
N_SC 64 number of subcarriers
CP_LEN 16


So LHS =164800 whereas RHS = 16384

WE WANT LHS < RHS FOR THE INEQUALITY TO BE UNTRUE

Offline

 

#9 2014-Nov-06 20:15:46

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hello,

I could resolve this issue.

2 observations:-
1) I see really weird constellation plots each time I run. EVM value goes as high as 50-60%. Probably they show the dynamics/fluctuations in the environment.

2) Also no where is power mentioned in the code. How can we play with that and also see plots with different values of power?

Thanks,
Krupesh

Offline

 

#10 2014-Nov-07 16:33:54

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: warplab_siso_example_Comm_WorkshopExercise.m

You can control the Tx power by adjusting the Tx gain settings. The gains are set in the .m script.

For each Tx power and propagation path loss there is an ideal Rx gain setting. You can use the AGC mode to let the Rx node set its gains per Rx. Otherwise you can set the Rx gains explicitly in the .m code. You should choose gains that keep the Rx IQ signal in the ±1 range of the ADC.

Offline

 

#11 2014-Nov-08 17:36:50

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Thank you for the reply.

I see that if AGC is enabled,

RxGainRF = 2; %Rx RF Gain in [1:3]
RxGainBB = 15; %Rx Baseband Gain in [0:31]

Whats difference between RF and BB?

My intuition tells me that  if these values are high (say 3 an 31), we are transmitting at a higher power and so the constellation diagram should be spread out and we should have less bit error rate. Correct me if I am wrong?

What I observe if really random fluctuations which are making it hard to observe the effect of gains and performance.

Offline

 

#12 2014-Nov-10 08:59:32

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: warplab_siso_example_Comm_WorkshopExercise.m

The BB (baseband) and RF gains control the two gain stages in the MAX2829 transceiver when it is receiving. Your intuition is not correct on the settings of these values. For any given received power, there exists an ideal gain selection above which and below which performance degrades significantly. The analog output of the MAX2829 feeds an ADC. If the gain selections are too low, the signal will only fill a couple of bits of the ADC and you will get significant quantization error. If the signal is too large, you will clip at the ADC and the samples will be railed to large positive or negative values. Could that be what you are seeing with the "random fluctuations" you mentioned? Your gains are probably too high.

The AGC core looks for a known preamble structure to automatically set gains that properly fill the ADCs.

Offline

 

#13 2014-Nov-12 16:35:49

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Thank you Admin.

This could possibly be the reason why I see anomalies in the phase Error Estimates. So how do we decide what is the "ideal" value to set for RFgain and BBgain? How do I know what is the correct value to choose from 0 to 31 and 1 to 3.

Best,
Krupesh

Offline

 

#14 2014-Nov-18 14:18:32

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hello Admin,

How does OFDM Symbol length affect the performance? Another fact I observe is that if I increase TX_SCALE from 1 to 2, it gives better performance however, it shoots a warning saying that
Warning: Sample vector contains values outside the range of [-1,+1]

Does increasing this scale indirectly increase transmitter power which improves performance?

Best,
Krupesh

Offline

 

#15 2014-Nov-19 14:32:47

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: warplab_siso_example_Comm_WorkshopExercise.m

How does OFDM Symbol length affect the performance?

OFDM symbol length is equivalent to the number of subcarriers. There are lots of OFDM tutorials that discuss how the number of subcarriers impacts performance in various fading environments (Google for 'number of ofdm subcarriers').

Does increasing this scale indirectly increase transmitter power which improves performance?

Increasing that scale value increases the amplitude of the digital values driven into the Tx DACs. Clipping at the DAC will cause some degradation in the Tx waveform. It's a tradeoff between this degradation and the increased power of the "good" signal. The optimal value depends on your waveform and your target Tx power.

Offline

 

#16 2014-Nov-20 19:59:29

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Thank you Admin,

I guess clipping of the DAC  for "good" signal is something I can compromise to get better plots.

Another question I had was regarding SNR at the receiver. I want to vary this SNR and get bit error plots (the famous waterfall) curve.How is it possible to vary the SNR? Should I keep AGC disabled and vary RXGain from 0 to 31? I guess that too wont work since it is not directly proportional to the SNR and also the RxGain depends on other factors apart from SNR.

Best,
Krupesh Ved

Offline

 

#17 2014-Nov-20 20:15:22

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Another question I had was relating to http://warpproject.org/trac/wiki/WARPLa … s/nodeSync

It is essential for the two clocks to be connected on the board while performing the experiment.This question comes because I don't see a straight line as part of the phase difference.

Best,
Krupesh Ved

Offline

 

#18 2014-Nov-21 11:04:04

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: warplab_siso_example_Comm_WorkshopExercise.m

If you look at the "observations" section of the example, you can see what happens when the the two clocks are not shared (ie the two clocks are not connected).

Unfortunately, we can't help without more information.  If you describe your setup and then post a picture of what you are observing, that would be helpful.

Offline

 

#19 2014-Nov-22 04:17:51

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: warplab_siso_example_Comm_WorkshopExercise.m

Another question I had was regarding SNR at the receiver. I want to vary this SNR and get bit error plots (the famous waterfall) curve.How is it possible to vary the SNR? Should I keep AGC disabled and vary RXGain from 0 to 31? I guess that too wont work since it is not directly proportional to the SNR and also the RxGain depends on other factors apart from SNR.

SNR is typically defined as the ratio of received power at the receiver input to noise power at the receiver input. Noise power can be assumed to be fixed, a function of the Rx circuit design. Thus to vary SNR you must vary Rx power, either by controlling Tx power or by controlling the propagation loss. Changing Rx gains does not change Rx power.

It is essential for the two clocks to be connected on the board while performing the experiment.This question comes because I don't see a straight line as part of the phase difference.

Sharing clock signals is only required for experiments which require zero sampling frequency offset and zero carrier frequency offset. This is typically only required when building arrays of multiple nodes which act together as one logical node with >4 antennas. For experiments with networks of multiple nodes clock sharing is not typically required. Instead the Rx PHY processing implements frequency offset correction, as in our WARPLab OFDM example and our real-time PHY implementations.

Offline

 

#20 2014-Nov-24 18:30:17

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Thus to vary SNR you must vary Rx power, either by controlling Tx power or by controlling the propagation loss. Changing Rx gains does not change Rx power.

Hello Admin, which parameter in the OFDM example helps me increase tx power? I guess its TX_SCALE but the bad thing is that it has a threshold of [-1,1] so as to not cause problems at the ADC/DAC.

Offline

 

#21 2014-Nov-24 19:02:39

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

After sufficiently analyzing the script, the best I am getting in terms of BIT ERROR RATE for 16-QAM is (2 into 10^-2 i.e. 0.02)

I have one last question. Does sampling frequency (40MHz now) play a role in the determination of BER.

Thanks,
Krupesh Ved

Offline

 

#22 2014-Nov-25 07:42:46

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hello Admin, which parameter in the OFDM example helps me increase tx power? I guess its TX_SCALE but the bad thing is that it has a threshold of [-1,1] so as to not cause problems at the ADC/DAC.

The MAX2829 Tx path has a variable gain amplifier (VGA) with ~30 dB range. You can adjust the Tx gain in WARPLab with:
   wl_interfaceCmd(nodes, 'RF_ALL', 'tx_gains', BB_GAIN, RF_GAIN);
Refer to the docs for the param value ranges.

Offline

 

#23 2014-Nov-25 13:35:18

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Thank you Admin for reply, appreciate it !!

Offline

 

#24 2014-Nov-26 15:23:11

krupeshved
Member
Registered: 2014-Sep-19
Posts: 37

Re: warplab_siso_example_Comm_WorkshopExercise.m

Hi Murpho,

For the OFDM script, what parameters can help me gain better SNR. In other words, the constellation plots that are generated on running the script, how can I find what is the value of SNR at which the constellation plots are generated? I am referring to http://warpproject.org/trac/wiki/WARPLab/Examples/OFDM

My question is what is the SNR obtained at the receiver for this example/ How can I vary this SNR? Noise is something I cant control . Interference can be avoided by going to 5 GHz from 2.4 Ghz, Transmitter Power can be increased by increasing TX_SCALE to 1.5 from 1. Any other factor to boost SNR? Am I missing something in the script?

Thanks,
Krupesh Ved

Offline

 

#25 2014-Nov-27 03:44:49

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: warplab_siso_example_Comm_WorkshopExercise.m

Transmitter Power can be increased by increasing TX_SCALE to 1.5 from 1

Adjusting the digital scaling is not a good way to control Tx power. Your digital Tx waveform should fill the DAC range (I/Q in ±1 when constructing waveforms in WARPLab). Overdriving the DAC will degrade Tx EVM due to clipping.

Offline

 

Board footer