www.gusucode.com > OFDM_16QAM系统仿真源码程序 > OFDM_16QAM系统仿真源码程序/code/ry_time_to_fre.m

    
function [fre_sym,pilot_sym] = ry_time_to_fre(time_sig, N_SPF,channel_time)

% Convert the time signal to frequency symbols by FFT, Channel equalization and extract pilot symbols

OFDM_sig = reshape(time_sig, 64+16,N_SPF);         % Reshape the received time signal to OFDM symbols,64 is FFT length,16 length of cyclic prefix
OFDM_sig = OFDM_sig(17:64+16,:);                   % Remove the cyclic prefix
OFDM_sig = OFDM_sig.';
channel_fre = fft(channel_time,64);                % Channel estimation 
% channel_fre = channel_fre';
for m = 1:N_SPF
    temp_sig = OFDM_sig(m,:);                      % Received time signal of the mth OFDM symbol 
    temp_sym = fft(temp_sig)/sqrt(64);             % FFT to convert the time signal to frequency symbols
    temp_sym = temp_sym./channel_fre;              % Channel equalization
    % Extract the information symbols and pilot symbols %
    fre_sym(m,:) = [temp_sym(39:43),temp_sym(45:57),temp_sym(59:64),temp_sym(2:7),temp_sym(9:21),temp_sym(23:27)];
    pilot_sym(m,:) = [temp_sym(44),temp_sym(58),temp_sym(8),temp_sym(22)];
end

fre_sym = fre_sym.';
fre_sym = fre_sym(:).';                            % Parallel to serial conversion