root/ResearchApps/PHY/MIMO_OFDM/Alamouti/CRC_table_gen.m

Revision 527, 413 bytes (checked in by murphpo, 19 months ago)

Adding Alamouti version of MIMO OFDM model

Line 
1function CRC_Table = CRC_table_gen(CRCPolynomial)
2
3%Based on the C code example at:
4%http://www.packet.cc/files/CRC32-code.html
5
6
7crc_accum = 0;
8for n=0:255
9        crc_accum = bitshift(n,24,32); %(unsigned long)(i<<24)
10       
11        for m=0:7
12                x = bitshift(crc_accum,1,32);
13                if(crc_accum >= 2^31)
14                        crc_accum = bitxor(x,CRCPolynomial);
15                else
16                        crc_accum = x;
17                end
18        end
19
20        CRC_Table(n+1) = crc_accum;
21end
Note: See TracBrowser for help on using the browser.