EE123: Digital Signal Processing


Fall, 2012

Slow-Scan TV over FM radio using software defined radio

Slow scan television is a method for transmitting still images. It is used mainly by amateur radio enthusiasts. While the old analog broadcast TV (NTSC) requires 6MHz bandwidth to transmit video and audio, SSTV uses a much narrow bandwidth of about 3KHz. Of course the transmission rates are much lower and take a few seconds to minutes to transmit.

Even though we are in the internet age, SSTV is still very active among amateurs. As an anecdote, SSTV was used to send images from space in the early days. In fact, the international space station astronauts still occasionally send images on amateur radio frequencies (145.8Mhz) using the SSTV protocol. You can visit, the ISS fan club webpage to see if the SSTV is active and when is the ISS going to be visible in your area. The task of this lab is to use the wide-band FM (WBFM) transmitter and the SDR you received and design a transceiver system for SSTV.

SSTV uses narrowband analog frequency modulation (NBFM) to transmit images. Brightness in the image is encoded as frequencies in the audio range (1500-2300Hz). Color images are achieved by transmitting green-blue-red signals sequentially. There are many modes of transmission for SSTV. Here we are going to use Martin M1, which is one of the most popular schemes to transmit SSTV. It is mostly popular in Europe. Because it is relatively straight forward we will use it here. With Martin M1 it takes 114 second to transmit a 256x320 pixel image. We will transmit the Martin M1 signal over broadcast FM radio using the WBFM transmitter, receive it on another computer using the SDR, demodulate it, and decode it to produce images.

There are several level of complications in the project which I will partly base the grade on. The minimum requirement to get a pass grade is to be able to demodulate the WBFM signal. The second is to be able to transmit a valid image coded with Martin M1. The third is an SSTV transceiver system. The fourth is “free-style” make-your-own modification to the Martin M1 method to achieve higher frame-rates. Beyond that, you can add many other layers of processing which I will mention towards the end of the document

You can work in pairs. The programming platform is up to you. Most students will probably would want to use Matlab, but other languages like python, java, C, and C are possible (and preferable if you are up for it!).


  1. Software:

    1. Functions to demodulate broadcast WBFM (mono)

    2. Functions to code Martin M1 SSTV signal of an input image.

    3. Functions to decode Martin M1 SSTV signal.

    4. Transmitter application

    5. Receiver application

    6. Documented code

  2. Up to 5 slides, 10 minute presentation on your system. This should include the description of the transceiver system, discussion on the design choices, parameters and results.

  3. Demonstration of the system

Evaluation criteria: (not by order of importance)

  1. Image quality of the transmission/reception

  2. Clarity of presentation

  3. Soundness of design choices

  4. Complexity of implementation

  5. Features in the application and processing

  6. Peer assessment score


WBFM demodulation:

Your FM transmitter modulates an audio input using frequency modulation. It's range is within US broadcast FM radio band 88.1-107.9Mhz. You can use the FM transmitter frequency at intervals of 100KHz, but I recommend using odd frequencies to minimize chances of interference with broadcast FM stations. The broadcast FM band is split into 200KHz slots. This is relatively a large bandwidth and therefore it is also called wideband FM as opposed to narrowband FM which can be as low as 5 Khz. The bandwidth of each channel is about 150KHz, though sidebands do leak outside of this range. In FM radio the information is encoded by modulating the frequency of the carrier,

 	y_c(t) = Acos left (2pi f_c t + 2pi Delta f int_0^t x(tau) dtau right )

Here, f_c is the carrier frequency, Delta f is the frequency deviation and x(t) is a normalized baseband signal.

The broadcast FM baseband signal, x(t), consists of mono (Left+Right) Channels from 30Hz to 15 KHz, a pilot signal at f_p=19 KHz, amplitude modulated Stereo (Left - Right) channels around 2cdot f_p =  38KHz. (See for more information). The baseband signal is:

  	x(t) = underbrace{(L+R)}_{mathrm{mono}} + underbrace{0.1 cdot cos(2pi f_p t)}_mathrm{pilot} +  underbrace{(L-R)cos(2pi (2f_p) t)}_mathrm{stereo}.

This is the spectrum of x(t):

Broadcast FM

Pre-emphasis and de-emphais: Both the mono and stereo signals are pre-emphasized using a single-pole high pass filter before modulation. This is because noise in FM modulation is larger for higher frequencies. By emphasizing the high frequency signal, we can improve the overall signal to noise ratio. It is likely that the your FM transmitter performs pre-emphasis. Because of the pre-emphasis, we must compensate in the receiver by filtering the demodulated signal with a single-pole low-pass filter with a cutoff frequency of 2122Hz.

Now, the SDR already demodulates by the carrier frequency f_c, so the samples you get are actually

 	y[n] = y(nT) = Aexp left ( j2pi Delta f int_0^{nT} x(tau) dtau right ),

where T is the sampling rate.

The demodulation can be done in the same way we did in the labs, or with other methods, such as: or,


  • Use a high sampling frequency > 900,000 Hz. The anti-aliasing filters at low sampling rates (like 240KHz) are not so good and will add distortions. In addition, a higher sampling rate reduces the quantization noise of the A/D, so you will get better SNR. However, if the processing is too slow due to the number of samples, a sampling rate of 240KHz, might be enough.

  • If you use high-rates, you can resample digitally to reduce computations.

  • Bandpass filter the signal prior to demodulation - make sure the filter is tight, but not filtering the FM signal.

  • Don't forget to de-emphasize the demodulated signal, low-pass filter it and resample it to the appropriate rate.


