Spectrogram configuration with vectors

Hello,I have 3 data series from an Excel file (Time with a step of 0.02s,Speed engine (rpm) Gearbox speed (rpm) ), I display several curves and I would like to plot the spectrogram of the blue curve as below:
I managed to display a spectrogram but it is incorrectly configured, even with the Matlab help of the spectrogram I can not find a good parameter.
I am looking for something more like this :
I hope someone can help me, here’s my script (with the .xlsx attached) :
clear all;
clc ;
close all;
Datas = xlsread('C:\Users\tlam\Desktop\Run 1.xlsx','Data1');
Time = Datas(:,1);
Engine_speed = Datas(:,12);
Gearbox_speed = Datas(:,17);
Delta = Engine_speed - Gearbox_speed;
Engine_Hz = Engine_speed * 0.016667;
Gearbox_Hz = Gearbox_speed *0.016667;
Delta_Hz = Delta * 0.016667;
F = figure('Renderer', 'painters', 'Position', [65 200 1500 680])
t = tiledlayout(1,3,'TileSpacing','Compact','Padding','Compact');
nexttile([1 2])
plot(Time,Engine_speed,'r',Time,Gearbox_speed,'g',Time,Delta,'b')
legend('Engine','Gearbox','Delta')
grid on
nexttile
spectrogram (Delta_Hz,100,99,100,38,'yaxis','power')
hold on
plot (Time, Engine_Hz,'r', Time,Gearbox_Hz,'g', Time,Delta_Hz,'b')
colormap('jet')

3 comentarios

chicken vector
chicken vector el 24 de Abr. de 2023
Editada: chicken vector el 24 de Abr. de 2023
There is no file attached here.
Edit your question accordingly.
Théo
Théo el 25 de Abr. de 2023
Oh you are right sorry, I updated it.
Théo
Théo el 25 de Abr. de 2023
The question is in fact, How to compute the spectrogram parameter, when I know the duration of the test, the frequency and the step (dt).

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Productos

Versión

R2022b

Preguntada:

el 24 de Abr. de 2023

Comentada:

el 25 de Abr. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by