Filtering a very noisy signal

42 visualizaciones (últimos 30 días)
José Sanches
José Sanches el 4 de Abr. de 2018
Respondida: ALOK el 2 de Ag. de 2023
Hi everyone
I´m trying to filter a very noisy signal.
My problem is I need some help because I don´t know how to do it.
My signal looks like this
As anyone can see this is very noisy. I want to filter this signal so that I can get a signal that follows the top values. To understand it better this I am measuring the temperature on a conveyor belt which transports something (which corresponds to the lower temperatures). I am interested just in the temperatures of the C.Belt...
I want that my signal should look like this.
can someone help me? This is my data in a matfile Thanks in advance
  2 comentarios
Birdman
Birdman el 4 de Abr. de 2018
Can you share your data in a mat file?
José Sanches
José Sanches el 4 de Abr. de 2018
Hi thanks for your concern

Iniciar sesión para comentar.

Respuesta aceptada

Birdman
Birdman el 4 de Abr. de 2018
Try the following code. Fistly, by the help of psd function, I observed your data's frequency plot to see at what frequencies you have noise, then in second part, by using butterworth function, I designed a filter to smooth your data. Hope this helps. Note that fc cut off frequency and order of filter should be chosen wisely.
load('oven.mat');
A=meas.Temp;
t=meas.Time;
Fs=1000;
h1=spectrum.welch;
set(h1,'Windowname','Hann');
set(h1,'OverlapPercent',66.7);
set(h1,'SegmentLength',1024);
myPsd=psd(h1,A,'Fs',Fs);
figure(1);
semilogx(myPsd.Frequencies/(2*pi),myPsd.Data);
set(gca,'XLim',[3 100]);
%it is seen that your data contains noise higher than 50Hz
fc=30;%cutoff frequency(Hz)
fs=1000;%sampling frequency(assumed)
[b,a] = butter(5,fc/(fs/2),'low');
y=filter(b,a,A);
figure(2);
plot(t,A);hold on;plot(t,y);legend('original','filtered');
hold off;
  2 comentarios
Birdman
Birdman el 4 de Abr. de 2018
Jose's answer moved here:
Hi again. This seems to work. But to use your code I need to understand it very well... Thanks for you help. Now... can you please explain what is done? what do you mean by "it is seen that your data contains noise higher than 50Hz" how can you see that?
Birdman
Birdman el 4 de Abr. de 2018
When you check the first figure, which is plotted by semilogx command, you will see that at higher frequencies(if you zoom on them), you will see some movements. This means that you have noises at those frequencies. If you want to get rid of them, you need to use a filter. The unit of them are Hertz.
butterworth command just uses cutoff and sampling frequencies to design the necessary filter of an order that you specify. It has the following transfer function:
Wn^2
________
(s+Wn)^2
If you plot the Bode of it, you will see the magnitude will start to decay after the cutoff frequency, which is given by us.

Iniciar sesión para comentar.

Más respuestas (1)

ALOK
ALOK el 2 de Ag. de 2023
Data1=load ( 'noisySignal.mat') ; Window =20; Moving _avg filter= ones

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by