# Simulate a simple multipath channel for OFDM Modulation test. MATLAB [closed]

Hi I need to simulate a simple multipath channel in matlab through which I can send my OFDM transmission signal, I want to test my OFDM receiver design. So far I have:

%% Passing through Channel
nIFFT = 4096;

% Create channel
channel = randn(1,nIFFT) + sqrt(-1)*randn(1,nIFFT);

% cext_data is the signal to be transmitted
after_channel = filter(channel, 1, cext_data);
wavwrite(after_channel,'ofdm_tx8khz.wav');


I get a warning when I run the transmitter:

Warning: Data clipped during write to file:ofdm_tx8khz.wav

and when I run the receiver I get:

Index exceeds matrix dimensions.

Error in ofdm_rx (line 26)

chunk2 = signal((s+nIFFT):(s+nIFFT+nCyclic-1));

I was really hoping someone could help me simulate a multipath channel for my OFDM program.

## closed as off-topic by Deve, Jim Clay, lennon310, Jason R, PhononMay 13 '14 at 3:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "General programming questions are off-topic here, but can be asked on Stack Overflow." – Deve, Jim Clay, lennon310, Jason R, Phonon
If this question can be reworded to fit the rules in the help center, please edit the question.

• Personally I don't like when people are using sqrt(-1) for imaginary unit. First of all MATLAB has in-built variables: i, (1i), j. Secondly, from mathematical point of view solution for $\sqrt{-1}$ is both: $i$ and $-i$. – jojek Apr 24 '14 at 11:58

after_channel = after_channel / max(abs(after_channel));
• Then normalize it: after_channel_norm = after_channel ./ max(abs(after_channel)) – Deve Apr 24 '14 at 12:37