0001 function SpectralMajorisationDemo();
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 randn('seed',10); rand('seed',10);
0027
0028 L = 8;
0029 P = 16;
0030 M = 8;
0031 K = 16;
0032 gamma = 0.08;
0033
0034 [H,D,F] = GenerateMIMOSources(L,P,M,K,gamma);
0035
0036 P = PolyMatDiagSpec(D,1024);
0037
0038 R = PolyMatConv(H,PolyMatConv(D,ParaHerm(H)));
0039
0040 LWidth = 1;
0041 LWidth2 = 3;
0042 ShadeColour=[.7 .7 .7];
0043 w= (0:1023)/512;
0044
0045
0046
0047
0048 figure(1);
0049 clf;
0050 [H_est,D_est] = SMD(R,50,0.00000001,0.00000001,'SMD');
0051 P_est = PolyMatDiagSpec(D_est,1024);
0052 subplot(221);
0053
0054 plot([-2 -1],[1 2],'b-o','LineWidth',LWidth);
0055 hold on;
0056 plot([-2 -1],[1 2],'r-.*','LineWidth',LWidth);
0057 plot([-2 -1],[1 2],'k--s','LineWidth',LWidth);
0058 plot([-2 -1],[1 2],'-+','Color',[0 .5 0],'LineWidth',LWidth);
0059 AlgorithmPSDs50Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0060
0061 dummy = legend('$l=1$','$l=2$','$l=3$','$l=4$');
0062 set(dummy,'interpreter','latex','location','SouthWest');
0063 text(0.05,1,'(a)');
0064 title('SMD after 50 iterations');
0065
0066
0067 subplot(222);
0068 [H_est,D_est] = SMD(R,50,0.00000001,0.00000001,'MESMD');
0069 P_est = PolyMatDiagSpec(D_est,1024);
0070 AlgorithmPSDs50Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0071 text(0.05,1,'(b)');
0072 title('ME-SMD after 50 iterations');
0073
0074
0075 subplot(223);
0076 [H_est,D_est] = SBR2(R,50,0.00000001,0.00000001,'SBR2');
0077 P_est = PolyMatDiagSpec(D_est,1024);
0078 AlgorithmPSDs50Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0079 text(0.05,1,'(c)');
0080 title('SBR2 after 50 iterations');
0081
0082
0083 subplot(224);
0084 [H_est,D_est] = SBR2(R,50,0.00000001,0.00000001,'SBR2C');
0085 P_est = PolyMatDiagSpec(D_est,1024);
0086 AlgorithmPSDs50Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0087 text(0.05,1,'(d)');
0088 title('SBR2C after 50 iterations');
0089
0090
0091
0092
0093 figure(2);
0094 clf;
0095 [H_est,D_est] = SMD(R,200,0.00000001,0.00000001,'SMD');
0096 P_est = PolyMatDiagSpec(D_est,1024);
0097 subplot(221);
0098
0099 plot([-2 -1],[1 2],'b-o','LineWidth',LWidth);
0100 hold on;
0101 plot([-2 -1],[1 2],'r-.*','LineWidth',LWidth);
0102 plot([-2 -1],[1 2],'k--s','LineWidth',LWidth);
0103 plot([-2 -1],[1 2],'-+','Color',[0 .5 0],'LineWidth',LWidth);
0104 plot([-2 -1],[1 2],'b-.d','LineWidth',LWidth);
0105 plot([-2 -1],[1 2],'r--x','LineWidth',LWidth);
0106 plot([-2 -1],[1 2],'k-o','LineWidth',LWidth);
0107 plot([-2 -1],[1 2],'-.*','Color',[0 .5 0],'LineWidth',LWidth);
0108 AlgorithmPSDs200Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0109 dummy = legend('$l=1$','$l=2$','$l=3$','$l=4$','$l=5$','$l=6$','$l=7$','$l=8$');
0110 set(dummy,'interpreter','latex','location','SouthWest');
0111 text(0.05,1,'(a)');
0112 title('SMD after 200 iterations');
0113
0114
0115 subplot(222);
0116 [H_est,D_est] = SMD(R,200,0.00000001,0.00000001,'MESMD');
0117 P_est = PolyMatDiagSpec(D_est,1024);
0118 AlgorithmPSDs200Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0119 text(0.05,1,'(b)');
0120 title('ME-SMD after 200 iterations');
0121
0122
0123 subplot(223);
0124 [H_est,D_est] = SBR2(R,200,0.00000001,0.00000001,'SBR2');
0125 P_est = PolyMatDiagSpec(D_est,1024);
0126 AlgorithmPSDs200Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0127 text(0.05,1,'(c)');
0128 title('SBR2 after 200 iterations');
0129
0130
0131 subplot(224);
0132 [H_est,D_est] = SBR2(R,200,0.00000001,0.00000001,'SBR2C');
0133 P_est = PolyMatDiagSpec(D_est,1024);
0134 AlgorithmPSDs200Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0135 text(0.05,1,'(d)');
0136 title('SBR2C after 200 iterations');
0137
0138
0139
0140 function AlgorithmPSDs50Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0141
0142
0143 w = (0:1023)/512;
0144 plot(w,10*log10(abs(P(:,1))),'Color',ShadeColour,'LineStyle','-','LineWidth',LWidth2);
0145 hold on;
0146 plot(w,10*log10(abs(P(:,2))),'Color',ShadeColour,'LineStyle','-.','LineWidth',LWidth2);
0147 plot(w,10*log10(abs(P(:,3))),'Color',ShadeColour,'LineStyle','--','LineWidth',LWidth2);
0148 plot(w,10*log10(abs(P(:,4))),'Color',ShadeColour,'LineStyle','-','LineWidth',LWidth2);
0149
0150 plot(w,10*log10(abs(P_est(:,1))),'b-','LineWidth',LWidth);
0151 plot(w,10*log10(abs(P_est(:,2))),'r-.','LineWidth',LWidth);
0152 plot(w,10*log10(abs(P_est(:,3))),'k--','LineWidth',LWidth);
0153 plot(w,10*log10(abs(P_est(:,4))),'-','Color',[0 .5 0],'LineWidth',LWidth);
0154
0155 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,1))),'bo','LineWidth',LWidth);
0156 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,2))),'r*','LineWidth',LWidth);
0157 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,3))),'ks','LineWidth',LWidth);
0158 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,4))),'+','Color',[0 .5 0],'LineWidth',LWidth);
0159
0160 xlabel('norm. angular frequency $\Omega/\pi$','fontsize',14,...
0161 'Interpreter','Latex');
0162 ylabel('$10\log_{10}S^{(50)}_{s,l}(e^{j\Omega})$ / [dB]','fontsize',...
0163 14,'Interpreter','Latex');
0164 axis([0 2 -8 2]);
0165 grid on;
0166
0167
0168 function AlgorithmPSDs200Plot(P_est,P,LWidth,LWidth2,ShadeColour);
0169
0170
0171 w= (0:1023)/512;
0172
0173
0174 plot(w,10*log10(abs(P(:,1))),'Color',ShadeColour,'LineStyle','-','LineWidth',LWidth2);
0175 hold on;
0176 plot(w,10*log10(abs(P(:,2))),'Color',ShadeColour,'LineStyle','-.','LineWidth',LWidth2);
0177 plot(w,10*log10(abs(P(:,3))),'Color',ShadeColour,'LineStyle','--','LineWidth',LWidth2);
0178 plot(w,10*log10(abs(P(:,4))),'Color',ShadeColour,'LineStyle','-','LineWidth',LWidth2);
0179 plot(w,10*log10(abs(P(:,5))),'Color',ShadeColour,'LineStyle','-.','LineWidth',LWidth2);
0180 plot(w,10*log10(abs(P(:,6))),'Color',ShadeColour,'LineStyle','--','LineWidth',LWidth2);
0181 plot(w,10*log10(abs(P(:,7))),'Color',ShadeColour,'LineStyle','-','LineWidth',LWidth2);
0182 plot(w,10*log10(abs(P(:,8))),'Color',ShadeColour,'LineStyle','-.','LineWidth',LWidth2);
0183
0184 plot(w,10*log10(abs(P_est(:,1))),'b-','LineWidth',LWidth);
0185 plot(w,10*log10(abs(P_est(:,2))),'r-.','LineWidth',LWidth);
0186 plot(w,10*log10(abs(P_est(:,3))),'k--','LineWidth',LWidth);
0187 plot(w,10*log10(abs(P_est(:,4))),'-','Color',[0 .5 0],'LineWidth',LWidth);
0188 plot(w,10*log10(abs(P_est(:,5))),'b-.','LineWidth',LWidth);
0189 plot(w,10*log10(abs(P_est(:,6))),'r--','LineWidth',LWidth);
0190 plot(w,10*log10(abs(P_est(:,7))),'k-','LineWidth',LWidth);
0191 plot(w,10*log10(abs(P_est(:,8))),'-.','Color',[0 .5 0],'LineWidth',LWidth);
0192
0193 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,1))),'bo','LineWidth',LWidth);
0194 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,2))),'r*','LineWidth',LWidth);
0195 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,3))),'ks','LineWidth',LWidth);
0196 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,4))),'+','Color',[0 .5 0],'LineWidth',LWidth);
0197 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,5))),'bd','LineWidth',LWidth);
0198 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,6))),'rx','LineWidth',LWidth);
0199 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,7))),'ko','LineWidth',LWidth);
0200 plot(w(64:128:end),10*log10(abs(P_est(64:128:end,8))),'g*','Color',[0 .5 0],'LineWidth',LWidth);
0201
0202 xlabel('norm. angular frequency $\Omega/\pi$','fontsize',14,...
0203 'Interpreter','Latex');
0204 ylabel('$10\log_{10}S^{(200)}_{s,l}(e^{j\Omega})$ / [dB]','fontsize',...
0205 14,'Interpreter','Latex');
0206 axis([0 2 -14 2]);
0207 grid on;
0208