how can i superimpose a sine wave according to give image. its an image of neuron firing. how can i convert this to sin wave. in simple way in matlab.

5 views (last 30 days)
  4 Comments
Alexander
Alexander on 23 Mar 2024
To be honest, I don't understand what you want. Two things would be very helpful:
  1. Attaching a sample file with data
  2. What do you expect as result? Paint it manually in the plot above.
Asha
Asha on 23 Mar 2024
clc;
clear all
close all
a1 = 0.02;
b1 = 0.2;
c1 = -65;
d1 = 8;
a2 = 0.1;
b2 = 0.2;
c2 = -65;
d2 = 2;
a3 = 0.02;
b3 = 0.25;
c3 = -65;
d3 = 2;
T0 = 100;
dt = 0.01;
T = ceil(T0/dt);
I_pre = 20;
v1(1) = -65;
u1(1) = b1 * v1;
v2(1) = -65;
u2(1) = b2 * v2;
v3(1) = -65;
u3(1) = b3 * v3;
t = linspace(0, T0);
% Synaptic weight
gII = 0.1; gOI = 0.2; gIO = 0.5; gIE = 0.1; %gOE = 0.1;
gEI = 0.1;
gEO = 0.01; IE = 1.3; II = 0.8; IO = -1; gOE = 0.08;
v_peak = 30;
for i=1:T-1
v1(i+1) = v1(i) + ((0.04 * v1(i)^2) + (5 * v1(i)) + 140 - u1(i) + I_pre)*dt;
u1(i+1) = u1(i)+ (a1 * (b1 * v1(i) - u1(i)))*dt;
if v1(i) >= v_peak
v1(i) = c1;
u1(i) = u1(i) + d1;
end
end
for i=1:T-1
v2(i+1) = v2(i) + ((0.04 * v1(1)^2) + (5 * v1(1)) + 140 - u1(1) + gEI*I_pre)*dt;
u2(i+1) = u2(i) + (a2 * (b2 * v2(i) - u2(i)))*dt;
if v2(i) >= v_peak
v2(i) = c2;
u2(i) = u2(i) + d2;
end
v3(i+1) = v3(i) + ((0.04 * v1(1)^2) + (5 * v1(1)) + 140 - u1(1) + gEO*I_pre)*dt;
u3(i+1) = u3(i) + (a3 * (b3 * v3(i) - u3(i)))*dt;
if v3(i) >= v_peak
v3(i) = c3;
u3(i) = u3(i) + d3;
end
v3(i+1) = v3(i) + ((0.04 * v2(i)^2) + (5 * v2(i)) + 140 - u2(i) + gIO*I_pre)*dt;
u3(i+1) = u3(i) + (a3 * (b3 * v3(i) - u3(i)))*dt;
if v3 >= v_peak
v3(i) = c3;
u3(i) = u3(i) + d3;
end
v2(i+1) = v2(i) + ((0.04 * v3(i)^2) + (5 * v3(i)) + 140 - u3(i) + gOI*I_pre)*dt;
u2(i+1) = u2(i) + (a2 * (b2 * v2(i) - u2(i)))*dt;
if v2(i) >= v_peak
v2(i) = c2;
u2(i) = u2(i) + d2;
end
v2(i+1) = v2(i) + ((0.04 * v2(i)^2) + (5 * v2(i)) + 140 - u2(i) + gII*I_pre)*dt;
u2(i+1) = u2(i) + (a2 * (b2 * v2(i) - u2(i)))*dt;
if v2(i) >= v_peak
v2(i) = c2;
u2(i) = u2(i) + d2;
end
v1(i+1) = v1(i) + ((0.04 * v2(i)^2) + (5 * v2(i)) + 140 - u2(i) + gIE*I_pre)*dt;
u1(i+1) = u1(i) + (a2 * (b2 * v2(i) - u2(i)))*dt;
if v1(i) >= v_peak
v1(i) = c1;
u1(i) = u1(i) + d2;
end
v1(i+1) = v1(i) + ((0.04 * v3(i)^2) + (5 * v3(i)) + 140 - u3(i) + gOE*I_pre)*dt;
u1(i+1) = u1(i) + (a2 * (b2 * v2(i) - u2(i)))*dt;
if v2(i) >= v_peak
v2(i) = c2;
u2(i) = u2(i) + d2;
end
end
% Plot membrane potential of postsynaptic neuron
time = 1:length(v1);
figure;
plot(time, v1);
xlabel('Time (ms)');
ylabel('Membrane Potential (mV) ');
title('Membrane Potential of Postsynaptic Neuron @ I = 14');
time = 1:length(v1);
figure;
plot(time, u1);
xlabel('Time (ms)');
ylabel('Voltage(V) ');
title('recovery variable @ I = 20');
here in this first graph i want get this signal as an nested theta and gamma waves. my resul should be a sine wave which is superimposed in the graph.

Sign in to comment.

Accepted Answer

Asha
Asha on 23 Mar 2024
  3 Comments
Asha
Asha on 24 Mar 2024
no i couldnt do that. i need to process it in matlab. this i have done to show how i want the data. please help if you know. after changing this to sine i have find peak and trough to give ultrasound signal.
Alexander
Alexander on 24 Mar 2024
Edited: Alexander on 24 Mar 2024
Move your "answer" to a comment above. currently everyone is thinking your question is perfectly answered. And if you get a satifying answer mark it with accepted.

Sign in to comment.

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!