How to remove artifact signal from my data

14 次查看(过去 30 天)
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.

回答(1 个)

Kevin Chng
Kevin Chng 2018-12-6
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 个评论
Thiago Petersen
Thiago Petersen 2018-12-6
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 2018-12-7
编辑:Kevin Chng 2018-12-7
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');

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Electrophysiology 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by