Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

http://www.springerlink.

com/content/q2j02qh43k1622j1/

KL

http://www.dsprelated.com/showmessage/57989/1.php

gordana

http://www.general-search.com/fileinfo/9846153

multirate_up_dn sampling

http://www.dspdesignline.com/howto/207400771;jsessionid=A4DWMV0BA4I4XQE1GHPSKH4ATMY32J
VN?pgno=4

http://books.google.co.in/books?id=Nubjp5Cd_KgC&pg=PA21&lpg=PA21&dq=upsampling+
%2B+downsampling+%2B+commutative&source=bl&ots=Qs8XOvR8-
5&sig=NHtnxUj0D03_fmosc4T0roPtMUM&hl=en&ei=JJubS7DJEtO3rAfk0tn3Ag&sa=X&oi=book_result&c
t=result&resnum=10&ved=0CCcQ6AEwCQ#v=onepage&q=upsampling%20%2B%20downsampling
%20%2B%20commutative&f=false

COLORED NOISE BOOK

http://books.google.co.in/books?id=MoeHcDxCH1UC&pg=PA165&dq=colored+noise+estimation+
%2B+karhunen+loeve+expansion&hl=en&ei=kUuqS87vNcO2rAeI7OTyAQ&sa=X&oi=book_result&ct=res
ult&resnum=2&ved=0CDsQ6AEwAQ#v=onepage&q=colored%20noise%20estimation%20%2B
%20karhunen%20loeve%20expansion&f=false

x_n = input('Enter the sequence');


L = input('Enter the value by which to upsample the sequence') ;
M = input('Enter the value by which to downsample the sequence') ;

%DOWNSAMPLING
len = length(x_n);
intg = ceil(len/M);

n1 = 0:len-1;
n2 = 0:intg-1;
n_n = len + ((L-1)*(len-1));
n3 = 0:n_n-1;

%code i wrote-------------------------------------------
% for n = 1:intg
% y_n_dn(n) = x_n((M*n - (M-1)));
% end;
%--------------------------------------------------------

%copied code
y_n_dn = x_n(1:M:len);

%UPSAMPLING

%code i wrote
for n = 0:len-2
y_n_up((L*n + 1):(L*n + L)) = [x_n(n+1) zeros(1,L-1)];
end;
y_n_up(n_n) = x_n(len);

%-----------------------------------------------------------
% %copied code
% y_n_up = zeros(1,(L*len-L+1));
% for n = 0:len-1
% y_n_up(n*L + 1) = x_n(n+1);
% end
%--------------------------------------

%plot
subplot (3,1,1);
stem(n1,x_n);
title('Sequence x(n)','fontsize',14);
xlabel('n -->','fontsize',12,'fontweight','b');
ylabel('Amplitude','fontsize',12,'fontweight','b');
subplot(3,1,2);
stem(n2,y_n_dn);
title('Downsampled Sequence [y(n) = x(M*n)]','fontsize',14);
xlabel('n -->','fontsize',12,'fontweight','b');
ylabel('Amplitude','fontsize',12,'fontweight','b');
subplot(3,1,3);
stem(n3,y_n_up);
title('Upsampled Sequence [y(n) = x(n/L)]','fontsize',14);
xlabel('n -->','fontsize',12,'fontweight','b');
ylabel('Amplitude','fontsize',12,'fontweight','b');

You might also like