フィルターのクリア

How to cut the signal for a particular time period

5 ビュー (過去 30 日間)
Chandrika Avvaru
Chandrika Avvaru 2018 年 5 月 21 日
コメント済み: KSSV 2018 年 5 月 21 日
I had a data with x samples in which i only need the samples during the time period y.How can I get those specific samples?

回答 (2 件)

KSSV
KSSV 2018 年 5 月 21 日
編集済み: KSSV 2018 年 5 月 21 日
Read about inerp1. Do the interpolation and get what you want.
Let t,x be your signal, and you want signal value at time ti.
xi = interp1(t,x,ti) ;
  2 件のコメント
Chandrika Avvaru
Chandrika Avvaru 2018 年 5 月 21 日
sir,actually i had a vector of samples of 1*x dimension which consists 0,1,3,5 for particular time.Now i need the range the samples where 0 comes and when 1 comes etc.Range in the in the sense I need to know the starting and ending sample values of 0
KSSV
KSSV 2018 年 5 月 21 日
If you want to know where 1 comes...let x be your signal.
tol = 10^-3 ;
idx = x(abs(x-1)<=tol) ;
iwant = t(idx)

サインインしてコメントする。


Ameer Hamza
Ameer Hamza 2018 年 5 月 21 日
編集済み: Ameer Hamza 2018 年 5 月 21 日
If x is a periodic signal and you want to extract its one cycle then you can use seqperiod().
y = x(1:seqperiod(x));
For example
x = [1 2 3 1 2 3 1 2 3 1]
y = x(1:seqperiod(x))
y =
1 2 3
Note: This function require Signal Processing Toolbox
  1 件のコメント
Chandrika Avvaru
Chandrika Avvaru 2018 年 5 月 21 日
It's not a periodic signal

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeWaveform Generation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by