Home
Add Document
Sign In
Register
Lloyd Max Quantizer (MATLAB Program)
Home
Lloyd Max Quantizer (MATLAB Program)
This is a MATLAB program for the Lloyd Max Quantizer. The sample data lies within -10 and +10...
Author:
Siddhant Rohela
45 downloads
329 Views
45KB Size
Report
DOWNLOAD .PDF
Recommend Documents
Matlab Program
TDM matlab program
time division multiplexing
Simple MATLAB program
Simple MATLAB programFull description
Dc Motor Matlab Program
Description complète
Lloyd Lif
liftingFull description
Program Matlab rotasi gambar 90 derajat.docx
Deskripsi lengkap
program matlab interpolasi,integral,turunan,dan pdb
Pembuatan Program Kalkulator Sains Menggunakan Matlab
Codigos de Lloyd Mear
lloydDescripción completa
Frank Lloyd Wright
Frank Lloyd Wright
Matlab
Deskripsi lengkap
Matlab
Matlab
Full description
MATLAB
Matlab
Matlab
matlab
Descripción completa
matlab
Matlab
Matlab
matlab
Descripción: matlab guid....
MATLAB
LABO INTRO A TELE SOTWARE
Matlab
Matlab
matlab
Descrição: numerical analysis by matlab
MATLAB ASSIGNMENT ASSIGNMENT 3 DATE OF SUBMISSION: 07-10-16 NAME: SIDDHANT ROHELA
ROLL NUMBER: 14690
n = 2;
%number of bits
g = 1;
%counter for storing the convergent values of MSE
sat = zeros(1, 6);
% array for storing the convergent values of MSE
while n <= <= 64
COURSE: EE320
%main loop
A = zeros(n, zeros(n, 10000); 10000);
%array assigned for each subdivision in -10 to 10
q = zeros(1, n);
%counter to tell where the last non zero entry is in every row of A
L = -10:(20/n):10;
%making the divisions (i.e. their borders)
v = zeros(1, n);
%initializing the values of the array of quantization levels
MSE = zeros(1, zeros(1, 100); 100);
%initializing the values of the array of MSE
plotter = 1:100;
%X-axis for plotting MSE v/s iterations
%////////CODE FOR ARRANGING THE SAMPLES OF THE SIGNAL INTO SUITABLE SUBDIVISIONS////////
for major=1:100
%loop for running iterations; major is the the counter of iterations
q = zeros(1,n);
%resetting the counter 'q' for a new iteration
for i=1:10000
%reading the samples of signal
for p=1:n
%pth subdivision
if ((L(p)<=X(i))&&((X(i)
%checking whether the ith sample lies in a given
subdivision q(p)=q(p)+1;
A(p, q(p))=X(i); q(p))=X(i);
%if yes, then increase the counter 'q' by 1,
%and fill the corresponding element of A with that sample
else end end end
%////////CODE FOR CALCULATING THE QUANTIZATION LEVELS AND THE MEAN SQUARED ERROR////////
MSE(major)=0; MSE(major)=0; for p=1:n if (q(p)==0)
%initializing the MSE for 'major'th iteration %pth subdivision %if there is no sample of signal within a group then,
v(p)=(L(p)+L(p+1))/2; v(p)=(L(p)+L(p+ 1))/2; %assume the level for that group as the average of the L and U limits else tempsum=0; for z=1:q(p)
%intitialize the counter for tempsum
tempsum = tempsum + A(p, z); end v(p) = tempsum/q(p);
%optimal pth level is the av. of all samples in the pth sub division
for z=1:q(p) MSE(major) MSE(major) = MSE(major) MSE(major) + ((v(p)-A(p, ((v(p)-A(p, z))*(v(p)-A(p, z))*(v(p)-A(p, z))); z)));
%building the MSE
end end end
MSE(major) = (MSE(major))/1000 (MSE(major))/10000; 0;
for y=2:n
%final value of MSE for that iteration
%corresponding to the calculated values of quantization levels,
L(y) = (v(y-1)+v(y))/2;
%calculate the new set of subdivisions (i.e. their borders)
end
end
sat(g) = MSE(100);
%filling in the converged value of MSE for every resolution
%////////CODE FOR PLOTTING MSE v/s NUMBER OF ITERATIONS////////
hold on plot (plotter, (plotter, MSE) MSE) xlabel('Number of Iterations'); ylabel('Mean Squared Error'); title('MSE v/s Number of Iterations');
end
g = g+1;
%proceeding with the counter 'g'
n = (2*n);
%proceeding with the counter 'n'
×
Report "Lloyd Max Quantizer (MATLAB Program)"
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
×
Sign In
Email
Password
Remember me
Forgot password?
Sign In
Our partners will collect data and use cookies for ad personalization and measurement.
Learn how we and our ad partner Google, collect and use data
.
Agree & close