datarate802.16
上传用户:hzie11
上传日期:2013-10-07
资源大小:1487k
文件大小:1k
- #!/bin/bash
- # Bash file to run datarate simulations for different modulation and cyclic prefix
- # @author rouil
- if [ "$1" == "clean" ]; then
- rm -r res_datarate
- else
- mkdir res_datarate
- cd res_datarate
- for modulation in "OFDM_BPSK_1_2" "OFDM_QPSK_1_2" "OFDM_QPSK_3_4" "OFDM_16QAM_1_2" "OFDM_16QAM_3_4" "OFDM_64QAM_2_3" "OFDM_64QAM_3_4" ; do
-
- if [ "$1" != "" ]; then
- modulation=$1
- fi
- mkdir $modulation
- cd $modulation
- for cp in "0" "0.03125" "0.0625" "0.125" "0.25"; do
- mkdir cp_$cp
- cd cp_$cp
- echo -n "Running for modulation" $modulation " and CP="$cp
- ns ../../../datarate.tcl $modulation $cp &> log.t
-
- DATARATE=`grep ^r out.res|grep "1 0 cbr"|awk 'BEGIN{first=-1; last=-1} {if (first==-1) {first=$2}; last=$2; i+=$6-0;} END {print (8*i/(last-first))}'`
- echo " datarate = " $DATARATE
- echo $modulation $cp $DATARATE >>../../result$modulation.dat
- echo $modulation $cp $DATARATE >>../../result.dat
- #rm out.res
- #rm log.t
- cd ..
- done
- cd ..
- if [ "$1" != "" ]; then
- break
- fi
- done
- cd ..
- gnuplot plot-datarate
- fi