Objectmix
Tags Register Mark Forums Read

Automatic Identification System CRC-CCITT : DSP

This is a discussion on Automatic Identification System CRC-CCITT within the DSP forums in Other Technologies category; I have GMSK-demodulated an AIS-burst (ship navigation system), dediffed it, and removed bitstuffing zeroes. AIS is transmitted in a HDLC-frame. The resulting dataframe looks like this: _________________________________ 01111110 --> Start symbol 0000100000000000101110010111000000 ---> Data... 1010101011111011101110110011000111 0101001111100110000010001101011110 1100010000110001101110110010000001 00000011100000000000001100011000 1110100000011111 --> Checksum 01111110 --> Stop symbol _______________________________ My problem is that when I try to calculate the Cyclic Redundancy Check, it does not seem to be correct with any of the bursts I collect, even if they are very strong and very clear. My calculation gives a CRC value of 0xe5cc on this frame. I assume that it uses a CRC-16-CCITT ...


Object Mix > Other Technologies > DSP > Automatic Identification System CRC-CCITT

Reply

 

LinkBack Thread Tools
  #1  
Old 07-06-2007, 03:58 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Automatic Identification System CRC-CCITT

I have GMSK-demodulated an AIS-burst (ship navigation system), dediffed
it, and removed bitstuffing zeroes. AIS is transmitted in a HDLC-frame.
The resulting dataframe looks like this:

_________________________________
01111110 --> Start symbol
0000100000000000101110010111000000 ---> Data...
1010101011111011101110110011000111
0101001111100110000010001101011110
1100010000110001101110110010000001
00000011100000000000001100011000
1110100000011111 --> Checksum
01111110 --> Stop symbol
_______________________________


My problem is that when I try to calculate the Cyclic Redundancy Check, it
does not seem to be correct with any of the bursts I collect, even if they
are very strong and very clear. My calculation gives a CRC value of
0xe5cc on this frame. I assume that it uses a CRC-16-CCITT like other
HDLC-frames. Anyone have any suggestions about what may be wrong? Could it
be that I have done something wrong in the demodulation steps? Have I
missed something, or is simply my CRC-calculation method wrong? I have
been stuck too long with this problem.


Thanks!
  #2  
Old 07-07-2007, 02:19 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Automatic Identification System CRC-CCITT

On Fri, 06 Jul 2007 22:58:48 +0200, Ruben wrote:

> I have GMSK-demodulated an AIS-burst (ship navigation system), dediffed
> it, and removed bitstuffing zeroes. AIS is transmitted in a HDLC-frame.
> The resulting dataframe looks like this:
>
> _________________________________
> 01111110 --> Start symbol
> 0000100000000000101110010111000000 ---> Data...
> 1010101011111011101110110011000111
> 0101001111100110000010001101011110
> 1100010000110001101110110010000001
> 00000011100000000000001100011000
> 1110100000011111 --> Checksum
> 01111110 --> Stop symbol
> _______________________________
>
>
> My problem is that when I try to calculate the Cyclic Redundancy Check, it
> does not seem to be correct with any of the bursts I collect, even if they
> are very strong and very clear. My calculation gives a CRC value of
> 0xe5cc on this frame. I assume that it uses a CRC-16-CCITT like other
> HDLC-frames. Anyone have any suggestions about what may be wrong? Could it
> be that I have done something wrong in the demodulation steps? Have I
> missed something, or is simply my CRC-calculation method wrong? I have
> been stuck too long with this problem.
>
>

I know that AX.25, and I believe X.25 and HLDC, reverse the bit-order
of the checksum. This was a very sensible thing to do back in the day,
because it simplified the hardware -- there was a way to feed the
checksum bits into the linear shift register that made the result come
out to zero for a 'good' packet.

Are you sure that's not happening here?

--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
  #3  
Old 07-07-2007, 04:06 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Automatic Identification System CRC-CCITT

