Mictronics / ais-simulator

Create and transmit AIS frames via gnuradio toolchain and web application in browser. Provides a websocket to PDU message block to change frame content on runtime. Works in burst mode, a frame is send on change immediately, one time. Transmitter remains silent until next change event.
Other
31 stars 6 forks source link

AIS payload 168 bit or 256 bit - NRZI string #8

Open Mas313 opened 1 month ago

Mas313 commented 1 month ago

Hi, The Variable ID sentence in the grc file holds 168 bit payload but AIS specifications says it to be 256 bits.
My Questions for better understanding are following, might be everything is already there but i am not getting it.

  1. Does 168 bits contains encoded payload only or AVDM also encoded in these bits? if not then where AVDM is encoded?
  2. Where is the NRZI generator? since GMSK modulator for AIS requires bipolar (-1 , 1) NRZI values ?

Thanks

Mictronics commented 1 month ago

The entire frame, or TDMA slot, is 256 bit long, including preamble, crc, bit stuffing etc. Payload is 168 bit an holds all the AVDM data. NRZI encoder is in bitstring_to_frame_impl.cc, function void bitstring_to_frame_impl::nrz_to_nrzi(char *data, int length).

Mas313 commented 1 month ago

Thanks for the reply. I have observed that nrz_to_nrzi()function generates NRZI but not bipolar 1s and -1s its like 0s and 1s. Does't GMSK Mod needs 1 & -1 bits for GMSK waveform shaping to limit its bandwidth. Thanks

Mictronics commented 4 weeks ago

The GNURadio GMSK modulator expects packed unsigned bytes in (0, 1). Vector modulator expects unpacked signed bytes in (-1, 1). Packing for GMSK is done in void bitstring_to_frame_impl::byte_packing(char input_frame, unsigned char out_byte, unsigned int len).

Mas313 commented 4 weeks ago

Thanks for the reply. I have genrated nrzi data file as per your procedure/code and used gnuradio with plutosdr for gmsk generation 'GMSK Mod' block with file source connected. The result is not correct, might be i have done something wrong, the generated signal occupy more than 1 Mhz of bandwidth(used sdrsharp), For AIS bandwidthis to be within AIS limits within 15-25Khz for GMSK. Have you observed any such behaviour