资源简介
ofdm的简单仿真matlab程序,里面画出了9格图可以更好的理解ofdm
代码片段和文件信息
%--------1---------2---------3---------4---------5---------6---------7---------8
% OFDM Simulation
clear all;
close all;
% Basic OFDM system parameters
fprintf (‘OFDM Analysis Program\n\n‘);
defaults = input(‘To use default parameters input “1“ otherwise input “0“: ‘);
if defaults == 1
IFFT_bin_length = 1024; % IFFT bin count for Tx FFT bin count for Rx
carrier_count = 200; % number of carriers
bits_per_symbol = 2; % bits per symbol 00011011
symbols_per_carrier = 50; % symbols per carrier
SNR = 10; % channel signal to noise ratio (dB)
else
IFFT_bin_length = input(‘IFFT bin length = ‘);
carrier_count = input(‘carrier count = ‘);
bits_per_symbol = input(‘bits per symbol = ‘);
symbols_per_carrier = input(‘symbols per carrier =‘);
SNR = input(‘SNR = ‘);
end
% Derived parameters
baseband_out_length = carrier_count * symbols_per_carrier * bits_per_symbol; % 20000
carriers = (1:carrier_count) + (floor(IFFT_bin_length/4) - floor(carrier_count/2))% 从157-356共200个子载波
conjugate_carriers = IFFT_bin_length - carriers + 2; % 从869-670共200个子载波
% carriers 和 conjugate_carriers 是关于第513号载波对称的
%--------1---------2---------3---------4---------5---------6---------7---------8
% TRANSMIT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
% Generate a random binary output signal:
% - a row of uniform random numbers (between 0 and 1) rounded to 0 or 1
% - this will be the baseband signal which is to be transmitted.
baseband_out = round(rand(1baseband_out_length)); % 20000个随机数,0、1
% Convert to ‘modulo N‘ integers where N = 2^bits_per_symbol
% - this defines how many states each symbol can represent
% - first make a matrix with each column representing consecutive bits
% from the input stream and the number of bits in a column equal to the
% number of bits per symbol
% - then for each column multiply each row value by the power of 2 that
% it represents and add all the rows
% - for example: input 0 1 1 0 0 0 1 1 1 0
% bits_per_symbol = 2
% convert_matrix = 0 1 0 1 1
% 1 0 0 1 0
% modulo_baseband = 1 2 0 3 2
convert_matrix = reshape(baseband_out bits_per_symbol length(baseband_out)/bits_per_symbol); % 变成了一个2行10000列的矩阵
for k = 1:(length(baseband_out)/bits_per_symbol) % k=1:10000
modulo_baseband(k) = 0;
for i = 1:bits_per_symbol % i=1:2
modulo_baseband(k) = modulo_baseband(k) + convert_matrix(ik)*2^(bits_per_symbol-i);
end
end
% modulo_baseband 是一个1行10000列的向量,每个元素可能为[0,1,2,3]
%--------1---------2---------3---------4---------5---------6---------7---------8
% Serial to Parallel Conversion
% - convert the serial modulo N stream into a matrix where each column
% represents a carrier and each row represents a symbol
% - for example:
%
- 上一篇:mATlab自编理想低通滤波器
- 下一篇:matlab仿真中的T2F函数
相关资源
- matlab仿真中的T2F函数
- mATlab自编理想低通滤波器
- 计算均方误差MSE信噪比SNR峰值信噪比
- matlab共振峰的提取
- MATLAB粒子群算法PSO解决TSP51个城市问题
- atlas_Athlon.dll
- MATLAB 简易钢琴 源代码
- matlab求解差分方程程序
- matlab 读取O文件 百分百实用
- 三维天线方向图matlab源代码
- 基于MATLAB_Robotics工具箱的工业机器人
- 有关交织器的matlab程序
- matlab仿真计算光纤的色散和自相位调
- 基于matlab的物料大小分级算法的实现
- 关于MATLAB的LM算法原理
- 用MATLAB控制一个真实的机械臂
- 4R动机器人逆运动学—基于MATLAB
- Gabor的matlab程序,Gabor滤波是一种不错
- 基于NLMS和LMS算法实现回声消除matlab
- 最小资源分配网络MATLAB源码
- MATLAB 动态规划——源代码+详细注释
- 云模型的软件实现文件与具体实现的
- matlab代码实现卷积
- Prim算法 matlab
- Q-Learning算法 Matlab代码实现
- 基于遗传算法寻优的PID控制及MATLAB仿
- MATLAB中V-Blast的ZF和MMSE检测算法仿真代
- FCM目标检测代码
- 二维规划算法的MATLAB程序
- 基于MATLAB的循环频谱检测算法
评论
共有 条评论