⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sine.m

📁 通过读取已有的由matlab产生的数据文件进行1024点浮点fft运算的c程序.其中,radix2()实现基2算法,ChangeOrder()实现变址运算.
💻 M
字号:
% Creat a data file of the sinewave, which DSP chip can load .%
clear all;
Fs=8000; %Sampling Frequecy of AD535 chip=8KHz%
f1=100; %Frequency of Sine Wave" 
y=10*sin(2*pi*f1*[0: 1023]/Fs); % Number of Sampling point=160, and create sine wave%
plot(y);
grid on;
reply=input('Please input category of data: '); % input category of data%
fid=fopen('sine1.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', y); % output 32bit hexadecimal data % 
case 2
fprintf(fid, '%d\n', round(y)); % output 32bit float data %
case 3
fprintf(fid, '%12.1f\n', round(y)); % output 40bit long inter data %
case 4
fprintf(fid, '%f\n', y); % outout 32bit integer data % 
end
fclose(fid); % close the .dat file

⌨️ 快捷键说明

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