Prosody data communications Protocols: FSK rx

FSK is 'frequency shift keying' which is a method of transmitting data using tones. Binary data is encoded by sending one of two tones for each bit, with one tone used for zero bits and another for one bits.

This protocol implements the receiver for FSK. Since it is only a receiver, it only uses the input half of a channel. Typically the output half is configured for FSK tx.

API function behaviour

This should be read in conjunction with the generic data communications documentation.

smdc_channel_config()

You must use #include "smdc_fsk.h" to get the appropriate declarations.

The protocol value is kSMDCProtocolFSKrx.

The config_data pointer must point to one of these structs:

	typedef struct smdc_fsk_config_parms {
		unsigned long speed;
		float mark_frequency;
		float space_frequency;
		unsigned long rx_carrier_on_mS;
		unsigned long rx_carrier_off_mS;
		unsigned long set_power;
		float user_power;
		unsigned long get_metric;
		unsigned long thresh_metric;
		unsigned long reverse_chan_filter;
	} SMDC_FSK_CONFIG_PARMS;

'speed' is the data rate in bits per second. Where supported by the firmware, fractional speeds may be specified by multiplying by 65536, e.g. 45.45 can by given as 2978909.

'mark_frequency' is the frequency, in Hz, of the tone used to encode mark ('1') bits.

'space_frequency' is the frequency, in Hz, of the tone used to encode space ('0') bits.

'rx_carrier_on_mS' is the minimum duration of carrier (in milliseconds) that should be recognised as valid.

'rx_carrier_off_mS' is the maximum duration of loss of carrier (in milliseconds) that will be tolerated before deciding that the carrier has gone.

'set_power' is not used and applies only to FSK transmission.

'user_power' is the is not used and applies only to FSK transmission.

'get_metric' if set non-zero requests a status indication of a measure of input signal is sent just prior to receiver sending finished status. This measure may be used by a subsequent complex modem to set an initial threshold value for its demodulation, or by subsequent FSK modem to filter out echos of FSK that it transmits (see thresh_metric)).

'thresh_metric' if set non-zero then this value is used as a threshold to allow FSK receiver to reject demodulation of initial signals that meet rx_carrier_on_mS criterea but whose power is so much less than that of a previous FSK signal that they must be echo of a transmission. To reject initial signals 12db weaker than previously demodulated FSK, set this value to the metric reported by kSMDCRxStatusSigMetric status divided by 16.

'reverse_chan_filter' if set non-zero applies a filter according to the value specified that is intended to filter out frequencies associated with echo of transmitted signal on opposing channel of full duplex FSK modem allowing more robust decoding. Normally only used with V.8 use of FSK where both V.21 channels can be simultaneously active.

reverse_chan_filter filter behaviour
1 Blocks frequencies associated with V.21 channel 2 (1650Hz and above)
2 Blocks frequencies associated with V.21 channel 1 (1180Hz and below)

This table shows values of these parameters for some standard FSK modems:

Standard speed mark space on_mS off_mS
V.21 Channel 1 300 980 1180 20..700 20..80
V.21 Channel 2 300 1650 1850 20..700 20..80
Bell 103 answering 300 1270 1070 ? ?
Bell 103 originating 300 2225 2025 ? ?
V.23 mode 2 1200 1300 2100 10..700 5..15
V.23 mode 1 600 1300 1700 10..700 5..15
V.23 back 75 390 450 0..80 15..80
Bell 202 1200 1200 2200 ? ?
Bell 202 back 75, 110, to 150 387 487 ? ?
V.18 Annex A 50 1400 1800 1 80

Note that for full duplex operation, V.21 channel 1 is the one used from the originator to the answering end, and channel 2 is used for the reverse direction. For half duplex, channel 2 is not used (at least, that's what the V.21 standard says, but fax machines complying with the T.30 standard use only channel 2).

There is also an alternative Bell 202 back channel which runs at 5 bps, but this uses a single carrier frequency of 387 Hz representing mark (1), with space (0) represented by no signal (so it's actually a continuous wave modem, not FSK).

This protocol can use these encodings: SYNC, ASYNC, and HDLC. Note that when using ASYNC encoding, the firmware module fskasyrx is used instead of asyrx, and when SYNC or HDLC encodings are used the firmware module fskpll is required in addition to the encoding module. Note that since an FSK signal contains no clock information, if SYNC or HDLC encodings are used, the data must contain enough transitions between the frequencies (i.e. no long runs of only zeros or only ones) to allow the receiver to keep locked onto the bit rate.

The firmware modules fskrx and inchan must have been downloaded.

smdc_line_control()

[note] not useful - receiver is always connected

smdc_line_status()

smdc_tx_status()

This function is not applicable since it only applies to the output half of a channel.

smdc_tx_control()

This function is not applicable since it only applies to the output half of a channel.

smdc_rx_status()

smdc_rx_control()

smdc_rx_data()

smdc_tx_data()

This function is not applicable since it only applies to the output half of a channel.