denoise non stationary signal

10 views (last 30 days)
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?
My signal in periodogram

Accepted Answer

Star Strider
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
mehrab zamanian
mehrab zamanian on 9 Sep 2022
Tnx a lot
Unfortunatly I cant find best order and framelength for this filter that suitable for my signal. In frequency domain I need my signal have certain peak and the frequency content between peaks become smooth.
please help me for this problem! this is a part of my thesis and I have been working on it for months.
my signal and sample rate are attached in .mat file. my code is written below. the main frequency is between [20-100]KHz
load("Bnew")
order = 9;
framelen =301;
sgf = sgolayfilt(Bnew,order,framelen);
fsgf=fft(sgf,2^20);
asgf=abs(fsgf);
Ze=asgf(1:end/2);
L=size(Ze,1);
f = fs*(0:floor(L)-1)/(2*L);
figure
plot(f,Ze)
xlim([20000 100000])
Star Strider
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'))
LD = struct with fields:
Bnew: [198657×1 double] fs: 10000000
Bnew = LD.Bnew;
fs = LD.fs
fs = 10000000
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.
.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!