s4rout1.m

来自「Industrial Mathematics」· M 代码 · 共 22 行

M
22
字号
fS = 8192;
t = 0:fS-1;
t = t/fS;
w = 2*pi*440;
x = sin(w*t) + .2*sin(2*w*t) + .1*sin(3.01*w*t) + .4*randn(1,fS);
% the above script simulates one second of sampled values
% of an oboe playing 440 Hz
%


%Routine 4.1 spectral analysis
n= 8192;
m = 400;
M = 1400;
%
xhat = fft(x,n)/n;
%
f = 0:n-1;
f = f(m:M);
yhat = xhat(m:M);
plot(f,abs(yhat),'k-')

⌨️ 快捷键说明

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