question regarding matched filter

1 次查看(过去 30 天)
Sotirios
Sotirios 2014-10-29
Hello,
I would like to apply a matched filter to a data to reduce some noise from it. I saw some topics on the internet about how to do it and I have created the code below.
clc; clear all; close all;
% load data
load data.mat
data = double(data);
[samples, pulse, pos] = size(data);
N = samples; % signal length
fs = 40*1e6; % sampling frequency [Hz]
T = 1/fs; % period [s]
t = 0 : T : (N-1)*T; % time vector
f_spa = fs/N; % frequency spacing
f = -fs/2 : f_spa : fs/2-1; % frequency vector
% signal in time domain
x_t = data;
% compute the matched filter
h_t = flipud(x_t);
% apply the filter to the signal
y_t = zeros(samples, pulse, pos);
for i = 1:pos
for j = 1:pulse
y_t(:,j,i) = conv(h_t(:,j,i), x_t(:,j,i), 'same');
end
end
% plot the spectrum of the signal
subplot 121; plot(f, abs(fftshift(fft(x_t(:,1,1)))), 'k');
xlabel('Frequency (Hz)'); ylabel('Signal amplitude');
title('Original signal');
% plot the spectrum of the filtered signal
subplot 122; plot(f, abs(fftshift(fft(y_t(:,1,1)))), 'r');
xlabel('Frequency (Hz)'); ylabel('Signal amplitude');
title('Filtered signal');
However, I am not quite satisfied with the result, since I would expect to get a smoother version of the sampled signal as a filtered signal.
I have also tried to use
y_t(:,j,i) = filter(h_t(:,j,i), 1, x_t(:,j,i));
instead of
y_t(:,j,i) = conv(h_t(:,j,i), x_t(:,j,i), 'same');
in the code, without getting a noticeable change in the output. Do you have any suggestions on how to get the result I want using a matched filter or any comments that might help me to reach on a solution?
Thank you guys!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matched Filter and Ambiguity Function 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by