필터 지우기
필터 지우기

Filtering .csv file

조회 수: 5 (최근 30일)
Sonali Sahansra
Sonali Sahansra 2020년 2월 18일
편집: Anurag Ojha 2023년 10월 25일
Hello,
I am using Galvanic Skin Response (GSR) to measure the skin conductance whose reponse is displayed on Neulog. The samping rate is 20samples/second for the duration of 10 seconds. The data is saved in form of CSV file. I have displayed the signal using following code.
dataset = xlsread('rohit calm 1.csv', 'rohit calm 1', 'A8:B209');
y=dataset(:,2);
x= dataset(:,1);
plot(x,y)
xlabel ('X Time(seconds)')
ylabel('Y / GSR Amplitude(uS)')
grid on
Now I don't know how to apply filter to this as I am new to Matlab. I need to process the signal to eliminate artifacts from my signal. How can i apply filter to my .csv file? I would be delighted to any help.
  댓글 수: 1
Vladimir Calderón
Vladimir Calderón 2021년 9월 13일
In brief:
filter slow component (low pass)
and detect onsets of the phasic componentes (fast increase-slow decrease)

댓글을 달려면 로그인하십시오.

답변 (1개)

Anurag Ojha
Anurag Ojha 2023년 10월 25일
편집: Anurag Ojha 2023년 10월 25일
Hi Sonali ,
As per my understanding, you want to know how to apply filters in order to eliminate artifacts from your signal.
In order to eliminate disturbance, you can use the Butterworth Filter. It is used to define a low-pass filter, which is applied to remove high-frequency noise and retain the lower-frequency components of interest.
We need to use “butter” in combination with “filtfilt”, which is used to ensure that the filtering process does not introduce phase distortions into the data, which can be critical when working with physiological signals like GSR.
Here is a sample code to apply “Butterworth filter” to a signal :
% Load your dataset
dataset = xlsread('rohitcalm1.csv', 'rohit calm 1', 'A8:B209');
y = dataset(:, 2);
x = dataset(:, 1);
% Define filter parameters
order = 4; % Filter order (you can adjust this)
cutoff_freq = 2; % Cutoff frequency in Hz
% Design the low-pass Butterworth filter
[b, a] = butter(order, cutoff_freq / (20 / 2)); % 20 is the sampling rate
% Apply the filter to your GSR data
filtered_data = filtfilt(b, a, y);
% Plot the filtered data
plot(x, y, 'b', x, filtered_data, 'r');
xlabel('Time (seconds)');
ylabel('GSR Amplitude (uS)');
legend('Original', 'Filtered');
grid on;
Please refer to following MATLAB documentation to explore more:
I hope this helps to resolve your query.

카테고리

Help CenterFile Exchange에서 Measurements and Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by