How to get spectrogram of an array in MATLAB?
14 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bridgit Schneider
el 21 de Mayo de 2020
Comentada: Star Strider
el 21 de Mayo de 2020
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 comentarios
Respuesta aceptada
Star Strider
el 21 de Mayo de 2020
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Time-Frequency Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!