Mapping a shifted and sequence to a given output axis

3 views (last 30 days)
Hi,
I have a sequence x1, which is the same lenght of an output vector (nx). However, the output vector goes from -12890:13975. I need to define the output (y[n]) of the system along the axis (nx). I used circshift( ) and made conditions for replacing the back/front fill of the shifted array with zeros, according to the direction of the shift. I think the output might be correct, but I doubt the output is defined along the output axis properly. is the system. Input is x1. Output vector is nx. I've arbitrarily chosen shifts of -30:30 to test plot. Thank you
x1 = x1';
y = zeros(1,length(nx));
k_vals = -30:30;
for k_idx = 1:length(k_vals)
k=k_vals(k_idx);
x = circshift(x1,Nb*k);
if k<0
x(end + k: end) = 0;
elseif k==0;
elseif k > 0;
x(1:k)=0;
end
y = y + (Ab^k).*x;
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!