This is an attempt to use matlab to make a SSTV (Slow scan television) type program.
Amplitude modulation Mark one (image derivative generator)
Thorey of operation:
First a transmitting program will be used to take the grayscale image and import it as a indexed matrix. At this point the image is a n-by-m matrix with integer values of 0-15 which correspond to the pixel darkness, 15 being white. Then all the columns are arranged top to bottom to make a t-by-one matrix. Where t is, is the product of n and m. This matrix is read from top to bottom with wavplay, with a user inputted sampling rate. The matrix is received by the decoding program after the user inputs the image file dimensions. These dimensions are used by rx.m to determine the length of time which it will receive and record audio for. In addition the user must input the sampling rate of the signal.
Obstacles:
There are two issues with the program. The first problem was that due to the simplicity of the transmit and receive programs we lacked sync tones. These tones would have been used at the beginning and end of each line of resolution to synchronize the transmitter to the receiver. Since we did not use these tones we relied on the transmitter and receiver computers having the exact same frequency stability. Most computers are close to each other however the difference between my Pentium four laptop and Alex's AMD desktop was 49 Hz. This is clearly seen in picture one as a slanted image. Adjusting the transmitting sampling rate up or the receive sampling rate down 49 Hz solved this problem.
There is also a fundamental issue with the transmitter. If the images are inspected you can see that they are not the original image, but rather a derivative, or outline of the image. In other words the received image is actually a picture of the change in the brightness. In this way you only see a line on the image if a dark region passes by a light region. I determined this is a function of the nature of the speaker and the nature of sound itself. For example, a string of values for one segment of the output string has values of 14, 13, 12, 13. If transmitted, these values would move the speaker to 14, then the next value which should be another fairly bright pixel, 13 would play. However the speaker would only move one unit to get to 13, this would actually correspond to a value of 1 (14-13=1). One is a rather small value, in fact it is almost black, when in fact the true value of this pixel is 13, which is white. To deal with this problem I determined we have to make every other value in the output matrix negative. In this way we would have the total value of each pixel rather than the change between pixels. Alex wrote a 'for' loop to do this, however matlab takes a very long time (20 minutes) to multiply every other value by negative one. In addition we may need to make changes to the receiving program.
Receiving program
Transmitting program |
 |