The Optical Transmitter.

The function of the optical transmitter is to take an electronic input signal and turn it into an optical output. The following diagram breaks such a device down into its constituent parts:

Previously we discussed the generation of an input signal, paying particular attention to a digital one. Whether the signal is digital or analogue we will still need a driver for the light source. In a digital system, the job of the light source is to switch on and off or between set levels of power rapidly. Depending on the level of complexity and encoding used we may now need a counter/timer circuit, some logic gates and probably an operational amplifier or two. If more than one stream of communication is desired we will also need a multiplexer.

If analogue is the required system, then the power of the light source increases or decreases in line with the modulation. It may well be that all we need is a simple linear amplifier.
The light source may be as simple as an incandescent bulb, but is more likely to be an LED, Burrus diode or in high quality systems an injection laser as the light produced from such is more coherent (i.e focussed on a narrower beam and therefore has more power at the centre of the beam).
A note: analogue systems may suffer from decay over too long a run, over which noise may be picked up. Digital signals can be restored, analogue cannot.
So the electronic signal controls the driver, which in turn controls the light source, which gives an output through a lens. The only remaining question is what function does that lens perform?
Although it is possible to butt-joint cables together, when interfacing with other components it is far more preferable to use a pair of lenses to couple the cable and device. This is especially important in consumer units where the need to move the device periodically may call for the cable to be removed- the repeatability (that is how many times a successful connection made be made at one attempt) of coupling is greatly improved. We use a collimating lens as shown below:

The lens causes the beam, and with it the modulation, to expand, and passing it on to a similar lens placed the other way round will cause the beam to contract and focus on the core of the cable. Losses will be made by Fresnel reflection but it is easier to couple a large lens measured in millimetres than a small core measured in micrometres.