How can I save a plot made using pwelch (power spectral density) command
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Walter Roberson
am 26 Aug. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Spectral Estimation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!