亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cooperativediversity.m

?? 瑞利信道下的AAF,DAF協作分集的實現主函數源碼
?? M
?? 第 1 頁 / 共 2 頁
字號:
                            SNR_direct = estimate_channel_SNR(channel(1), ...
                                signal.modulation_type, relay.mode);
                        SNR_via = estimate_channel_SNR([channel(2),...
                                channel(3)], signal.modulation_type, relay.mode);
                        if (signal.modulation_type == 'QPSK')
                            SNR_via = [SNR_via, SNR_via];
                            SNR_direct = [SNR_direct, SNR_direct];
                        end
                        
                        switch rx.combining_type
                            case 'SNRC'
                                bit_sequence_ratio = (sum([SNR_direct; SNR_via] .* ...
                                    values2analyse,1)>=0)*2-1;
                                bit_sequence_inf = (mean(values2analyse,1)>=0)*2-1;
                                SNR_equal_inf = ((SNR_via == inf) &...
                                    (SNR_direct == inf));
                                bit_sequence = SNR_equal_inf .* bit_sequence_inf +...
                                    not(SNR_equal_inf) .* bit_sequence_ratio;
                                
                            case 'ESNRC'
                                % .1 < SNR_direct/SNR_via < 10 : the to channels are
                                % weighted equally otherwise only the
                                % channel with the
                                % higher SNRR is used.
                                use_direct = (SNR_direct == inf) & (SNR_via ~= inf)...
                                    | ((SNR_direct ./ SNR_via) > 10);
                                use_via = (SNR_via == inf) & (SNR_direct ~= inf) | ...
                                    ((SNR_via ./ SNR_direct) > 10);
                                use_equal_ratio = not(use_direct + use_via);
                                
                                bit_sequence_equal_ratio =...
                                    (mean(values2analyse,1)>=0)*2-1;
                                bit_sequence_direct = (values2analyse(1,:)>=0)*2-1;
                                bit_sequence_via = (values2analyse(2,:)>=0)*2-1;
                                bit_sequence = ...
                                    use_equal_ratio .* bit_sequence_equal_ratio + ...
                                use_direct .* bit_sequence_direct + ...
                                use_via .* bit_sequence_via;
                        end
                    end
                    
                otherwise
                    error(['Combining-type unknown: ',rx.combining_type])
            end
    end
    
    symbol_sequence = bit2symbol(bit_sequence);
    
    %A.5 Relay - prepare relay2send.m
    function relay = prepare_relay2send(relay,channel);
    % Relay: Prepare received signal to make it ready to send
    global signal;
    switch relay.mode
        case 'AAF'
            % Amplify and Forward
            % Normalise signal power to the power of the original signal
            
            xi = abs(signal.symbol_sequence(1))^2;
            relay.amplification = sqrt(xi ./ (xi .*...
                channel(1).attenuation.h_mag .^ 2 + 2 .*...
                channel(1).noise.sigma .^ 2));
            relay.signal2send = ...
                relay.rx.received_signal .* relay.amplification;
            
        case 'DAF'
            % Decode and Forward
            relay.rx = rx_correct_phaseshift(relay.rx,...
                channel.attenuation.phi);
            relay.symbol_sequence = rx_combine(relay.rx, channel, 0);
            relay.signal2send = relay.symbol_sequence;
            
        otherwise
            error(['Unknown relay-mode: ', relay.mode])
    end
    
    %A.6 Structures
    %A.6.1 Signal - generate signal structure.m
    %function [signal_structure] = generate_signal_structure();
    % Creates the structure for all signal parameters
    
    signal_structure = struct(...
        'nr_of_bits',{},...% nr of bits to transfer
    'nr_of_symbols',{},...% nr of symbols to transfer
    'bits_per_symbol',{},...% BPSK (1 bit/symbol)
    ...% QPSK (2 bits/symbol)
    'modulation_type',{},...% ’BPSK’, ’QPSK’
    'bit_sequence',{},...% bit sequence of the signal
    'symbol_sequence',{},...% symbol sequence of the signal
    'received_bit_sequence',{});% bit sequence after transmission

%A.6.2 Channel - generate channel structure.m
%function [channel_structure] = generate_channel_structure();
% Creates the structure for all channel parameters
attenuation_structure = generate_attenuation_structure;
noise_structure = generate_noise_structure;
channel_structure = struct(...
    'attenuation', attenuation_structure,... % fading
    'noise', noise_structure);% noise

%function [fading_structure] = generate_attenuation_structure();
% Creates the structure for all fading parameters

fading_structure = struct(...
    'pattern',{},...% ’no’, ’Rayleigh’
    'distance', {},... % distance
    'd', {},...% path loss
    'h',{},...% attenuation incl. phaseshift
    'h_mag',{},...% magnitude
    'phi',{},...% phaseshift
    'block_length',{}); % lenth of the block (bit/block)

