How to get spectrogram of an array in MATLAB?

조회 수: 14 (최근 30일)
Bridgit Schneider
Bridgit Schneider 2020년 5월 21일
댓글: Star Strider 2020년 5월 21일
So.. I want to make spectrogram out of 4 signals that i need to add in array.
When I add them in array, it looks like this s=[x1 x2 x3 x4]; or with values: [1 1 0 1] But I'm not sure if it's proper adding..
Example of signal si this:
f1=1000; t1=0.2; x1=cos(2*pi*f1*t1);
so x1 is 1.
Is there a way of making spectrogram out of s?

채택된 답변

Star Strider
Star Strider 2020년 5월 21일
The documentation states that the input signal is ‘specified as a row or column vector’, so you would need to loop through each column of ‘s’, saving the results (outputs you will need to request in your code) in appropriate cell arrays.
Example —
for k = 1:size(s,2)
[sp{k},w{k},t{k}] = spectrogram(s(:,k));
end
Add other arguments to the spectrogram call as necessary to produce the results you want.
  댓글 수: 6
Bridgit Schneider
Bridgit Schneider 2020년 5월 21일
I think this will help a lot! Thank you very much for help :)
Star Strider
Star Strider 2020년 5월 21일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by