%DEMO_OFDM Demo of Gabor systems used for OFDM
% This demo shows how to use a Gabor Riesz basis for OFDM.
% We want to transmit a signal consisting of 0's and 1's through a
% noisy communication channel. This is accomplished in the following
% steps in the demo:
% 1) Convert this digital signal into complex valued coefficients by
% QAM modulation.
% 2) Construct the signal to be transmitted by an inverse Gabor
% transform of the complex coefficients
% 3) "Transmit" the signal by applying a spreading operator to the
% signal and adding white noise
% 4) Convert the received signal into noisy coefficients by a Gabor
% 5) Convert the noisy coefficients into bits by inverse QAM.
% Some simplifications used to make this demo simple:
% * We assume that the whole spectrum is available for transmission.
% * The window and its dual have full length support. This is not
% practical, because all data would have to be processed at once.
% Instead, an FIR should be used, with both the window and its dual
% having a short length.
% * The window is periodic. The data at the very end interferes with
% the data at the very beginning. A simple way to solve this is to
% transmit zeros at the beginning and at the end, to flush the system
% .. figure::
% Received coefficients.
% This figure shows the distribution in the complex plane of the
% received coefficients. If the channel was perfect, all the points
% should appear at the complex roots of unity (1,i,-1 and -i). This
% demo is random, so everytime it is run it produces a new plot, and
% the error rate may vary.
disp('Type "help demo_ofdm" to see a description of how this demo works.');
%% ----------- setup of signal and transmission system --------------------
% Number of channels to use
% Time-distance between succesive transmission. This must be
% larger than M, otherwise the symbols will interfere.
% Number of bits to transmit, must be divisable by 2*M
% Length (in samples) of transmitted signal.
% We choose an orthonormal window.
%% ----------- Setup of communication channel ---------------------------
% Larger means more random
% Rate of decay away from (1,1). Larger means smaller spread (faster decay).
% Noiselevel for the channel.
% Define the symbol of the spreading operator
% Make the symbol conserve real signals.
% Make sure that energy is conserved
%% ------------ Convert input data into analog signal -------------------
% Create a random stream of bits.
% QAM modulate it
% Create the signal to be tranmitted
% --- transmission of signal - influence of the channel ----------
% Apply the underspread operator.
% add white noise.
noise = ((randn(size(f))-.5)+i*(randn(size(f))-.5));
% --- reconstruction of received signal ------------------------
% Obtain the noisy coefficients from the transmitted signal
receivedcoefficients = dgt(f,g,a,M);
% Convert the analog signal to the digital coefficients by inverse QAM
%% --- visualization and print output -------------------------
% Plot the coefficients in the complex plane.
axis([-1 1 -1 1]);
% Test for errors.
disp('Number of faulty bits:');