Code covered by the BSD License  

Highlights from
EC1302 DSP Lab

EC1302 DSP Lab

by

 

These are matlab code for experiments in the course EC1302 DSP Lab.

y=linsav(x,h,L)
%y=linsav(x,h,L) returns linear convolution between 
%                a long sequence x and a short sequence h
%                using overlap-save method with a segment length, L
function y=linsav(x,h,L)

  P=length(x);
  M=length(h);
 
  inc=L-M+1;
  R=rem(P+M-1-L,inc);
  long=[zeros(1,M-1),x,zeros(1,inc-R)];
  short=[h,zeros(1,L-M)];
  
  nfr=((P-R)/inc)+1;
  
  H=[];
  for i=0:L-1
    H=[H,(shift(short,i))'];
  end

  yii=[];
  for i=1:nfr
    xi=long((1+(i-1)*inc):(L+(i-1)*inc));
    yi=H*xi';
    yii=[yii,(yi(M:L))'];
  end
  y=yii(1:P+M-1);

Contact us