分析MATLAB代码 load("silk_tmp.mat",'silk_tmp_phase'); load("silk_tmp_out.mat",'silk_tmp_out'); load('F:\MATLAB\melp_2700bps_syn_final\phase_value_rect_1.mat','y2'); channel_num = [10,14]; for i=1: length(channel_num) tmp = silk_tmp_phase(channel_num(i)-4,:); subplot(1,length(channel_num),i); phase_angle = [-pi/4,pi/4,3*pi/4,-3*pi/4]; y_1= y2(channel_num(i)-4)*pi/180; y_3=mod(y_1,2*pi); if pi<y_3 y_3 = y_3-2*pi; end line_angle(1:4) = phase_angle+y_3; plural(1:4) = 3000*exp(j*line_angle(1:4)); for ii=1:4 plural_1(ii,:) = [plural(ii);0]; end plot(plural_1(1,:),'-+','color','k'); hold on plot(plural_1(2,:),'-+','color','y'); hold on plot(plural_1(3,:),'-+','color','m'); hold on plot(plural_1(4,:),'-+','color','r'); hold on for j = 1:size(silk_tmp_phase,2) if (-pi/4<angle(tmp(j)))&&(angle(tmp(j))<=pi/4) plot(silk_tmp_out(channel_num(i)-4,j),'*','color','r'); hold on elseif (pi/4<angle(tmp(j)))&&(angle(tmp(j))<=3*pi/4) plot(silk_tmp_out(channel_num(i)-4,j),'*','color','k'); hold on elseif (-3*pi/4<angle(tmp(j)))&&(angle(tmp(j))<=-pi/4) plot(silk_tmp_out(channel_num(i)-4,j),'*','color','y'); hold on else plot(silk_tmp_out(channel_num(i)-4,j),'*','color','m'); hold on end xlabel(['Channel ' num2str(channel_num(i)) ': QPSK']); end end %syms x1; % y1 = tan(pi/4) * x1; % fplot(y1); % hold on %syms x2; % y2 = tan(-pi/4) * x2; % fplot(y2); % hold on
时间: 2023-06-06 09:08:20 浏览: 117
层次分析matlab代码-gene-network-CCC:MATLAB代码可根据基因表达数据为给定的表型组和基因集计算表型相关系数(CCC)
&& (angle(tmp(j))<=pi/4)) silk_tmp_out(channel_num(i),j) = plural_1(1,j); elseif (pi/4<angle(tmp(j))) && (angle(tmp(j))<=3*pi/4) silk_tmp_out(channel_num(i),j) = plural_1(2,j); elseif (-3*pi/4<angle(tmp(j))) && (angle(tmp(j))<=-pi/4) silk_tmp_out(channel_num(i),j) = plural_1(4,j); else silk_tmp_out(channel_num(i),j) = plural_1(3,j); end end end
回答:这段代码主要是对给定的信道进行相位调制,并生成相应的调制结果。函数load用于加载.mat文件,channel_num指定了需要处理的信道编号,for循环迭代对每个信道进行调制。调制结果保存在silk_tmp_out中。具体实现方式为:首先根据给定的相位角的变化规律(即phase_angle和y_3的值),生成4个复数值。然后,根据每个采样点的相位角是否在规定的范围内,确定该采样点所属的复数值。最后,所有采样点都经过了处理,生成了相应的调制结果。
阅读全文