fft_small_tb.m

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

M
30
字号
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Altera FFT MegaCore Function Version 2.1.0% file : fft_small_tb.m%% Description : The following Matlab testbench excercises the Altera FFT Model fft_small_model.m% generated by Altera's FFT Megacore and outputs results to text files.%% Copyright (C) 1988-2004 Altera Corporation                                                % Parameterization Space    N=16384;% Read input complex vector from source text files fidr = fopen('real_input.txt','r');                                            fidi = fopen('imag_input.txt','r');                                            xreali=fscanf(fidr,'%d');                                                      ximagi=fscanf(fidi,'%d');                                                      fclose(fidi);                                                                  fclose(fidr);                                                                  % Create input complex row vector from source text files x = xreali' + j*ximagi';                                                         [y, exp_out] = fft_small_model(x,N,0); fidro = fopen('real_output_c_model.txt','w');                                  fidio = fopen('imag_output_c_model.txt','w');                                  fideo = fopen('exponent_out_c_model.txt','w');                                 fprintf(fidro,'%d\n',real(y));                                                 fprintf(fidio,'%d\n',imag(y));                                                 fprintf(fideo,'%d\n',exp_out);                                                 fclose(fidro);                                                                 fclose(fidio);                                                                 fclose(fideo);                                                                 

⌨️ 快捷键说明

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