通过MATLAB实现OFDM的信息传送,对不同的调制方式进行了测试。
clear all
close all
clc
%% simulation parameters
%modulation method: BPSK, QPSK, SPSK, 16QAM, 32QAM, 64QAM
mod_method = 'QPSK';
% IFFT/FFT size
n_fft = 64;
%size of cyclic prefix extension
n_cpe = 16;
%target SNR (dB)
snr = 20;
%number of channel taps (1 == no channel)
n_taps = 8;
%channel estimation method: none, LS
ch_est_method = 'LS';
%option to save plot to file
save_file = 0;
%calculate modulation order from modulation method
mod_methods = {'BPSK', 'QPSK', '8PSK', '16QAM', '32QAM', '64QAM'};
mod_order = find (ismember (mod_methods, mod_method));
%% input data do binary stream
im = imread('slika.bmp');
im_bin = dec2bin(im(:))';
im_bin = im_bin(:);
%% binary stream to symbols
%parse binary stream into mod_order bit symbols
%pads input signal to appropriate length
sym_rem = mod( mod_or