How can I plot some fft data in a different way?
Afficher commentaires plus anciens
Dear all,
I usual plot spectrograms plotting time vs. frequency vs. amplitude. I have collected some records through a microphone and each of the recordings are named usign a parameter, so called 'ϕ'. I would like to plot a single spectrogram similar to the one in the attached picture containing my data. File structure is 2 colums (time and amplitude) and 10000 rows.
Could you please help me making this "ϕ vs. frequency vs. amplitude" plot by using the two signal files attached?
I would sincerly appreciate it since I am litterally freaking out trying to fixing this issue.
4 commentaires
Yazan
le 21 Juil 2021
Define for us first the relation between time and ϕ. As you said, the spectrogram helps you plot the instantaneous spectra. To plot the instantaneous spectra as a function of ϕ, you need to define the relation between ϕ and time.
Francesco Pignatelli
le 22 Juil 2021
Francesco Pignatelli
le 22 Juil 2021
Modifié(e) : Francesco Pignatelli
le 22 Juil 2021
Réponse acceptée
Plus de réponses (1)
% Assume there are 3 spec (corresponding to phi)
nf = 20; nt=15; nspec = 3;
sp = randn(nf, nt, nspec);
% reshape the spectrogram to 2D
sp = reshape(sp, [nf, nt*nspec]);
% multiple spectrograms
imagesc(sp);
% annotation
h = gca;
h.XTick = 0.5+(0:nspec-1)*nt;
h.YTick = [];
grid on
phi = [1.2 3.4 5.6];
h.XTickLabel = string(phi);
xlabel('\phi')
1 commentaire
Francesco Pignatelli
le 22 Juil 2021
Catégories
En savoir plus sur Scopes and Data Logging dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



