Plain Old Telephone Service (POTS) Simulator


Value in dB. Approximate. Lower is noisier. Default: 30.

Accepts integers. Leave blank for random seed.

  • 32 MB maximum
  • 44.1 kHz sample rate (blindly assumed for all input formats: if yours is different, the filter will given strange results

WAV

  • File must end with .wav
  • Mono/1-channel
  • 16-bit linear

Text

  • File must end with .txt
  • One number per line (they will be normalized and quantized to 16-bit)

JSON

  • POST an object with a "data" field containing a 1-D array of numbers to /pots/json. Optional fields:
    • "snr" can take a number (in dB) to control the signal to noise ratio (default: 30)
    • "seed" can take a number to fix the PRNG seed
  • Reply is an object with a "data" field which hopefully has what you want.
    • "seed" is also provided for repeatability
  • Same format as input (WAV, text or JSON)
  • Input signal band-pass filtered to approximately 300 Hz to 3400 Hz. (See Bode plot below and/or coefficients for details)
    • FIR filters are used so phase delay is non-linear.
  • Band-limited white noise added at specified level.
  • Identical length/number of samples as input.

SNR of about 30 dB (somewhat realistic). Band-limited white noise, fixed seed.

Signal

Passband of roughly 300 to 3400 Hz with various rolloffs. The good-looking parameters I came up with are a combination of:

  • 2rd order Butterworth high-pass filter with 200 Hz knee
  • 2rd order Butterworth high-pass filter with 300 Hz knee
  • 8th order Chebyshev Type II low-pass filter with 3900 Hz knee and stop-band attenuation of 50 dB.
  • 2nd order Butterworth low-pass filter with 5000 Hz knee

Noise

White noise is also band-limited with a broader filter. Roughly −50 dB unfiltered noise will also be added to attempt to wash out the pass-band ripples.

  • 2rd order Butterworth high-pass filter with 300 Hz knee
  • 2th order Butterworth low-pass filter with 4000 Hz knee
  • 4th order Chebyshev Type II low-pass filter with 4500 Hz knee and stop-band attenuation of 20 dB.

Other stuff

  • Filter poles/zeros are converted into parameters for a bunch of serial biquad filters
  • Zero jitter (I don't think it matters relative to the noise/frequency bandwidth)
Fork me on GitHub