How to remove artifact signal from my data

16 Ansichten (letzte 30 Tage)
Thiago Petersen
Thiago Petersen am 5 Dez. 2018
Bearbeitet: Kevin Chng am 7 Dez. 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.

Antworten (1)

Kevin Chng
Kevin Chng am 6 Dez. 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 Kommentare
Thiago Petersen
Thiago Petersen am 6 Dez. 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 am 7 Dez. 2018
Bearbeitet: Kevin Chng am 7 Dez. 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');

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Electrophysiology finden Sie in Help Center und File Exchange

Produkte


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by