Ruben wrote:
> I have GMSK-demodulated an AIS-burst (ship navigation system), dediffed
> it, and removed bitstuffing zeroes. AIS is transmitted in a HDLC-frame.
> The resulting dataframe looks like this:
>
> _________________________________
> 01111110 --> Start symbol
> 0000100000000000101110010111000000 ---> Data...
> 1010101011111011101110110011000111
> 0101001111100110000010001101011110
> 1100010000110001101110110010000001
> 00000011100000000000001100011000
> 1110100000011111 --> Checksum
> 01111110 --> Stop symbol
> _______________________________
>
>
> My problem is that when I try to calculate the Cyclic Redundancy Check, it
> does not seem to be correct with any of the bursts I collect, even if they
> are very strong and very clear. My calculation gives a CRC value of
> 0xe5cc on this frame. I assume that it uses a CRC-16-CCITT like other
> HDLC-frames. Anyone have any suggestions about what may be wrong? Could it
> be that I have done something wrong in the demodulation steps? Have I
> missed something, or is simply my CRC-calculation method wrong? I have
> been stuck too long with this problem.


I just pumped that message through the ITU-16 CRC algorithm, and it is
correct. The test code I threw together is at
http://www.soft-switch.org/crc_test.c

Steve
  #4  
Old 07-09-2007, 11:25 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Automatic Identification System CRC-CCITT

On Fri, 06 Jul 2007 22:58:48 +0200, Ruben wrote:

> I have GMSK-demodulated an AIS-burst (ship navigation system), dediffed
> it, and removed bitstuffing zeroes. AIS is transmitted in a HDLC-frame.
> The resulting dataframe looks like this:
>
> _________________________________
> 01111110 --> Start symbol
> 0000100000000000101110010111000000 ---> Data...
> 1010101011111011101110110011000111
> 0101001111100110000010001101011110
> 1100010000110001101110110010000001
> 00000011100000000000001100011000
> 1110100000011111 --> Checksum
> 01111110 --> Stop symbol
> _______________________________
>
>
> My problem is that when I try to calculate the Cyclic Redundancy Check, it
> does not seem to be correct with any of the bursts I collect, even if they
> are very strong and very clear. My calculation gives a CRC value of
> 0xe5cc on this frame. I assume that it uses a CRC-16-CCITT like other
> HDLC-frames. Anyone have any suggestions about what may be wrong? Could it
> be that I have done something wrong in the demodulation steps? Have I
> missed something, or is simply my CRC-calculation method wrong? I have
> been stuck too long with this problem.
>
>
> Thanks!


Thank you both! It works correctly now.

I did not know that the bits in
each byte in the HDLC frame where ordered least significant bit first,
while the bytes where ordered most significant byte first. That was not
what I expected. I think I tried everything except this case.. reversing
the whole bitstream, bytes as LSB and bits as MSb etc.

Ruben

  #5  
Old 03-16-2009, 06:19 PM
Junior Member
 
Join Date: Mar 2009
Posts: 1
sghuffar is on a distinguished road
Default Re: Automatic Identification System CRC-CCITT

Hi Ruben
Can you please tell me how did u got the correct CRC bytes
I have used two online calculators and one code but they dont give the same bytes
I have reversed the bits as well and new array of data is
%10%00%9D%0E%54%7D%77%33%AE%7C%06%B1%DE%08%63%37%81%C0%01%C0%18
% is used to separate hex value
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
Re: Blind System Identification usenet DSP 2 10-19-2007 07:47 AM
Re: system identification miso models usenet labview 0 08-22-2007 10:10 AM
How much data is needed for blind system identification? usenet DSP 3 06-29-2007 09:54 AM
Re: Blind System Identification, Estimate order FIRs usenet DSP 0 06-21-2007 03:04 AM
Automatic Identification of Transfer btwn Accounts usenet Microsoft Money 0 01-11-2004 12:00 AM


All times are GMT -5. The time now is 01:04 AM.

Managed by Infnx Pvt Ltd.