필터 지우기
필터 지우기

FSK and Adalm-Pluto

조회 수: 10 (최근 30일)
Andrea Carroll
Andrea Carroll 2020년 3월 13일
댓글: Andrea Carroll 2020년 3월 16일
I am getting some errors in the following code;
clc;
%Creating transmission object
txPluto = sdrtx('Pluto','RadioID','usb:0','CenterFrequency',2.4e9, ...
'BasebandSampleRate',1e6,'ChannelMapping',1);
%creating receiver object
rx = sdrrx('Pluto','RadioID','usb:0','CenterFrequency',2.4e9, ...
'BasebandSampleRate',1e6,'ChannelMapping',1);
%Creating fsk modulator and demodulator objects
fskMod = comm.FSKModulator(2,1000,100);
fskDemod = comm.FSKDemodulator(2,1000,100);
%Creating array of data
data = randi([0 1],5,1);
%Modulating the data using FSK scheme
modSignal = step(fskMod,data)
%Transmitting singal
txPluto(modSignal);
%Releasing the transmitter
release(txPluto);
%Capturing the data from the receiver
[data,mdata]=capture(rx,length(modSignal))
%Demodulating the signal to attain the original data
%demodSignal=step(fskDemod,data);
demodSignal=fskDemod(data)
At the moment the final line is not working. I get the following error message: "The input data type must be double precision or single precision."
In addition, when the arrays modSignal and data are not the same. Does anyone know why this is?
--Cheers, A

채택된 답변

Sriram Tadavarty
Sriram Tadavarty 2020년 3월 14일
Hi Andrea,
The error can be solved when the variable data passed to fskDemod is type casted to double. Update the following in the code:
demodSignal=fskDemod(double(data))
The purpose of this update is due the different type provided by capture, based on the input length. Here are more details about what the data type of data would be while using the capture function of Pluto. https://www.mathworks.com/help/supportpkg/plutoradio/ref/plutoradio.sdrrxpluto.capture.html#mw_2dd7d96d-66cc-4e3d-a19a-8bcf004cf4c2 (Go through output arguments sections)
Regarding the dimensions of modSignals and data. The property 'SamplesPerSymbol' of FSKModulator decides it. The defult value is 17. So, the output length is the product of SamplesPerSymbol and length of input, i.e. 17*5 = 85. For more derails on the usage of object, go through https://www.mathworks.com/help/comm/ref/comm.fskmodulator-system-object.html
Hope this helps.
Regards,
Sriram
  댓글 수: 4
Andrea Carroll
Andrea Carroll 2020년 3월 14일
Thanks, I will have a look into those links and if there are any further problems, I'll get back to you!
--cheers, A
Andrea Carroll
Andrea Carroll 2020년 3월 16일
Hi Sriram,
Would you know how to implement a simple FSK transmission model using the Adalm-Puto SDR on simulink? The example of QPSK you sent above is still quite complex and not intuitive to understand.
thanks, A

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Analog Devices ADALM1000 Support from Data Acquisition Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by