24小时热门版块排行榜    

查看: 210  |  回复: 1
当前主题已经存档。

aaaa4564

木虫 (正式写手)

[交流] 【求助】VBLAST系统的IPIC算法的流程

请教高手帮忙用maltab编程,以下给出了算法的流程!小弟急需用!各位行行好,帮帮忙!小弟先在此谢过了!
只要大家对vblast系统的zf,mmse算法了解的,基本上变量是一致的,只是处理干扰的过程不同。
各个变量基本是一致的!
以下是zf_osuc和mmse_osuc算法的程序,请各位参考以下!
我只需做2发2收的IPIC算法的信号检测!
function [BER]=vblast(Num,alg,modulation,corr,alpha)

%**************************************************************************
% This program implements vblast using perfect channel estimation for a 2x2
% system.
% z=vblast(Num,alg,modulation,corr,alpha) where
% Num-> number of runs
% alg -> algorithm.Choose from 'ZF' (for zero-forcing),'MM'(MMSE
% estimation),'ML'(maximum-likelihood decoding)
% modulation -> 'BPSK,'QPSK','16QAM','64QAM' (Note: for 'ML' algorithm only
% BPSK and QPSK exist and that too only for 2x2 configuration, as otherwise
% run time is too high.
% corr -> 1 for correlation at the receiver, 0 for no correlation
% alpha -> correlation coefficient value from 0 -> 1 and 0 in case corr =0;
% EXAMPLE: vblast(1000,'ZF','QPSK',1,0.5)plots ZF curve for QPSK with 0.5  
% correlation coefficient at the receiver using 1000 Monte Carlo runs
%**************************************************************************

clc;
close all;
% identify bits for each type of modulation
switch modulation   
    case 'BPSK'
        BITS=1;
        
    case 'QPSK'
        BITS=2;
    case '16QAM'
        BITS=4;
    case '64QAM'
        BITS=6;
end

% define SNR range
EbNo=[0:1:10];

%define plotting axis
SNR_axis=[];
BER_axis=[];

%set initial count
idx=1;

%define numbers of antennas
M=2;%rx antennas
N=1;%tx antennas


%parameters for wait bar
h = waitbar(0,'Please wait...');
wb=6.25;

%clear BER register
BER=[];

%commence SNR loop
for SNR=EbNo
    errors=0;
%define standard deviation, sigma,  for noise     
    sigma=0.5/(sqrt(N)*10^(SNR/10));
        for iter=1:Num %commence iteration loop
%define a random Rayleigh channel            
            H=(randn(M,N)+j*randn(M,N))/sqrt(2);
%exercise correlation option, if any
            if corr
                R=chol([1 alpha;alpha 1]);%cholesky factor of correlation matrix, i.e. 'R' square root of correlation matrix
                H=R*H; % R^0.5 *H -> correlation at receiver
            end
            H_save=H;%assign H to unalterable value

