recurse_other.m

来自「Hierarchical-QAM的程序」· M 代码 · 共 42 行

M
42
字号
function [err_value] = recurse_other(position, theta_input_vector, snr)% This function recursively finds out the ber of bits in positions i_{1} % to i_{n-1}n=length(theta_input_vector);if(n>1)    theta_output_vector1=zeros(n-1,1);    theta_output_vector2=zeros(n-1,1);end;if(n>1)    if( position<n+1)	  alpha=theta_input_vector(n-1)+theta_input_vector(n);	  beta=theta_input_vector(n-1)-theta_input_vector(n);        if (n > 2)    		for i=1:n-2                theta_output_vector1(i,1)=theta_input_vector(i);		        theta_output_vector2(i,1)=theta_input_vector(i);  		    end;        end;     		theta_output_vector1(n-1,1)=alpha;       		theta_output_vector2(n-1,1)=beta;    theta_output_vector1;    theta_output_vector2;    position;    snr;    	    err_value=0.5*recurse_other(position, theta_output_vector1, snr)+0.5*recurse_other(position, theta_output_vector2, snr);    else        err_value=lsb_error_new(theta_input_vector, 1/(snr*snr));    end;elseif( n==1 )        if(position == 1)	        err_value = 0.5*erfc(sin(theta_input_vector(1))/snr);        elseif(position == 2)            err_value= 0.5*erfc(cos(theta_input_vector(1))/snr);        end;      end;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?