How to cut the signal for a particular time period
5 views (last 30 days)
Show older comments
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?
0 Comments
Answers (2)
KSSV
on 21 May 2018
Edited: KSSV
on 21 May 2018
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 Comments
KSSV
on 21 May 2018
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
on 21 May 2018
Edited: Ameer Hamza
on 21 May 2018
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
See Also
Categories
Find more on Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!