16

The Story

I don't possess any fax hardware, so its hard for me to communicate with people who have a fax noise answering on the phone. It is hard even to imagine that in 2012 people are still using devices that eat trees and paper for communication. So, I wanted to fax them an announcement that new era of internet, email and video conferencing has finally arrived.

http://xkcd.com/454/

The Problem

As I don't possess any fax hardware, the obvious and fastest choice would be to send a message through online services. From the other side fax hardware is basically a speaker, a microphone and a little bit of digital signal processing code. The only obvious problem is the code. The fax protocol is known - it should not be a problem to implement it even in Python, but so far I haven't seen any examples of using speaker+mic for faxing. The CPU performance is out of question - modern PC have sufficient power to calculate enough noises for 2400 bits/second. So the only technical explanation for this I have is that latency - (the time of noise to travel from mic to a DSP code and back to speaker) is so long that it disrupts the transmission.

Questions

If the above is true - what is the required latency for fax protocol?
Is there a tool to measure mic-speaker latency?
What else did I miss?
Is it possible to implement everything in Python?

P.S. I couldn't find anything when I looked into ITU (except that I've discovered that ITU looks for you)

anatoly techtonik
  • 19,847
  • 9
  • 124
  • 140
  • 1
    This question is amazing. I honestly wish every single question had this much background and thought in it. I love the fact you included a picture, this is one of the best questions I have ever read. – Jakob Bowyer Jun 12 '12 at 12:38
  • 3
    What you are describing is more or less what modem cards have been doing since a decade or two. They are actually softmodems, encoding stuff in software and posessing only simple hardware to modulate the signal onto the wire, without using an acoustic coupler ;) – mensi Jun 12 '12 at 12:41
  • 1
    The problem is likely not computational, see the wretched WinModem for handing off modem signal generation to the CPU from back when CPUs were *slow*. As soon as you say "speaker and mic for faxing" you've gotten into a physical problem of acoustic coupling for modems running at 14kbit/s. I've never seen anyone even try to jump that hurdle. – msw Jun 12 '12 at 12:41
  • Why not just write a program that will filter out the fax noise for you instead? – JAB Jun 12 '12 at 13:05
  • A low-end fax machine or faxmodem is going to be much, much, much, much, *much* cheaper than the time you'll spend trying to implement faxing via a mic and speaker. (eBay's current top result for "fax modem" is a USB unit for $12 including shipping!) – kindall Jun 12 '12 at 14:15
  • @JakobBowyer, thanks for the compliment, the image is from [xkcd](http://xkcd.com/454/). – anatoly techtonik Jun 14 '12 at 05:29
  • @mensi, nice catch! This `acoustic coupler` is exactly the missing component I am trying to rebuild with mic+speaker. Thanks to direct bus connection softmodems have a guaranteed very low latency from memory to wire. Unfortunately for PC audio there is no such guarantee. – anatoly techtonik Jun 14 '12 at 11:32
  • @techtonik: I'm not familiar with the protocols involved in fax but is latency really an issue? I'd assume you only need to be interactive for the handshake and everything past that is continuous data? – mensi Jun 14 '12 at 11:42
  • @msw, but is where the problem with faxing speed exactly? It may appear that the bottleneck is 44.1kHz sampling rate of audio signal, or a frequency distortion, or narrowing of frequency band, or the latency. I suspect that the answer requires a bit of specific knowledge, but there should be a knowledgeable person able to explain this in a few minutes (at least I hope so). =) – anatoly techtonik Jun 14 '12 at 11:45
  • @kindall, buying faxmodem sounds like a hack in this context. – anatoly techtonik Jun 14 '12 at 11:56
  • @techtonik: Your problem is "I don't have a faxmodem." How is buying a faxmodem a "hack" in this context? – kindall Jun 14 '12 at 15:06
  • @kindall: Software fax is a hack for the necessity to own (probably expensive) hardware. Buying (cheap) hardware cancels this idea, so it is the same type of hack. – anatoly techtonik Jun 15 '12 at 11:07
  • @techtonik IANAAudioEngineer but my gut feeling is that band-narrowing is the problem. ITU V.17 encoding is very complex in terms of phase shifting and you are trying to cram this down a 8kbit/s hard-limited µ-law channel designed for voice. The viscosity of air might prove a limiting factor if every other component was perfect. – msw Jun 15 '12 at 11:28

2 Answers2

2

Fabrice Bellard (yes, the QEMU and Javascript-PC-emulator guy, he's awesome ;) ) did some work on software modems. According to his project page, there is code for "soundcard interface" as well as modulation/demodulation of various protocols. I haven't looked at the source, but this might provide useful pieces. There is also the linmodems.org site with further pointers.

Linmodems.org links to some software by the late Tony Fisher, who seems to have had a complete implementation of the sending part of what you want to achieve, although for an ancient workstation. Have a look at the manpage.

Additionally, there is this post on the GNU radio mailinglists from 2003 of a guy that seems to want the same thing, although he didn't have xkcd to describe it back then ;)

mensi
  • 9,580
  • 2
  • 34
  • 43
  • Nice links. They can be useful for making a beeper for manual tests, but still they don't explain why there is no pure mic+speaker solution. I've got to the point that explaining time delays in V.21 protocol description would be a sufficient answer for this question. – anatoly techtonik Jun 14 '12 at 12:29
  • @techtonik Look at the last post from the thread in the GNU radio mailing lists, they hook up the phone line more or less directly to the soundcard. I guess you could also achieve the same with acoustic coupling, although with more losses & noise – mensi Jun 14 '12 at 12:32
  • I suspect at least part of the reason for no speaker/microphone setup is that the microphone cannot discern between its own signal being transmitted and the signal being received. That is, it only works half-duplex. You can't play a sound and record a _different_ sound simultaneously unless the speaker and microphone are sufficiently isolated from one another. – Nathan Jul 11 '13 at 12:05
1

Why reinvent things.

The code is available at http://www.hylafax.org/archive/2005-12/msg00120.php

dilip kumbham
  • 703
  • 6
  • 15
  • 1
    "Any modem that supports one of the standard interfaces for facsimile operation can be used". The problem is that I don't have modem. – anatoly techtonik Jun 12 '12 at 13:07