% modulated input data
            tx_bits=randn(N,BITS)>0;   
            temp1=[];
                for i=1:N   
                    d1=tx_modulate(tx_bits(i,,modulation);
                    temp1=[temp1; d1];
                end
            d=temp1;
%AWGN noise            
                 AWGN_noise = sqrt(sigma)*(randn(M, N)+j*randn(M, N));
%receiver signal vector added to AWGN noise            
            r = (H_save*d)/sqrt(N) + sqrt(sigma)*(randn(M, 1)+j*randn(M, 1));
%Zero-forcing algorithm            
            if alg=='ZF'
%initialization
                G=pinv(H);
                [gk k0]=min(sum(abs(G).^2,2));
      
                    for m=1:N     % This FOR loop determines the ordering sequence k1 and determines the 'a' matrix.
                                  %This is just one run,i.e. one for each H matrix.
                                               %The 'a' matrix is automatically sorted as [a1 a2...aM]
                        k1(m)=k0;
                        w(m,=G(k1(m),;
                        y=w(m,*r;
                        a(k1(m),1)=Q(y,modulation);
                        r = r - a(k1(m)) * H_save(:, k1(m));   
                        H(:,k0)=zeros(M,1);
                        G=pinv(H);
                    for t=1:m
                        G(k1(
                        t),=inf;
                        endm
                    [gk k0]=min(sum(abs(G).^2,2));
                end
%MMSE algorithm               
            elseif alg=='MM'
  %initialisation
                    G=inv(H'*H+N/(10^(0.1*SNR))*eye(N))*H';
                    [gk k0]=min(sum(abs(G).^2,2));
        
      
                    for m=1:N     % This FOR loop determines the ordering sequence k1 and determines the 'a' matrix.  
                                  % This is just one run,i.e.one for each H matrix.The 'a' matrix is automatically sorted
                                  % as [a1 a2...aM]
         
                        k1(m)=k0;
                        w(m,=G(k1(m),;
                        y=w(m,*r;
                        a(k1(m),1)=Q(y,modulation);
                        r = r - a(k1(m)) * H_save(:, k1(m));   
                        H(:,k0)=zeros(M,1);
                        G=inv(H'*H+N/(10^(0.1*SNR))*eye(N))*H';
                        for t=1:m
                            G(k1(t),=inf;
                        end
                        [gk k0]=min(sum(abs(G).^2,2));
                    end
                     
%count errors   
            if BITS==1 %for BPSK modulation
                errors(iter) =  sum((sign(real(a))~=sign(real(d))));
            else %for QPSK,16QAM and 64QAM modulations
                errors(iter) =  sum((sign(real(a))~=sign(real(d))) | sign(imag(a))~=sign(imag(d)));
            end
        end %end of iteration loop Loop
    BER(idx)=sum(errors)/(Num) ; % Calculate BER after completion of 'Num' runs
    SER(idx)=BER(idx)*BITS; %calculate symbol error rate
    idx=idx + 1; %increment count
    waitbar(wb/100);
    wb=wb+6.25;%increment wait bar
end %end of SNR loop
close(h);%terminate wait bar

SNR_axis=EbNo;
BER_axis=[BER_axis BER];
SER_axis=SER;

%plot BER
semilogy(SNR_axis,BER_axis,'b-');
xlabel('SNR [dB]');
ylabel('BER');
legend('')
%title('BER Plots');

%hold;

%plot SER
semilogy(SNR_axis,SER_axis,'b-o');
axis([0 10 1e-4 1]);
grid on;
legend('BER','SER');

hold off;
if alg=='MM'
    alg='MMSE'
end
str=['VBLAST System-' '2x 2 ' alg ' Algorithm with ' modulation ' Modulation'];
set(gcf,'NumberTitle','off');
set(gcf,'Name',str);
grid on

[ Last edited by aaaa4564 on 2009-6-28 at 21:18 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

mininurse

金虫 (正式写手)

★ ★ ★ ★
kuhailangyu(金币+2,VIP+0):欢迎光临,多多参与 6-29 09:50
aaaa4564(金币+1,VIP+0):xiexie 8-12 07:04
wuguocheng(金币+1,VIP+0):多鼓励,多参与 8-12 10:11
中间缺失的东西还是很多的,有一些变量根本不清楚到底值应该从哪里来。建议还是自己看一下Matlab,如果有PERL或者C的基础,编Matlab程序难度不大。
引用回帖:
Originally posted by aaaa4564 at 2009-6-28 21:02:
请教高手帮忙用maltab编程,以下给出了算法的流程!小弟急需用!各位行行好,帮帮忙!小弟先在此谢过了!

2楼2009-06-28 21:08:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 aaaa4564 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 为什么网上很多人说本周 12号出结果 +4 瞬息宇宙 2026-08-10 4/200 2026-08-11 02:02 by 旁观2020
[基金申请] 帮忙看看fileCode +4 wwncly 2026-08-10 8/400 2026-08-10 22:07 by demonstreets
[基金申请] 小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊 +3 Tide man 2026-08-10 3/150 2026-08-10 21:48 by GZUZM
[基金申请] filecode +8 documentary 2026-08-10 8/400 2026-08-10 19:20 by loufangrui
[基金申请] 关于代码变化问题,想知道的进来 +17 且听虎啸 2026-08-07 24/1200 2026-08-10 18:35 by zhangduo2008
[基金申请] 8月时间戳变的,举个手。玩一下,释放压力 +11 archvillain 2026-08-04 13/650 2026-08-10 14:41 by seekfind
[基金申请] 好奇怪的filecode +4 布布和一二 2026-08-08 5/250 2026-08-10 14:20 by 冰心玉壶晴
[基金申请] 这样的filecode谁见过 +11 布布和一二 2026-08-08 22/1100 2026-08-10 11:10 by wmfsnow
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
[基金申请] filecode与中标关系的预测 +5 布布和一二 2026-08-07 5/250 2026-08-09 16:15 by 袁向阳007
[基金申请] fileCode有新解读? +10 Tide man 2026-08-08 18/900 2026-08-09 12:55 by 仁砚薪传
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 化学口download_prp&fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
[基金申请] 纯娱乐,不喜欢勿喷 +7 Tide man 2026-08-04 10/500 2026-08-04 15:10 by loufangrui
信息提示
请填处理意见