please share it with us if anyone have demo code for for Tx/Rx in Matlab.
thanks!
I have use jocover’s interface for MATLAB-LimeSDR to captrue bluetooth signal successfully. But I need to more documents for Simulink-MATLAB-LimeSDR in detail to control LimeSDR 's Tx/Rx in Matlab.
below code can capture FM signal
% LimeSDR MATLAB interface
%
% (1) Open a device handle:
%
dev = limeSDR(); % Open device
%
% (2) Setup device parameters. These may be changed while the device
% is actively streaming.
%
dev.rx0.frequency = 93.4e6;
dev.rx0.samplerate = 5e6;
dev.rx0.gain = 30;
dev.rx0.antenna = 2;
%
% (3) Enable stream parameters. These may NOT be changed while the device
% is streaming.
%
dev.rx0.enable;
%
% (4) Start the module
%
dev.start();
%
% (5) Receive 5000 samples on RX0 channel
%
samples = dev.receive(5000,0);
Fs=dev.rx0.samplerate;
spectrum_plot(Fs,samples)
%
% (6) Cleanup and shutdown by stopping the RX stream and having MATLAB
% delete the handle object.
%
dev.stop();
clear dev;
dev = limeSDR(); % does it complete below steps
a. limeSDR.load_library(); %load lib
b. limeSDR.check_status(calllib(‘libLimeSuite’, ‘LMS_Open’, dptr,pdevlist,0)); %open Limesdr
c. limeSDR.check_status(calllib(‘libLimeSuite’, ‘LMS_Init’, dptr));%init Limesdr
I guess ‘samples = dev.receive(5000,0);’ will call below function, but I don’t understand how match ‘receive(5000,0);’ with
’ receive(obj, num_samples, chan,timeout_ms, timestamp_in)’.
function [samples, timestamp_out, actual_count, overrun] = receive(obj, num_samples, chan,timeout_ms, timestamp_in)
if nargin < 3
chan = 0;
end
if nargin < 4
timeout_ms = 1000;
end
if nargin < 5
timestamp_in = 0;
end
if ~obj.running
error('please start device');
end
f32=single(zeros(2*num_samples, 1));
metad = libstruct('lms_stream_meta_t');
if timestamp_in == 0
metad.waitForTimestamp=false;
else
metad.waitForTimestamp=true;
end
metad.timestamp=timestamp_in;
if chan==0
rx_stream=obj.rx0_stream;
if isempty(rx_stream)
error('rx0 stream not enabled');
end
else
rx_stream=obj.rx1_stream;
if isempty(rx_stream)
error('rx1 stream not enabled');
end
end
[actual_count, ~, f32, ~]=calllib('libLimeSuite', 'LMS_RecvStream', rx_stream,f32,num_samples,metad,timeout_ms);
samples=(double(f32(1:2:end)) + double(f32(2:2:end))*1j);
timestamp_out = metad.timestamp;
end
hi, guys!
could you share your FM transmitter code in matlab, which can transmitter a mp3 file through sdrlime?
thanks!