How to isolate one pulse from a periodic pulse train

조회 수: 4 (최근 30일)
Hans123
Hans123 2019년 6월 20일
댓글: Star Strider 2019년 6월 20일
I want to isolate on pulse from this waveform, the data is in a CSV file and the 2 columns contain time data and voltage data.
I want to use a MATLAB code to trim out one full pulse (+peak,zero,-peak,zero)
How can I do this, the peak value is shown using the data cursor
PEAK.PNG
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 6월 20일
Use voltage>upper_th & voltage<lower_th??
Hans123
Hans123 2019년 6월 20일
If you can, can you explain a little further. I need only one pulse out of the 3 in the image. How can I isolate one pulse?

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

채택된 답변

Star Strider
Star Strider 2019년 6월 20일
One approach:
t = linspace(0, 2.3, 500); % Time Vector
pulses = -0.14*sign(sin(5*pi*t/2).*(abs(sin(5*pi*t/2))>0.9)) + rand(size(t))*0.005; % Create Waveform
Mv = pulses > 0.1; % Threshold
Mvs = strfind(Mv, [0 1]); % Start Of Each Pulse
Mve = strfind(Mv, [1 0])+1; % End Of Each Pulse
figure
plot(t, pulses)
hold on
plot(t(Mvs(1):Mve(1)), pulses(Mvs(1):Mve(1)), '+')
hold off
Make appropriate changes to work with your signal.
  댓글 수: 4
Hans123
Hans123 2019년 6월 20일
Thanks a lot, I really appreciate your help!
Star Strider
Star Strider 2019년 6월 20일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by