How to remove artifact signal from my data

16 visualizaciones (últimos 30 días)
Thiago Petersen
Thiago Petersen el 5 de Dic. de 2018
Editada: Kevin Chng el 7 de Dic. de 2018
Hi guys,
Hope everything is fine. I am working with some electric signal recordings and i want to remove some artifact signals from my data. I have two spikes: the big spikes, that i want to keep in the file, and the small spikes, that I want to remove from the data (I call this the artifact). Here a code that I use to plot the data:
fs = 48828.128; % my sample rate
t=[1/fs:1/fs:length(wav)/fs]; % to calculate the time (seconds) for x axis
plot(t,wav);
ylabel ('Amplitude (V)');
xlabel ('Time (s)');
I get a plot like this:
So, you guys knows how I can remove this small spikes from the data? Follows the datafile attached.
Thanks for your help.

Respuestas (1)

Kevin Chng
Kevin Chng el 6 de Dic. de 2018
Try, however, other might have better answer/solution for it.
load file1
fs = 48828.128; % my sample rate
t=[1/fs:1/fs:length(wav)/fs]; % to calculate the time (seconds) for x axis
wav(wav>0.06 & wav<0.1)=nan;
wav(wav<0.04 & wav>-0.03)=nan;
wav=fillmissing(wav,'linear');
plot(t,wav);
ylabel ('Amplitude (V)');
xlabel ('Time (s)');
xlim([1.7 1.8])
  2 comentarios
Thiago Petersen
Thiago Petersen el 6 de Dic. de 2018
Hi Kevin!
Your code works good in some way, but some small peaks still persists during the 15 seconds recording. What I really want is to delete all the small peaks from the recording (the 15 seconds).
Kevin Chng
Kevin Chng el 7 de Dic. de 2018
Editada: Kevin Chng el 7 de Dic. de 2018
You may play around with the range on small peak by following command. set them to nan, then link them up by linear interpolation. Will it work for you?
wav(wav>0.06 & wav<0.1)=nan;
wav=fillmissing(wav,'linear');

Iniciar sesión para comentar.

Categorías

Más información sobre Electrophysiology en Help Center y File Exchange.

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by