How to receive a sine wave signal from USRP2?
Mostrar comentarios más antiguos
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
1 comentario
ethan Miao
el 23 de Mayo de 2024
I encoutered the same question.Have you solved it? Thank you
Respuestas (1)
wxd
el 10 de Mzo. de 2014
0 votos
Hi Davis, I encouter the same question as you.Have you solved it? Thank you. Best regard, wxd
Categorías
Más información sobre Communications Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!