📄 ofdm_ldpc_sse2.lyx
字号:
Figure 8: Using Packed addition in program.\layout StandardOn the cnode side, 8 short integers are converted to 8 \emph on floats\emph default , 4 each in two xmm registers because there is no instruction for parallel divide of integers . lookup_tanh() of the messages is stored in the 3Dimensional array so that we don't need to call it again while calculating the message for vnode.\layout Standard\added_space_bottom bigskip vtomessage=lookup_atanh\begin_inset Formula $(\frac{product}{lookup\_ tanh(cmessage)})$\end_inset \layout Standard\align center \begin_inset Graphics filename cnode.fig scale 60 keepAspectRatio\end_inset \layout StandardFigure 9: Intermediate conversions between floats and integers for packed multiplication and division\layout StandardNow the division is also done parallely on each xmm register containing 4 \emph on floats\emph default each. Before sending the message to the vnodes the messages are converted back to short integers. We can see two chains of operations in Figure 9. We do the operations on the left and right chains in an interleaved manner i.e we do one operation on the left chain and then the same operation on the right chain. Like this, we can optimise a bit because the Pentium 4 processor can perform these operations parallelly as these operations are performed on different registers.\layout StandardWe also used SSE instructions which worked on aligned memory because it was faster. For this we ensured that all the memory we used was 16 byte aligned. This final code was working in 24 ms.\layout SubsectionOther Optimisations \layout StandardWe tried some other optimisations along the way. however these did not find a place in the final version of the program.\layout SubsubsectionLookup Tables for Log and Exp\layout StandardWe had made a lookup table for the exp function and used the same table for looking up the log also by doing a search amongst the values of the lookup table.\layout StandardThis was faster than the log/exp method and was fastest when we used only the lookup exp and the original log function because the lookup log was taking a lot of time, in fact sometimes more that the original math library log function.\layout StandardThe time taken by the program for decoding a 0.25 rate code with lookup exp and math log was 167 ms.\layout StandardHowever it was difficult to convert this method to short integers and so we abandoned it.\layout SubsubsectionStraight Line Approximation to tanh\layout StandardThe tanh function can be approximated by a straight line of slope near 1 and then it canbe made to saturate to 1 around \begin_inset Formula $\pm$\end_inset 0.9. This approximation however could not maintain the precision and so we couldn't use it in our final program.\layout SubsubsectionThe min Approximation\layout StandardAt high SNR, the method involving the tanh and atanh can be approximated by taking the minimum of the absolute of all the incoming messages. In this method no multiplication or division of messages needs to be carried out. This yields low probability of error for positive SNR for the code rate 0.25. We tried this but we couldn't get it to decode properly. This procedure may be considered for higher code rates which work at higher SNR range.\layout SubsectionUsage of the Code Generator \layout Standard\added_space_bottom medskip Because we were loading 8 short integers at a time in the xmm registers, we had to generate a new LDPC code in which the number of vnodes and cnodes of each degree are multiples of eight in order to avoid some check operations every time we loaded the xmm registers. We first made such a distribution by trying various permutations and in the process the number of vnodes dropped to 3992 from 4000 but the number of check nodes remained unchanged at 3000. So the rate of the code fell slightly from 0.25. The new degree distribution was as follows:\layout Standard\align center \begin_inset Tabular<lyxtabular version="3" rows="6" columns="3"><features><column alignment="center" valignment="top" leftline="true" width="0"><column alignment="center" valignment="top" leftline="true" width="0"><column alignment="center" valignment="top" leftline="true" rightline="true" width="0"><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardvdegree\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardno. of nodes\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standardpercentage(%)\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard2\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard2368\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard59.319\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard3\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard936\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard23.447\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard5\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard248\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard6.212\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard6\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard208\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard5.210\end_inset </cell></row><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard14\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard236\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard5.912\end_inset </cell></row></lyxtabular>\end_inset \layout Standard\align center \begin_inset Tabular<lyxtabular version="3" rows="3" columns="3"><features><column alignment="center" valignment="top" leftline="true" width="0"><column alignment="center" valignment="top" leftline="true" width="0"><column alignment="center" valignment="top" leftline="true" rightline="true" width="0"><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardcdegree\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standardno. of nodes\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standardpercentage(%)\end_inset </cell></row><row topline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard4\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard1672\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard55.733\end_inset </cell></row><row topline="true" bottomline="true"><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard5\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">\begin_inset Text\layout Standard1328\end_inset </cell><cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">\begin_inset Text\layout Standard44.267\end_inset </cell></row></lyxtabular>\end_inset \layout Standard\added_space_top smallskip We took the code generator/simulator program from Abdelaziz Amraoui of the LTHC lab and put this new degree distribution in the \begin_inset Quotes eld\end_inset param\begin_inset Quotes erd\end_inset file. We also had to set a parameter to indicate that a new graph has to be generated and specified the file name into which the new graph would be written. We also tested the performance of this new code using the simulator for different SNR's and found that this was working well. In order to use this new code in our program, we had to convert it to a suitable format and for this we used the \begin_inset Quotes eld\end_inset write\begin_inset Quotes erd\end_inset program in the \begin_inset Quotes eld\end_inset Main/Tools/LDPC\begin_inset Quotes erd\end_inset directory to write this file into an array format in \begin_inset Quotes eld\end_inset graphs.c\begin_inset Quotes erd\end_inset . We have plotted the performance of this new code along with the theoretically expected performance of a 0.25 code.\layout Standard\pagebreak_bottom \align left \begin_inset Graphics filename graphcomp.eps\end_inset \newline Figure 10: Performance of new code with respect to theoretical performance.\layout SectionApplications\layout SubsectionFFT module\layout StandardThe FFT module is being used for doing OFDM. It consists of an IFFT module in the sending chain to convert frequency domain samples to time domain samples, which are then sent on the channel after appropraite modulation. On the receiving side, FFT of the samples is taken. The output of the IFFT module gets scaled down by a factor which depends on the statistical nature of the input due to which the transmitter power falls. If the input is uniform and all samples are of amplitude A, then the IFFT output is an impulse of amplitude A. However when the input is random, the fall in amplitude is much more significant and one has to be careful because this can be a problem in the low SNR cases. So we have to put in appropriate amplification based on the input size in the IFFT module and deamplify the samples in the FFT module. The two graphs below show one slot of the OFDM-module in action. The data corresponds to transmission over air. The specifications of the system are:\layout Standard4-QAM\layout Standard256-FFT\layout Standard3 Mhz Bandwidth\layout Standard2.16 GHz Carrier\layout Standard9 FFT-blocks per slot\layout Standard\align center \begin_inset Graphics filename ofdm_complex.ps scale 65 keepAspectRatio\end_inset \layout Standard\align center Figure 11: OFDM reciever showing QPSK modulated output\layout Standard\align center \begin_inset Graphics filename ofdm_abs.ps scale 70 keepAspectRatio\end_inset \layout Standard\align center Figure 12: Magnitude of the OFDM receiver output.\layout StandardFigure 12 shows a periodic fluctuation of the signal which is due to the hardware. As can be clearly seen, there are 9 FFT-blocks in the slot (9 repetitions of the pattern).\layout SubsectionLDPC module\layout Standard\added_space_bottom bigskip The LDPC module is being used to test the performance of various codes on the software radio platform. This helps in understanding the functionality of LDPC codes and their ability to attain channel capacity. \layout Standard\start_of_appendix \noun on Appendix\noun default :\layout StandardThe final version of FFT is in /home/ysrini/Main.fft/Modules/Signal/FFT\layout StandardThe final version of LDPC is in /home/ggupta/Main/Modules/Coding/LDPC.optimizealigned\layout StandardThe additional files in LDPC which we have created are :\layout Standard1. lookup.h and lookup.c - These files contain the lookup tables for tanh and arctanh. These also contain the functions lookup_tanh() and lookup_atanh() which can be used to use these lookup tables.\layout Standard2. sse2mmx.h and sse2mmx.c - These files contain SSE2 code which basically consists of MMX instructions that have been adapted to work on 128 bit SSE2 registers. \the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -