# DAC implementation in OFDM

In an OFDM transmitter, after IFFT & CP block, a DAC block is used.Since the output of IFFT is complex, and the input to DAC should be an integer, how can we integrate the two blocks? I implemented OFDM (upto CP block) in MATLAB but I could not integrate DAC with it.

Regards Ehsan

• Is there any code available in matlab which can be used to convert 2-level digital signal(1 and -1) into analog? Jan 27, 2017 at 10:01

In a real system you actually need two DACs: one for the real part and one for the imaginary part. The implementation of the DAC model depends on what should be included in your simulation. There are two main aspects: quantization and pulse shaping.

1. Quantization - if quantization effects of the DAC should be modelled, the floating point output of IFFT/CP insertion has to be mapped to a discrete number of values. Quantization can, for example, be implemented by scaling and rounding. Say your DAC has a vertical resolution of 8 bit. Then the IFFT output signal should be scaled such, that its maximum value is 127. Afterwards the signal is rounded to integer numbers. Note that OFDM signals are often clipped before quantization to reduce quantization noise, especially for lower resolutions (1).
2. Pulse shaping - if a physical channel should be modeled (for example a wireless channel), the analog output of the DAC must be simulated. This is implemented by converting every input sample into an impulse that is weighted with the sample's value. In the simulation the impulse itself consists of $L$ samples, of course, that mimic the analog signal. $L$ is the oversampling factor (not to be confused with the OFDM oversampling that is achieved by zero padded subcarriers). The simplest impulse shape is a rectangle, i.e. every sample in the simulation is just repeated $L$ times.

If the channel model is very simple, for example an AWGN channel, DAC and ADC can be omitted. It really depends on how realistic the simulation model should be.

• Thanks for reply. It helped a lot. I actually want to study OFDM for wireless channel and want to integrate DAC block with IFFT/CP output. But I am not able to simulate DAC. I am not sure whether there is any inbuilt DAC block in SIMULINK or some available code in MATLAB. Apr 30, 2015 at 13:21
• "This is implemented by converting every input sample into an impulse that is weighted with the sample's value." By sample value do you mean real value or imaginary value or the magnitude of the complex sample. Apr 30, 2015 at 13:45
• @Ehsan: As I said in my answer you need two DACs: one takes the real part and the other takes the imaginary part.
– Deve
Apr 30, 2015 at 13:47