?? mathscript_example.m
字號:
num=2^9;
t=(1:num)/num;
A1=1;
A2=.2;
f1=input('Low Frequency:');
f2=105;
noise_mag=0;
S1=A1*sin(2*pi*f1*t);
S2=A2*sin(2*pi*f2*t);
S=S1+S2;
S=S+noise_mag*(rand(1,length(t))-.5);
filt=fft(S);
filt=abs(filt);
filt=(filt(1:num/2))/(num/2);
f=1:num/2;
subplot(2,1,1);
plot(t,S),title('Simulated Signal');
axis([0,1,-1.5,1.5]);
grid on;
subplot(2,1,2);
plot(f,filt),title('FFT');
axis([0,length(f),0,1.5]);
grid on;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -