kamalmostafa / minimodem

general-purpose software audio FSK modem
http://www.whence.com/minimodem
Other
837 stars 111 forks source link

V.21 frequencies are off. #42

Closed jboone closed 3 years ago

jboone commented 4 years ago

I was decoding a V.21 300-baud modem conversation recently and wasn't having much luck. I noticed that the frequencies for V.21 are a bit off:

https://github.com/kamalmostafa/minimodem/blob/9a1e8769ab15623fc27850fa41452201e8e40566/src/minimodem.c#L889-L899

The V.21 recommendation uses 1080Hz +/- 100, which would give 1180 for a mark frequency and 980 for space frequency. So bfsk_mark_f should be 1180 Hz for V.21.

I would make the change and submit a pull request, but since there's no way I can see through command-line options to choose between Bell 103 and V.21 (aside from setting --mark and --space explicitly), some bigger decisions need to be made about how to distinguish the two.

kamalmostafa commented 3 years ago

If someone wants to implement it, I'd be willing to merge a new "baudmode" which would set those mark/space freqs and 300 baud e.g. minimodem --tx V.21 versus minimodem --tx 300.

kamalmostafa commented 3 years ago

@jboone By my reading of the V.21 recommendation the mark and space frequencies (for 'channel No. 1') are the inverse of those in your comment. So I've implemented baudmode v.21, equivalent to 300 --mark 980 --space 1180.

Can you verify that this actually works with a real-world V.21 signal? (You could build from source and try minimodem --rx v.21 or just test with those equivalent parameters.)