- hilbert - https://in.mathworks.com/help/signal/ref/hilbert.html
- angle - https://in.mathworks.com/help/matlab/ref/angle.html
Does signal filtering with wavelet deconstruction (wavedec) and then reconstruction (wrcoef) introduce a phase shift ?
4 次查看(过去 30 天)
显示 更早的评论
Hello
I am removing low frequency noise from a signal using wavelet deconstruction and then reconstruction at a specific level:
I am removing the approximation signal at level 10 which approximates the low frequency noise
[c,l] = wavedec(signal,14,'db2');
lfnoise = wrcoef('a',c,l,'db2',10);
final = signal - lfnoise;
Does this instroduce a phase shift in the final filtered signal? Visually it does not seem to add a significant phase shift, but wanted to know if there is a small phase shift that may be hard to detect? If so how can I quantify this phase shift?
Tx
0 个评论
回答(1 个)
Paras Gupta
2023-8-22
Greetings,
I understand that you want to quantify the phase shift between the original and the reconstructed signals. The phase shift occurs as some information may be lost during the deconstruction and reconstruction process.
Please refer the code below to quantify the phase shift:
Fs = 1000; % Sampling frequency (Hz)
t = 0:1/Fs:1; % Time vector (1 second duration)
f = 10; % Frequency of the signal (Hz)
signal = sin(2*pi*f*t);
[c,l] = wavedec(signal,14,'db2');
lfnoise = wrcoef('a',c,l,'db2',10);
final = signal - lfnoise;
% Plot the original signal and the final filtered signal
figure;
subplot(2, 1, 1);
plot(t, signal);
title('Original Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(2, 1, 2);
plot(t, final);
title('Final Filtered Signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Quantifying the Phase Shift
original_phase = angle(hilbert(signal));
filtered_phase = angle(hilbert(final));
phase_difference = filtered_phase - original_phase;
size(phase_difference)
Please find more information on the functions used in the code above using the following documentation links.
Hope this helps.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!