How to get spectrogram of an array in MATLAB?
조회 수: 14 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!