写一段matlab程序实现ricker子波的匹配滤波
clear all; close all;
%生成ricker子波 f = 25; %中心频率 t = -0.2:0.001:0.2; %时间范围 w = pif(t-1/f); y = (1-2*w.^2).*exp(-w.^2);
%绘制ricker子波 figure; plot(t,y); xlabel('Time (s)'); ylabel('Amplitude'); title('Ricker Wavelet');
%生成信号并加噪声 t1 = -1:0.001:1; %时间范围 f1 = 10; %信号频率 y1 = sin(2pif1*t1); %信号 noise = randn(size(t1))*0.5; %噪声 y2 = y1 + noise; %加噪声后的信号
%绘制信号和加噪声后的信号 figure; subplot(2,1,1); plot(t1,y1); xlabel('Time (s)'); ylabel('Amplitude'); title('Signal'); subplot(2,1,2); plot(t1,y2); xlabel('Time (s)'); ylabel('Amplitude'); title('Noisy Signal');
%匹配滤波 y3 = conv(y2,fliplr(y)); %滤波 t2 = linspace(t1(1)+t(1),t1(end)+t(end),length(y3)); %时间坐标 y3 = y3(length(y)/2+1:end-length(y)/2); %裁剪
%绘制匹配滤波后的信号 figure; plot(t2,y3); xlabel('Time (s)'); ylabel('Amplitude'); title('Matched Filtered Signal')
原文地址: https://www.cveoy.top/t/topic/dxoV 著作权归作者所有。请勿转载和采集!