当前位置:首页 > 基于MATLAB的心电信号分析系统的设计与仿真
信号与线性系统课程设计报告
4.1.3 把数据读到txt中
fid = fopen('t.txt','wt'); fprintf(fid,'%g\\n',t); fclose(fid);
fid = fopen('F.txt','wt'); fprintf(fid,'%g\\n',F); fclose(fid);
4.1.4插值前后波形比较 subplot(2,2,1) plot(x,y)
title('初始信号时域波形') axis([0 2.5 -2 1]) subplot(2,2,2) fs=1000; N=length(y) n=1:N;
f1=n*fs/N; Y1=fft(y);
plot(f1,abs(Y1))
title('初始信号频谱') axis([0 1000 0 200])
~ 5 ~
信号与线性系统课程设计报告
subplot(2,2,3) plot(t,F)
title('差值后信号时域波形') axis([0 2.5 -2 1]) M=length(F); m=1:M;
f2=m*fs/M; Y2=fft(F);
subplot(2,2,4) plot(f2,abs(Y2))
title('插值后信号频谱') axis([0 1000 0 200])
4.1.5模拟低通滤波器:
wp=60*2*pi;ws=99*2*pi;Rp=1;As=40; [N,wc]=buttord(wp,ws,Rp,As,'s') [B,A]=butter(N,wc,'s')
k=0:511;fk=0:1000/512:1000;wk=2*pi*fk; Hk=freqs(B,A,wk);
plot(fk,20*log10(abs(Hk)));
gridon N =
~ 6 ~
信号与线性系统课程设计报告
11
wc =
409.2596 B =
1.0e+028 *
Columns 1 through 10
0 0 0 0 0 0 0 0 0 0 0 5.3949
Columns 11 through 12 A =
1.0e+028 *
Columns 1 through 10
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0008
Columns 11 through 12
0.0926 5.3949
~ 7 ~
信号与线性系统课程设计报告
4.1.6模拟高通滤波器:
wp=0.7*2*pi;ws=0.25*2*pi;Rp=0.1;As=40; [N,wc]=buttord(wp,ws,Rp,As,'s') [B0,A0]=butter(N,wc,'s');
wph=2*pi*0.25;hk=freqs(B0,A0,wph); [BH,AH]=lp2hp(B,A,wph); [h,w]=freqs(BH,AH);
plot(w,20*log10(abs(h))); axis([0,1,-80,5]); N =
7
wc =
3.0327
B0 =
1.0e+003 *
0 0 0 0 0 0 0 2.3595
~ 8 ~
共分享92篇相关文档