How to receive a sine wave signal from USRP2?

5 views (last 30 days)
Davis
Davis on 20 Jun 2013
Answered: wxd on 10 Mar 2014
I am a student using the USRP N210 for the first time.
I have a USRP N210 with the LFRX daughter board. I am using Matlab to communicate with the USRP. Right now I am trying to familiarize myself with the USRP.
Using a signal generator, I am feeding a simple sine wave at around 2Mhz, 0dBm. I am trying to write a simple Matlab program that will be able to read the received sine wave through the USRP and plot it. I am having trouble producing the correct code to do so. Would the code below be in the right direction? Thanks.
RXObj = comm.SDRuReceiver(findsdru, ...
'CenterFrequency', 2e6, ...
'DecimationFactor', 100, ...
'OutputDataType', 'double')
SigLog = dsp.SignalSink;
SigCount = 0;
while 1
% Get samples from RX at 100MHz/100 sample rate
[x, len] = step(RXObj);
if len > 0
step(SigLog, x)
SigCount = SigCount + 1;
end
if SigCount > 2000
break
end
end
data = SigLog.Buffer; %put logged data into array
release(hSDRu);
Now, this code just outputs complex doubles of really small magnitudes to data.
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 3.05185094759972e-05i
6.10370189519944e-05 + 3.05185094759972e-05i
0.00000000000000 + 3.05185094759972e-05i
0.00000000000000 + 3.05185094759972e-05i
0.00000000000000 + 0.00000000000000i
-3.05185094759972e-05 + 0.00000000000000i
-3.05185094759972e-05 - 3.05185094759972e-05i
-3.05185094759972e-05 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
-3.05185094759972e-05 + 0.00000000000000i

Answers (1)

wxd
wxd on 10 Mar 2014
Hi Davis, I encouter the same question as you.Have you solved it? Thank you. Best regard, wxd

Categories

Find more on Communications Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!