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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? program1_2.m

?? matlab實現(xiàn)ofdm完整系統(tǒng)
?? M
字號:

% 【問題】 
% 1. 該程序進行了簡單的LMS信道估計,沒有加入與MMSE等其他信道估計算法的比較;
% 2. 程序中循環(huán)前綴的設(shè)置,作者稱是25%的CP,但是從矩陣的構(gòu)造并不能看出這一點
%    并且CP為Zero-CP,需要加入與真正復(fù)制了數(shù)據(jù)樣值的循環(huán)CP系統(tǒng)進行性能對比;
% 3. 仿真條件為系統(tǒng)處于理想同步情況下。
% 

clear all;
close all;
fprintf( '\n OFDM仿真\n \n') ;
% --------------------------------------------- %
%                   參數(shù)定義                     %
% --------------------------------------------- %
IFFT_bin_length = 1024;
carrier_count   = 200;
bits_per_symbol = 2;
symbols_per_carrier = 50;
% 子載波數(shù)            200
% 位數(shù)/ 符號          2
% 符號數(shù)/ 載波        50
% 訓(xùn)練符號數(shù)          10
% 循環(huán)前綴長度        T/4(作者注明,不解為什么是該值)  All-zero CP  
% 多徑信道數(shù)          2、3、4(缺省)
% 信道最大時延        7 (單位數(shù)據(jù)符號)
% 仿真條件            收發(fā)之間嚴格同步
SNR =364;
%SNR = input('SNR =') ;% 輸入信噪比參數(shù)
baseband_out_length = carrier_count * symbols_per_carrier * bits_per_symbol;% 計算發(fā)送的二進制序列長度
carriers = (1: carrier_count) + (floor(IFFT_bin_length/4) - floor(carrier_count/2));   % 坐標: (1 to 200) + 156 ,  157 -- 356
conjugate_carriers = IFFT_bin_length - carriers + 2;    % 坐標 :1024 - (157:356) + 2 = 1026 - (157:356) = (869:670)     
% 構(gòu)造共軛時間-載波矩陣,以便應(yīng)用所謂的RCC,Reduced Computational Complexity算法,即ifft之后結(jié)果為實數(shù) 
% Define the conjugate time-carrier matrix
% 也可以用flipdim函數(shù)構(gòu)造對稱共軛矩陣

% --------------------------------------------- %
%                   信號發(fā)射                     %
% --------------------------------------------- %
out = rand(1,baseband_out_length);
baseband_out = round(out) ;
convert_matrix = reshape(baseband_out,length(baseband_out)/bits_per_symbol,bits_per_symbol) ;
modulo_baseband = bi2de(convert_matrix,bits_per_symbol,'left-msb');%1*10000的十進制矩陣
carrier_matrix = reshape(modulo_baseband,carrier_count,symbols_per_carrier)'; % 生成時間-載波矩陣 50*200

