필터 지우기
필터 지우기

How to obtain each each maximum value from each signal set?

조회 수: 25 (최근 30일)
Chen Kevin
Chen Kevin 2020년 4월 16일
댓글: Peng Li 2020년 4월 30일
Hi all
Because I am doing a special flow cytometry and I got 8 sets of wave, which means 1 set of wave is 1 cell pass through my sensor.
Now, I want to know how to pick up the maximum amplitude from each sets of wave?
Plus, are there any method to prevent double pick if one set of wave have same max value?
Thanks!
  댓글 수: 10
Chen Kevin
Chen Kevin 2020년 4월 20일
Hi Peng Li,
May I hear about how do you use "threshold" way to find the max value from each wave sets? Maybe using "if" function?
Here is the signal code:
%Generate signal
fs = 1e9;
tc = gauspuls('cutoff',10e3,0.5,[],-40);
t = -tc:1/fs:tc;
x = gauspuls(t,10e3,0.5);
ts = 0:1/50e3:0.025;
d = [0:1/1e3:0.025;sin(2*pi*0.1*(0:25))]';
y = pulstran(ts,d,x,fs);
plot(ts,y)
xlim([0 0.01])
Peng Li
Peng Li 2020년 4월 30일
Sorry didn't log on these days. quite stressful working from home...
see below an example using your synthetic data
%% Your Generate signal Copied here
fs = 1e9;
tc = gauspuls('cutoff',10e3,0.5,[],-40);
t = -tc:1/fs:tc;
x = gauspuls(t,10e3,0.5);
ts = 0:1/50e3:0.025;
d = [0:1/1e3:0.025;sin(2*pi*0.1*(0:25))]';
y = pulstran(ts,d,x,fs);
plot(ts,y)
xlim([0 0.01])
%% segmentation
baseline = ismembertol(y, 0, 1e-3);
% convert 0-1 series baseline to segments
incl = baseline ~= 1;
incT = diff([0; incl(:); 0]);
stId = find(incT == 1);
edId = find(incT == -1) - 1;
seg = [stId(:) edId(:)];
% you could possibly add some condition here to filter out segments that is
% too short
% alternatively (better), you find the between-waves segments, and add
% conditions to check the length of these segments. If too short, this
% might be a wrong detection and you delete it to merge the two waves
% let me know if this is clear for you
%% with each segment, detect maximum
% can use for, or arrayfun for better readability
pind = nan(size(seg, 1), 1);
for iS = 1:size(seg,1)
[~, ind] = max(y(seg(iS, 1):seg(iS, 2)));
pind(iS) = ind + seg(iS, 1) - 1;
end
hold on;
plot(ts(pind), y(pind), 'ro');

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

채택된 답변

Star Strider
Star Strider 2020년 4월 16일
You have the Signal Processing Toolbox, so use the findpeaks function to get the peak amplitudes. It has a number of options so you can be certain to get only the values you want. If you want to get the amplitudes of the ‘valleys’ use findpeaks on the negative value of the signal vector.
  댓글 수: 10
Chen Kevin
Chen Kevin 2020년 4월 17일
What I have considered method by used for and if function is :
  1. Set a threshold for switch on and switch off record the data
  2. Once the amplitude (y>threshold) which means the cell just enter the sensing zone, start the record
  3. When the amplitude (y<threshold) which means the cell almost leave the zone, stop recording
  4. Find the max value from this recording time interval
  5. The width can be get when the time interval calculated
However, I am quite fresh in Matlab so don't know how to wirte down them...
Star Strider
Star Strider 2020년 4월 18일
I do not understand. If you want to do this in real time, I doubt MATLAB is capable of tha. That might require additional hardware. If so, I will not be able to help you with it.
If you are only interested in recorded signals, there are several functions that might be able to help you with that, including findchangepts, and ischange.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by