码迷,mamicode.com
首页 > 其他好文 > 详细

read_ila

时间:2019-08-19 17:28:23      阅读:68      评论:0      收藏:0      [点我收藏+]

标签:show   length   atl   fft   point   pre   频谱   class   部分   

close all;
clc;
%clear;
%点数
%point=40960;
fft_point=200;
show_point=200;
end_point=1024;
FS=30.72;%%MHZ
%转换为频率
f=((2:fft_point)-1)*FS/fft_point; %换算成实际的频率值
w=boxcar(fft_point-1);
%读取ila
ila_data_get_I=ci(2:4:end_point,1);
ila_data_get_I(1)=0;
ila_data_get_Q=cq(2:4:end_point,1);
ila_data_get_Q(1)=0;% ila_data_get_I_2=[ila_data_get_I_1‘ ila_data_get_I_1‘ ila_data_get_I_1‘ ila_data_get_I_1‘];
% ila_data_get_Q_2=[ila_data_get_Q_1‘ ila_data_get_Q_1‘ ila_data_get_Q_1‘ ila_data_get_Q_1‘];
% ila_data_get_I=ila_data_get_I_2;
% ila_data_get_Q=ila_data_get_Q_2;
ila_data_get=ila_data_get_I+ila_data_get_Q*1i;
% ila_data_get_2=[ila_data_get_1‘ ila_data_get_1‘ ila_data_get_1‘ ila_data_get_1‘];
% ila_data_get=ila_data_get_2‘;
% ila_data_get=ila_data_get_Q;
%显示部分ila_data
figure;
plot(ila_data_get_I(1:show_point));title(‘信号I‘);grid on;legend(‘信号I‘);ylabel(‘幅度(V)‘);
ila_data_get_a=ila_data_get(2:fft_point);
fft_data=fft(ila_data_get_a,(fft_point-1));
%取模
abs_fft=abs(fft_data);
%转换为幅度
V_fft=abs_fft/(fft_point/2);
V_fft(1)=abs_fft(1)/fft_point;
%转换为对数
data_dB=20*log10(abs(fft_data));
len=length(data_dB);
fri_fig=data_dB(1:len/2);
sec_fig=data_dB((len/2+1):len);
tol_fig_l=[sec_fig‘ fri_fig‘];
tol_fig=tol_fig_l‘;

figure;
plot(f,V_fft);title(‘IQ的频谱幅度‘);xlabel(‘频率(MHz)‘);ylabel(‘幅度(V)‘);grid on;legend(‘IQ的频谱‘);
figure;
plot(f,data_dB);title(‘IQ的频谱对数‘);xlabel(‘频率(MHz)‘);ylabel(‘dB‘);grid on;legend(‘IQ的频谱‘);
figure;
plot(tol_fig);title(‘IQ的中心谱‘);ylabel(‘dB‘);grid on;legend(‘IQ中心谱‘);

  

read_ila

标签:show   length   atl   fft   point   pre   频谱   class   部分   

原文地址:https://www.cnblogs.com/yssrf-possible/p/11378051.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!