% --------------------------------------------- %
%                   QDPSK調(diào)制                   %
% --------------------------------------------- %
carrier_matrix = [zeros(1,carrier_count); carrier_matrix];% 添加一個差分調(diào)制的初始相位,為0  51*200矩陣
for i = 2:(symbols_per_carrier + 1)
carrier_matrix(i,:) = rem(carrier_matrix(i,:) + carrier_matrix (i-1,:), 2^bits_per_symbol) ;% 差分調(diào)制 
end
carrier_matrix = carrier_matrix*((2*pi)/(2^bits_per_symbol)) ;
% 產(chǎn)生差分相位
[X, Y]=pol2cart(carrier_matrix, ones(size(carrier_matrix,1),size(carrier_matrix,2))); 
% 由極坐標向復(fù)數(shù)坐標轉(zhuǎn)化 第一參數(shù)為相位 第二參數(shù)為幅度
% Carrier_matrix contains all the phase information and all the amplitudes
% are the same,‘1’.  
%---------------------------------------
% 函數(shù)說明:
%  POL2CART Transform polar to Cartesian coordinates.
%    [X,Y] = POL2CART(TH,R) transforms corresponding elements of data
%    stored in polar coordinates (angle TH, radius R) to Cartesian
%    coordinates X,Y.  The arrays TH and R must the same size (or
%    either can be scalar).  TH must be in radians.
% [X,Y,Z] = POL2CART(TH,R,Z) transforms corresponding elements of
%    data stored in cylindrical coordinates (angle TH, radius R, height Z) 
%    to Cartesian coordinates X,Y,Z. The arrays TH, R, and Z must be
%    the same size (or any of them can be scalar).  TH must be in radians.
%---------------------------------------
complex_carrier_matrix = complex(X, Y) ;%51*200的QPSK調(diào)制信號
figure(1);
plot(complex_carrier_matrix,'*r')
axis([-2,2,-2,2])
grid on
%---------------------------------------
% 添加訓(xùn)練序列
%---------------------------------------
training_symbols = [ 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 ...
-j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 ...
1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 ...
-1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j ...
-1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 1 j j 1 -1 -j -j -1 ]; 
% 25 times "1 j j 1" 
% 25 times "-1 -j -j -1"
% totally 200 symbols as a row   1*200
training_symbols = [training_symbols;training_symbols] ;  
training_symbols = [training_symbols;training_symbols] ;   %4*200
complex_carrier_matrix = [training_symbols;complex_carrier_matrix] ; % 訓(xùn)練序列與數(shù)據(jù)合并 55*200


IFFT_modulation = zeros(4 + symbols_per_carrier + 1,IFFT_bin_length) ;%55*1024
% % Here a row vector of zeros is between training symbols and data symbols!!! 
% % 4 training symbols and 1 zero symbol
% % every OFDM symbol takes a row of "IFFT_modulation" 
IFFT_modulation(: , carriers) = complex_carrier_matrix;%carriers=[157:356]
IFFT_modulation(: , conjugate_carriers) = conj(complex_carrier_matrix) ;%conjugate_carriers=[869:670]
%-------------------------------------------------------------------------

