File Exchange

image thumbnail

Least Mean Square (LMS)

version (1.51 KB) by Shujaat Khan
An example of least mean square algorithm to determine a linear model's parameter.


Updated 03 Nov 2016

View License

In this code, a linear equation is used to generate sample data using a slope and bias. Later a Gaussian noise is added to the desired output. The noisy output and original input is used to determine the slope and bias of the linear equation using LMS algorithm. This implementation of LMS is based on batch update rule of gradient decent algorithm in which we use the sum of error instead of sample error. You can modify this code to create sample based update rule easily.

Cite As

Shujaat Khan (2021). Least Mean Square (LMS) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)


Shujaat Khan

@heena panda (1) you will require two dimensional filter to process image data. (2) for specific problem you need to redefine your cost function.

heena panda

How can I apply it on image deblurring after determination of the length of blur and angle of the blur?

Ouyang Liu

Syed Saiq Hussain

salaheddine salah

stefano boooonj

Naveed Ahmed

well commented and easy to understand, good job

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!