denoise non stationary signal
10 views (last 30 days)
Show older comments
mehrab zamanian
on 9 Sep 2022
Commented: Star Strider
on 9 Sep 2022
how an non-stationary signal could be denoised ? In most material, is only written about denoising stationary signals.
Is there any specific filter?
Besides that I just need my signal in the frequency domain and if you suggest denoise with wavelet how can I transform the signal from wavelet to frequency domain directly?
0 Comments
Accepted Answer
Star Strider
on 9 Sep 2022
I have nothing against using wavelets to denoise a signal, however I generally find the sgolayfilt function useful in eliminating broadband noise from a signal. If you have band-limited noise, then use an appropriate digital filter such as bandpass to eliminiate it (the filter type will be dependent on the nature of the noise).
4 Comments
Star Strider
on 9 Sep 2022
I should have been a bit more specific in my recommendations. I usually choose a 3-degree polynomial. Higher orders than 5 will model the signal very closely and not give good noise elimination. I always have to experiment with the frame length.
Try this —
LD = load(websave('Bnew','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1120910/Bnew.mat'))
Bnew = LD.Bnew;
fs = LD.fs
L = numel(Bnew);
t = linspace(0, L-1, L)/fs;
figure
plot(t, Bnew)
grid
xlim([0 0.005])
Bnew_filt = sgolayfilt(Bnew, 3, 301);
figure
plot(t, Bnew_filt)
grid
xlim([0 0.005])
Fn = fs/2;
NFFT = 2^nextpow2(L);
FTssf = fft([Bnew Bnew_filt], NFFT)/L;
Fv = linspace(0, 1, NFFT/2+1)*Fn;
Iv = 1:numel(Fv);
H = FTssf(:,2) ./ FTssf(:,1);
figure
plot(Fv, abs(FTssf(Iv,:))*2)
grid
xlabel('Frequency')
ylabel('Magnitude')
title('Fourier Transforms')
legend('Original','Filtered', 'Location','best')
xlim([0 2.5E+5])
figure
plot(Fv, mag2db(abs(H(Iv))))
% set(gca,'XScale','log')
grid
xlim([0 2.5E+5])
xlabel('Frequency')
ylabel('Magnitude')
title('Transfer Function of Savitzky-Golay Filter For This Signal')
The frequency characteristics of this signal are interesting, leading me to believe it has already been lowpass-filtered. The derived thansfer function of the Savitzky-Golay filter reveals it to have a ‘comb’ characteristic with significant filtering at three different frequencies.
Experiment with it (and this code) to get the result you want.
.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!