confusion regarding code of FFT decimation in time?

1 回表示 (過去 30 日間)
ABTJ
ABTJ 2020 年 6 月 16 日
編集済み: ABTJ 2020 年 6 月 16 日
Below is the code , i got it from MATLAB FEX.
Although i am getting valid answers using this function but I am confused regarding value/variable "Half" and its justification in context/view of decimation in time
function [ y ] = FFT_DIT_R2(x)
p= nextpow2(length(x)) % checking the size of the input array
x= [x zeros(1,(2^p)-length(x))] % complementing an array of zeros if necessary
N= length(x) % computing the array size
S= log2(N) % computing the number of conversion stages
Half= 1 % Seting the initial "Half" value
x= bitrevorder(x)
for stage= 1:S % stages of transformation
stage
for index= 0:(2^stage):(N-1) % series of "butterflies" for each stage
index
for n= 0:(Half-1) % creating "butterfly" and saving the results
n
pos= n+index+1 % index of the data sample
pow= (2^(S-stage))*n % part of power of the complex multiplier
w= exp((-1i)*(2*pi)*pow/N) % complex multiplier
a= x(pos)+x(pos+Half).*w % 1-st part of the "butterfly" creating operation
b= x(pos)-x(pos+Half).*w % 2-nd part of the "butterfly" creating operation
x(pos)= a % saving computation of the 1-st part
x(pos+Half)= b % saving computation of the 2-nd part
end;
end;
Half= 2*Half % computing the next "Half" value
end;
y= x; % returning the result from function
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by