How to plot Gaussian spikes individually for peaks then show them summed together?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello, I am basically trying to create something that looks like this:
I am curretnly using a program that gives me the overall line shape after the Gaussian peaks have been added together. I can't seem to be able to plot the individual peaks that make it though.
I am doing something like:
spike_positions=[matrix of variable size depending on above functions];
Intensity= [matrix of Intensities as a function of spike_positions];
minvec=min[spike_position];
maxvec=max[spike_positions];
vec=0:1/srate:max_vec-min_vec;
spkvec=zeros(size(vec));
for i=1:length(spkpos)
t=gausswin(srate-1,alpha)';
t = t*Intensity(i);
start_end=[spkpos(i)-(round(srate/2)-1) spkpos(i)+(round(srate/2)-1) 1 srate-1];
if spkpos(i)<=(round(srate/2)-1);
start_end(1)=1;
start_end(3)=(round(srate/2)+1)-spkpos(i);
end
if spkpos(i)+(round(srate/2)-1)>=length(spkvec);
start_end(2)=length(spkvec);
start_end(4)=1+start_end(2)-start_end(1);
end
spkvec(start_end(1):start_end(2))=spkvec(start_end(1):start_end(2))+t(start_end(3):start_end(4));
end
vec=vec+min_vec+1/srate;
figure
plot(spkvec,'r')
This has worked well for me so far, but I would really like to see the individual peaks at each peak postions, not just the resulting sum. Any advice ?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!