How to calculate mean frequency and amplitude between a period of a particular time interval.

조회 수: 1 (최근 30일)
I wish to calculate mean frequency and amplitude in a particular interval of 5 seconds. i have a text file which has 2 columns (time and electrical activity). Please help me out with the code or syntax. Thank you. :)
  댓글 수: 1
Akshat Shrivastava
Akshat Shrivastava 2018년 8월 2일
So far, i have used this code :
[fid,msg] = fopen('Rose.txt','rt');
assert(fid>=3,msg)
C = textscan(fid, '%f%f', 'CommentStyle','#', 'CollectOutput',true);
fclose(fid);
M = C{1};
Now i need to calculate the frequency and amplitude for a period of 5 seconds from a particular time. Kindly help me out. Thank you :)

댓글을 달려면 로그인하십시오.

답변 (1개)

Peter Perkins
Peter Perkins 2018년 8월 3일
I'm guessing you want to use readtable, convert the result to a timetable using table2timetable, and then either use a timerange subscript to compute mean over one period, or use retime to compute means over all 5sec periods.
  댓글 수: 1
Akshat Shrivastava
Akshat Shrivastava 2018년 8월 3일
@ Peter Perkins: Thank you for the suggestion, could you please also tell me the syntax/code for function you mentioned. (As per the code i mentioned above). I would be really grateful . Thank you :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Standard File Formats에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by