How can I save a plot made using pwelch (power spectral density) command
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
So, I'm using this command to generate a power spectral density plot:
pwelch(a(1:1843200),hanning(1024*8),0,1024*8,512);
but this returns a window and I was wondering if I could write another line of code which is going to save this image automatically.
Furthermore, when I set
X= pwelch(a(1:1843200),hanning(1024*8),0,1024*8,512);
and do plot(x) it does not give me the plot with power and frequency on the axis. Is there a way of solving that?
Any help will be appreciated guys!
0 commentaires
Réponses (1)
Walter Roberson
le 26 Août 2015
[X, f] = pwelch(a(1:1843200),hanning(1024*8),0,1024*8,512);
plot(f, 10*log10(X));
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)')
saveas(gcf, 'MyPwelch.jpg');
0 commentaires
Voir également
Catégories
En savoir plus sur Spectral Estimation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!