通信人家园

标题: volterra代码分享  [查看完整版帖子] [打印本页]

时间:  2021-6-15 10:11
作者: epizil     标题: volterra代码分享

linear_length=5; % channel_length should be odd
% second_memory_length=5;
% second_nonlinear_length=second_memory_length*(second_memory_length+1)/2;
second_nonlinear_length=0;
third_memory_length=5;
third_nonlinear_length=3*(third_memory_length)*(third_memory_length+1)/12+...
    third_memory_length*(third_memory_length+1)*(2*third_memory_length+1)/12;
channel_length=linear_length+second_nonlinear_length+third_nonlinear_length;
w=zeros(channel_length,1);
half_length=ceil(linear_length/2);
w(half_length)=1;
P=eye(channel_length)*1;
lamda=1;
Nb=1;
Nsym=length(x_stream);
for k = half_length:Nb:Nsym*Nb-half_length
    kernel_3=third_order(x_stream(k+floor(third_memory_length/2):-1:k-floor(third_memory_length/2))).';
    temp_input=[x_stream(k+floor(linear_length/2):-1:k-floor(linear_length/2)),kernel_3];
    temp_x=P*temp_input.';
    temp_k=temp_x/(lamda+conj(temp_input)*temp_x);
    temp_output=w'*temp_input.';
    e(ceil(k/Nb)) = datax(ceil(k/Nb)) - temp_output ;
    w=w+temp_k.*conj(e(ceil(k/Nb)));  
    P=1/lamda*(P-temp_k*conj(temp_input)*P);
end
figure
plot(e.*conj(e));      
set(gca,'Linewidth',2,'fontsize', 13);
xlabel('符号数', 'fontsize', 13);
ylabel('均方误差', 'fontsize', 13);
set(gca,'YLim',[0 25]);%Y轴的数据显示范围
set(gca,'xtick',0:1000:4000,'xticklabel',0:1000:4000);
text(500,22,'(b) ','FontSize',19)
grid on






通信人家园 (https://www.txrjy.com/) Powered by C114