%function [noise_structure] = generate_noise_structure();
% Creates the structure for all noise parameters

noise_structure = struct(...
    'SNR',{},... % Signal to Noise Ratio (dB)
    'sigma',{}); % sigma of AVGN

%A.6.3 Receiver - generate rx structure.m
%function [rx_structure] = generate_rx_structure();
% Creates the structure for all receiver (Rx) parameters
rx_structure = struct(...
    'combining_type',{},... % ’ERC’, ’SNRC’, ’ESNRC’, ’MRC’
    'sd_weight',{},...% used for ’FRC’
                   ...% relay link is weighted one
    'received_signal',{},...% signal originally received. after
                          ...phaseshift is undone, saved in
                            ...signal2analyse
    'signal2analyse',{});% one row per incomming signal, which
                           % then are combined to estimate the
                           % bit-sequence
                %A.6.4 Relay - generate relay structure.m
                %function [relay_structure] = generate_relay_structure();
                % Creates the structure for all relay parameters
                rx_structure = generate_rx_structure;
                relay_structure = struct(...
                    'mode',{},...% ’AAF’ (Amplify and Forward)
                    ...              ’DAF’ (Decode and Forward)
                    'magic_genie',{},...% ’Magic Genie
                    'amplification',{},...% used in AAF mode
                    'symbol_sequence',{},...% used in DAF mode
                    'signal2send',{},...% Signal to be send
                    'rx',struct(rx_structure)); % Receiver\
                
                %A.6.5 Statistic - generate statistic structure.m
                %function [statistic_structure] = generate_statistic_structure();
                % Creates the structure for all statistic parameters
                statistic_structure = struct(...
                    'xlabel','SNR [dB]',...% label x-axis
                    'ylabel','Probability of error',... % label y-axis
                    'x',[],...% one graph per row x-axis
                    'y',[],...%y-axis
                    'legend','');
                %legend
                
                %A.7 ConversionsA.7.1 SNR to BER - ber2snr.m
                %function y = snr2ber(x)
                % Calculates the BER of the channel
                global signal;
                switch signal.modulation_type
                    case 'QPSK'
                        y = q(sqrt(x));
                    case 'BPSK'
                        y = q(sqrt(2 * x));
                    otherwise
                        error(['Modulation-type unknown: ', signal.modulation_type])
                end
                %A.7.2 BER to SNR - ber2snr.m
                %function y = ber2snr(x);
                % Calculates the SNR of the channel
                %
                % The SNR of the channel can be estimated/calculated when the
                % BER of the channel is known.
                global signal;
                switch signal.modulation_type
                    case 'QPSK'
                        y = qinv(x) .^ 2;
                    case 'BPSK'
                        y = qinv(x) .^ 2 / 2;
                    otherwise
                        error(['Modulation-type unknown: ', signal.modulation_type])
                end
                %A.7.3 Symbol Sequence to Bit Sequence - symbol2bit.m
                %function [bit_sequence] = symbol2bit(symbol_sequence);
                % Calculates bit_sequence from the symbol_sequence depending
                % on the modulation type
                global signal;
                switch signal.modulation_type
                    case 'BPSK'
                        bit_sequence = symbol_sequence;
                        
                    case 'QPSK'
                        bit_sequence = [real(symbol_sequence), imag(symbol_sequence)];
                        
                    otherwise
                        error(['Modulation-type unknown: ', signal.modulation_type])
                end
                %A.7.4 Bit Sequence to Symbol Sequence - bit2symbol.m
                %function [symbol_sequence] = bit2symbol(bit_sequence);
                % Calculates symbol_sequence from the bit_sequence depending on
                % the modulation type
                
                global signal;
                switch signal.modulation_type
                    case 'BPSK'
                        symbol_sequence = bit_sequence;
                        
                    case 'QPSK'
                        symbol_sequence = bit_sequence(1:signal.nr_of_symbols) + j*...
                            bit_sequence(signal.nr_of_symbols + 1 : signal.nr_of_bits);
                    otherwise
                        error(['Modulation-type unknown: ', signal.modulation_type])
                end
                %A.8 Statistic
                %A.8.1 Add Statistic - add2statistic.m
                %function add2statistic(x,y,leg);
                % Add graph to statistic
                global statistic;
                
                statistic.x = [statistic.x;x];
                statistic.y = [statistic.y;y];
                statistic.legend = strvcat(statistic.legend,leg);
                %A.8.2 Show Statistic - show statistic.m
                %function [handle] = show_statistic(colour_bw, order);
                % Shows the result in a plot
                global statistic;
                if (nargin<1), colour_bw = 0;
                end
                if (nargin<2), order = 1:size(statistic.x,1); end
                if (colour_bw == 1)
                    colours = ['k-o';'k-*';'k-s';'k-+';'k-^';'k-h';'k-v';'k-p'];
                else
                    colours = ['b-o';'r-d';'g-s';'k-v';'m-^';'b-<';'r->';'g-p'];
                end
                legend_ordered = [];
                handle = figure;
                colour = 0;
                for n = order
                    colour = colour + 1;
                    semilogy(statistic.x(n,:),statistic.y(n,:),colours(colour,:));
                    legend_ordered = strvcat(legend_ordered,statistic.legend(n,:));
                    hold on
                end
                grid on;
                legend (legend_ordered,3)
                xlabel (statistic.xlabel)
                ylabel (statistic.ylabel)
                %A.9 Theoretical BER
                %A.9.1 Single Link Channel - ber.m
                %function [y] = ber(snr, modulation_type, fading_type);
                % Calculates the BER(SNR) depending on the modulation-type and
                % the fading-type
                
                switch fading_type
                    case 'Rayleigh'
                        switch modulation_type
                            case 'BPSK'
                                y = (1 - sqrt(snr ./ (1 / 2 + snr))) / 2;
                            case 'QPSK'
                                y = (1 - sqrt(snr ./ (1 + snr))) / 2;
                                
                            otherwise
                                error(['Modulation-type unknown: ', modulation_type])
                        end
                    case 'no'
                        switch modulation_type
                            case 'BPSK'
                                y = q(sqrt(2 * snr));
                            case 'QPSK'
                                y = q(sqrt(snr));
                            otherwise
                                error(['Modulation-type unknown: ', modulation_type])
                        end
                    otherwise
                        error(['Fading-type unknown: ', fading_type])
                end
                %A.9.2 Two Independent Senders - ber 2 senders.m
                %function y = ber_2_senders(SNR_avg, modulation_type);
                % BER(SNR) using two senders. The (average) SNR is assumed to be
                % equal for both channel
                switch modulation_type
                    case 'BPSK'
                        mu = sqrt(SNR_avg ./ (1 / 2 + SNR_avg));
                    case 'QPSK'
                        mu = sqrt(SNR_avg ./ (1 + SNR_avg));
                    otherwise
                        error(['Modulation-type unknown: ', modulation_type])
                end
                
                y = 1 / 4 * (1 - mu) .^ 2 .* (2 + mu);
                %A.10 Math functions
                %A.10.1 Q-function - q.m
                function [y] = q(x);
                % Q-probability function
                y = erfc(x / sqrt(2)) / 2;
                
                %A.10.2 Inverse Q-function - invq.m
                function [y] = qinv(x);
                % Inverse Q-probability function
                y = erfcinv(x*2) *sqrt(2);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产主播一区二区| 国产清纯美女被跳蛋高潮一区二区久久w| 免费成人在线播放| 亚洲国产精品久久艾草纯爱| 成人免费一区二区三区在线观看| 久久久综合视频| 国产精品麻豆99久久久久久| 精品国产百合女同互慰| 日韩欧美黄色影院| 精品福利在线导航| 久久久亚洲精品一区二区三区| 精品欧美一区二区在线观看| 日韩精品一区二区三区视频在线观看 | 欧美色爱综合网| 在线观看视频一区| 欧美伊人精品成人久久综合97 | 欧美性极品少妇| 在线视频国内自拍亚洲视频| 在线免费不卡电影| 欧美日韩高清一区二区不卡 | 日韩三级免费观看| 久久综合色综合88| 国产精品妹子av| 亚洲福利视频一区| 久久成人av少妇免费| 国产精品一区二区你懂的| 国产凹凸在线观看一区二区| 不卡的av网站| 91精品国产综合久久久蜜臀粉嫩| 日韩午夜激情视频| 中文字幕一区在线观看| 亚洲一区二区三区爽爽爽爽爽| 丝袜美腿亚洲一区| 国产传媒一区在线| 欧美日韩在线三级| 精品国产污污免费网站入口 | 综合久久久久久| 水蜜桃久久夜色精品一区的特点 | 国产成人综合亚洲91猫咪| 不卡电影免费在线播放一区| 91成人国产精品| 亚洲精品在线免费观看视频| 亚洲色大成网站www久久九九| 亚洲18女电影在线观看| 国产一区二区福利视频| 在线观看亚洲精品| 国产欧美一二三区| 午夜久久电影网| 成人黄色av网站在线| 欧美日韩国产小视频| 欧美极品xxx| 亚洲18色成人| 91在线云播放| 中文字幕不卡在线| 久草在线在线精品观看| 91久久一区二区| 国产三级久久久| 日韩综合小视频| 在线观看国产91| 国产亚洲综合av| 亚洲va国产va欧美va观看| 成人精品鲁一区一区二区| 精品少妇一区二区三区在线视频| 尤物视频一区二区| 成人av在线资源网| 国产午夜精品一区二区三区视频| 丝袜亚洲另类欧美| 欧美探花视频资源| 亚洲精品午夜久久久| www.一区二区| 中文字幕一区二区三区在线不卡| 国产一区二区91| 日韩欧美国产1| 强制捆绑调教一区二区| 欧美日韩国产高清一区二区三区| 一区二区三区精品久久久| 成人免费高清在线| 国产色产综合色产在线视频| 韩国成人在线视频| 欧美mv日韩mv亚洲| 狠狠色丁香婷综合久久| 精品国产三级电影在线观看| 久草中文综合在线| 久久精品水蜜桃av综合天堂| 国产伦理精品不卡| 久久久无码精品亚洲日韩按摩| 麻豆91在线播放免费| 欧美v日韩v国产v| 国产一区久久久| 国产日韩欧美不卡在线| 国产精品一区二区黑丝| 国产欧美一区二区在线| 成人福利视频在线看| 中文字幕一区二区三区在线观看| 在线日韩av片| 婷婷成人激情在线网| 精品理论电影在线| 国产a视频精品免费观看| 亚洲欧洲色图综合| 欧美日韩精品欧美日韩精品一 | 国产福利精品一区| 亚洲欧美偷拍三级| 欧美三级中文字幕| 狠狠狠色丁香婷婷综合激情 | 亚洲一线二线三线视频| 在线观看91精品国产麻豆| 麻豆精品一区二区三区| 久久精品亚洲一区二区三区浴池 | 一区二区在线看| 欧美日本免费一区二区三区| 国产专区综合网| 亚洲精品ww久久久久久p站 | 国产1区2区3区精品美女| 亚洲日本在线a| 欧美一区二区三区小说| 国产成人综合在线| 夜夜嗨av一区二区三区网页 | 国产精品久久久久久户外露出 | 国产亚洲欧美一区在线观看| 色婷婷综合久久久久中文 | 国产毛片精品视频| 亚洲精品久久久蜜桃| 精品久久久久久久久久久久包黑料| 丁香网亚洲国际| 天堂在线一区二区| 《视频一区视频二区| 精品久久人人做人人爱| 色婷婷激情综合| 国产福利一区在线观看| 日韩中文字幕不卡| 亚洲六月丁香色婷婷综合久久| 日韩欧美色综合网站| 一本高清dvd不卡在线观看| 麻豆91小视频| 亚洲国产欧美另类丝袜| 国产精品灌醉下药二区| 日韩欧美国产综合| 欧美日韩在线免费视频| 91丨porny丨首页| 国产在线播放一区二区三区| 性感美女久久精品| 亚洲一区在线观看视频| 国产欧美日韩麻豆91| 亚洲精品一区二区在线观看| 欧美喷水一区二区| 在线观看日韩电影| 菠萝蜜视频在线观看一区| 国产a级毛片一区| 国产乱码精品一区二区三区av | 亚洲人吸女人奶水| 国产精品久久毛片| 国产日韩高清在线| 久久久精品日韩欧美| 337p粉嫩大胆噜噜噜噜噜91av| 欧美美女bb生活片| 欧美人动与zoxxxx乱| 欧美精品一二三| 这里是久久伊人| 欧美一区二区国产| 欧美成人午夜电影| 久久综合色鬼综合色| 久久看人人爽人人| 国产精品视频在线看| 国产精品毛片大码女人| 亚洲免费电影在线| 亚洲午夜久久久| 日韩成人一级大片| 精品一区二区三区在线观看国产| 精品一区二区在线看| 国产精品一二三在| 成人av动漫在线| 色偷偷久久一区二区三区| 欧美系列一区二区| 欧美一二三四在线| 久久久久久久久久久黄色| 国产日韩精品一区| 亚洲国产日韩a在线播放| 日本女优在线视频一区二区 | 精品欧美久久久| 久久综合成人精品亚洲另类欧美 | 欧美激情一区二区三区在线| 国产精品私人影院| 亚洲精品成人在线| 久久精品国产秦先生| 不卡视频在线观看| 欧美日韩综合一区| 久久久精品国产免费观看同学| 17c精品麻豆一区二区免费| 五月婷婷欧美视频| 国产一区二区精品久久99| 91国偷自产一区二区三区观看 | 成人一区二区三区视频在线观看 | 欧美精品日日鲁夜夜添| 久久久综合精品| 亚洲欧美aⅴ...| 麻豆一区二区三| 91久久国产综合久久| 日韩视频永久免费| 亚洲猫色日本管| 国产麻豆91精品|