Scanning a band of frequencies using ADALM-Pluto
19 次查看(过去 30 天)
显示 更早的评论
I'm writing a program to scan a range of frequencies using the ADALM-Pluto SDR and display their spectrum. For example, I want to scan through 90MHz to 100MHz by 1MHz increments. The code is mainly from a built-in example in Matlab to receive signals using the Pluto which I edited to fit my goal. I am faily new to Matlab so need some assitance with this.
%For the option to change default settings, set |cmdlineInput| to 1.
cmdlineInput = 1;
if cmdlineInput
% Request user input from the command-line for application parameters
userInput = helperFMUserInput;
else
load('defaultinputsFM.mat');
end
%----------------------------------------------------------------------
Spect = spectrumAnalyzer;
% Calculate FM system parameters based on the user input
[fmRxParams,sigSrc] = helperFMConfig(userInput);
% Create FM broadcast receiver object and configure based on user input
fmBroadcastDemod = comm.FMBroadcastDemodulator(...
'SampleRate', fmRxParams.FrontEndSampleRate, ...
'FrequencyDeviation', fmRxParams.FrequencyDeviation, ...
'FilterTimeConstant', fmRxParams.FilterTimeConstant, ...
'AudioSampleRate', fmRxParams.AudioSampleRate, ...
'Stereo', false);
% Create audio player
player = audioDeviceWriter('SampleRate',fmRxParams.AudioSampleRate);
% Initialize radio time
radioTime = 0;
% Main loop
while sigSrc() < 100e6
% Receive baseband samples (Signal Source)
if fmRxParams.isSourceRadio
if fmRxParams.isSourcePlutoSDR
rcv = sigSrc();
lost = 0;
late = 1;
elseif fmRxParams.isSourceUsrpRadio
rcv= sigSrc();
lost = 0;
else
[rcv,~,lost,late] = sigSrc();
end
else
rcv = sigSrc();
lost = 0;
late = 1;
end
% Demodulate FM broadcast signals and play the decoded audio
audioSig = fmBroadcastDemod(rcv);
player(audioSig);
% Update radio time. If there were lost samples, add those too.
radioTime = radioTime + fmRxParams.FrontEndFrameTime + ...
double(lost)/fmRxParams.FrontEndSampleRate;
%Live Analysis--------------------------------------------------
Spect(audioSig);
% Release the audio and the signal source
release(sigSrc)
release(fmBroadcastDemod)
release(player)
sigSrc = sigSrc + 1e6;
end
% Release the audio and the signal source
release(sigSrc)
release(fmBroadcastDemod)
release(player)
0 个评论
回答(1 个)
Nadia Shaik
2023-3-10
Hi Mario,
I understand that you wish to scan a range of frequencies using "ADALM-Pluto SDR" and you are currently only receiving signals from a single frequency at a time, i.e., 100MHz.
To scan through a range of frequencies, instead of using a "while" loop to loop through your desired frequency range in 1 MHz increments you can use "for" loop and iterate through frequencies from 90 MHz to 100 MHz in 1 MHz increments.
For each iteration, a new signal source would be configured with the "sdrtx" function, with the center frequency set to the current frequency value. The rest of the code within the loop can be same as before.
I hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File 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!