附件是使用安诺尼实时频谱仪软件RTSA Suite PRO HTTP Server功能模块接口的简单Matlab示例:
Matlab脚本要求RTSA Suite PRO实时频谱分析仪软件提供IQ数据并绘制频谱。
当RTSA Suite PRO软件的mission运行到连接IQ Signal Generator功能模块的HTTP Server时,Control Sequencer模块用于在Mission加载后自动启动IQ Signal Generator功能。
Matlab脚本非常简单,代码如下:
---------------------------------------------------------------------------------------
import matlab.net.*
import matlab.net.http.*
fftsize = 1024*4;
address = 'http://localhost:54664/';
r = RequestMessage;
resp = send(r,URI(append(address , 'sample')));
disp( resp.Body.Data );
I = resp.Body.Data.samples(1:2
ftsize);
Q = resp.Body.Data.samples(2:2
ftsize);
IQData = I+1i*Q;
y = fftshift( fft( hanning(length(IQData)).*IQData, fftsize ) ) ;
y = abs(y/fftsize).^2;
y = y/50;
y = 10*log10( y / 0.001 );
x = linspace(resp.Body.Data.startFrequency, ...
resp.Body.Data.endFrequency, fftsize);
figure
plot(x,y);
xlabel('Frequency in Hz');
ylabel('Power in dBm');
title('Spectrum of RTSA IQ Data');
status = resp.StatusCode;
---------------------------------------------------------------------------------------------------------------
- RTSA-IQ-Matlab-FFT.zip (, 下载次数:0)