资源简介
DMT(离散多音频调制)matlab代码
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SIMULATION OF A DMT SYSTEM %%%%%%%%%%%%%%%%%%%
%% This program starts off with assigning the number of bits to each subchannel
% (bit-loading)in the DMT system. Since the SNR of each subchannel is unavailable
% this allocation is done in a random manner.
% A random data is generated for transmission through each sub-channel.
% Constellation Encoding and Decoding were done with the help of a piece
% of code available on the Internet.
% Y. SRIRAJA DEC 2001
clear all;
clc;close all;
% For each of N channels assign no. of bits and genration of the data stream
% such that sum of all (bits/subchannel) = the data length.
N=32; %No. of sub-channels
v=5; % Cyclic prefix length
h1=[1 0.5 0.3 0.2 -0.1 0.02 0.05 0.08 0.01]; % channel impulse response.
k=input(‘1 Ideal Channel\n 2 Channel with length v+1 \n 3 Channel with length greater than v+1 \n‘);
if k==1
h=[1];
elseif k==2
h=h1(1:6);
elseif k==3
h=h1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Bit Allocation and data generation %%%%%%%%%%%%%%%%%%%%%
for i=1:N-1
%Since the SNR of each subchannel is unknown bit loading is random
bit_channel(i)=ceil(rand*15);
end
bar(bit_channel‘w‘);
title(‘Bit Distribution‘);
xlabel(‘Channel Number‘);
ylabel(‘bits/channel‘);
fprintf(‘Press Enter to continue‘)
pause
clc
% Data assignment in each channel
for i=1:N-1
data_channel=[];
% data_channel is the particular data assigned to the subchannel.
for j=1:bit_channel(i)
val=round(rand);
data_channel=[data_channel val];
end
% data conatains all the data_channel values.
data{i}=data_channel;
end
clear i j;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% CONSTELLATION ENCODING %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Calculate the intersymbol spacing (based on a transmit
% symbol energy of 1).
for i=1:N-1
d = sqrt (6/((2^bit_channel(i))-1));
% The number of bits sent to the top and bottom DACs
bits_top = ceil(bit_channel(i)/2);
bits_bot = floor(bit_channel(i)/2);
% The actual binary data sent to the top and bottom DACs
data_top = [data{i}(1:bits_top)];
data_bot = [data{i}(bits_top+1:bit_channel(i))];
% The decimal value of the data at the top and bottom DACs
v_top = sum(data_top(1:bits_top).*(2.^(0:(bits_top-1))));
v_bot = sum(data_bot(1:bits_bot).*(2.^(0:(bits_bot-1))));
% The output values of the top and bottom DACs
d_top =(v_top*d)-(((2^bits_top-1)/2)*d);
d_bot =(v_bot*d)-(((2^bits_bot- 1)/2)*d);
% Since the top DAC output is the amplitude of the cosine wave
% and the bottom DAC output is the amplitude of the sine wave
% we can consider them to be the inphase and quadrature
% components of the complex QAM symbol.
i_comp(i)=d_top;
q_comp(i)=d_bot;
complex_symbol
- 上一篇:卷积码 编码 译码 MATLAB程序
- 下一篇:LMS基本理论matlab
相关资源
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
- matlab程序用Hopfield网络解决TSP
- 实例matlab 编程100个常用程序
- 用MATLAB(BPSK仿真 直接扩频)
评论
共有 条评论