changing Power spectrum to spectrogram
can anyone advise which Matlab code I can add to the below codes to have Spectrogram Plot?
OptimalValuesx1y1z1 = [dataArray{1:end-1}];
%% Clear temporary variables
clearvars filename delimiter formatSpec fileID dataArray ans;
re=1; fs=20e3/re; datatable=OptimalValuesx1y1z1; datatable=resample(OptimalValuesx1y1z1,1,re); %datatable=lowpass(OptimalValuesx1y1z1,10,fs); datatable(:,2)=datatable(:,2).*0.01;
figure t=1/fs:1/fs:length(datatable)/fs; plot(t, rms(datatable(:,2:4)*9.81,3));
ylim([0 10])
xlim([0 10])
%ylim([0 1])
hold on
%plot(t,ones(1,length(datatable(:,2:4)*9.81))*12,'r--')
xlabel('Time [s]')
ylabel('Amplitude [m/s^2]')
legend('axis X','axis Y','axis Z','limit')
out_mean = mean(rms(datatable(:,2:4),3)) std_mean = std(rms(datatable(:,2:4),3))
% %PSD analysis
figure
x=datatable(:,2:4)*9.81;
nbar = 4;
sll = -30;
win = taylorwin(length(x),nbar,sll);
periodogram(x,win,[],fs);
xlim([0 1.624])
legend('axis X','axis Y','axis Z')
1 Kommentar
Zeit (absteigend)Hi Amin,
I suggest posting your question on MATLAB Answers. You'll likely get more responses there. This discussion board is for people looking to discuss tools and techniques around distance learning, online learning.
By the way, I suggest being more specific on what you want your graph to look like. People cannot run your example code, because the data is not provided. The more specific you are with your questions (including what you have tried, where exactly the problem is, etc.), the more likely you will get a response.
Good luck.
Anmelden, um teilzunehmen