add_freqdomain_reponse.m
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:2k
源码类别:

传真(Fax)编程

开发平台:

Matlab

  1. function ofdm_sym = add_freqdomain_reponse(pilot_added,H_freq,N_subc,N_syn_preamble,...
  2.     N_sym,N_Rx_ant,N_Tx_ant,var_noise,ofdm_sym,ChannelEffectTest,AddChFreq)
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. % 在频域加信道响应,其响应为理想信道响应
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. ofdm_sym = zeros(N_subc, N_sym - N_syn_preamble , N_Rx_ant );
  7. if AddChFreq
  8.     
  9.     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
  10.     if (ChannelEffectTest == 0)
  11.         % 加信道响应
  12.         for n_r = 1:N_Rx_ant
  13.             for n_t = 1:N_Tx_ant
  14.                 ofdm_sym(:,:,n_r) = ofdm_sym(:,:,n_r) + pilot_added(:,:,n_t).*...
  15.                     H_freq(:,N_syn_preamble+1:N_sym,(n_r-1)*N_Tx_ant + n_t);
  16.             end
  17.         end
  18.         % 加高斯白噪
  19.         ofdm_sym = ofdm_sym + sqrt(var_noise)*( randn(N_subc, N_sym - N_syn_preamble , N_Rx_ant ) + ...
  20.             j*randn(N_subc, N_sym - N_syn_preamble , N_Rx_ant ));
  21.     end
  22.     
  23.     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
  24.     if (ChannelEffectTest == 1)
  25.         for n_r = 1:N_Rx_ant
  26.             for n_t = 1:N_Tx_ant
  27.                 ofdm_sym(:,:,n_r) = ofdm_sym(:,:,n_r) + pilot_added(:,:,n_t).*...
  28.                     H_freq(:,N_syn_preamble+1:N_sym,(n_r-1)*N_Tx_ant + n_t);
  29.             end
  30.         end
  31.         
  32.     end
  33.     
  34.     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
  35.     if (ChannelEffectTest == 2)
  36.         ofdm_sym = pilot_added + sqrt(var_noise)*( randn(N_subc, N_sym - N_syn_preamble , N_Rx_ant ) + ...
  37.             j*randn(N_subc, N_sym - N_syn_preamble , N_Rx_ant ));
  38.     end
  39.     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
  40.     
  41. else
  42.     ofdm_sym = pilot_added;
  43. end