View Full Version : modem error correction
rjet
Jul 22, 2005, 03:04 PM
Hello,
I am building a simple 1200 baud modem for UAV telemetry that uses minimal parts. Just a PIC and a couple of capacitors. It is bidirectional as I want to transfer large data files and be able to remove radio noise from this file by implementing an error correction protocol.
It now transmits files of several kilobytes when a command byte is received, and I have broken the file down into small 8 byte packets that are each followed by a checksum byte to allow the ground station to identify packets that contain errors.
I am not very knowledgable about modems, but am considering having it request retransmission of each bad packet. Is there a better way to do this?
Mr.RC-CAM
Jul 22, 2005, 03:21 PM
If you have about 25K of code space available on the microcontroller, then embedded Kermit (an open source project) would be nice. But on a PIC, that would require an PIC18F part and some luck. :)
But, maybe there are some concepts you can borrow from the eKermit protocol:
http://www.columbia.edu/kermit/ek.html
RC-CAM
vintage1
Jul 22, 2005, 04:32 PM
There are dozens of ways to get error free transmission: Most rely on a back channel though - i.e. you need to send back an ACK or a NACK with a packet ID number to tell the sender that it was good/corrupted.
If its a one way street, best thing is to send it three times with a fairly complex checksum, and if two or more packets agree, and pass checksums, consider them valid.
Its not as though you are trying to achieve huge bandwidth, after all..
rjet
Jul 23, 2005, 03:24 PM
Thanks guys,
vintage1, I have a back channel setup. I like the idea of the packet ID number, and I think I will try to have the ground station send back a NACK command followed by a potentially long list of 16-bit packet addresses that have bad checksums to speed up the process.
RC-CAM, I am using a 16f628, but thanks for the link. I will try to read up on it.
vintage1
Jul 23, 2005, 05:51 PM
its all basic IP protocol.
It might be worth downloading one or two IP layer protocol RFC's and see how they did it.
Don't send back just NACK's - send ACK's as well and collect any missing ACKS and interpret as NACKS and retransmit those as well.
.
If you use fixed length packets you will be able to insert late data that was corrupted first time around in a large ring buffer and only spit out what is actually received and valid from the stream..
jfitter
Jul 24, 2005, 12:13 PM
Get hold of a book on radio data baseband processing and study it. TAPR (Tuscon Amateur Packet Radio Operators) have some very good publications and they are on the web too.
At a minimum you will need robust error detection. You will also need to provide error correction, and of course this is not much use if you do not include some form of data interleaving. Your packets will also need leaders to get the receiver data slicer tracking properly.
You must decide on your maximum acceptable corrected bit error rate and use your computed or measured uncorrected BER to determine what type of baseband processing you are going to perform.
It is possible to buy ready made modules that already perform all of the baseband processing described above including the special filtering you need for digital data transmission. Some of these modules have simple serial interfaces - spi, async, i2c etc. and this would be my reccomendation if you don't have the skills or the time to acquire them.
Don't be conned by armchair experts - digital data transmission, particularly by radio, is an exceedingly complex subject and even what appears to be the simplest task has a level of complexity beyond belief. Ask the experts if they have ever done what they talk about successfully, and then challenge them to prove it!!!
foofighter
Jul 26, 2005, 08:05 AM
- digital data transmission, particularly by radio, is an exceedingly complex subject and even what appears to be the simplest task has a level of complexity beyond belief.
Fair comment!
The radio channel will be mostly subject to occasional radom bit error plus burst errors. Therefore you need multiple coding to give you an FEC system to protect for both.
An example would be (for 8 bytes data)
- 8 byte data # Add 8 bit CRC
- Apply 12,8 short hamming correction to each 8 bits gives 108 bits total
- Interleave these through a 12 x 9 matrix
- Finally scramble the bits with a suitable scrambling polynomial (X7 + X5 + 1 for example)
The CRC+Hamming coding gives protection for the bit errors, the interleave gives protection for the burst errors and the overall (CRC+hamming+interleave+scramble) will give you several dB of coding gain at 1200Bd)
At least you wont have too much doppler at that bitrate!
rjet
Jul 27, 2005, 04:37 PM
Yes, it does seem complicated. I have transfered files over a short distance with no error correction - just plain FSK, and this makes me wonder how much of a difference various error correction methods make. I enjoy experimenting, so I may try a few of the methods you guys suggest.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.