필터 지우기
필터 지우기

Create signal block based on a threshold

조회 수: 2 (최근 30일)
Angus Joyce
Angus Joyce 2019년 9월 10일
답변: Sammit Jain 2020년 1월 27일
Hi there,
I have a signal which is saved as a csv file. I'm trying to break up the signal into individual blocks of a fixed length (say 100 samples) for analysis (fft, wavelet, amplitude etc) when a threshold is crossed. If, the threshold was to be placed at 5, I still need the a bit before the threshold included in the block (say 30 of the 100 samples before the major peak, 70 after). How would i go about this, only getting 1 block output per signal pulse.
Many thanks in advance!
matlab question.png

답변 (1개)

Sammit Jain
Sammit Jain 2020년 1월 27일
Hi Angus,
I'm assuming that the csv file has been imported into the MATLAB workspace. If you encountered issues while importing the csv, you may look at: https://www.mathworks.com/matlabcentral/answers/72545-how-to-import-csv-file-in-matlab
Let us say it had 600 samples, and it was broken down into 6 blocks of 100 samples each.
For the sake of this example, let us consider each block to be of length 10 samples.
Consider one such block B = [4 3 2 2 10 1 5 20 9 1].
B = [4 3 2 2 10 1 5 20 9 1];
idx = find(B > 5);
peak_idx = idx(1);
thresholded_sample = B(1:peak_idx-1);
In this case thresholded_sample will have [4 3 2 2]

카테고리

Help CenterFile Exchange에서 Signal Analysis에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by