delay of swt command

5 views (last 30 days)
Bo
Bo on 19 Nov 2014
Hi, I am trying to decompose a 1D signal with swt command. What I find is that the decomposed signals always have a (negative) delay compared to the original signal.
For example, the following code will generate the attached plot. Is there a way to get rid of this delay? (PS: I am trying to implement the a trous alogrithm.)
clear all
close all
clc
%%construct signal
N = 128;
ecg = zeros(N,1);
ecg(N/2) = 1;
%%decompose with wavelet transform
h = [+1 +3 +3 +1]/8;
g = [-2 +2];
[ecga,ecgd] = swt(ecg,5,h,g);
%%plot
figure
set(gcf,'unit','normalized')
set(gcf,'position',[0.05 0.05 0.7 0.7])
ax(1) = subplot(5,1,1);
plot(ecg)
grid on
box on
ax(2) = subplot(5,1,2);
plot(ecgd(1,:))
grid on
box on
ax(3) = subplot(5,1,3);
plot(ecgd(2,:))
grid on
box on
ax(4) = subplot(5,1,4);
plot(ecgd(3,:))
grid on
box on
ax(5) = subplot(5,1,5);
plot(ecgd(4,:))
grid on
box on
linkaxes(ax,'x')

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!