Circular shift in MATLAB(with and without built in function)
CODE:
x_n=input('Enter the sequence:');
m=input('Enter required amount of shift:');
N=length(x_n);
X_K=fft(x_n,N);
K=0:N-1;
a=exp(-1i*((2*pi)/N).*K*m);
X2_K=X_K.*a;
x2_n=ifft(X2_K)
With built in function:
y_n=circshift(x_n,3)
No comments