File Exchange

image thumbnail

OFDM LSE Channel Estimation

version 1.0 (1.39 KB) by

the performance of LSE channel estimation will be evaluated based on bit error rate in received data

12 Ratings



View License

the comb pilot aided channel estimation in ofdm modulation is considered. the power of pilot subchannels is under the control.
The data experience frequency selective channel then the AWGN noise is added to make the situation worse. The bit error rate is ploted versus SNR.

Comments and Ratings (28)

jinah yeon


pls send me the built in functions that are being used really greatful to u , thanks in advance, pls mail me at

biandou Tang

could you plz send me the code? thank you sooooo much~


Dear Hamid Ramezani
I'm a student . I'm learning channel estimation ( Least Square and Direct-decision )
But i don't know about code it . .
Please share code of it to me .
Thank you so much

Preethi s

Can anyone send me the code regarding power allocation and relay selection in cooperative communication to my mail-id

Sugantha G

could you please send the simulation code for channel estimation for massive MIMO and my email



thank you a lot

gagan kalita

is it not possible to estimate the channel without having ofdm


Dan (view profile)


can someone explain this:
G = (Ep * length(Ip))^-1 ...
* ctranspose(sqrt(Ep)*diag(Spilot)*ctranspose(F(1:L,Ip)));

Why it is not just the inverse filter from Ypilot and Spilot? Like hHat = Ypilot/Spilot ?

Hamid Ramezani

Hamid Ramezani (view profile)

Dear Aydar,

Thanks, and it is funny that you waited two years, I am really sorry for that. :) you know sometimes the life does not go as you expect.

Hello Hamid,
Thanks again. Didn't have to wait this time another 2 years ;)
Ok, now I understood what you mean.
Must admit, it was quite confusing - your script actually doesn't provide only pure link-level simulation results but has also some system-level assumptions on top of it.

Hamid Ramezani

Hamid Ramezani (view profile)

Dear Aydar,

If we want to evaluate the performance of BER without any power limit on the transmitter, and we only consider the SNR on the data, (not pilots) then your right. Regarding your comment I recently submitted a project here, which will be published soon. There, we can see how the power allocation among pilots and data affects the total capacity of the network. I hope it would be helpful for the people who are interested in this field of study.


Hi Hamid,
thanks for your reply.
I dont remember what i meant by different power on data and pilots nor the details of your code. Maybe i was wrong about the power thing but i see now in your code:

Ep = 2; % energy in pilot symbols in comparison to energy in data symbols.

Anyways, what I wanted to point out that according to your BER plot when you increase pilot power (Ep) you performance gets bad, ex.: compare Ep=10 vs Ep=1. BER (Ep=10) must have best performance. And I think the problems is in a wrong Noise generation.


Hamid Ramezani

Hamid Ramezani (view profile)

To Aydar Zimaliev,
Thanks for your comment. In practical scenarios in which the power is an important resource of the system, we should consider the overall performance of the systems. And as you know, the transmit power limit put a condition on the overall transmission power and it is not different for pilots or data. For the optimum power allocation between pilots and data please see the following paper: "On the Power Allocation and System capacity of OFDM Systems Using Superimposed Training Schemes".

However, if we consider the power allocation of pilots and data disjointly, then you'r right.



king (view profile)

Hi Hamid,would you not use the formula G compute channel impulse respone,instead of 3 formulas of LMS


Maran (view profile)

Hi Hamid, nice work here, I understand that you used the estimation formulation based on least square. But would you mind sharing the paper or book that you obtained this formula from. Thank you very much.

Excellent job again.

Babar AZIZ

Hi, a very nice code ... can you kindly explain me the formula ...
G = (Ep * length(Ip))^-1 ...
* ctranspose(sqrt(Ep)*diag(Spilot)*ctranspose(F(1:L,Ip)));


While I was commenting (above) I noticed something strange in your picture above: when you increase pilot power (Ep) you performance gets bad, which is wrong! More power you have on pilots the better channel estimation => the better performance must be.
Your bug is at the noise generation, which should not be a function of pilot power ( when we set SNR we mean SNR on data symbols and not on data+pilot symbols). What your code does it increases noise on data symbols when Pilot power (Ep) is increased.

Instead of

TxDataIfftGiNoise = awgn(TxDataIfftGi , SNR - db(std(TxDataIfftGi)));

I would write

TxDataIfftGiNoise = awgn(TxDataIfftGi , SNR);

or better without Matlab built-in function

TxDataIfftGiNoise = TxDataIfftGi*10^(SNR/20)+1/sqrt(2)*(randn(length(TxDataIfftGi),1)+j*randn(length(TxDataIfftGi),1));

Overall, your code is a very nice example, thank you for sharing with us!

Very good!

Julius Sandy

I want to ask, can you give me the number of input parameters so that the picture above can be build? how many numbers of iteration that been inputed?

Hamid Ramezani

instead of function
"random('Normal',0,1,L,1)", the function randn(L,1) can be used.

sherif ahmed

the program is not run as the built in function is not given

Morteza MRO

The code shared, is just the simulation of a SISO system with LS Estimation in time domain and the code is a stand-alone program that has no built-in function.

inderjeet kaur

pls send me the built in functions that are being used really greatful to u , thanks in advance, pls mail me at

anil pattanayak

hamed nozari

ash ash

Thanks, please send me the built in functions.



license will be added

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video