Effacer les filtres
Effacer les filtres

question regarding matched filter

1 vue (au cours des 30 derniers jours)
Sotirios
Sotirios le 29 Oct 2014
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!

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by