fft_small_model.m

来自「FFT 32k use VHDL MATLAB」· M 代码 · 共 40 行

M
40
字号
% function [y, exp_out] = fft_small_model(x,N,INVERSE)         %                                                                                             %   calculates the complex block-floating point FFT/IFFT of length N of a                     %   complex input vector x                                                                    %                                                                                             %   Inputs:   x          : Input complex vector of length B*N, where B is                     %                          the number of blocks over which the length-N FFT is to             %                          be applied. If the length of the vector is not                     %                          an integral multiple of N, zeros are                               %                          appended to the input sequence appropriately.                      %             N          : Transform Length                                                   %             INVERSE    : FFT direction                                                      %                          0 => FFT                                                           %                          1 => IFFT                                                          %                                                                                             %   Outputs   y          : The transform-domain complex vector output                         %             exp_out    : Block exponent value                                               %                                                                                             %   Copyright (C) 1988-2004 Altera Corporation                                                function [y, exp_out] = fft_small(x,N,INVERSE)         addpath 'C:/software/altera/MegaCore/fft-v2.1.3/lib//ip_toolbench/../';% Parameterization Space    THROUGHPUT=4;ARCH=0;DATA_PREC=16;TWIDDLE_PREC=16;input_vector_length = length(x);                                                              number_of_blocks = ceil(input_vector_length/N);                                               % Zero-stuff last block if necessary                                                          x = [x, zeros(1,number_of_blocks * N - input_vector_length)];                                 y=[];                                                                                         exp_out=[];                                                                                   for i=1:number_of_blocks                                                                          rin = real(x((i-1)*N + 1: i*N));                                                              iin = imag(x((i-1)*N + 1: i*N));                                                              [roc,ioc,eoc] = sfftmodel(rin,iin,N,THROUGHPUT,ARCH,DATA_PREC,TWIDDLE_PREC,INVERSE);          y = [y, roc+j*ioc];                                                                           exp_out = [exp_out, eoc];                                                                 end                                                                                           

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?