📄 compare_with_matlab_test.m
字号:
% Run this program and follow the instructions to compare DSP and matlab
% implementations of the same function.
%fid = fopen('input.dat', 'r');
%data_input = fread(fid, 'int16');
%fclose(fid);
%data_input;
%Input=(0:15)-(rand*15);
%write_float32_hex('Input.dat',Input);
%Input_short=0:3;
%write_int16_hex('Input_short.dat',Input_short);
%Output_Matlab=FunctionToBeTested(Input);
%disp('1) Load the program.')
%disp('2) Load data in DSP (File->Data->Load->"Input.dat"->Open->Adress=Input->OK) or use load.gel');
%disp('3) Run DSP program.');
%disp('4) Save data from DSP (File->Data->Save->"Output.dat"->Adress=Output,Length=16->OK) or use save.gel');
%disp('5) Press any key in this matlab window');
%pause
data_input=read_float32_hex('input.dat');
% Compare e.g. graphically
%hold off
%plot(Output_Matlab,'b')
%hold on
%plot(Output_DSP+0.1,'g')
%legend('Matlab result','DSP result');
plot(data_input,'b')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -