Hello Totanly,
To extract the original waveform from the noisy waveform, you can use signal processing techniques like the Wiener filter and the Richardson-Lucy deconvolution in MATLAB. Here is how you can apply both methods to your data:
- Wiener Filter:
The Wiener filter is used to reduce noise and improve the signal quality. It assumes that both the signal and noise are stationary processes. Here is how you can apply the Wiener filter using MATLAB:
% Noisy waveform
noisywaveform = [0 0 0 0 0 0 0 0 0 0 0 0 82 76 66 82 70 64 70 82 87 79 88 89 84 100 89 79 98 96 85 72 108 98 99 106 105 108 101 105 129 111 133 108 101 118 117 142 123 131 137 122 118 144 196 131 137 151 162 146 183 157 172 152 166 171 172 193 174 175 171 158 168 174 166 179 198 166 172 187 164 133 161 155 163 143 134 155 144 157 136 136 151 129 139 156 168 105 127 130 150 137 136 138 171 146 125 135 106 123 115 123 113 98 108 87 0 0 0 0 0 0 0 0 0 0 0 0];
% Apply Wiener filter
estimated_signal_wiener = wiener2(noisywaveform, [1, 5]); % Adjust window size as needed
% Plot the results
figure;
plot(noisywaveform, 'r', 'DisplayName', 'Noisy Waveform');
hold on;
plot(estimated_signal_wiener, 'b', 'DisplayName', 'Wiener Filtered Signal');
legend;
title('Wiener Filter');
xlabel('Sample Index');
ylabel('Amplitude');
The plot looks like:
- Richardson-Lucy Deconvolution:
The Richardson-Lucy algorithm is typically used for deconvolution, especially in image processing, but it can be adapted for 1D signals. This method assumes a known point spread function (PSF). Here is how you can apply the Richardson-Lucy deconvolution:
% Define the point spread function (PSF)
psf = ones(1, 5) / 5; % Example PSF, adjust as needed
% Apply Richardson-Lucy deconvolution
estimated_signal_rl = deconvlucy(noisywaveform, psf, 10); % Number of iterations can be adjusted
% Plot the results
figure;
plot(noisywaveform, 'r', 'DisplayName', 'Noisy Waveform');
hold on;
plot(estimated_signal_rl, 'g', 'DisplayName', 'Richardson-Lucy Deconvolved Signal');
legend;
title('Richardson-Lucy Deconvolution');
xlabel('Sample Index');
ylabel('Amplitude');
The result looks like:
I hope this helps!