Deconvolution creates new peaks

조회 수: 4 (최근 30일)
Riccardo
Riccardo 2025년 3월 2일
댓글: Riccardo 2025년 3월 3일
Hi, I'm trying to remove some noise on an accelerometer signal, this is mounted on the back of a hammer and I would ideally position it on the front to measure the acceleration of the impact. Both the accelerometer and the load cell signals have seven impacts. To remove the influnce of the body of the hammer I tryed to estimate the transfer function using tfestimate and then performing a deconvolution of the signal. This seems to work at first but zooming on the impacts, some peaks have doubled, like the fourth one:
this is my code:
load('accCorrectedReduced.mat')
load('forceCorrectedReduced.mat')
L = length(acc);
fs=51201;
%% deconvolution
nfft = L;
[Txy, f] = tfestimate(force, acc, hann(nfft), 0.7*fs, nfft, fs);
Y = fft(acc, nfft);
TxyFull = [Txy; conj(Txy(end-1:-1:2))];
fFull = linspace(0,fs,nfft);
TxyInterp = interp1(f, Txy, fFull(1:length(f)), 'linear', 'extrap');
TxyFull = [TxyInterp, conj(TxyInterp(end-1:-1:2))];
X_estimated = Y(1:end-1) ./ TxyFull.';
x_deconvolved = ifft(X_estimated);
figure;
plot( acc);
hold on
plot(-abs(x_deconvolved));

채택된 답변

Paul
Paul 2025년 3월 3일
편집: Paul 2025년 3월 3일
Hi Riccardo,
It might be simpler to just use the twosided option of tfestimate
Also, the input data is single, might want to convert to double for processing.
load('accCorrectedReduced.mat')
load('forceCorrectedReduced.mat')
whos
Name Size Bytes Class Attributes acc 2119721x1 8478884 single ans 1x47 94 char force 2119721x1 8478884 single
L = length(acc);
fs = 51201;
%% deconvolution
nfft = L;
[Txy, f] = tfestimate(force, acc, hann(nfft), 0.7*fs, nfft, fs,'twosided');
Y = fft(acc, nfft);
%TxyFull = [Txy; conj(Txy(end-1:-1:2))];
%fFull = linspace(0,fs,nfft);
%TxyInterp = interp1(f, Txy, fFull(1:length(f)), 'linear', 'extrap');
%TxyFull = [TxyInterp, conj(TxyInterp(end-1:-1:2))];
%X_estimated = Y(1:end-1) ./ TxyFull.';
X_estimated = Y./Txy;
x_deconvolved = ifft(X_estimated);
figure;
plot(acc);
hold on
%plot(-abs(x_deconvolved));
plot(-x_deconvolved)
Zoom in on each peak
[~,locs] = findpeaks(x_deconvolved,'MinPeakHeight',20,'MinPeakProminence',10);
numel(locs)
ans = 7
n = 1:numel(acc);
for ii = 1:numel(locs)
figure
index = (-1000:1000) + locs(ii);
plot(n(index),acc(index))
hold on
plot(n(index),-x_deconvolved(index))
end
  댓글 수: 1
Riccardo
Riccardo 2025년 3월 3일

Thank you very much this seems to be working

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by