91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-05
  • 語言: Matlab
  • 標簽: matlab??

資源簡介

DMT(離散多音頻調(diào)制)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

評論

共有 條評論