Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@thebigk • Jul 14, 2009
-
@habibctg-Z8rZpC • Jul 14, 2009
stage=4;
n = stage-2;
N_z = 2^n-1;
C0 = [1 1];
S0 = [1 -1];
C1 = conj(fliplr(S0));
S1 = -conj(fliplr(C0));
Mat_C = [C0 S0; C1 S1];
for iter=1:n-1
iter
Length = 2^(iter+1);
M_tmp=[];
for loop=1:4:Length-3
loop
M_tmp(loop ,😀 = [Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) Mat_C((loop-1)/2+2,Length/2+1:Length)];
M_tmp(loop+1,😀 = [Mat_C((loop-1)/2+1,1:Length/2) -Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) -Mat_C((loop-1)/2+2,Length/2+1:Length)];
M_tmp(loop+2,😀 = [Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) Mat_C((loop-1)/2+1,Length/2+1:Length)];
M_tmp(loop+3,😀 = [Mat_C((loop-1)/2+2,1:Length/2) -Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) -Mat_C((loop-1)/2+1,Length/2+1:Length)];
end
Mat_C = M_tmp
end
G = Mat_C;
N_zero = zeros(1,N_z) ;
L2 = length(G(1,😀);
codeset(1,😀 = [N_zero(1:N_z) G(1,1:L2/2) N_zero(1:N_z) G(1,L2/2+1:L2)];
codeset(2,😀 = [N_zero(1:N_z) G(2,1:L2/2) N_zero(1:N_z) G(2,L2/2+1:L2)];
this is the matlab code. tq -
@habibctg-Z8rZpC • Jul 14, 2009
stage=4; n = stage-2; N_z = 2^n-1; C0 = [1 1]; S0 = [1 -1]; C1 = conj(fliplr(S0)); S1 = -conj(fliplr(C0)); Mat_C = [C0 S0; C1 S1]; for iter=1:n-1 iter Length = 2^(iter+1); M_tmp=[]; for loop=1:4:Length-3 loop M_tmp(loop ,:) = [Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) Mat_C((loop-1)/2+2,Length/2+1:Length)]; M_tmp(loop+1,:) = [Mat_C((loop-1)/2+1,1:Length/2) -Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,Length/2+1:Length) -Mat_C((loop-1)/2+2,Length/2+1:Length)]; M_tmp(loop+2,:) = [Mat_C((loop-1)/2+2,1:Length/2) Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) Mat_C((loop-1)/2+1,Length/2+1:Length)]; M_tmp(loop+3,:) = [Mat_C((loop-1)/2+2,1:Length/2) -Mat_C((loop-1)/2+1,1:Length/2) Mat_C((loop-1)/2+2,Length/2+1:Length) -Mat_C((loop-1)/2+1,Length/2+1:Length)]; end Mat_C = M_tmp end G = Mat_C; N_zero = zeros(1,N_z) ; L2 = length(G(1,:)); codeset(1,:) = [N_zero(1:N_z) G(1,1:L2/2) N_zero(1:N_z) G(1,L2/2+1:L2)]; codeset(2,:) = [N_zero(1:N_z) G(2,1:L2/2) N_zero(1:N_z) G(2,L2/2+1:L2)];