资源简介
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
- 基线解算的matlab源码
- 基于相位相关的图像平移检测算法m
- 指静脉处理代码
- SIMPLE算法Matlab代码
- 《无人驾驶车辆模型预测控制》书中
- 基于SIFT特征的图像配准MATLAB代码
- 多目标遗传算法matlab程序
- 布谷鸟算法的matlab代码
- MATLAB+背景减除目标检测+鱼头截取
- matlab实现文件读写波形处理,小波变
- RBF神经网络的训练 MATLAB源程序代码
- SMO_matlabfunction.rar
- agent蜂拥的实现matlab
- 如何自定义一个神经网络
- 万有引力搜索算法(Matlab)
- 标准差分进化算法多目标线性规划的
- matlab完整GUI 源程序免费
- matlab神经网络资料
- matlab,深度图转换三维点云,depthma
- matlab生成ply程序
- 测井曲线的MATLAB绘制
- 最大后验实现图像盲复原
- 小波变换 matlab程序
- SVM用于故障诊断的实现
- 基于遗传算法的投影寻踪模型Matlab源
- labview matlab 小波去噪
- 自适应控制算法-matlab编程实现
- 油位计仪表盘识别matlab代码实现
- 罚函数matlab实现
评论
共有 条评论