Combining EEG Signal with Sine wave (transcranial AC Stimulation- tACS) at a particular point of injection via addition

3 visualizzazioni (ultimi 30 giorni)
Hi everyone,
I am trying to combine two signals into one via addition or multplication. As a start of test, maybe addition first. So my target is to get EEG+tACS as the output signal from code. But I combining them only for a period of time, in other means, injection of tACS is done for a period of time. In my case,I am opting for 5 seconds. And I am not injecting it onto EEG recording from 0s. I want to inject it mid-way: After 30 seconds the EEG is recorded. The drawing attached explains what I am trying to do.
The code that I am working on: (it is incomplete, I am confused but I am pretty sure it should be simple) considering the sampling time is different too. I have attached the EEG data if needed.
%load EEG data
load('Test_Sham_Alpha.mat');
%plot(EEG.Time(1,1:46600)' , EEG.Data(1,1:46600)') - this is the full data
%length
%define sine wave
%%Time specifications:
Fs = 500; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 5; % seconds
t = (0:dt:StopTime-dt)'; % seconds
%%Sine wave:
Fc = 5; % hertz
A= 0.001;
x = A*sin(2*pi*Fc*t);
% Plot the signal versus time:
%figure;
%plot(t,x);%length t elements (interested) = 2500
%xlabel('time (in seconds)');
%title('tACS Signal');
%inject f 5 Hz tACS at time: 30 seconds (Y= 30453934)
%for 5 seconds (25 cycles)
time= EEG.Time(1,1:46600)
for EEG.Time(1,15000:17500)%length of EEG.time =2501
%add y-axis value for both signals
y1= EEG.Data(1,1:46600);
y2= x
y= y1+y2
end
%i am not sure if the above make sense or now
%not sure how to continue
%for the figure: I wanted that the plot shows EEG of its full length data
%where between 30-35s of EEG, there is a signal combination (adding of tACS sine
%wave with the EEG)
figure ('Name','Combined EEG+ tACS');
plot(t,y);%length t elements = 2500
xlabel('time (in seconds)');
%for simplicity: maybe a replica of EEG data is is this one:
ns = sqrt(0.2)*randn(1,n);
% (I do not have the authority permission to publicly post here
Other Information:
Basically I am trying to computationaly replicate EEG+tACS data signal that was measure before. And maybe after that use some of validation tehcnique to see how the code-based output signal matches (accuracy level). The tACS is an AC signal but not necessarily a sine wave. The EEG signal is in the range of nV and tACS is in the range of mA. The combination of these two creates artefacts that blocks from able to obtain the tACS-affected EEG. In the data, tACS is what is blocking the EEG (visually) and creating sudden spike. Right now, I am not sure hoe the EEG+tACS is combined (when it is measured and processed for display) logically, I think addition operation makes more sense. Because multiplication would cause a smaller signal output made from both of that
That is all. Any help and ideas are very much welcomed. Please help out! Thank you very much in advance.
Regards,
Anis

Risposte (0)

Categorie

Scopri di più su Biomedical Signal Processing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by