Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

Circular shift in MATLAB(with and without built in function)

CODE:

Without built in function:

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