필터 지우기
필터 지우기

analyzing biosignals in Matlab

조회 수: 3 (최근 30일)
Mary G
Mary G 2011년 7월 2일
Hi, I am having a project where I have to open a signal from muscles in matlab and use to it find a few parameters. I'm a beginner in matlab so I apologize if my questions might sound too simple. first, the file for my signal is a .mat file. I know how to load it in matlab but how can I open it as a figure? (a plot of my signal) I mean I wanna see my signal in matlab. second, I need to find the median frequency for this signal which is in the time domain itself so it has to turn into freq domain first. I need the median frequecy for 2 parts of signal, from the beginning to near the middle, and then middle to end. How do I do that? I know about the functions in matlab that take median freq etc but I need the exact code as an example. any help would be really appreciated.

채택된 답변

Rick Rosson
Rick Rosson 2011년 7월 2일
Hi Mary,
The functions that you need in MATLAB include:
plot
median
fft
fftshift
To use these function, you will need a time-domain representation of your signal, which according to your question you can load from a MAT file.
If you need information about how to call these functions, please type
doc functionName
at the MATLAB command line, where functionName is the name of one of these function. For example, type
doc fft
to open the function reference page for the fft function.
You will also need to know the sampling rate (call it Fs) in samples per second of the signal. Once you have Fs, you can compute the time domain t and the frequency domain f.
HTH.
Rick
  댓글 수: 1
Mary G
Mary G 2011년 7월 2일
Dear Rick,
Thank you so much for your reply.
Well I know how to load the file in matlab, but how do I view it? I mean how can I see the signal from matlab after loading its file?

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

추가 답변 (4개)

Rick Rosson
Rick Rosson 2011년 7월 2일
Hi Mary,
When you load the file into MATLAB, what are the names and sizes of the variables that appear in the MATLAB Workspace? To find out, please try the following:
filename = 'myfile.mat'; % or whatever the file is called
load(filename);
whos
Then please copy and paste the table from the Command Window to this forum.
Thanks.

Rick Rosson
Rick Rosson 2011년 7월 3일
Hi Mary,
The easiest way to visualize a signal in MATLAB is to simply plot it. Please try:
plot(x);
where x is the name of the variable containing the samples of the signal.
HTH.
Rick

Mary G
Mary G 2011년 7월 4일
Dear Rick, thanks alot for your repllies! I figured it out now. All the best Mary

Mary G
Mary G 2011년 7월 16일
Hi, I'm having problem getting some info from my image data files. I need the resolution, time of imaging and imaging pulse sequence used for my data files. my data are in .hdr and .img format. Unfortunately I can not use the imfinfo function of matlab to get image info. is there anything else I can use for my data formats to extract these three parameters I'm looking for? please reply asap if you can thank you mary
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 7월 16일
Is there a name for the data file format you are using? If not, then what kind of device produced it?
Mary G
Mary G 2011년 7월 17일
Well, I don know what kind of device produced it; its just some data collected from a subject during a functional MRI procedure. the files are in pairs of image files and header files (name.img and name.hdr)so for each data collected from the subject there's 2 formats.

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

카테고리

Help CenterFile Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by