segment exact time of signal
    6 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Farhad Abedinzadeh
 el 2 de Feb. de 2022
  
    
    
    
    
    Respondida: Lei Hou
    
 el 15 de Feb. de 2022
            Hi dear viewers.
I want to extract the exact time of the signal,for example I have a signal which is 1*1000000 in size.
and the sampling frequency is 200hz,I want to extract 00:14:36 to 00:16:12 from this signal.
would you please help me?
0 comentarios
Respuesta aceptada
  Lei Hou
    
 el 15 de Feb. de 2022
        Hi Farhad,
You can also use timetable + timerange indexing to complete your task.
>> tt = array2timetable(val','StartTime',duration(0,0,0),'SampleRate',200);
>> tt(timerange(duration(0,14,36),duration(0,16,12),'closed'),:)
ans =
  19201×1 timetable
      Time      Var1
    ________    ____
    00:14:36     25 
    00:14:36     25 
    00:14:36     24 
    00:14:36     25 
    00:14:36     25 
    00:14:36     25 
    00:14:36     25 
       :         :  
    00:16:11     34 
    00:16:11     37 
    00:16:11     35 
    00:16:11     35 
    00:16:11     37 
    00:16:11     37 
    00:16:12     34 
	Display all 19201 rows.
0 comentarios
Más respuestas (1)
  Benjamin Thompson
      
 el 2 de Feb. de 2022
        So this should be the calculation for the start and end sample numbers:
>> (14*60+36)*200
ans =
      175200
>> (16*60+12)*200
ans =
      194400
Then if you have a million-element vector D with your data, you can extract what you want as:
D(175200:194400)
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


