clc; clear; close all; tic; %% ref Osnr19G = 10:1:28; Osnr19G = Osnr19G + 10*log10(200/120); %TDM calibration Snr19G = Osnr19G - 10*log10(39.385/2/12.5); %OSNR to SNR Snr19G = Snr19G + 10*log10(6/5); %5I6O Snr19G = Snr19G - 10*log10(2); %2 polarizations EbNo19G = Snr19G - 10*log10(2); %bit per symbol BERRef = berawgn(EbNo19G,'qam',4); % semilogy(Osnr19G,BERRef,'ro-');hold on; %% SIC 5x6L1 BerSic5x6L1 = [0.103880297823597,0.139282646048110,0.173408266513937,0.137755345551737,0.0972222222222222,0.110848606338297,0.192797823596793,0.0572499045437190,0.121086292478045,0.0610562237495227;0.0876169339442535,0.109369033982436,0.135750763650248,0.106624665903016,0.0801355479190531,0.0882612638411607,0.158385834287896,0.0449241122565865,0.0969835815196640,0.0494702176403207;0.0665688239786178,0.0840969835815197,0.109106529209622,0.0852424589537992,0.0765798014509355,0.0706615120274914,0.124582378770523,0.0356529209621993,0.0759116074837724,0.0422394043528064;0.0509020618556701,0.0719859679266896,0.0871515845742650,0.0645642420771287,0.0515941198930890,0.0610084956090111,0.0954324169530355,0.0288277968690340,0.0446138793432608,0.0326818442153494;0.0383376288659794,0.0637409316533028,0.0712461817487591,0.0489452080946926,0.0470957426498664,0.0495298778159603,0.0691103474608629,0.0293289423444063,0.0346386979763268,0.0224202940053456;0.0266680985108820,0.0321091065292096,0.0349966590301642,0.0292931462390225,0.0282431271477663,0.0212390225276823,0.0339227758686522,0.0133280832378771,0.0196162657502864,0.0149269759450172;0.0164423444062619,0.0236134975181367,0.0252601183657885,0.0233271286750668,0.0167048491790760,0.0181008972890416,0.0246038564337533,0.00829276441389843,0.0103212103856434,0.0103450744558992;0.00793480336006109,0.0137815005727377,0.0137695685376098,0.0121110156548301,0.0140320733104238,0.0108223558610157,0.0135070637647957,0.00532168766704849,0.00639557082856052,0.00657455135547919;0.00516657121038564,0.00935471554028255,0.00998711340206186,0.00661034746086293,0.00949789996181749,0.00665807560137457,0.0101660939289805,0.00338869797632684,0.00397336769759450,0.00307846506300115;0.00255345551737304,0.00367506681939672,0.00354381443298969,0.00336483390607102,0.00408075601374571,0.00306653302787323,0.00400916380297824,0.00165855288277969,0.00128865979381443,0.00180173730431462;0.00118843069873998,0.00219072164948454,0.00213344788087056,0.00214776632302406,0.00234822451317297,0.00160366552119129,0.00216208476517755,0.000973654066437572,0.00107388316151203,0.000902061855670103;0.00100229095074456,0.00139604810996564,0.000942630775105002,0.000763650248186331,0.00116933944253532,0.000954562810232913,0.00115740740740741,0.000453417334860634,0.000703990072546774,0.000513077510500191;0.000429553264604811,0.000515463917525773,0.000773195876288660,0.000443871706758305,0.000272050400916380,0.000357961053837342,0.000630011454753723,0.000143184421534937,0.000229095074455899,0.000143184421534937;0.000229095074455899,0.000315005727376861,0.000386597938144330,0.000272050400916380,0.000315005727376861,0.000214776632302406,0.000415234822451317,0.000143184421534937,0.000128865979381443,0.000157502863688431;8.59106529209622e-05,0.000157502863688431,0.000214776632302406,8.59106529209622e-05,0.000114547537227950,8.59106529209622e-05,0.000200458190148912,5.72737686139748e-05,0.000100229095074456,5.72737686139748e-05;3.57961053837343e-05,8.35242458953799e-05,0.000107388316151203,7.15922107674685e-05,0.000143184421534937,3.57961053837343e-05,0.000131252386407026,3.57961053837343e-05,5.96601756395571e-05,7.15922107674685e-05;7.15922107674685e-05,8.35242458953799e-05,0.000178980526918671,5.96601756395571e-05,1.19320351279114e-05,4.77281405116457e-05,0.000107388316151203,1.19320351279114e-05,4.77281405116457e-05,0;3.57961053837343e-05,4.77281405116457e-05,8.35242458953799e-05,5.96601756395571e-05,3.57961053837343e-05,2.38640702558228e-05,9.54562810232913e-05,2.38640702558228e-05,3.57961053837343e-05,2.38640702558228e-05;1.19320351279114e-05,5.96601756395571e-05,5.96601756395571e-05,0,3.57961053837343e-05,3.57961053837343e-05,5.96601756395571e-05,2.38640702558228e-05,1.19320351279114e-05,0]; BerSic5x6L1Avg = mean(BerSic5x6L1,2); BerSic5x6L1Min = min(BerSic5x6L1,[],2); BerSic5x6L1Max = max(BerSic5x6L1,[],2); %% MMSE 5x6 BerMmse5x6 = [0.101660939289805,0.160104047346315,0.173575315005727,0.174374761359297,0.107125811378389,0.108259354715540,0.183991981672394,0.0571186521573120,0.116969740358916,0.0627147766323024;0.0892993508972891,0.158779591447117,0.148434516991218,0.164864929362352,0.0954562810232913,0.0940244368079420,0.161368843069874,0.0461173157693776,0.0935471554028255,0.0492554410080183;0.0787991599847270,0.141704849179076,0.131491027109584,0.151059564719359,0.0905522145857197,0.0797895189003436,0.144926498663612,0.0371444253531882,0.0757087628865979,0.0422513363879343;0.0599107483772432,0.135691103474609,0.103617793050783,0.135488258877434,0.0764724131347843,0.0669983772432226,0.126181271477663,0.0277181176021382,0.0518088965253914,0.0324789996181749;0.0506992172584956,0.127040378006873,0.0864237304314624,0.126240931653303,0.0691819396716304,0.0566890988927071,0.0972699503627339,0.0211554982817869,0.0386478617793051,0.0223606338297060;0.0396143566246659,0.117256109201986,0.0616886216113020,0.0987733867888507,0.0569158075601375,0.0444468308514700,0.0780832378770523,0.0133400152730050,0.0247709049255441,0.0173611111111111;0.0323477472317679,0.0995966972126766,0.0479429171439481,0.0815196639938908,0.0465945971744941,0.0331352615502100,0.0654114165712104,0.00814957999236350,0.0146286750668194,0.0120632875143184;0.0205946926307751,0.0906238067964872,0.0299255441008018,0.0663898434516991,0.0387075219549446,0.0231123520427644,0.0437905689194349,0.00521429935089729,0.00999904543718977,0.00780355097365407;0.0159292668957617,0.0770093547155403,0.0251646620847652,0.0518327605956472,0.0276584574264987,0.0153684612447499,0.0354023482245132,0.00337676594119893,0.00556032836960672,0.00357961053837343;0.00959335624284078,0.0682631729667812,0.0140917334860634,0.0393279877815960,0.0199384306987400,0.0113950935471554,0.0216805078274150,0.00165855288277969,0.00301880488736159,0.00218356242840779;0.00569873997709049,0.0504295532646048,0.00866265750286369,0.0270045819014891,0.0128436426116838,0.00644329896907217,0.0163373424971363,0.000945017182130584,0.00164662084765178,0.00105956471935853;0.00385404734631539,0.0444348988163421,0.00510691103474609,0.0210123138602520,0.0102734822451317,0.00548873615883925,0.0118127147766323,0.000441485299732722,0.000906834669721268,0.000727854142802597;0.00303550973654066,0.0335481099656357,0.00462485681557847,0.0182703321878580,0.00595647193585338,0.00294959908361970,0.00720217640320733,0.000157502863688431,0.000515463917525773,0.000229095074455899;0.00181844215349370,0.0272050400916380,0.00272050400916380,0.0113831615120275,0.00508304696449026,0.00196162657502864,0.00518327605956472,0.000114547537227950,0.000128865979381443,0.000100229095074456;0.00151775486827033,0.0227949599083620,0.00203321878579611,0.00883447880870561,0.00379438717067583,0.000945017182130584,0.00336483390607102,8.59106529209622e-05,8.59106529209622e-05,7.15922107674685e-05;0.00124093165330279,0.0194372852233677,0.00107388316151203,0.00610920198549065,0.00224322260404735,0.000847174494081711,0.00283982436044292,4.77281405116457e-05,5.96601756395571e-05,4.77281405116457e-05;0.000763650248186331,0.0152252768232150,0.000930698739977090,0.00448644520809469,0.00226708667430317,0.000632397861779305,0.00233867888507064,1.19320351279114e-05,4.77281405116457e-05,7.15922107674685e-05;0.000692058037418862,0.0138292287132493,0.000990358915616648,0.00362733867888507,0.00170628102329133,0.000274436807941963,0.00164662084765178,2.38640702558228e-05,5.96601756395571e-05,1.19320351279114e-05;0.000405689194348988,0.0114905498281787,0.000596601756395571,0.00357961053837343,0.00143184421534937,0.000167048491790760,0.00102615502100038,2.38640702558228e-05,1.19320351279114e-05,2.38640702558228e-05]; BerMmse5x6Avg = mean(BerMmse5x6,2); BerMmse5x6Min = min(BerMmse5x6,[],2); BerMmse5x6Max = max(BerMmse5x6,[],2); %% MMSE 5x5 BerMmse5x5 = [0.121861874761359,0.160330756013746,0.236075315005727,0.208404925544101,0.114571401298205,0.136311569301260,0.186318728522337,0.0635619511263841,0.131288182512409,0.0729763268423062;0.107758209240168,0.154830087819779,0.219072164948454,0.198214967544864,0.100324551355479,0.121921534936999,0.170210481099656,0.0526083428789614,0.114642993508973,0.0584311760213822;0.102901870943108,0.142790664375716,0.207366838487973,0.186760213822070,0.0942511454753723,0.107137743413517,0.158898911798396,0.0446019473081329,0.0953250286368843,0.0490168003054601;0.0827486636120657,0.133137647957236,0.190960290187094,0.166917239404353,0.0785366552119129,0.0936306796487209,0.146525391370752,0.0355455326460481,0.0712223176785033,0.0370966972126766;0.0783338106147384,0.127899484536082,0.172549159984727,0.155164184803360,0.0742411225658648,0.0820327415043910,0.125501145475372,0.0297704276441390,0.0535151775486827,0.0262743413516609;0.0647909507445590,0.121336865215731,0.152049923634975,0.125835242458954,0.0612829324169530,0.0712461817487591,0.114344692630775,0.0200935471554028,0.0383018327605957,0.0219907407407407;0.0556748759068347,0.112578751431844,0.133268900343643,0.109607674684994,0.0548515654830088,0.0591470981290569,0.100384211531119,0.0143661702940053,0.0270260595647194,0.0153803932798778;0.0434684039709813,0.108008781977854,0.111564528445972,0.0892038946162658,0.0477639366170294,0.0510571783123330,0.0863640702558228,0.0104285987017946,0.0168718976708667,0.00996324933180603;0.0407478999618175,0.101971172203131,0.100598988163421,0.0780713058419244,0.0406763077510500,0.0418695112638412,0.0736087247040855,0.00953369606720122,0.0123138602520046,0.00502338678885071;0.0301403207331042,0.101601279114166,0.0819969453990073,0.0612829324169530,0.0328608247422680,0.0363927071401298,0.0633352424589538,0.00529782359679267,0.00731433753340970,0.00293528064146621;0.0197737686139748,0.0916093928980527,0.0674255441008018,0.0430555555555556,0.0270189003436426,0.0289662084765178,0.0555412371134021,0.00406643757159221,0.00546964490263459,0.00186139747995418;0.0178383925162276,0.0907311951126384,0.0578942344406262,0.0368699885452463,0.0234941771668576,0.0295914471172203,0.0501384116074838,0.00235061092019855,0.00295914471172203,0.000942630775105002;0.0185710194730813,0.0808848797250859,0.0535366552119129,0.0342926689576174,0.0183132875143184,0.0235967926689576,0.0397766323024055,0.00186139747995418,0.00233390607101947,0.000601374570446735;0.0150773195876289,0.0820160366552119,0.0480813287514319,0.0253579610538373,0.0179410080183276,0.0202319587628866,0.0379438717067583,0.00118843069873998,0.00103092783505155,0.000272050400916380;0.0137743413516609,0.0751718213058419,0.0424684994272623,0.0209621993127148,0.0177548682703322,0.0168528064146621,0.0331615120274914,0.00124570446735395,0.000887743413516609,0.000143184421534937;0.0112638411607484,0.0751837533409698,0.0361898625429553,0.0167048491790760,0.0140201412752959,0.0151178885070638,0.0288635929744177,0.000811378388697976,0.000513077510500191,7.15922107674685e-05;0.0112280450553646,0.0739189576174112,0.0334454944635357,0.0134951317296678,0.0125882970599465,0.0134593356242841,0.0301045246277205,0.000608533791523482,0.000346029018709431,1.19320351279114e-05;0.0100825696830851,0.0691461435662467,0.0302357770141275,0.0111564528445972,0.0113235013363879,0.0111922489499809,0.0241265750286369,0.000489213440244368,0.000274436807941963,3.57961053837343e-05;0.0110252004581902,0.0688001145475372,0.0294721267659412,0.00982006491027110,0.0116218022145857,0.0109536082474227,0.0226589347079038,0.000536941580756014,0.000202844597174494,3.57961053837343e-05]; BerMmse5x5Avg = mean(BerMmse5x5,2); BerMmse5x5Min = min(BerMmse5x5,[],2); BerMmse5x5Max = max(BerMmse5x5,[],2); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot setting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Plot coeffcients FontName = 'Times New Roman'; FontSize = 8; MarkSize = 4; LineWid = 2; %limit setting AxW = 2.25; AxH = 2; PlotMinW = 0; PlotMinH = 1; PlotMaxW = 3.4;%AxW*2; PlotMaxH = 2.6; %figure setting AxScale = 0.82;%0.7; %% Fig.position Fig1 = figure; Fig1.Units = 'inches'; Fig1.InnerPosition = [PlotMinW, PlotMinH, PlotMaxW, PlotMaxH]; % colormap parula%jet%autumn%winter% ax1 = axes; ax1.InnerPosition = [0.105 0.12 0.89 0.875];%position with labels semilogy(ax1, [10 31], [4.7e-3 4.7e-3],'k--'); hold on; %FEC limit p(1) = semilogy(ax1, Osnr19G, BerMmse5x5Avg,... 'v-','Color','#77AC30', 'LineWidth',LineWid, ... 'DisplayName','MMSE 10x10. Avg'); hold on; p(4) = semilogy(ax1,Osnr19G,BerMmse5x6Avg,... 'bh-','LineWidth',LineWid, ... 'DisplayName','MMSE 10x12. Avg'); hold on; p(7) = semilogy(ax1,Osnr19G,BerSic5x6L1Avg,... 'rs-','LineWidth',LineWid, ... 'DisplayName','SIC 10x12. Avg'); hold on; p(2) = semilogy(ax1, Osnr19G(1:16), BerMmse5x5Min(1:16),... '^-','Color','#77AC30','MarkerSize',MarkSize, ... 'DisplayName','MMSE 10x10. Min'); hold on; p(3) = semilogy(ax1, Osnr19G, BerMmse5x5Max,... '^-','Color','#77AC30','MarkerFaceColor','#77AC30','MarkerSize',MarkSize, ... 'DisplayName','MMSE 10x10. Max'); hold on; p(5) = semilogy(ax1,Osnr19G(1:16),BerMmse5x6Min(1:16),... 'bo-','MarkerFaceColor','b','MarkerSize',MarkSize, ... 'DisplayName','MMSE 10x12. Min'); hold on; p(6) = semilogy(ax1,Osnr19G,BerMmse5x6Max,... 'bo-','MarkerSize',MarkSize, ... 'DisplayName','MMSE 10x12. Max'); hold on; p(8) = semilogy(ax1,Osnr19G(1:16),BerSic5x6L1Min(1:16),... 'rd-','MarkerSize',MarkSize, ... 'DisplayName','SIC 10x12. Min'); hold on; p(9) = semilogy(ax1,Osnr19G,BerSic5x6L1Max,... 'rd-','MarkerFaceColor','r','MarkerSize',MarkSize, ... 'DisplayName','SIC 10x12. Max'); hold on; lgd = legend(p,'location','southwest'); lgd.ItemTokenSize = [15,1]; xlabel('Average OSNR (dB/0.1nm)'); yticks(10.^[-5 -4 -3 -2 -1 0]) ylabel('BER'); ax1.FontName = FontName; ax1.FontSize = FontSize; axis([12 30.5 7e-6 3e-1]) t = text(12.3,7e-3,'HD-FEC limit'); t.FontName = 'Times New Roman'; t.FontSize = FontSize; x = [0.521 0.77]; y = [0.654 0.654]; annotation('doublearrow',x,y,'LineWidth',2) t = text(22.8,3e-3,'~5 dB'); t.FontName = 'Times New Roman'; t.FontSize = FontSize; % grid on;grid minor % axis equal; toc;