VIS code

All standard SSTV modes utilize a unique digital code that identifies the mode to a receiving system. The code is called the VIS, or Vertical Interval Signal code. Although the entire calibration header is often referred to as the “VIS code”, the code itself is only a part of it. The seven-bit code is transmitted least-significant- bit (LSB) first, and uses “even” parity. The code for Martin M1 is 44d (decimal).

The VIS packet is transmitted before the image information:

VIS code

The VIS packet consists of 300ms Leader tone at 1900Hz, 30ms break tone at 1200Hz, another Leader tone at 1900Hz, 30ms VIS start bit at 1200Hz, Seven 30ms bits where 1100Hz = “1” and 1300Hz = “0”, 30ms of parity bit where Even=1300Hz and Odd = 1100Hz, 30ms VIS stop bit at 1200Hz.

Martin M1 Mode:

The Martin M1 Mode is pretty straight-forward. It is based on FM modulation and encodes the intensity of the color components in frequency. The color mode is RGB with frequency range of 1500-2300Hz to in code the luminance. The line scan has 320 pixels and there are 256 lines. The scan sequence in each line consists of Green, Blue and then Red. Below is a diagram of Martin M1:

Martin M1

Each line starts with a T_s=4.862ms sync pulse at 1200Hz. It is followed by a T_1=0.572ms separator at 1500Hz, a T_g=146.432 (0.4576ms/pixel) Green scan at 1500-2300Hz, a T_1=0.572ms separator at 1500Hz, a T_b=146.432 Blue scan at 1500-2300Hz, a T_1=0.572ms separator at 1500Hz, a T_r=146.432 Red scan at 1500-2300Hz and a final T_1=0.572ms separator at 1500Hz. The total transmission is therefore 114.3 seconds.

Specs and Tips On modulator:

  • Your encoding function should generate a valid VIS packet and Martin M1 data

  • It is recommended that you first construct a signal of frequencies and then modulate using continuous phase:

 	s(t) = cosleft(2pi f_c t + 2pi  int_{-infty}^t Delta f(tau)dtauright) label{fsk_sig}
  • Use a sampling rate of at least 48Khz to construct the message to minimize offsets due to the fact that the intervals lengths in time are not integer multiples of the sampling rate. You can construct the signal at a high sampling rate and then resample so you can play it on your sound card.

  • Make sure your volume is between 12-34th to not saturate the FM transmitter.

  • Debug at every point.

  • Suggestion: Install an application for SSTV (multimode for macs, plenty more for windows and linux) and play a coded image to test your coding. There's even an iPhone app!

Specs and Tips On Decoder:

  • You must decode the VIS packet and check for the 44d code.

  • It is recommended that you use the sync pulses for synchronization between scan lines - this way if you missed the beginning of the packet you can still reconstruct an image. It will also help if the clocks on the transmitter and the clock on the receiver have an offset.

  • Use appropriate filtering

  • The FM modulation can be demodulated by taking the derivative of the (one sided signal) phase. It can also be decoded with other methods. Each method will have different sensitivity to noise. See: Some thought on “Real-Time” SSTV processing

Transmit and Receive Applications Once you have debugged all the above and you are convinced they work, you will need to develop two simple applications. These will provide a user interface and display for transmitting and receiving images.

Specs and Tips on the Transmitter

  • The transmitter application should continuously transmit an image. The image can be chosen in advance, it can be the same image over and over, or can be acquired from your laptop's webcam. Matlab has an interface for taking snapshots from your webcam. Try help on videoinput and getsnapshot functions. Be aware that the size of the images can vary, so you will need to resize if necessary. Also, the color scheme may not be RGB. In that case you can use the function ycbcr2rgb.

  • A GUI is encouraged, but not necessary.

Specs and Tips On Receiver

  • Receiver should always be listening for a transmission

  • It should start automatically when a transmission is detected

  • It is recommended that you incrementally display the received lines as they arrive.

  • The receiver application should be able to choose the center frequency – you can use the GUI example for the first lab as reference. In the same application GUI you can display the received image.

  • I expect people to send images to each other during the presentation day on various frequencies!

  • If you are planning on displaying real-time result as the image is received I recommend that you use internal buffering. Getting data from the SDR for a short time has an overhead. Try to get data for several seconds and then use it for processing. Once data is exhausted, get a fee more seconds.

  • Continuity of processing: Each filter, decimator etc, has boundary effects. It is better that you use processing on overlapping sections - similarly to overlap and save where you use overlapped data for processing and save only the valid signal.

General Tips

  • Test your transmitter!

  • Make sure the frequency you are using does not have interference.

  • Work in a room away from windows as much as possible to reduce chances of interference.

  • Make sure that you are not over saturating your SDR – don't transmit too close.

  • Make sure the volume of the computer is set to half the maximum volume to avoid saturating the transmitter.

Useful Links:

Beyond…..Faster SSTV? There are many possible extensions:

  • Filtering and processing of the image to improve quality and reduce artifacts.

  • The bandwidth of WBFM is much wider than for amateur radio. It is possible to send the data much faster by using more bandwidth. You can redesign the specs in order to transmit at much higher frame rates.

  • You can try to use the stereo channel of the transmitter to increase your bandwidth even further – This is tricky though!

  • you can also transmit sound in the available bandwidth.

  • Anything you like to do, just ask and I will approve.

please let me know if there are any problems.

-- Miki