The windowed Fourier transform and its sampled version - the Gabor transform - are introduced. With the help of Gabor's signal expansion, an interpolation function is derived with which the windowed Fourier transform can be constructed from the Gabor transform. Using the Zak transform, it is shown that - at least in the case of integer oversampling - the Gabor transform can be represented in product form. Based on this product form, a coherent-optical system is presented with which the Gabor transform can be generated on a rectangular lattice in the output plane of the optical system. It is shown how the function in the output plane is related to the Gabor transform, and under what conditions this function resembles the windowed Fourier tra...