Mercurial > hg > ishara
annotate dsp/zeropad.m @ 32:c3b0cd708782
Imported core dsp tools.
author | samer |
---|---|
date | Sun, 20 Jan 2013 13:48:47 +0000 |
parents | |
children |
rev | line source |
---|---|
samer@32 | 1 function y=zeropad(n,x) |
samer@32 | 2 % ZEROPAD - Function to zero pad a signal |
samer@32 | 3 % |
samer@32 | 4 % y=zeropad(n,x) : adds n zeros to head and tail of signal |
samer@32 | 5 % If n<=0, y=x; |
samer@32 | 6 |
samer@32 | 7 if n>0, |
samer@32 | 8 y=[zeros(n,1); x(:); zeros(n,1)]; |
samer@32 | 9 else |
samer@32 | 10 y=x(:); |
samer@32 | 11 end |