资源简介
USRP N210 快速频谱监测程序,运行平台为MATLAB,监测带宽为0到100M,监测速度快
代码片段和文件信息
Fc=420e6;
Fs=25e6;
M=16384;
hSDRu1= comm.SDRuReceiver(‘192.168.10.3‘ ...
‘CenterFrequencySource‘‘Input port‘...
‘Gain‘25...
‘OverrunOutputPort‘ true...
‘OutputDataType‘ ‘double‘...
‘frameLength‘ M...
‘EnableBurstMode‘ true);
hSDRu1.DecimationFactor=4;%%%%100M/4得到USRP的接受带宽
hp1 = dsp.ArrayPlot;
hp1.YLimits = [-1500];
hp1.SampleIncrement =25e6/M;
hp1.title = ‘频谱监测‘;
hp1.XLabel = ‘频率(Hz)‘;
hp1.XOffset = 420e6;
hp1.YLabel = ‘标准化功率 (dB)‘;
hp1.PlotType=‘Line‘;
hp1.Position =[6 227 576 521];
for k=1:1000
z=step(hSDRu1Fc);
u=hanning(M).*z;
x=fft(uM);
%%%%%%%%去除中心频率处的峰值
for j=1:200
x(j)=rand/3;
x(16184+j)=rand/3;
end
%Plot single-sided amplitude spectrum.
f =Fc+Fs/2*linspace(01M/2+1);
step(hp110*log(abs(x(1:M/2+1))./(M/2)));
%plot(f10*log(abs(x(1:M/2+1))./(M/2)))
%axis([420e6 432.5e6 -140 -20]);
%grid on;
%%%%%%%%%%%GUI输出
plot(handles.axes1f10*log(abs(x(1:M/2+1))./(M/2)))
set(handles.axes1 ‘xlim‘[420e6 432.5e6]...
‘ylim‘[-150 -30]);
grid on
%%%%%%%%%%%%%%
u=abs(x);
[MaxPoision]=max(u(1:M/2+1));
P(k)=Poision;
% if ((10*log(abs(x(P(k)))./(M/2))>-49.5)&(10*log(abs(x(P(k)-50))./(M/2))>-60)&(10*log(abs(x(P(k)+50))./(M/2))>-60))
% break;
% end
if ((10*log(abs(x(P(k)))./(M/2))>-49.5)&(10*log(abs(x(P(k)-50))./(M/2))>-90)&(10*log(abs(x(P(k)+50))./(M/2))>-90))
break;
end
%%%%%%%%双边功率谱
%step(hp110*log(fftshift(abs(v)./(N/2))));
end
F=Fc+25e6*Poision/M
tstart = tic;
telapsed = toc(tstart);
while telapsed<=0.2
telapsed = toc(tstart);
end
release(hSDRu1)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1895 2015-12-29 11:07 pricisescan.m
----------- --------- ---------- ----- ----
1895 1
评论
共有 条评论