필터 지우기
필터 지우기

how to retain the pulses of a specific duration and delete the rest ?

조회 수: 3 (최근 30일)
pavan sunder
pavan sunder 2016년 11월 2일
답변: Kushagr Gupta 2016년 11월 7일
i have a vetor which has pulses of different durations. I want to capture the pulses with a specific duration and delete the rest. Also the captured pulses should be displayed in the same time interval as in the original vector .kindly help me with a matlab code.

답변 (1개)

Kushagr Gupta
Kushagr Gupta 2016년 11월 7일
I understand that you wish to detect pulse widths along with their time-stamps and threshold the signal based on width.
The function 'pulsewidth' can be very useful in this regard as it outputs the widths and time information as well. Documentation for the same can be found at :
Once the widths and start-time of each pulse is known it can be used to capture wanted pulses. Following code snippet shows how 'pulsewidth' can be used:
>>A = rand(100,1);
>>B = A > 0.5; % creating a random signal of 1's and 0's
>>[wid, P_start, P_end, midL] = pulsewidth(double(B));
>>PulseInd=P_start+0.5 % index where a pulse begins
Thus "PulseInd" contains the index where a pulse begins and "wid" contains the width of that particular pulse. Using this information the signal can be thresholded and desired result obtained.

카테고리

Help CenterFile Exchange에서 Pulse and Transition Metrics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by