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!