3d plot of spectrum data object
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi I have acceleration data of a machine acquired at every 1 minute interval for 5 minutes. I have obtained psd plot for each data set using psd.welch. Now I want to plot the all 6 psd plots on a 3-d plot more or less like a waterfall plot so that I can see gradual changes in the spectra with increasing time. Here is my code:
clear all
close all
echo on
Fs=30000;
forceZ1 = xlsread('1.xlsx',2,'H6:H5001');
forceZ10 = xlsread('10.xlsx',2,'H6:H5001');
forceZ20 = xlsread('20.xlsx',2,'H6:H5001');
forceZ30 = xlsread('30.xlsx',2,'H6:H5001');
forceZ40 = xlsread('40.xlsx',2,'H6:H5001');
forceZ50 = xlsread('50.xlsx',2,'H6:H5001');
Hs1=spectrum.welch;
Hs10=spectrum.welch;
Hs20=spectrum.welch;
Hs40=spectrum.welch;
Hs50=spectrum.welch;
Hpsd1=psd(Hs1,forceZ1,'Fs',Fs);
Pxx1=Hpsd1.Data;
W=Hpsd1.Frequencies;
Hpsd10=psd(Hs10,forceZ10,'Fs',Fs);
Pxx10=Hpsd10.Data;
Hpsd20=psd(Hs20,forceZ20,'Fs',Fs);
Pxx20=Hpsd20.Data;
Hpsd30=psd(Hs30,forceZ30,'Fs',Fs);
Pxx30=Hpsd30.Data;
Hpsd40=psd(Hs40,forceZ40,'Fs',Fs);
Pxx40=Hpsd40.Data;
Hpsd50=psd(Hs50,forceZ50,'Fs',Fs);
Pxx50=Hpsd50.Data;
hpsd=dspdata.psd([Pxx1, Pxx10, Pxx20, Pxx30, Pxx40, Pxx50],W,'Fs',Fs);
plot(hpsd);
legend('Pxx1', 'Pxx10', 'Pxx20', 'Pxx30', 'Pxx40', 'Pxx50');
waterfall(hpsd');
grid on;
I have tried to look for various 3d options available in Matlab but couldnot find any except waterfall which can make a line plot in 3d but could not figure out how to use it with psddata object.
Please help.
Thanks.
I want my final plot to look like this:
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Parametric 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!