level 1
卞和qiyu
楼主
clc
clear[x,fs,bits]=wavread('F:\北京\guan.wav');
sound(x,fs,bits); %播放语音信号
reply=input('Please input category of data:'); % input category of data%
fid=fopen('YY.dat', 'w'); %creat a data file in the given folder%
fprintf(fid, '1651 %d 0 0 0 /n', reply); % output the head file of .dat file %
switch reply % output data into the .dat file according to the category of data%
case 1
fprintf(fid, '0x%x/n', x); % output 32bit hexadecimal data %
case 2
fprintf(fid, 'x%x/n', y1); % output 16bit hexadecimal data %
case 3
fprintf(fid, '%12.1f/n', round(y1)); % output 40bit long inter data %
case 4
fprintf(fid, '%f/n', y1); % outout 32bit integer data % endfclose(fid); % close the .dat file %
这是一个将MATLAB中的.mat文件转换成.dat文件的程序,我现在用的是TMS320VC5402,需要的数据时16bit的十六进制数,我不知道怎么样转换,能有哪位大神告诉一下吗
2013年05月08日 01点05分
1
clear[x,fs,bits]=wavread('F:\北京\guan.wav');
sound(x,fs,bits); %播放语音信号
reply=input('Please input category of data:'); % input category of data%
fid=fopen('YY.dat', 'w'); %creat a data file in the given folder%
fprintf(fid, '1651 %d 0 0 0 /n', reply); % output the head file of .dat file %
switch reply % output data into the .dat file according to the category of data%
case 1
fprintf(fid, '0x%x/n', x); % output 32bit hexadecimal data %
case 2
fprintf(fid, 'x%x/n', y1); % output 16bit hexadecimal data %
case 3
fprintf(fid, '%12.1f/n', round(y1)); % output 40bit long inter data %
case 4
fprintf(fid, '%f/n', y1); % outout 32bit integer data % endfclose(fid); % close the .dat file %
这是一个将MATLAB中的.mat文件转换成.dat文件的程序,我现在用的是TMS320VC5402,需要的数据时16bit的十六进制数,我不知道怎么样转换,能有哪位大神告诉一下吗