%-------------------------------------------------------------------------
time_wave_matrix = ifft(IFFT_modulation') ; % 進行IFFT操作
time_wave_matrix = time_wave_matrix';
% If X is a matrix, ifft returns the inverse Fourier transform of each column of the matrix.
%IFFT結(jié)果都是實數(shù)
% 由此可以看出,只是取了IFFT之后載波上的點,并未進行CP的復(fù)制和添加end

figure(2);
subplot(4,1,1)
plot(time_wave_matrix)
grid on

ofdm_modulation = reshape(time_wave_matrix',1, IFFT_bin_length*(4 + symbols_per_carrier + 1) ) ;% P2S operation
%-------------------------------------------------------------------------
%-------------------------------------------------------------------------
Tx_data = ofdm_modulation;%1*56320

% --------------------------------------------- %
%                   信道模擬                     %
% --------------------------------------------- %
d1 = 4; a1 = 0.2; d2 = 5; a2 = 0.3; d3 = 6; a3 = 0.4;
d4 = 7; a4 = 0.5;
copy1 = zeros(size(Tx_data)) ;
for i = 1 + d1: length(Tx_data)
copy1(i) = a1*Tx_data( i - d1) ;
end
copy2 = zeros(size(Tx_data) ) ;
for i = 1 + d2: length( Tx_data)
copy2(i) = a2*Tx_data( i - d2) ;
end
copy3 = zeros(size(Tx_data) ) ;
for i = 1 + d3: length(Tx_data)
copy3(i) = a3*Tx_data ( i - d3) ;
end
copy4 = zeros(size(Tx_data) ) ;
for i = 1 + d4: length( Tx_data)
copy4(i) = a4*Tx_data(i - d4) ;
end
Tx_data = Tx_data + copy1 + copy2 + copy3 + copy4;% 4 multi-paths

subplot(4,1,2)
plot(Tx_data)
grid on

Tx_signal_power = var(Tx_data);

%-------------------------------------------------------------------------
% 函數(shù)說明:
%  VAR Variance.
%     For vectors, Y = VAR(X) returns the variance of the values in X.  For
%     matrices, Y is a row vector containing the variance of each column of
%     X.
linear_SNR = 10^( SNR /10) ;
noise_sigma = Tx_signal_power / linear_SNR;
noise_scale_factor = sqrt(noise_sigma) ;
noise = randn(1, length(Tx_data) )*noise_scale_factor;

subplot(4,1,3)
plot(noise)

%-------------------------------------------------------------------------
% 函數(shù)說明:
% Y = randn(m,n) or Y = randn([m n]) returns an m-by-n matrix of random
% entries.
% The randn function generates arrays of random numbers whose elements are
% normally distributed with mean 0 and variance 1.
Rx_Data = Tx_data + noise;
subplot(4,1,4)
plot(Rx_Data)
% --------------------------------------------- %
%                  信號接收                      %
% --------------------------------------------- %
Rx_Data_matrix = reshape(Rx_Data, IFFT_bin_length, 4 + symbols_per_carrier + 1) ;
Rx_spectrum = fft(Rx_Data_matrix) ; 
% %  Suppose precise synchronazition between Tx and Rx
Rx_carriers = Rx_spectrum( carriers, : )';
Rx_training_symbols = Rx_carriers( (1: 4) , : ) ;
Rx_carriers = Rx_carriers((5: 55), : ) ;
% --------------------------------------------- %
%                    信道估計                    %
% --------------------------------------------- %
Rx_training_symbols = Rx_training_symbols./ training_symbols;
Rx_training_symbols_deno = Rx_training_symbols.^2;
Rx_training_symbols_deno = Rx_training_symbols_deno(1,:)+Rx_training_symbols_deno(2,:)+Rx_training_symbols_deno(3,:)+Rx_training_symbols_deno(4,:) ;
Rx_training_symbols_nume = Rx_training_symbols(1, : ) +Rx_training_symbols(2, : ) + Rx_training_symbols(3, : ) +Rx_training_symbols(4, : ) ;
Rx_training_symbols_nume = conj(Rx_training_symbols_nume) ;
% % 取4個向量的導(dǎo)頻符號是為了進行平均優(yōu)化
% % 都是針對 “行向量”即單個的OFDM符號 進行操作
% % 原理:尋求1/H,對FFT之后的數(shù)據(jù)進行頻域補償
% % 1/H = conj(H)/H^2 because H^2 = H * conj(H) 
Rx_training_symbols = Rx_training_symbols_nume./Rx_training_symbols_deno;
Rx_training_symbols_2 = cat(1, Rx_training_symbols,Rx_training_symbols) ;
Rx_training_symbols_4 = cat(1, Rx_training_symbols_2,Rx_training_symbols_2) ;
Rx_training_symbols_8 = cat(1, Rx_training_symbols_4,Rx_training_symbols_4) ;
Rx_training_symbols_16 = cat(1, Rx_training_symbols_8, Rx_training_symbols_8) ;
Rx_training_symbols_32 = cat(1, Rx_training_symbols_16, Rx_training_symbols_16) ;
Rx_training_symbols_48 = cat(1, Rx_training_symbols_32, Rx_training_symbols_16) ;
Rx_training_symbols_50 = cat(1, Rx_training_symbols_48, Rx_training_symbols_2) ;
Rx_training_symbols = cat(1, Rx_training_symbols_50,Rx_training_symbols) ;
Rx_carriers = Rx_training_symbols.*Rx_carriers;
% 進行頻域單抽頭均衡
Rx_phase = angle(Rx_carriers)*(180/pi) ;
phase_negative = find(Rx_phase < 0) ;
%-------------------------------------------------------------------------
% 函數(shù)說明:
% %     FIND   Find indices of nonzero elements.
% %     I = FIND(X) returns the linear indices of the array X that are nonzero.
% %     X may be a logical expression. Use IND2SUB(I,SIZE(X)) to calculate
% %     multiple subscripts from the linear indices I.
%----------------------Test of Using "rem"---------------------------------
Rx_phase1 = Rx_phase; 
Rx_phase2 = Rx_phase;
Rx_phase1(phase_negative) = rem(Rx_phase1(phase_negative) + 360, 360) ;
Rx_phase2(phase_negative) = Rx_phase2(phase_negative) + 360 ;
if Rx_phase2(phase_negative) == Rx_phase1(phase_negative)
    fprintf('\n There is no need using rem in negative phase transition.\n')
else
    fprintf('\n We need to use rem in negative phase transition.\n')    
end
%-------------------------------------------------------------------------
Rx_phase(phase_negative) = rem(Rx_phase(phase_negative) + 360, 360) ;
% % 把負的相位轉(zhuǎn)化為正的相位
Rx_decoded_phase = diff(Rx_phase) ;
% %  這也是為什么要在前面加上初始相位的原因 
% % “Here a row vector of zeros is between training symbols and data symbols!!!”
%-------------------------------------------------------------------------
% 函數(shù)說明:
% %     DIFF Difference and approximate derivative.
% %     DIFF(X), for a vector X, is [X(2)-X(1)  X(3)-X(2) ... X(n)-X(n-1)].
% %     DIFF(X), for a matrix X, is the matrix of row differences,
% %        [X(2:n,:) - X(1:n-1,:)].
%------------------------Test Codes --------------------------------------
% %  a = [1 2 3; 4 5 6; 7 8 9; 10 11 12];
% %  b = a;
% %      for i = 2:4
% %        b(i,:) = b(i-1,:) + b(i,:);
% %      end
% %  c = diff(b);
%-----------------------Test Result --------------------------------------
% %  a =                  Modulating signal
% %      1     2     3
% %      4     5     6
% %      7     8     9
% %     10    11    12
% %  b =                  Modulated signal
% %      1     2     3
% %      5     7     9
% %     12    15    18
% %     22    26    30
% %  c =                  Recovered signal
% %      4     5     6
% %      7     8     9
% %     10    11    12
% % ----------------------------------------------------------------------------
% %   Name                   Size                    Bytes  Class
% %   Rx_phase              51x200                   81600  double array
% %   Rx_decoded_phase      50x200                   80000  double array
% % ---------------------------------------------------------------------------- 
phase_negative = find(Rx_decoded_phase < 0) ;
Rx_decoded_phase(phase_negative)= rem(Rx_decoded_phase(phase_negative) + 360, 360) ;
% % 再次把負的相位轉(zhuǎn)化為正的相位
% --------------------------------------------- %
%                   QDPSK解調(diào)                   %
% --------------------------------------------- %
base_phase = 360 /2^bits_per_symbol;
delta_phase = base_phase /2;
Rx_decoded_symbols = zeros(size(Rx_decoded_phase,1),size(Rx_decoded_phase,2)) ;
%
for i = 1: (2^bits_per_symbol - 1)
center_phase = base_phase*i;
plus_delta = center_phase + delta_phase;  % Decision threshold 1
minus_delta = center_phase - delta_phase; % Decision threshold 2
decoded = find((Rx_decoded_phase <= plus_delta)&(Rx_decoded_phase > minus_delta)) ;
Rx_decoded_symbols(decoded) = i;
end
% %  僅僅對三個區(qū)域進行判決
% %  剩下的區(qū)域就是零相位的空間了
% %  這個區(qū)域在定義解調(diào)矩陣時已經(jīng)定義為零
Rx_serial_symbols = reshape(Rx_decoded_symbols',1,size(Rx_decoded_symbols, 1)*size(Rx_decoded_symbols,2)) ;
for i = bits_per_symbol: -1: 1
if i ~= 1
Rx_binary_matrix(i, : ) = rem(Rx_serial_symbols, 2) ;
Rx_serial_symbols = floor(Rx_serial_symbols/2) ;
else
Rx_binary_matrix( i, : ) = Rx_serial_symbols;
end
end
% % Integer to binary
baseband_in = reshape(Rx_binary_matrix, 1,size(Rx_binary_matrix, 1)*size(Rx_binary_matrix, 2) ) ;
% --------------------------------------------- %
%                   誤碼率計算                   %
% --------------------------------------------- %
bit_errors = find(baseband_in ~= baseband_out) ;
% % find的結(jié)果 其每個元素為滿足邏輯條件的輸入向量的標號,其向量長度也就是收發(fā)不一樣的bit的個數(shù)
bit_error_count = size(bit_errors, 2) ;
total_bits = size( baseband_out, 2) ;
bit_error_rate = bit_error_count/ total_bits;
fprintf ( '%f \n',bit_error_rate) ;
% --------------------------------------------- %
%                   The END                     %
% --------------------------------------------- %
     

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频yy9299一区| 欧美视频一区二| 欧美精品一区二区三区在线| 日韩在线卡一卡二| 欧美高清精品3d| 青椒成人免费视频| 日韩欧美123| 国产成人高清在线| 国产精品国产自产拍高清av王其| 成人精品电影在线观看| 成人免费在线视频观看| 色婷婷激情一区二区三区| 亚洲综合色在线| 欧美丰满一区二区免费视频 | 91在线你懂得| 亚洲综合一区二区精品导航| 欧美精品三级在线观看| 久久国产精品72免费观看| 久久理论电影网| 成人毛片视频在线观看| 亚洲一区二区三区四区在线免费观看| 欧美日韩黄色影视| 狠狠狠色丁香婷婷综合激情| 国产精品嫩草99a| 国产精品午夜久久| 色伊人久久综合中文字幕| 午夜影院在线观看欧美| wwww国产精品欧美| 色欧美片视频在线观看| 日本午夜一本久久久综合| 国产午夜一区二区三区| 色一区在线观看| 精品一区二区三区av| 亚洲欧洲日韩在线| 91精品国产福利| youjizz久久| 日本不卡一区二区三区高清视频| 国产欧美综合在线| 欧美日韩一区成人| 成人蜜臀av电影| 午夜电影一区二区| 欧美激情中文字幕| 欧美一区二区三区公司| aa级大片欧美| 韩国三级在线一区| 亚洲一二三区不卡| 国产精品免费aⅴ片在线观看| 精品视频123区在线观看| 成人午夜精品一区二区三区| 五月天丁香久久| 亚洲天天做日日做天天谢日日欢 | 美国三级日本三级久久99| 国产精品日韩精品欧美在线| 91精品国产色综合久久ai换脸| 99精品视频在线观看免费| 国内外精品视频| 日韩精品一二三区| 亚洲激情自拍偷拍| 中文字幕亚洲区| 久久在线免费观看| 日韩三级视频中文字幕| 欧美视频在线播放| 色诱视频网站一区| 成年人国产精品| 国产乱码精品一区二区三区忘忧草 | 国产一区二区免费看| 日韩精品色哟哟| 亚洲超丰满肉感bbw| 一区二区三区四区在线| 国产精品高清亚洲| 国产网红主播福利一区二区| 日韩欧美专区在线| 91精品国产欧美一区二区18| 欧美视频在线一区二区三区 | 久久免费午夜影院| 精品捆绑美女sm三区| 欧美一区二区三区男人的天堂| 欧美性一级生活| 欧美亚洲一区三区| 欧美色精品在线视频| 91成人在线精品| 在线视频欧美精品| 欧美午夜精品理论片a级按摩| 色婷婷精品久久二区二区蜜臂av| 色域天天综合网| 91福利小视频| 欧美日韩成人在线| 欧美猛男男办公室激情| 欧美精品久久久久久久多人混战| 欧美日韩国产高清一区二区| 欧美日韩色一区| 337p亚洲精品色噜噜狠狠| 欧美一区二区精品在线| 日韩欧美国产综合| 久久久精品日韩欧美| 久久久久久久久久久久久夜| 国产三级三级三级精品8ⅰ区| 国产欧美视频在线观看| 国产精品毛片a∨一区二区三区| 国产精品二区一区二区aⅴ污介绍| 国产精品久久毛片| 一级日本不卡的影视| 亚洲第一会所有码转帖| 美女一区二区三区| 国产老女人精品毛片久久| 丰满放荡岳乱妇91ww| 91亚洲精品久久久蜜桃网站 | 日韩美女视频在线| 国产日韩欧美综合在线| 亚洲日本在线a| 日日骚欧美日韩| 国产成人自拍高清视频在线免费播放| 懂色中文一区二区在线播放| 色噜噜夜夜夜综合网| 欧美一级精品大片| 国产精品麻豆久久久| 亚洲午夜精品17c| 黄一区二区三区| 91美女视频网站| 欧美大尺度电影在线| 国产精品电影院| 日韩av高清在线观看| 成人免费观看男女羞羞视频| 在线观看日韩电影| 久久久夜色精品亚洲| 亚洲一区二区三区中文字幕在线| 久久精品国产999大香线蕉| eeuss鲁片一区二区三区在线看| 欧美手机在线视频| 日本一区二区三级电影在线观看| 亚洲午夜视频在线| 国产成人8x视频一区二区| 欧美私模裸体表演在线观看| 国产欧美日韩综合精品一区二区| 亚洲午夜精品网| 成人国产亚洲欧美成人综合网 | 国产一区二区三区免费观看| 91理论电影在线观看| 久久在线观看免费| 亚洲成a人片在线观看中文| 成人午夜精品在线| 日韩欧美在线网站| 一区二区成人在线观看| 国产成人免费视频| 日韩三级.com| 一本久道久久综合中文字幕| 日韩一区二区在线观看视频| 亚洲同性gay激情无套| 国产一区二区看久久| 欧美日韩国产系列| 亚洲精品菠萝久久久久久久| 国产成都精品91一区二区三| 日韩欧美在线1卡| 日韩中文字幕区一区有砖一区 | 色哟哟一区二区三区| 国产亚洲福利社区一区| 美女网站色91| 精品视频一区三区九区| 综合欧美亚洲日本| 大白屁股一区二区视频| 精品日韩一区二区| 蜜臀av一区二区| 在线成人av影院| 亚洲国产成人高清精品| 一本大道久久a久久综合| 亚洲欧洲国产日韩| 成人app下载| 国产精品国产三级国产普通话99| 国模一区二区三区白浆| 精品国产一区二区三区忘忧草| 丝袜亚洲另类欧美| 欧美天堂一区二区三区| 亚洲成人手机在线| 欧美日本在线一区| 91麻豆精品一区二区三区| 国产精品私房写真福利视频| 国产一区二区三区久久悠悠色av | 亚洲一区二区五区| 欧美性猛交一区二区三区精品| 亚洲免费在线看| 色婷婷亚洲综合| 一区二区不卡在线视频 午夜欧美不卡在| 不卡欧美aaaaa| 亚洲欧美偷拍卡通变态| 色欧美片视频在线观看在线视频| 亚洲美女屁股眼交| 欧美日韩一区二区三区免费看| 亚洲成av人片在线观看| 91精品国产色综合久久| 激情欧美一区二区| 国产精品乱码人人做人人爱 | 黄一区二区三区| 欧美激情中文不卡| 99re8在线精品视频免费播放| 亚洲日本一区二区| 欧美日韩1区2区| 国产美女娇喘av呻吟久久 | 国产精品久久久久久久岛一牛影视| 国产成人丝袜美腿| 亚洲视频在线一区|