完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨!
我需要matlab代码来获得频率衰减图。 我写了一个,但我没有得到真实的情节。 频谱分析仪与GPiB连接。 我希望你能提供帮助。 集(MXA,” InputBufferSize”,4005); %仪器响应超时设置(mxa,'超时',5); 的fopen(MXA); %将数据跟踪格式设置为REAL,32位fprintf(mxa,':FORM:DATA REAL,32'); %获取nr跟踪点nr_points = str2double(查询(mxa,':SWE:POIN?')); %获取参考级别ref_lev = str2num(查询(mxa,':DISP:WIND:TRAC:Y:RLEV?')); %获取跟踪数据fprintf(mxa,':INIT:IMM; * WAI'); %开始扫描,%等待直到完成fprintf(mxa,':TRAC?TRACE1'); data = binblockread(mxa,'fl oat32'); %获取跟踪数据fscanf(mxa); %删除终结符字符%create并带到前面的图形编号1图(1)%绘图轨迹数据与扫描点索引图(1:nr_points,data)%将x限制调整为nr点%和y 100 dB动态范围的限制xlim([1 nr_points])ylim([ref_lev-100 ref_lev])%激活标题上的网格线网格('扫描SA轨迹')xlabel('点索引')ylabel('幅度( dBm)')%断开清理fclose(mxa); 删除(MXA); 明确; 以上来自于谷歌翻译 以下为原文 Hi! I need the Matlab code to get the plot of attenuation agains Frequency. I wrote one but i did not get the true plot. The spectrum analyzer is connected with GPiB. I hope u could help. set(mxa,’InputBufferSize’,4005); % instrument response timeout set(mxa,’Timeout’,5); fopen(mxa); % Set the data trace format to REAL, 32 bits fprintf(mxa,’:FORM:DATA REAL,32’); % Get the nr of trace points nr_points = str2double(query(mxa,’:SWE:POIN?’)); % Get the reference level ref_lev = str2num(query(mxa,’:DISP:WIND:TRAC:Y:RLEV?’)); % Get the trace data fprintf(mxa,’:INIT:IMM;*WAI’); % start a sweep and %wait until it completes fprintf(mxa,’:TRAC? TRACE1’); data = binblockread(mxa,’fl oat32’); % get the trace data fscanf(mxa); %removes the terminator character % create and bring to front fi gure number 1 fi gure(1) % Plot trace data vs sweep point index plot(1:nr_points,data) % Adjust the x limits to the nr of points % and the y limits for 100 dB of dynamic range xlim([1 nr_points]) ylim([ref_lev-100 ref_lev]) % activate the grid lines grid on title(‘Swept SA trace’) xlabel(‘Point index’) ylabel(‘Amplitude (dBm)’) % Disconnect an clean up fclose(mxa); delete(mxa); clear; |
|
相关推荐
1个回答
|
|
|
嗨 - 您可以在http://www.agilent.com/find/saprogramming上找到有关如何从ESA提取跟踪数据的Agilent Vee编程示例此示例程序将说明用于成功提取分析仪跟踪的SCPI命令
数据。 希望您可以利用并将其集成到MatLab程序中。 问候 - 以上来自于谷歌翻译 以下为原文 Hi - You can find an Agilent Vee programming example of how to pull trace data from an ESA at http://www.agilent.com/find/saprogramming This example program will illustrate the SCPI commands that are used to successfully pull the analyzer trace data. Hopefully, you can leverage and integrate this into your MatLab program. Regards - |
|
|
|
|
只有小组成员才能发言,加入小组>>
1845 浏览 0 评论
2739 浏览 1 评论
2640 浏览 1 评论
2450 浏览 5 评论
3460 浏览 3 评论
1845浏览 0评论
417浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 20:06 , Processed in 0.808831 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3890