高斯滤波器特性演示

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

t1=-1.5:0.01:1.5; t2=-0.5:0.01:0.5;b1=ones(1,length(t2)); y1=sqrt(pi)/0.25*exp(-((pi*t1).^2)/0.25.^2); z1=0.5*(erfc(pi/0.25*(t1-0.5))-erfc(pi/0.25*(t1+0.5))); y2=sqrt(pi)/0.5*exp(-((pi*t1).^2)/0.5.^2); z2=0.5*(erfc(pi/0.5*(t1-0.5))-erfc(pi/0.5*(t1+0.5))); y3=sqrt(pi)*exp(-(pi*t1).^2); z3=0.5*(erfc(pi*(t1-0.5))-erfc(pi*(t1+0.5))); y4=sqrt(pi)/2*exp(-((pi*t1).^2)/2.^2); z4=0.5*(erfc(pi/2*(t1-0.5))-erfc(pi/2*(t1+0.5))); subplot(3,1,1),plot(t2,b1);axis([-1.5 1.5 0 1.5]);xlabel('t/T');ylabel('b(t)'); title('rect impulse input of Gaussian pulse shaping filter'); subplot(3,1,2),plot(t1,y1,'r',t1,y2,'g',t1,y3,'b',t1,y4,'m'); xlabel('t/T');ylabel('h(t)');title('impulse response of Gaussian pulse shaping filter'); subplot(3,1,3),plot(t1,z1,'r',t1,z2,'g',t1,z3,'b',t1,z4,'m');xlabel('t/T');ylabel('g(t)'); title('output (rect impulse response) of Gaussian pulse shaping filter');
高斯滤波器的传输函数H(f )
H ( f ) = exp(− a 2 f 2 ) 0.5887 Bb = a
f=0:0.05:2.5; y1=exp(-(0.25*f).^2); y2=exp(-(0.5*f).^2); y3=exp(-(f.^2)); y4=exp(-(2*f).^2); plot(f,y1,'r',f,y2,'g',f,y3,'b',f,y4,'m'); axis([0 2.5 0.7 1]); xlabel('f');ylabel('H(f)'); title('Transfer Function of Gaussian Filter');
高斯脉冲成形滤波器对矩形脉冲b(t)的响应波形g(t)
g (t ) = h(t ) * b(t ) = ∫
Tb 2 Tb t− 2 t+
π
a
exp(−
π2
a
T T 1 π π τ 2 )dτ = {erfc[ (t − b )] − erfc[ (t + b )]} 2 2 a 2 a 2
—— a=0.25,Bb=2.4 —— a=0.5,Bb=1.2 —— a=1,Bb=0.6 —— a=2,Bb=0.3
注意:采样频率fs=1000,数据率Rb=10
数字角频率=模拟角频率*Ts,数字频率=模拟角频率/采样频率=100/1000=0.1 N为pwelch的谱计算长度,采样数字频率k/N
利用MATLAB的FFT函数计算功率谱
f c = 10 Rb
t=0.001:0.001:1;Tb=0.1;w0=20*pi/Tb; c=cos(w0*t); subplot(7,1,1),plot(t,c); d=[1 -1 -1 -1 1 -1 1 1 -1 -1]; w=d*pi/(2*Tb); s=2*[ones(1,100) zeros(1,100) zeros(1,100) zeros(1,100) ones(1,100) zeros(1,100) ones(1,100) ones(1,100) zeros(1,100) zeros(1,100)]-1; subplot(7,1,2),plot(t,s); y0=c.*s; subplot(7,1,3),plot(t,y0); t1=0.001:0.001:Tb y1=cos((w0+w(1)).*t1); for i=1:9 z(1)=0 z(i+1)=z(i)+(d(i)-d(i+1))*i*pi/2; end y2=cos((w0+w(2)).*(t1+Tb)+z(2)); y3=cos((w0+w(3)).*(t1+2*Tb)+z(3)); y4=cos((w0+w(4)).*(t1+3*Tb)+z(4)); y5=cos((w0+w(5)).*(t1+4*Tb)+z(5)); y6=cos((w0+w(6)).*(t1+5*Tb)+z(6)); y7=cos((w0+w(7)).*(t1+6*Tb)+z(7)); y8=cos((w0+w(8)).*(t1+7*Tb)+z(8)); y9=cos((w0+w(9)).*(t1+8*Tb)+z(9)); y10=cos((w0+w(10)).*(t1+9*Tb)+z(10)); y=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10]; subplot(7,1,4),plot(y); S=fft(s); subplot(7,1,5),plot(10*log10(abs(S).^2/max(abs(S).^2)));axis([0 1000 -50 0]); Y0=fft(y0); subplot(7,1,6),plot(10*log10((abs(Y0).^2)/max(abs(Y0).^2)));axis([0 1000 -50 0]); Y=fft(y); subplot(7,1,7),plot(10*log10(abs(Y).^2/max(abs(Y).^2)));axis([0 1000 -50 0]);
ASK、MSK信号及其功率谱仿真
d(k)={1,0,0,01,0,1,1,0,0},采样间隔Ts=0.001 1、Tb=0.1,fc=100时,观察区间T=1 功率谱计算方法:① 利用MATLAB的FFT函数 ② 利用MATLAB的pwelch函数 2、Tb=0.1,fc=20时, 比较时域波形和功率谱的情况(差异)
利用MATLAB的pwelch函数计算功率谱
f c = 10 Rb
t=0.001:0.001:1;Tb=0.1;w0=10*2*pi/Tb; c=cos(w0*t); subplot(7,1,1),plot(t,c); d=[1 -1 -1 -1 1 -1 1 1 -1 -1]; w=d*pi/(2*Tb); s=2*[ones(1,100) zeros(1,100) zeros(1,100) zeros(1,100) ones(1,100) zeros(1,100) ones(1,100) ones(1,100) zeros(1,100) zeros(1,100)]-1; subplot(7,1,2),plot(t,s); y0=c.*s; subplot(7,1,3),plot(t,y0); t1=0.001:0.001:Tb y1=cos((w0+w(1)).*t1); for i=1:9 z(1)=0 z(i+1)=z(i)+(d(i)-d(i+1))*i*pi/2; end y2=cos((w0+w(2)).*(t1+Tb)+z(2)); y3=cos((w0+w(3)).*(t1+2*Tb)+z(3)); y4=cos((w0+w(4)).*(t1+3*Tb)+z(4)); y5=cos((w0+w(5)).*(t1+4*Tb)+z(5)); y6=cos((w0+w(6)).*(t1+5*Tb)+z(6)); y7=cos((w0+w(7)).*(t1+6*Tb)+z(7)); y8=cos((w0+w(8)).*(t1+7*Tb)+z(8)); y9=cos((w0+w(9)).*(t1+8*Tb)+z(9)); y10=cos((w0+w(10)).*(t1+9*Tb)+z(10)); y=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10]; subplot(7,1,4),plot(y); N=4096;Fn=(-0.5:1/N:0.5-1/N); Y=pwelch(y,hamming(33),16,N,'whole'); Y=10*log10(Y/max(Y)+0.000001); S=pwelch(s,hamming(33),16,N,'whole'); S=10*log10(S/max(S)+0.000001); Y0=pwelch(y0,hamming(33),16,N,'whole'); Y0=10*log10(Y0/max(Y0)+0.000001); subplot(7,1,5),plot(Fn,fftshift(S)); subplot(7,1,6),plot(Fn,fftshift(Y0)); subplot(7,1,7),plot(Fn,fftshift(Y));
利用MATLAB的pwelch函数计算功率谱
f c = 10 Rb
利用MATLAB的pwelch函数计算功率谱
f c = ห้องสมุดไป่ตู้b
t=0.001:0.001:1;Tb=0.1;w0=10*2*pi/Tb; c=cos(w0*t); d=[1 -1 -1 -1 1 -1 1 1 -1 -1]; w=d*pi/(2*Tb); s=2*[ones(1,100) zeros(1,100) zeros(1,100) zeros(1,100) ones(1,100) zeros(1,100) ones(1,100) ones(1,100) zeros(1,100) zeros(1,100)]-1; y0=c.*s; t1=0.001:0.001:Tb y1=cos((w0+w(1)).*t1); for i=1:9 z(1)=0 z(i+1)=z(i)+(d(i)-d(i+1))*i*pi/2; end y2=cos((w0+w(2)).*(t1+Tb)+z(2)); y3=cos((w0+w(3)).*(t1+2*Tb)+z(3)); y4=cos((w0+w(4)).*(t1+3*Tb)+z(4)); y5=cos((w0+w(5)).*(t1+4*Tb)+z(5)); y6=cos((w0+w(6)).*(t1+5*Tb)+z(6)); y7=cos((w0+w(7)).*(t1+6*Tb)+z(7)); y8=cos((w0+w(8)).*(t1+7*Tb)+z(8)); y9=cos((w0+w(9)).*(t1+8*Tb)+z(9)); y10=cos((w0+w(10)).*(t1+9*Tb)+z(10)); y=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10]; N=4096; Fn=-0.5:1/N:0.5-1/N; Y=pwelch(y,hamming(33),16,N,'whole'); Y=10*log10(Y/max(Y)+0.000001); S=pwelch(s,hamming(33),16,N,'whole'); S=10*log10(S/max(S)+0.000001); Y0=pwelch(y0,hamming(33),16,N,'whole'); Y0=10*log10(Y0/max(Y0)+0.000001); plot(Fn,fftshift(Y0),'g',Fn,fftshift(Y),'b',Fn,fftshift(S),'r');grid on;
—— a=0.25,Bb=2.4 —— a=0.5,Bb=1.2 —— a=1,Bb=0.6 —— a=2,Bb=0.3
高斯滤波器的冲激响应h(t)
h(t ) =
π
a
exp(−
π2
a2
t2)
t=0:0.01:1.5; y1=sqrt(pi)/0.25*exp(-((pi*t).^2)/0.25.^2); y2=sqrt(pi)/0.5*exp(-((pi*t).^2)/0.5.^2); y3=sqrt(pi)*exp(-(pi*t).^2); y4=sqrt(pi)/2*exp(-((pi*t).^2)/2.^2); plot(t,y1,'r',t,y2,'g',t,y3,'b',t,y4,'m'); xlabel('t/T');ylabel('h(t)'); title('Impulse Response of Gaussian Filter'); —— a=0.25 —— a=0.5 —— a=1 —— a=2
相关文档
最新文档