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=lincon2(x,h)
function y=lincon2(x,h)
  %Find lengths of x and h
  P=length(x);
  M=length(h);
  %Compute length of convolution
  N=P+M-1;
  %Pad zeros to x and h to make their lengths to N
  xi=[x,zeros(1,N-P)];
  hi=[h,zeros(1,N-M)];
  %Form N-by-N matrix H by circularly rotating hi N times
  H=[];
  for i=0:N-1
      for j=0:N-1
          
          hj(mod(j+i,N)+1)=hi(j+1);
      end
      H=[H,hj'];
  end
  y=(H*xi')';
    

Contact us