MathScript_example.m
资源名称:labview.rar [点击查看]
上传用户:sh_ffjj
上传日期:2022-08-05
资源大小:684k
文件大小:0k
源码类别:
LabView编程
开发平台:
LabView
- 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;