資源描述:
《OFDM源程序及解析.doc》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、OFDM簡單實(shí)現(xiàn)%a_run_design.m文件setup%系統(tǒng)設(shè)置OFDM%OFDM調(diào)制方式Analysis%OFDM的收發(fā)數(shù)據(jù)及誤碼1setup%初始化部分%setupdisp(''),disp('------------------------------------------------------------')disp('SimulationSetup')%OFDMSetup-----------------------------------------------------------fft_size=128%shouldbeapowerof2fo
2、rfastcomputation%morepoints=moretimedomainsamples(smoother&morecycles)num_carriers=32%shouldbe<=fft_size/4%numberofcarriersusedforeachdatachunk%newvar-denotesevenspacingorvariationsofcarriersamongfftpointsinput_type=2;%1=testinputtest_input_type=1;%1=bitspecified(binary)binary_data=[0101
3、0101];%2=randomdatastream(samplesintherangeof0-255)num_symbols=9;%3=sinusoidalfrequency=2;num_samples=50;%2=externalfile'mywav.wav';%Nameofinputfilefile_input_type=3;%1=binary(notimplemented)%2=text%Demofile:'text.txt'%3=sound%Demofiles:'mywav.wav'%4=image(notimplemented)%ChannelSimulati
4、onParameters--------------------------------------------channel_on=1;%1=on,0=offclip_level=1.0;%0.0-1.0(0-100%)%Maxmagnitudeofthesignalis'clip_level'timesthefullmagnitudeofthesignalnoise_level=0.0;%0.0-1.0(0-100%)%Magnitudeofnoiseis'noise_level'timesthemagnitudeofthesignal%MultipathChann
5、elSimulation10%Gooddefaultswhenfft_size=128andnum_carriers=32:%d1=6;a1=0.30;d2=10;a2=0.25d1=6;%delayinunitsa1=0.30;%attenuationfactor-multipathsignalisx%ofsizeororiginalsignald2=10;%delayforsecondmultipathsignala2=0.25;%attenuationfactorforsecondmultipathsignal%******************TESTINPU
6、TSETUP-DONOTMODIFY**************************ifinput_type==1iftest_input_type==1%specifyBINARYinputbit-by-bitdata_in=binary_data;endiftest_input_type==2%randominputdefinedbyparametersnum_levels=255;%numberofpossiblelevelsofasymbol%mustbeintegerbetween1-255data_samples=round(rand(1,num_sym
7、bols)*(num_levels-1));data_in=zeros(1,8*length(data_samples));fori=1:length(data_samples)data_in(1+(i-1)*8:(i-1)*8+8)=eight2bin(data_samples(i));endendiftest_input_type==3%datastreamrepresentssinewavesamplest=linspace(0,1,num_symbols);%evenlyspacenumberofsamples%take8-bit