exmp2_1.m
来自「用dsp解压mp3程序的算法」· M 代码 · 共 17 行
M
17 行
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exmp2_1.m - Code for generate, plot, and save sinewave
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A = 2.0; % amplitude of sinewave
w0 = 0.2*pi; % frequency of sinewave
N = 128; % length of sinewave
n = [0:N-1]; % time index
sn = A*sin(w0*n); % sine function defined in (2.2.6)
save sn.dat sn -ASCII;% save the sequence in ASCII file
% sn.dat for later use
plot(n,sn) % plot the sinewave
axis([0, 127, -inf, inf])
title('Sinewave'); % title of figure
xlabel('Time index, n'); ylabel('Amplitude');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?