%% Explore Latency of HDL IFFT Object
% The latency of the object varies with the FFT length and the vector size. Use the getLatency function to find the latency of a particular configuration. The latency is the number of cycles between the first valid input and the first valid output, assuming that the input is contiguous.
% Create a new dsp.HDLIFFT object and request the latency.

hdlifft = dsp.HDLIFFT('FFTLength',512);
L512 = getLatency(hdlifft)

%
% Request hypothetical latency information about a similar object with a different FFT length. The properties of the original object do not change. When you do not specify a vector length, the function assumes scalar input data.

L256 = getLatency(hdlifft,256)
N = hdlifft.FFTLength

%
% Request hypothetical latency information of a similar object that accepts eight-sample vector input.

L256v8 = getLatency(hdlifft,256,8)

%
% Enable scaling at each stage of the IFFT. The latency does not change.

hdlifft.Normalize = true;
L512n = getLatency(hdlifft)

%
% Request the same output order as the input order. This setting increases the latency because the object must collect the output before reordering.

hdlifft.BitReversedOutput = false;
L512r = getLatency(hdlifft)

% Copyright 2012 The MathWorks, Inc.