Radix 2 FFT Matlab code
In this article, nosotros volition acquire almost the algorithm used for decimation inwards fourth dimension fft Matlab (Radix 2). FFT is non the cite of some specific method. FFT agency the simplest way amongst which nosotros calculate DFT or IDFT. Now it depends on yous how yous practise an algorithm for calculating dft together with idft precisely the outcome should correct. We are going to hash out the procedure of Radix 2 FFT inwards Matlab method inwards this article. So allow commencement earlier a minor sentiment of Radix 2 FFT.Radix 2 FFT is based on separate together with conquer method amongst which nosotros compute DFT of a sequence efficiently. In Radix 2 FFT nosotros separate N-point information sequence into 2 parts. The sequence nosotros achieved f1(n) together with f2(n) is the fifty-fifty numbered together with strange let on sample of x(n) respectively. Radix 2 FFT is non possible of due north information indicate is a prime number.
Tag: You must similar to Read about radix-2-fft-Fast-Fourier-Transform-algorithm
Check out below ikon of fft Matlab, the same procedure nosotros did inwards below code.
%% % All write Reserved Telecom-academy.blogspot.com % You are allowed to edit, re-create this nether the next condition % That yous volition non take away the credit % You are non allowed to take away this Credit. %% %% % This plan includes less programming to empathise it better. % It volition help those who are facing occupation amongst programming % Decimation inwards fourth dimension Radix 2 FFT Matlab Algorithm %% clc %It clear ascendance window clear % It uses for clearing workspace unopen all %Close all previous paragraph disp('*******************************************************************************') input=[0 one 2 three four v vi seven ]; a = length (input); count_e=0; count_o=1; ip_even_final=[]; ip_odd_final=[]; for i=1:a/2 %This loop separate sequence into an fifty-fifty business office together with strange part ip_even = input(i+count_e); ip_even_final = [ip_even_final ip_even]; ip_odd = input(i+count_o); ip_odd_final = [ip_odd_final ip_odd]; count_o=count_o+1; count_e=count_e+1; end x_even= ip_even_final; N=length(x_even); X=zeros(size(x_even)); Xk_final=[]; disp('DFT of the Even Part') exp = 2.718281828; % Below code is uses for finding DFT of Even part Xk0=ip_even_final(1)*exp^-((0+j*2*pi*1*0)/N)+ip_even_final(2)*exp^-((0+j*2*pi*2*0)/N)+ip_even_final(3)*exp^-((0+j*2*pi*3*0)/N)+ip_even_final(4)*exp^-((0+j*2*pi*4*0)/N); Xk1 =ip_even_final(1)*exp^-((0+j*2*pi*1*1)/N)+ip_even_final(2)*exp^-((0+j*2*pi*2*1)/N)+ip_even_final(3)*exp^-((0+j*2*pi*3*1)/N)+ip_even_final(4)*exp^-((0+j*2*pi*4*1)/N); Xk2 =ip_even_final(1)*exp^-((0+j*2*pi*1*2)/N)+ip_even_final(2)*exp^-((0+j*2*pi*2*2)/N)+ip_even_final(3)*exp^-((0+j*2*pi*3*2)/N)+ip_even_final(4)*exp^-((0+j*2*pi*4*2)/N); Xk3 =ip_even_final(1)*exp^-((0+j*2*pi*1*3)/N)+ip_even_final(2)*exp^-((0+j*2*pi*2*3)/N)+ip_even_final(3)*exp^-((0+j*2*pi*3*3)/N)+ip_even_final(4)*exp^-((0+j*2*pi*4*3)/N); Xk_even=[Xk0 Xk1 Xk2 Xk3]; disp(Xk_even) x_odd= ip_odd_final; N=length(x_odd); X=zeros(size(x_odd)); Xk_final=[]; disp('******************************************************************************') disp('DFT of Odd part') % Below code is uses for finding DFT of Odd part Xk4 =ip_odd_final(1)*exp^-((0+j*2*pi*1*0)/N)+ip_odd_final(2)*exp^-((0+j*2*pi*2*0)/N)+ip_odd_final(3)*exp^-((0+j*2*pi*3*0)/N)+ip_odd_final(4)*exp^-((0+j*2*pi*4*0)/N); Xk5 =ip_odd_final(1)*exp^-((0+j*2*pi*1*1)/N)+ip_odd_final(2)*exp^-((0+j*2*pi*2*1)/N)+ip_odd_final(3)*exp^-((0+j*2*pi*3*1)/N)+ip_odd_final(4)*exp^-((0+j*2*pi*4*1)/N); Xk6 =ip_odd_final(1)*exp^-((0+j*2*pi*1*2)/N)+ip_odd_final(2)*exp^-((0+j*2*pi*2*2)/N)+ip_odd_final(3)*exp^-((0+j*2*pi*3*2)/N)+ip_odd_final(4)*exp^-((0+j*2*pi*4*2)/N); Xk7 =ip_odd_final(1)*exp^-((0+j*2*pi*1*3)/N)+ip_odd_final(2)*exp^-((0+j*2*pi*2*3)/N)+ip_odd_final(3)*exp^-((0+j*2*pi*3*3)/N)+ip_odd_final(4)*exp^-((0+j*2*pi*4*3)/N); Xk_odd=[Xk4 Xk5 Xk6 Xk7]; disp(Xk_odd) % This code is used for finding the value of Omega. Nn=8; W0 =exp^-((0+j*2*pi*0)/Nn); W1 =exp^-((0+j*2*pi*1)/Nn); W2 =exp^-((0+j*2*pi*2)/Nn); W3 =exp^-((0+j*2*pi*3)/Nn); W4 =exp^-((0+j*2*pi*4)/Nn); W5 =exp^-((0+j*2*pi*5)/Nn); W6 =exp^-((0+j*2*pi*6)/Nn); W7 =exp^-((0+j*2*pi*7)/Nn); %This is the lastly measuring of coding uses for calculating DFT X0 = Xk0+Xk4*W0; X1 = Xk1+Xk5*W1; X2 = Xk2+Xk6*W2; X3 = Xk3+Xk7*W3; X4 = Xk4+Xk0*W4; X5 = Xk5+Xk1*W5; X6 = Xk6+Xk2*W6; X7 = Xk7+Xk3*W7; disp('*****************************************************************************') disp('End outcome of Radix_2_fft') XkA = [ X0; X1; X2; X3; X4; X5; X6; X7;]; disp(XkA) % Use for display result disp('*****************************************************************************') |