필터 지우기
필터 지우기

Scanning a band of frequencies using ADALM-Pluto

조회 수: 33 (최근 30일)
Mario
Mario 2022년 8월 11일
답변: Nadia Shaik 2023년 3월 10일
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)

답변 (1개)

Nadia Shaik
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!

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by